You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug][WHL] MIC jack is off if plug in headset when HDA Analog isn't in use. #1628
so somehow the PM is messing up mic jack detection? @ranj063@bardliao any recollection of this kind of issue? headphone jack detection seems to work but mic jack detection is messed with PM?
@juimonen It is more like a codec issue. Or maybe we miss some patches for patch_realtek.c? @ClarexZhou Can we test it with topic/sof-dev branch? I would like to know if we can see the issue with the latest topic/sof-dev branch.
@bardliao Error can be reproduced on topic/sof-dev.
But error not seen on legacy HDA after changing runtime PM status to suspend via
echo 1 > /sys/module/snd_hda_intel/parameters/power_save
echo auto > /sys/bus/pci/devices/0000:00:1f:3/power/control
@ClarexZhou@bardliao I'm still clarifying here after talking to Clare:
So "Mic Jack" works during aplay (we are not in PM save), but doesn't work in idle (we are in PM save). "Headphone Jack" works both during idle and running state. And "Mick Jack" works with legacy HDA fine. So somehow sof PM is more aggressive etc. so that we are loosing the "Mic Jack" detect, could it just be that the detect task is not renewed properly after waking up?
@juimonen Yes, it could be. Ideally, alc_update_headset_mode() will be triggered when a jack is plugged or unplugged, and it will get and report the jack type.
@bardliao@juimonen
MIC Jack is only work when HDA Analog playback/capture is using, eg. aplay/ arecord via Dhw:0,0.
MIC jack isn't work if using other pipeline or just active rumtime PM status.
changed the title [-][Bug][WHL] MIC jack is off when plug in headset during runtime PM status is suspended.[/-][+][Bug][WHL] MIC jack is off if plug in headset when HDA Analog isn't in use.[/+]on Dec 18, 2019
@plbossart@keyonjie any idea about this? When we go to sof suspend/resume cycle the Mic Jack events stop coming. You don't see them even with evtest (and choosing to listen for Mic). I tried to browse through hda jack event code, but couldn't find anything obvious, and have to say it was pretty complicated. An with legacy driver this doesn't happen...
and if I'm playing something (so we don't suspend/resume) those event's are coming. So during playback I get 2 unsol_events (1 for headphone, 1 for mic), when not playing anything and we go to suspend get 1 unsol_event (Headphone) when sof and hda wakeup.
Thanks @KailangYang for the information that the codec use auto check type mode which needs 300ms ~ 800ms to check jack type. And we confirmed by adding a 1 second delay in the alc_suspend. Mic detection was working as expected with the 1 second delay.
Seems to be the same issue as #1798 on an HP CML device. Set to P1 since this is a generic issue to refine power management implementation for SOF and Realtek codec driver.
Seems to be the same issue as #1798 on an HP CML device. Set to P1 since this is a generic issue to refine power management implementation for SOF and Realtek codec driver.
Activity
juimonen commentedon Dec 16, 2019
so somehow the PM is messing up mic jack detection? @ranj063 @bardliao any recollection of this kind of issue? headphone jack detection seems to work but mic jack detection is messed with PM?
bardliao commentedon Dec 16, 2019
@juimonen It is more like a codec issue. Or maybe we miss some patches for patch_realtek.c? @ClarexZhou Can we test it with topic/sof-dev branch? I would like to know if we can see the issue with the latest topic/sof-dev branch.
ClarexZhou commentedon Dec 17, 2019
@bardliao Error can be reproduced on topic/sof-dev.
But error not seen on legacy HDA after changing runtime PM status to suspend via
echo 1 > /sys/module/snd_hda_intel/parameters/power_save
echo auto > /sys/bus/pci/devices/0000:00:1f:3/power/control
juimonen commentedon Dec 17, 2019
@ClarexZhou @bardliao I'm still clarifying here after talking to Clare:
So "Mic Jack" works during aplay (we are not in PM save), but doesn't work in idle (we are in PM save). "Headphone Jack" works both during idle and running state. And "Mick Jack" works with legacy HDA fine. So somehow sof PM is more aggressive etc. so that we are loosing the "Mic Jack" detect, could it just be that the detect task is not renewed properly after waking up?
bardliao commentedon Dec 17, 2019
@juimonen Yes, it could be. Ideally, alc_update_headset_mode() will be triggered when a jack is plugged or unplugged, and it will get and report the jack type.
ClarexZhou commentedon Dec 18, 2019
@bardliao @juimonen
MIC Jack is only work when HDA Analog playback/capture is using, eg. aplay/ arecord via Dhw:0,0.
MIC jack isn't work if using other pipeline or just active rumtime PM status.
[-][Bug][WHL] MIC jack is off when plug in headset during runtime PM status is suspended.[/-][+][Bug][WHL] MIC jack is off if plug in headset when HDA Analog isn't in use.[/+]ClarexZhou commentedon Dec 18, 2019
Check with sudo evtest:
No MIC event when error occurred. Details as below:
Error seen on SOF:
Error not seen on Legacy HDA:
bardliao commentedon Dec 18, 2019
@ClarexZhou Could you do the following change and check dmesg when you plug a headset?
Please check it when MIC Jack is detected and not detected.
Thanks
juimonen commentedon Dec 18, 2019
@bardliao I tried yesterday to add prints to this function and it was never called at least according to my logs...
ClarexZhou commentedon Dec 18, 2019
Logs as below:
kern.log.txt
plug in headset from idle
Plug in headset during HDA analog aplay
1 remaining item
juimonen commentedon Dec 19, 2019
@plbossart @keyonjie any idea about this? When we go to sof suspend/resume cycle the Mic Jack events stop coming. You don't see them even with evtest (and choosing to listen for Mic). I tried to browse through hda jack event code, but couldn't find anything obvious, and have to say it was pretty complicated. An with legacy driver this doesn't happen...
juimonen commentedon Dec 19, 2019
and if I'm playing something (so we don't suspend/resume) those event's are coming. So during playback I get 2 unsol_events (1 for headphone, 1 for mic), when not playing anything and we go to suspend get 1 unsol_event (Headphone) when sof and hda wakeup.
bardliao commentedon Jan 10, 2020
Thanks @KailangYang for the information that the codec use auto check type mode which needs 300ms ~ 800ms to check jack type. And we confirmed by adding a 1 second delay in the alc_suspend. Mic detection was working as expected with the 1 second delay.
ClarexZhou commentedon Jan 15, 2020
Track in PR #1689
mengdonglin commentedon Feb 23, 2020
Seems to be the same issue as #1798 on an HP CML device. Set to P1 since this is a generic issue to refine power management implementation for SOF and Realtek codec driver.
kv2019i commentedon Mar 24, 2020
Latest update on this:
#1837 (comment)
A fix is available, but we need further work to make the fix acceptable upstream.
We potentially have a separate issue on CML that requires more work on top. A separate bug will be filed for this.
ClarexZhou commentedon Apr 9, 2020
Close for error not seen since PR #1983 is merged. And still got open issue #2003