Skip to content

[PM] Audio device failed to suspend with HDA support enabled on APL-nocodec #512

Closed

Description

@markyang

Summary:
Check runtime_status, it always shows "active" whether audio is working or not on APL-nocodec.
It's okay on APL PCM512x.

Test steps:

1. cat /sys/bus/pci/devices/0000:00:0e.0/power/runtime_status
active

Test env:
sof master: c6ff3fd
kernel sof-dev: 5931a30
tplg: sof-apl-nocodec.tplg

Activity

  1. added
    bugSomething isn't working
    APLApplies to ApolloLake platform
    on Jan 8, 2019
  2. bardliao commented on Jan 9, 2019

    @bardliao
    Collaborator

    @markyang I believe that the issue can be fixed by adding HDMI support to nocodec machine driver and topology. The question is do we really need to enable HDMI support in the kconfig if we don't use it?

  3. mengdonglin commented on Jan 9, 2019

    @mengdonglin

    @bardliao This can be a solution. But probably we need a clean isolation of HDA-stuff in case we want to use the nocodec machine driver/topology to verify non-HDA audio on soe platforms that don't require HDA. In addition, HDMI audio depends on i915 display driver and usually i915 is not stable for early platforms. We don't want audio to be impacted.

    @plbossart Would you please comment?

  4. plbossart commented on Jan 9, 2019

    @plbossart
    Member
  5. mengdonglin commented on Jan 22, 2019

    @mengdonglin

    @xiulipan @xun2z Could you help to check if current kconfig used by daily build server has disabled both HDaudio links and HDaudio codecs (both legacy HD-A codecs and asoc HDMI audio codec) ?

  6. xun2z commented on Jan 28, 2019

    @xun2z

    @mengdonglin Kconfig is OK. nocodec is isolated well from HDA.
    This issue is caused by no pm_runtime_suspend support in nocodec, we have only machine driver. As pierre said, we don't want to add hard-coded HDA. I perfer to try a virtual codec driver supporting PM, or disable PM in nocodec.

  7. assigned and unassigned on Jan 31, 2019
  8. 15 remaining items

  9. lyakh commented on Feb 7, 2019

    @lyakh
    Collaborator

    @ranj063 well, sure, we can make sure to avoid this issue when using nocodec, but is that enough? I think there are multiple other situations when for one reason or for another a codec driver would not probe correctly, would this be a reason enough to keep the HDA device active? Since the HDA driver isn't SOF specific, I think we can do some preliminary discussing here and then take this to the ALSA ML?

  10. plbossart commented on Feb 7, 2019

    @plbossart
    Member

    I am having difficulties following this thread. We already have multiple Kconfig options to support HDaudio and nocodec:

    SND_SOC_SOF_NOCODEC
    SND_SOC_SOF_HDA_LINK
    SND_SOC_SOF_HDA_AUDIO_CODEC

    We don't look for the codecs in all cases, so what combination of these three exposes the problem on Up2?

  11. lyakh commented on Feb 7, 2019

    @lyakh
    Collaborator

    @plbossart I think I attached my .config above ;-) But anyway - enable and force nocodec and keep all the HDA options too. That should do it.

  12. plbossart commented on Feb 7, 2019

    @plbossart
    Member

    @lyakh your initial explanations threw me off ("It's about whether HDMI codecs are included in the topology or not"). This is really not about the topology file but about the Kconfigs. If we have the HDaudio link enabled, then indeed we will initialize codecs but the card will never make any reference to those codecs so we can't suspend them, right?

    if we are aligned on the analysis, I see three ways of fixing this.

    1. we make NOCODEC incompatible with HDA_LINK - and move the NOCODEC to a different defconfig that's not selected. simple but we lose a bit in terms of flexibility.
    2. we are smarter and modify hda_init_caps() so that when only a single codec is detected but we are in NOCODEC mode we don't initialize those codecs.
    3. we add another option where we specify that we want NOCODEC to support suspend/resume, and this disables HDA_LINK. That might be the best case for testing.
  13. ranj063 commented on Feb 7, 2019

    @ranj063
    Collaborator

    @plbossart I agree option 3 sounds like the best thing to do.

  14. lyakh commented on Feb 7, 2019

    @lyakh
    Collaborator

    To choose one of the above options I'd like to understand - is this really only a problem with nocodec? What if nocodec isn't used but the real codec, that is supposed to probe, hasn't succeeded for some reason, or haven't even attempted? Isn't it better to let the HDA driver autosuspend itself at the end of its probing and let any further users (codecs) "get()" it again?

  15. bardliao commented on Feb 11, 2019

    @bardliao
    Collaborator

    Agree with @lyakh This issue will happen if SND_SOC_HDAC_HDMI is selected but HDMI is not used. Similar issue is discussed in #140 (comment)

  16. assigned and unassigned on Mar 1, 2019
  17. xun2z commented on Mar 1, 2019

    @xun2z

    Making CONFIG_SND_SOC_SOF_HDA_LINK incompatible with nocodec in kconfig is a solution for this issue. will close this issue when corresponding patch is merged

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

Metadata

Metadata

Assignees

Labels

APLApplies to ApolloLake platformP2Critical bugs or normal featuresbugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions