-
Notifications
You must be signed in to change notification settings - Fork 140
Fix set autosuspend delay #1983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix set autosuspend delay #1983
Conversation
On some Lenovo and HP laptops, if both codec driver and SOF driver are in runtime suspend mode, we plug a headset to the audio jack, the headphone could be detected but Mic couldn't. That is because when plugging, the headphone triggers a unsol event first, and about 0.7s later (on the Lenovo X1 Carbon 7th), the Mic triggers a unsol event. But if the codec driver enters runtime suspend within 0.7s, the Mic can't trigger the unsol event. If we don't set autosuspend_delay to a non-zero value for the hda codec driver, it will enter runtime suspend immediately after the headphone triggers the unsol event. Follow the sequence of legacy hda driver and set a autosuspend delay of 1sec after card registration (refer to pci/hda/hda_intel.c and pci/hda/hda_codec.c). Signed-off-by: Hui Wang <hui.wang@canonical.com> Co-developed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Co-developed-by: Jaska Uimonen <jaska.uimonen@linux.intel.com> Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
|
SOFCI TEST |
|
@ClarexZhou or @juimonen , could you double-check this works ok on Mantis? It seems this is otherwise good to go -- we do need ack from you @jason77-wang as well before merging. |
|
Test on Mantis,jack detection is pass and has no side effect |
|
Tested this PR on lenovo. Mic jack detection works. Still has issue "Trigger again when runtime PM enter suspend" and it's caused by one upstream commit. See #1837 (comment). On sof-dev branch, revert that commit directly failed. @Liviali155 also verified on Mantis. All works ok. Also no side effect. |
|
Can we update this PR to cherry-pick 476c02e ("ALSA: hda/realtek - a fake key event is triggered by running shutup") and redo the tests? |
jason77-wang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
|
@plbossart wrote:
I reviewed that again and that seems orthogonal. As this fix helps with so many machines and has taken so long already, let's go ahead and merge this and fix any follow-ups after the rebase. We anyways still have more issues (like the CML regression #1938). |
@kv2019i I wasn't making this up, this patch was listed in #1837 (comment) |
|
@plbossart wrote:
Aa, my bad, I didn't check that comment anymore. But alas, it's a regression that also shows up with legacy driver, and now that we align with legacy driver, we hit the regression as well. But it's fixed in upstream, so we should be good once we do the upstream rebase. |
One more attempt to fix this bug. This is a combination of patches from @jason77-wang and @juimonen . We set a non-zero value for codecs after ASoC registration is done, to mimic to programming flow of the legacy driver.
This is alternative to: