Skip to content

[BUG][CML]Can't detect Mic jack of combo headset #1798

Closed

Description

@qinwan-hp

Describe the bug
Plug in headset, the headphone jack can be detected, but the mic jack can seldom to be detected.
If prohibit the codec runtime auto-suspend, the headphone and mic jack can be detected normally.
If change to hda driver, the headphone jack and mic jack can be detected normally.

To Reproduce
Plugin headset

Reproduction Rate
Almost near to 100%

Expected behavior
Both headphone and mic jack can be detected.

Impact
Cannot record sound if plugin headset

Environment

  1. Branch name and commit hash of the 2 repositories: sof (firmware/topology) and linux (kernel driver).
  2. Name of the topology file
    • Topology: sof-hda-generic-2ch.tplg
  3. Name of the platform(s) on which the bug is observed.
    • Platform: A notebook with CometLake LP, codec ALC3247 and combo headset

codecinfo.txt
dmesg.txt
sof.txt

Activity

  1. juimonen commented on Jan 14, 2020

    @juimonen

    @qinwan-hp #1689, this is probably the same...(?)

  2. lgirdwood commented on Jan 14, 2020

    @lgirdwood
    Member

    @qinwan-hp any chance you could try #1689 and see if it fixes the issue for you. I think Its a duplicate.

  3. qinwan-hp commented on Jan 15, 2020

    @qinwan-hp
    Author

    @lgirdwood @juimonen I tried this method before and I still have chance without mic detected.
    When wait dsp and codec suspended, plugin headset can duplicate this issue sometimes.
    There is only unsol event for headphone jack, no unsol event for mic jack.
    That's why I disable auto-suspend.
    But if I disable auto-suspend, we found the DSP panic when kill/run pulseaudio several times.

    I upload the dsp panic kernel log and sof trace.
    dsp_firmware_panic.txt
    sof_trace.txt
    sof_etrace.txt

  4. lgirdwood commented on Jan 15, 2020

    @lgirdwood
    Member

    @qinwan-hp thanks for the info, this now looks like 2 issues :-

    1. Failure to detect the mic jack. @kv2019i any comments ?
    2. FW is constantly busy - hence we get the panic. @qinwan-hp we need more information here, can you switch on FW IPC debug within the kernel (under SOF debug kconfig). This will tell us what commands pulseaudio is sending to the FW when the Mic is not detected.
  5. kv2019i commented on Jan 15, 2020

    @kv2019i
    Collaborator

    @lgirdwood wrote:

    1. Failure to detect the mic jack. @kv2019i any comments ?
    

    I'm pretty certain this is fixed by #1689 . We have the fix candidate (but no agreement how this should be fixed in upstream yet). @qinwan-hp testing feedback on that pull-request is welcome. FYI @juimonen

  6. qinwan-hp commented on Jan 16, 2020

    @qinwan-hp
    Author

    @juimonen Original we have hda with CONFIG_SND_HDA_POWER_SAVE_DEFAULT =0 on our platform, so hda is OK. Change config to CONFIG_SND_HDA_POWER_SAVE_DEFAULT = 2, I did see the same issue happend. But the failure rate is very low and can be igonored.

  7. qinwan-hp commented on Jan 16, 2020

    @qinwan-hp
    Author

    2. he kernel (under SOF debug kconfig). This will tell us what commands pulseaudio is sending to the FW when the Mic is not detected.
    @lgirdwood It occurs when prohibit codec auto-suspend. Mic can be detected if there is no codec runtime suspend/resume.

  8. juimonen commented on Jan 16, 2020

    @juimonen

    @qinwan-hp so the value 0 for suspend disables the PM altogether, so the codec never goes to sleep -> detect works. I guess with certain values, like you mentioned 2s the detection might still fail occasionally. if pm_autosuspend is set, legacy HDA will set 3s suspend delay, so even longer than 2s.

    There is a blacklist in legacy HDA for certain platforms that will never use PM, so they will be always on. So this platform looks/sounds like a candidate for a quirk, if it fails even with 2s delay.

    Now with SOF we are currently not calling at all the suspend delay setting, so codec will go to suspend immediately/asap. I think this is a bug and we need to fix it in SOF. What value to set from SOF is a good question (so should we have quirks for platforms which don't work with 2s etc.).

  9. qinwan-hp commented on Jan 17, 2020

    @qinwan-hp
    Author

    @juimonen I tried the kernel v5.4.1. The mic jack detction can work and still has failure but hard to reproduce. Our current kernel is v5.3.6.

  10. juimonen commented on Jan 17, 2020

    @juimonen

    @qinwan-hp ok thanks, did you test the new kernel with thesofproject/sof#1689 or without it?

  11. qinwan-hp commented on Jan 17, 2020

    @qinwan-hp
    Author

    @juimonen With thesofproject/sof#1689. But I cannot figure out what's the difference between v5.3.6 and v5.4.1 that may lead to this issue. Do you have any comment ?

  12. juimonen commented on Jan 17, 2020

    @juimonen

    @qinwan-hp hmm ok, I can't think anything from top of my head... maybe we have some changes in the power management, but not sure... @ranj063 any idea?

  13. slawblauciak commented on Jan 21, 2020

    @slawblauciak

    @bkokoszx mind taking a look at it?

  14. bkokoszx commented on Jan 22, 2020

    @bkokoszx

    @lgirdwood @juimonen
    I have a questions, as I'm not kernel expert. Is it correct that we have here in logs things like: skl_hda_dsp_generic, snd_hda_codec_realtek. It seemed to me that we usually blacklist them during kernel building. Why does skylake appear in dmesg logs:
    Digital mics found on Skylake+ platform, using SOF driver? Also there appear some topology mismatches:
    Topology: ABI 3:12:0 Kernel ABI 3:8:0
    warn: topology ABI is more recent than kernel

  15. lgirdwood commented on Jan 22, 2020

    @lgirdwood
    Member

    @slawblauciak @bkokoszx this does not look like a FW issue so best let @juimonen look at it.

  16. lgirdwood commented on Jan 27, 2020

    @lgirdwood
    Member

    @juimonen @kv2019i any insights here on this one ? This looks like a kernel issue to me.

  17. juimonen commented on Jan 28, 2020

    @juimonen

    @lgirdwood @slawblauciak basically it seems that this issue is the same we have when not setting the PM suspend delay to HDA from SOF: #1689. In that PR we are setting suspend delay to 2s, but for example legacy HDA might set it even to 3s if not defined.
    So if there is no suspend delay, HDA codec will suspend really fast, and in some codecs the mic detection takes time -> hence no mic detection.

    I'm not sure if it is worth to start bisecting differences in kernel's if it works with the latest/greatest. There has been reports that with #1689 there can be detection issues at boot, otherwise it seems to work. The boot thing should be investigated and fixed separately, because I really think not setting suspend delay from SOF is a bug.

  18. lgirdwood commented on Jan 28, 2020

    @lgirdwood
    Member

    @juimonen ok, can you take care of this, I guess it all falls into userspace/kernel integration.

  19. mengdonglin commented on Feb 23, 2020

    @mengdonglin

    @qinwan-hp Can you please share your email here or on GitHub personal profile? We want to understand if this is a HP device and who can support from codec driver side. Thanks!

  20. added
    bugSomething isn't working
    CMLApplies to Comet Lake platform
    P1Blocker bugs or important features
    on Feb 23, 2020
  21. qinwan-hp commented on Mar 20, 2020

    @qinwan-hp
    Author

    We still do not enable runtime control to make jack detection work normally.
    And the crash of FW can be fixed with latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

CMLApplies to Comet Lake platformHDAApplies to HD-Audio bus for codec connectionJack DetectionP1Blocker bugs or important featuresbugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions