Skip to content

[BUG][TGL][SDW] playback failed on speaker: failed to find SOF DAI for: SDW2 Pin2 #2821

Closed

Description

@keqiaozhang

Describe the bug
Looks like this is a regression on TGL SDW device when playing on speaker.
dmesg error:

[15877.035457] sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx: 0x80010000: GLB_DAI_MSG: CONFIG
[15877.035670] sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx succeeded: 0x80010000: GLB_DAI_MSG: CONFIG
[15877.035676] sof-audio-pci-intel-tgl 0000:00:1f.3: error: failed to find SOF DAI for: SDW2 Pin2
[15877.035680] soundwire_intel soundwire_intel.link.2: ASoC: error at snd_soc_dai_hw_params on SDW2 Pin2: -22
[15877.035698] sdw_deprepare_stream: subdevice #0-Playback: inconsistent state state 1
[15877.035707] sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx: 0x80010000: GLB_DAI_MSG: CONFIG
[15877.035907] sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx succeeded: 0x80010000: GLB_DAI_MSG: CONFIG
[15877.035910]  SDW1-Playback: ASoC: soc_pcm_hw_params() failed (-22)
[15877.035912]  Speaker: ASoC: dpcm_fe_dai_hw_params failed (-22)

To Reproduce
aplay -Dhw:0,2 -r 48000 -c 2 -f S16_LE -d 10 /dev/zero -v -q

Reproduction Rate
10/10

Environment
Kernel Branch: topic/sof-dev
Kernel Commit: 138a5d7

SOF Branch: main
SOF Commit: 5aeb29b

Device:TGLH_0A5E_SDW/TGLU_SKU0A32_SDCA

Screenshots or console output

aplay   -Dhw:0,2 -r 48000 -c 2 -f S16_LE -d 10 /dev/zero -v -q
aplay: set_params:1407: Unable to install hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  S16_LE
SUBFORMAT:  STD
SAMPLE_BITS: 16
FRAME_BITS: 32
CHANNELS: 2
RATE: 48000
PERIOD_TIME: (85333 85334)
PERIOD_SIZE: 4096
PERIOD_BYTES: 16384
PERIODS: 4
BUFFER_TIME: (341333 341334)
BUFFER_SIZE: 16384
BUFFER_BYTES: 65536
TICK_TIME: 0

dmesg.txt
trace.txt

Activity

  1. added
    bugSomething isn't working
    P1Blocker bugs or important features
    TGLApplies to Tiger Lake platform
    SDWApplies to SoundWire bus for codec connection
    on Apr 6, 2021
  2. changed the title [-][BUG][TGLH][SDW] playback failed on speaker: failed to find SOF DAI for: SDW2 Pin2[/-] [+][BUG][TGL][SDW] playback failed on speaker: failed to find SOF DAI for: SDW2 Pin2[/+] on Apr 6, 2021
  3. plbossart commented on Apr 6, 2021

    @plbossart
    Member

    @keqiaozhang can you confirm that this happened between Intel daily test 2935 and 3038? Please provide more context so that we can bisect configurations. Thanks!

  4. keqiaozhang commented on Apr 7, 2021

    @keqiaozhang
    Author

    @XiaoyunWu6666 , please help to do the bisection and update the result here.

  5. plbossart commented on Apr 8, 2021

    @plbossart
    Member

    this bug is confirmed on all devices with 2 amps and likely related to the dynamic pipelines. @ranj063 is already looking into this.

  6. self-assigned this
    on Apr 8, 2021
  7. keqiaozhang commented on Apr 9, 2021

    @keqiaozhang
    Author

    Bisect result shows this issue is introduced by:

    242d33837f6218c1db1a020d8069cdf85545b277 is the first bad commit
    commit 242d33837f6218c1db1a020d8069cdf85545b277
    Author: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
    Date:   Fri Mar 12 10:40:59 2021 -0800
    
        ASoC: SOF: Intel: hda: make sure DAI widget is set up before IPC
    
        With the implementation of the dynamic pipeline feature, widgets
        will only be setup when a PCM is opened during the
        hw_params ioctl. The BE hw_params callback is responsible for
        sending the DAI_CONFIG for the DAI widgets in the DSP.
        With dynamic pipelines, the DAI widgets will need to set up
        first before sending the DAI_CONFIG IPC in the BE hw_params.
    
        Update the BE hw_params/hw_free callbacks for all ALH, HDA and SSP
        DAIs to set up/free the DAI widget before/after DAI_CONFIG IPC.
    
        Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
    
     sound/soc/sof/intel/hda-dai.c | 131 ++++++++++++++++++++++++---------------
     sound/soc/sof/intel/hda.c     | 141 ++++++++++++++++++++++++++++--------------
     sound/soc/sof/intel/hda.h     |   5 ++
     3 files changed, 181 insertions(+), 96 deletions(-)
    
  8. ranj063 commented on Apr 9, 2021

    @ranj063
    Collaborator

    The issue was not introduced by but rather exposed by that commit. @keqiaozhang can you please check if my PR helps?

  9. keqiaozhang commented on Apr 9, 2021

    @keqiaozhang
    Author

    @ranj063 , confirmed that your PR#2832 can fix this issue.

  10. keqiaozhang commented on Apr 9, 2021

    @keqiaozhang
    Author

    @ranj063 I found another issue with your PR, If I run aplay on speaker pipeline and press ctrl+c to stop aplay randomly. it will run to below error:

    [   84.534342] sof-audio-pci-intel-tgl 0000:00:1f.3: widget BUF3.2 setup complete
    [   84.534353] sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx: 0x30010000: GLB_TPLG_MSG: COMP_NEW
    [   84.534574] sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx succeeded: 0x30010000: GLB_TPLG_MSG: COMP_NEW
    [   84.534594] sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx: 0x80010000: GLB_DAI_MSG: CONFIG
    [   84.534749] sof-audio-pci-intel-tgl 0000:00:1f.3: error: ipc error for 0x80010000 size 12
    [   84.534757] sof-audio-pci-intel-tgl 0000:00:1f.3: error: failed to set dai config for SDW1-Playback
    [   84.534761] sof-audio-pci-intel-tgl 0000:00:1f.3: error: failed to load dai config for DAI ALH0x102.OUT
    [   84.534767] sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx: 0x30020000: GLB_TPLG_MSG: COMP_FREE
    [   84.534906] sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx succeeded: 0x30020000: GLB_TPLG_MSG: COMP_FREE
    [   84.534912] sof-audio-pci-intel-tgl 0000:00:1f.3: widget ALH0x102.OUT freed
    [   84.534914] sof-audio-pci-intel-tgl 0000:00:1f.3: error: failed to restore pipeline after resume -19
    [   84.534924] soundwire_intel soundwire_intel.link.1: ASoC: error at snd_soc_pcm_component_pm_runtime_get on soundwire_intel.link.1: -16
    [   84.534932]  SDW1-Playback: soc_pcm_open() failed (-16)
    [   84.534937]  Speaker: ASoC: dpcm_be_dai_startup() failed at SDW1-Playback (-16)
    [   84.534942]  Speaker: dpcm_fe_dai_startup() failed (-16)
    

    How to reproduce:

    1. $ aplay -Dhw:0,2 -r 48000 -c 2 -f S16_LE -d 10 /dev/zero -v -q
    2. press ctrl +c randomly during the playback
    3. repeat step 1 and 2.

    The reproduction rate is high >20%.

  11. keqiaozhang commented on Apr 9, 2021

    @keqiaozhang
    Author

    @ranj063 , I found a easy way to reproduce the above issue I mentioned.

    1.  $ aplay -Dhw:0,2 -r 48000 -c 2 -f S16_LE -d 10 /dev/zero -v -q
    2.  press ctrl +c randomly during the playback
    3.  wait for 5+ seconds 
    4.  repeat step 1
    

    Then you can 100% reproduce the issue.

  12. ranj063 commented on Apr 9, 2021

    @ranj063
    Collaborator

    @keqiaozhang @XiaoyunWu6666 could you please try the PR #2832 again to see if both this isseu and #2835 are fixed with it?

  13. keqiaozhang commented on Apr 12, 2021

    @keqiaozhang
    Author

    @ranj063 , confirmed that PR #2832 can fix above 2 issues.

  14. XiaoyunWu6666 commented on Apr 12, 2021

    @XiaoyunWu6666

    @ranj063 , confirmed that PR #2832 can fix both this issue #2821 and issue #2835

  15. ranj063 commented on Apr 12, 2021

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

Metadata

Metadata

Assignees

Labels

P1Blocker bugs or important featuresSDWApplies to SoundWire bus for codec connectionTGLApplies to Tiger Lake platformbugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions