Skip to content

[BUG][TGL][ADLP]dai_report_xrun: overrun happens when pausing one smart-amp pipeline on TGLU_VOLT_SDW and ADLP_BRYA_SDW #4434

Closed

Description

@XiaoyunWu6666

Describe the bug
when dw_dma_get_data_size. xrun was detected and then dai report xrun with 'overrun due to no space'
since inner daily testresult 4961

To Reproduce
TPLG=sof-tgl-sdw-max98373-rt5682.tplg ~/sof-test/test-case/multiple-pause-resume.sh -r 25
or:
Just run playback on pcm2(smart amplifier pipeline) and capture on pcm3(feedback pipeline):

  1. Terminal A:$ aplay -D hw:0,2 -r 48000 -c 2 -f S16_LE -vv -i /dev/zero -q
  2. Terminal B: $ arecord -D hw:0,3 -r 48000 -c 2 -f S16_LE -vv -i /dev/null -q
  3. pause playback several times in terminal A, then you will run to this error.

Reproduction Rate
100%
Environment
Kernel Branch: topic/sof-dev
Kernel Commit: dd6665e0
SOF Branch: main
SOF Commit: eb7add5

Screenshots or console output
[sof-logger]

[    11881985.204936] (    11881985.000000) c0 dw-dma                 src/drivers/dw/dma.c:1102 ERROR dw_dma_get_data_size(): xrun detected
[    11882003.069518] (          17.864582) c0 dai          4.23           src/audio/dai.c:889  ERROR dai_report_xrun(): overrun due to no space available
[    11882020.934101] (          17.864582) c0 dai          4.23           src/audio/dai.c:679  ERROR comp_overrun(): sink->free = 128, copy_bytes = 0
[    11882124.996597] (         104.062492) c0 pipe         4.24  ....../pipeline-stream.c:168  ERROR pipeline_copy(): ret = -61, start->comp.id = 23, dir = 0
[    11882144.163263] (          19.166666) c0 pipe         4.24  ..../pipeline-schedule.c:63   ERROR pipeline_task(): xrun recover failed! pipeline will be stopped!
[    11902019.110390] (       19874.947266) c0 dw-dma                 src/drivers/dw/dma.c:1102 ERROR dw_dma_get_data_size(): xrun detected
[    11902036.089556] (          16.979166) c0 dai          3.17           src/audio/dai.c:886  ERROR dai_report_xrun(): underrun due to no data available
[    11902053.485388] (          17.395832) c0 dai          3.17           src/audio/dai.c:661  ERROR comp_underrun(): dev->comp.id = 17, source->avail = 0, copy_bytes = 0
[    11902187.079133] (         133.593750) c0 pipe         3.18  ....../pipeline-stream.c:168  ERROR pipeline_copy(): ret = -61, start->comp.id = 17, dir = 1
[    11902206.402049] (          19.322916) c0 pipe         3.18  ..../pipeline-schedule.c:63   ERROR pipeline_task(): xrun recover failed! pipeline will be stopped!
[    13005986.045689] (     1103779.625000) c0 dw-dma                 src/drivers/dw/dma.c:1102 ERROR dw_dma_get_data_size(): xrun detected
[    13006003.493605] (          17.447916) c0 dai          4.23           src/audio/dai.c:889  ERROR dai_report_xrun(): overrun due to no space available
[    13006020.733187] (          17.239582) c0 dai          4.23           src/audio/dai.c:679  ERROR comp_overrun(): sink->free = 128, copy_bytes = 0
[    13006121.149850] (         100.416664) c0 pipe         4.24  ....../pipeline-stream.c:168  ERROR pipeline_copy(): ret = -61, start->comp.id = 23, dir = 0
[    13006139.951932] (          18.802082) c0 pipe         4.24  ..../pipeline-schedule.c:63   ERROR pipeline_task(): xrun recover failed! pipeline will be stopped!
[    13094017.500524] (       87877.546875) c0 dw-dma                 src/drivers/dw/dma.c:1102 ERROR dw_dma_get_data_size(): xrun detected
[    13094034.792190] (          17.291666) c0 dai          3.17           src/audio/dai.c:886  ERROR dai_report_xrun(): underrun due to no data available
[    13094052.031772] (          17.239582) c0 dai          3.17           src/audio/dai.c:661  ERROR comp_underrun(): dev->comp.id = 17, source->avail = 0, copy_bytes = 0
[    13094188.750517] (         136.718750) c0 pipe         3.18  ....../pipeline-stream.c:168  ERROR pipeline_copy(): ret = -61, start->comp.id = 17, dir = 1
[    13094207.917183] (          19.166666) c0 pipe         3.18  ..../pipeline-schedule.c:63   ERROR pipeline_task(): xrun recover failed! pipeline will be stopped!
[    14239980.319571] (     1145772.375000) c0 dw-dma                 src/drivers/dw/dma.c:1102 ERROR dw_dma_get_data_size(): xrun detected
[    14239997.611237] (          17.291666) c0 dai          4.23           src/audio/dai.c:889  ERROR dai_report_xrun(): overrun due to no space available
[    14240014.746653] (          17.135416) c0 dai          4.23           src/audio/dai.c:679  ERROR comp_overrun(): sink->free = 128, copy_bytes = 0
[    14240114.798732] (         100.052078) c0 pipe         4.24  ....../pipeline-stream.c:168  ERROR pipeline_copy(): ret = -61, start->comp.id = 23, dir = 0
[    14240133.861231] (          19.062500) c0 pipe         4.24  ..../pipeline-schedule.c:63   ERROR pipeline_task(): xrun recover failed! pipeline will be stopped!
[    14326016.670319] (       85882.812500) c0 dw-dma                 src/drivers/dw/dma.c:1102 ERROR dw_dma_get_data_size(): xrun detected
[    14326034.118235] (          17.447916) c0 dai          3.17           src/audio/dai.c:886  ERROR dai_report_xrun(): underrun due to no data available
[    14326051.566151] (          17.447916) c0 dai          3.17           src/audio/dai.c:661  ERROR comp_underrun(): dev->comp.id = 17, source->avail = 0, copy_bytes = 0
[    14326181.461979] (         129.895828) c0 pipe         3.18  ....../pipeline-stream.c:168  ERROR pipeline_copy(): ret = -61, start->comp.id = 17, dir = 1
[    14326200.941145] (          19.479166) c0 pipe         3.18  ..../pipeline-schedule.c:63   ERROR pipeline_task(): xrun recover failed! 

Activity

  1. plbossart commented on Jun 30, 2021

    @plbossart
    Member

    @lgirdwood Daily test 4928 on 6/29 seems to work, Daily test 4961 on 6/30 does not.

    We haven't merged anything at the kernel level that is related to SoundWire or streaming, more precisely we merged @RanderWang's fix that made this problem go away.

    Firmware changes?

  2. ranj063 commented on Jul 1, 2021

    @ranj063
    Collaborator

    @lgirdwood Daily test 4928 on 6/29 seems to work, Daily test 4961 on 6/30 does not.

    We haven't merged anything at the kernel level that is related to SoundWire or streaming, more precisely we merged @RanderWang's fix that made this problem go away.

    Firmware changes?

    @plbossart this one is not SDW-specifc I think. I saw this today with the TGL nocodec tplg. Haven't been able to understand what's going on. And it is also on the same test multiple-pause-resume.

    This could be a genuine issue but I won't rule out the test itself being the culprit. I need to go through the script to figure out.

  3. plbossart commented on Jul 8, 2021

    @plbossart
    Member

    @ranj063 I don't think this has anything to do with TGL-nocodec. All the issues I see are between the Speaker and 'Amplifier Reference' devices

    2021-07-07 22:42:35 UTC [REMOTE_INFO] Speaker to command: aplay -D hw:0,2 -r 48000 -c 2 -f S16_LE -vv -i /dev/zero -q
    spawn aplay -D hw:0,2 -r 48000 -c 2 -f S16_LE -vv -i /dev/zero -q
    2021-07-07 22:42:35 UTC [REMOTE_INFO] Amplifier Reference to command: arecord -D hw:0,3 -r 48000 -c 2 -f S16_LE -vv -i /dev/null -q
    

    And given the topology, I think it's a case of dependencies between connected streams that's not well handled.
    sof-tgl-sdw-max98373-rt5682 (1)

  4. plbossart commented on Jul 8, 2021

    @plbossart
    Member

    And I can prove my theory with two simple commands

    in terminal 1, run

    root@jf-tglu-volt-sdw-1:~# aplay -Dhw:0,2 -c2 -r48000 -fdat /dev/zero -i
    Playing raw data '/dev/zero' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
      aplay: pcm_write:2086: write error: Input/output error     
    

    and in terminal two run

    root@jf-tglu-volt-sdw-1:~# arecord -Dhw:0,3 -c2 -r48000 -fdat test.wav
    Recording WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
    arecord: pcm_read:2178: read error: Input/output error
    

    After a 10s of monkey testing with the space bar, both streams reached an xrun.

    of course when I tried to reproduce the issue I couldn't, so it's a nasty race condition somewhere.

  5. ranj063 commented on Jul 8, 2021

    @ranj063
    Collaborator

    @plbossart oh this has to be mux/demux acting up most likely.

  6. plbossart commented on Jul 8, 2021

    @plbossart
    Member

    @ranj063 we could test this theory with a modified topology where BUFF3.0, SMARTAMP3.0 and BUF3.2 are removed, i.e. completely independent pipelines. If we still see a problem it would point to a SoundWire enable/disable issue (that would be surprising though since we don't have this problem with other SoundWire topologies, this is the only case where we have a demux and joined pipelines).

  7. plbossart commented on Jul 8, 2021

    @plbossart
    Member

    I think the rules need to be
    a) any component with more than one source (and a single sink) can only pause when all its sources are paused. (that applies to mixer, mux and smart-amp)
    b) any component with more than one sink (and a single source) can only pause when all its sinks are paused (that applies to demux)

  8. ranj063 commented on Jul 9, 2021

    @ranj063
    Collaborator

    a) any component with more than one source (and a single sink) can only pause when all its sources are paused. (that applies to mixer, mux and smart-amp)

    @plbossart is this correct to assume that we pause smart-amp only when all sources are paused? In theory, we should be using the smart-amp in such a way that when the playback stream in paused, the reference capture stream is also paused via UCM perhaps. But in reality, the way we test the smart_amp is by treating the playback and capture streams as separate streams. Im wondering if we should add the UCM changes too so we test it the way we it will be used.

  9. plbossart commented on Jul 9, 2021

    @plbossart
    Member

    @ranj063 I am not sure if we need to special-case the smart-amp component. We've already added logic in the mixer code to deal with one source paused/others active, I think it's only a matter of making sure the smart-amp component follows the same logic.

  10. changed the title [-][BUG]dai_report_xrun:overrun due to no space available on TGLU_VOLT_SDW[/-] [+][BUG]dai_report_xrun:overrun due to no space available when pause release on TGLU_VOLT_SDW[/+] on Jul 14, 2021
  11. lgirdwood commented on Jul 16, 2021

    @lgirdwood
    Member

    @XiaoyunWu6666 are these memory bugs now still all open after #4445 merged ?

  12. XiaoyunWu6666 commented on Jul 19, 2021

    @XiaoyunWu6666
    Author
  13. 10 remaining items

  14. changed the title [-][BUG]dai_report_xrun: overrun happens when pause release or multiple-pipeline-capture on TGLU_VOLT_SDW[/-] [+][BUG][TGL][ADLP]dai_report_xrun: overrun happens when pause release or multiple-pipeline-capture on TGLU_VOLT_SDW and ADLP_BRYA_SDW[/+] on Jan 10, 2022
  15. keqiaozhang commented on Jan 10, 2022

    @keqiaozhang
    Collaborator

    Recently, we added the ADLP Chrome device ADLP_BRYA_SDW to CI, this device has same amplifier as TGLU_VOLT_SDW and this issue also can be reproduced on this ADLP Brya device, the error logs are almost the same. please refer to inner test ID:9237.

  16. changed the title [-][BUG][TGL][ADLP]dai_report_xrun: overrun happens when pause release or multiple-pipeline-capture on TGLU_VOLT_SDW and ADLP_BRYA_SDW[/-] [+][BUG][TGL][ADLP]dai_report_xrun: overrun happens when pausing one smart-amp pipeline on TGLU_VOLT_SDW and ADLP_BRYA_SDW[/+] on Jan 11, 2022
  17. marc-hb commented on Feb 22, 2022

    @marc-hb
    Collaborator

    @kfrydryx, @abonislawski any update? This is one of the few failures still impacting daily tests.

  18. added this to the v2.1 milestone on Feb 23, 2022
  19. added
    P2Critical bugs or normal features
    and removed
    P1Blocker bugs or important features
    on Feb 28, 2022
  20. mengdonglin commented on Feb 28, 2022

    @mengdonglin
    Collaborator

    This issue won't be fixed. When smart amplifier is present, the playback and capture (feedback) pipelines are not independent. The playback pipeline is data provider and feedback pipeline is consumer. We cannot do random pause/release on these 2 pipelines in parallel. In addition, Chrome doesn't use PAUSE/RELEASE function of SOF driver/firmware.

    thesofproject/sof-test#866 is created to revise the test case.

    @XiaoyunWu6666 @keqiaozhang @marc-hb FYI. Maybe we can skip multiple-pause-resume.sh on the 2 device models.

  21. added
    won't fixThis will not be worked on atm (e.g. a bug closed for lack of user request, hardware etc)
    on Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ADLApplies to Alder Lake platformMux/DemuxP2Critical bugs or normal featuresTGLApplies to Tiger LakebugSomething isn't working as expectedmixerMixer componentwon't fixThis will not be worked on atm (e.g. a bug closed for lack of user request, hardware etc)

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions