Repository navigation
[BUG][TGL][ADLP]dai_report_xrun: overrun happens when pausing one smart-amp pipeline on TGLU_VOLT_SDW and ADLP_BRYA_SDW #4434
Copy link
Copy link
Closed
Labels
ADLApplies to Alder Lake platformApplies to Alder Lake platformMux/DemuxP2Critical bugs or normal featuresCritical bugs or normal featuresTGLApplies to Tiger LakeApplies to Tiger LakebugSomething isn't working as expectedSomething isn't working as expectedmixerMixer componentMixer componentwon't fixThis will not be worked on atm (e.g. a bug closed for lack of user request, hardware etc)This will not be worked on atm (e.g. a bug closed for lack of user request, hardware etc)
Milestone
Description
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):
- Terminal A:$ aplay -D hw:0,2 -r 48000 -c 2 -f S16_LE -vv -i /dev/zero -q
- Terminal B: $ arecord -D hw:0,3 -r 48000 -c 2 -f S16_LE -vv -i /dev/null -q
- 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!
Metadata
Metadata
Assignees
Labels
ADLApplies to Alder Lake platformApplies to Alder Lake platformMux/DemuxP2Critical bugs or normal featuresCritical bugs or normal featuresTGLApplies to Tiger LakeApplies to Tiger LakebugSomething isn't working as expectedSomething isn't working as expectedmixerMixer componentMixer componentwon't fixThis will not be worked on atm (e.g. a bug closed for lack of user request, hardware etc)This will not be worked on atm (e.g. a bug closed for lack of user request, hardware etc)
Activity
plbossart commentedon Jun 30, 2021
@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?
ranj063 commentedon Jul 1, 2021
@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.
plbossart commentedon Jul 8, 2021
@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
And given the topology, I think it's a case of dependencies between connected streams that's not well handled.

plbossart commentedon Jul 8, 2021
And I can prove my theory with two simple commands
in terminal 1, run
and in terminal two run
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.
ranj063 commentedon Jul 8, 2021
@plbossart oh this has to be mux/demux acting up most likely.
plbossart commentedon Jul 8, 2021
@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).
plbossart commentedon Jul 8, 2021
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)
ranj063 commentedon Jul 9, 2021
@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.
plbossart commentedon Jul 9, 2021
@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.
[-][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[/+]lgirdwood commentedon Jul 16, 2021
@XiaoyunWu6666 are these memory bugs now still all open after #4445 merged ?
XiaoyunWu6666 commentedon Jul 19, 2021
10 remaining items
[-][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[/+]keqiaozhang commentedon Jan 10, 2022
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.
[-][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[/+]marc-hb commentedon Feb 22, 2022
@kfrydryx, @abonislawski any update? This is one of the few failures still impacting daily tests.
mengdonglin commentedon Feb 28, 2022
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.