Repository navigation
[BUG][APL]ipc error and error trace with "ERROR dw_dma_get_data_size(): xrun detected" when do Pause/Release: simultaneous playback/capture test #2735
Description
Describe the bug
"ERROR dw_dma_get_data_size(): xrun detected" when do Pause/Release: simultaneous playback/capture test
After error occured,all the pipeline can not work,reboot can recovery
Used ubuntu@sh-apl-up2-pcm512x-02:
ubuntu@sh-apl-up2-pcm512x-02:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sofpcm512x [sof-pcm512x], device 0: Port5 (*) []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: sofpcm512x [sof-pcm512x], device 1: HDMI1 (*) []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: sofpcm512x [sof-pcm512x], device 2: HDMI2 (*) []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: sofpcm512x [sof-pcm512x], device 3: HDMI3 (*) []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: sofpcm512x [sof-pcm512x], device 4: Media Playback 4 (*) []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Device [USB Audio Device], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
ubuntu@sh-apl-up2-pcm512x-02:~$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: sofpcm512x [sof-pcm512x], device 0: Port5 (*) []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: sofpcm512x [sof-pcm512x], device 5: DMIC (*) []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: sofpcm512x [sof-pcm512x], device 6: DMIC16kHz (*) []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Device [USB Audio Device], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
To Reproduce
1.sudo reboot
2.cd sof-test
3.cd test-case
4.export TPLG=/lib/firmware/intel/sof-tplg/sof-apl-pcm512x.tplg
5../multiple-pause-resume.sh -r 25(https://github.com/thesofproject/sof-test/blob/master/test-case/multiple-pause-resume.sh)
Reproduction Rate
2/3
Expected behavior
There is o error occured when do do Pause/Release: simultaneous playback/capture test
Impact
Connection timed out,dmesg show ""error: ipc timed out for 0x60070000 size 12" when do pause/release of aplay(0,0) and arecord (0,0)
dmesgerror.log
32110] sof-audio-pci 0000:00:0e.0: pcm: trigger stream 0 dir 0 cmd 4
sh-apl-up2-pcm512x-02 kernel: [ 1094.433119] sof-audio-pci 0000:00:0e.0: FW Poll Status: reg=0x2014001e successful
sh-apl-up2-pcm512x-02 kernel: [ 1094.433137] sof-audio-pci 0000:00:0e.0: ipc tx: 0x60070000: GLB_STREAM_MSG: TRIG_RELEASE
sh-apl-up2-pcm512x-02 kernel: [ 1094.844684] sof-audio-pci 0000:00:0e.0: pcm: trigger stream 0 dir 1 cmd 3
sh-apl-up2-pcm512x-02 kernel: [ 1094.936041] sof-audio-pci 0000:00:0e.0: error: ipc timed out for 0x60070000 size 12
sh-apl-up2-pcm512x-02 kernel: [ 1094.936055] sof-audio-pci 0000:00:0e.0: info: preventing DSP entering D3 state to preserve context
sh-apl-up2-pcm512x-02 kernel: [ 1094.936064] sof-audio-pci 0000:00:0e.0: status: fw entered - code 00000005
sh-apl-up2-pcm512x-02 kernel: [ 1094.936120] sof-audio-pci 0000:00:0e.0: error: unexpected fault 0x00000000 trace 0x00004000
sh-apl-up2-pcm512x-02 kernel: [ 1094.936132] sof-audio-pci 0000:00:0e.0: error: hda irq intsts 0x00000000 intlctl 0xc0000083 rirb 00
sh-apl-up2-pcm512x-02 kernel: [ 1094.936138] sof-audio-pci 0000:00:0e.0: error: dsp irq ppsts 0x00000000 adspis 0x00000000
sh-apl-up2-pcm512x-02 kernel: [ 1094.936147] sof-audio-pci 0000:00:0e.0: error: host status 0x00000000 dsp status 0x00000000 mask 0x00000003
sh-apl-up2-pcm512x-02 kernel: [ 1094.936153] sof-audio-pci 0000:00:0e.0: error: waking up any trace sleepers
sh-apl-up2-pcm512x-02 kernel: [ 1094.936172] Port5: ASoC: trigger FE cmd: 4 failed: -110
sh-apl-up2-pcm512x-02 kernel: [ 1094.936190] sof-audio-pci 0000:00:0e.0: pcm: trigger stream 0 dir 0 cmd 3
sh-apl-up2-pcm512x-02 kernel: [ 1094.936201] sof-audio-pci 0000:00:0e.0: ipc tx: 0x60060000: GLB_STREAM_MSG: TRIG_PAUSE
sh-apl-up2-pcm512x-02 kernel: [ 1094.936212] sof-audio-pci 0000:00:0e.0: error: trace IO error
sh-apl-up2-pcm512x-02 kernel: [ 1095.440015] sof-audio-pci 0000:00:0e.0: error: ipc timed out for 0x60060000 size 12
sof_errortrace.log
TIMESTAMP DELTA C# COMPONENT LOCATION CONTENT
[1094283701.770833] ( nan) c0 DMA src/drivers/dw/dma.c:1063 ERROR dw_dma_get_data_size(): xrun detected
[1094283706.406250] ( 4.635417) c0 dai 6.39 src/audio/dai.c:648 ERROR dai_report_xrun(): overrun due to no data available
[1094283709.791667] ( 3.385417) c0 dai 6.39 src/audio/dai.c:657 ERROR comp_overrun(): sink->free = 768, copy_bytes = 0
[1094283770.156250] ( 60.364582) c0 PIPE src/audio/pipeline.c:860 ERROR pipeline_copy(): ret = -61, start->comp.id = 39, dir = 0
[1094283774.166667] ( 4.010417) c0 PIPE 6.40 src/audio/pipeline.c:1040 ERROR pipeline_task(): xrun recover failed! pipeline will be stopped!
Platform: APL UP2 with I2S PCM512x
Firmware: b4e8b1e https://github.com/thesofproject/sof/commits/master
Kernel: 052e45d https://github.com/thesofproject/linux/commits/topic/sof-dev
Topology: file: tools/topology/sof-apl-pcm512x.tplg same as firmware
Activity
Liviali155 commentedon Apr 7, 2020
Bisect result:Caused by firmware commit 8b7f1fa
paulstelian97 commentedon Apr 7, 2020
Did you turn off the agent on that firmware? This commit switches to DMA scheduling which doesn't work well with the agent (currently).
Liviali155 commentedon Apr 9, 2020
After turn off the agent,issue still can be reproduced
paulstelian97 commentedon Apr 9, 2020
How many pipelines? It's possible we have an issue of overloading the system so you may need to also disable the low-power clock (if it applies to this platform, I'm not sure)
Liviali155 commentedon Apr 9, 2020
Error occured when do pause/release of
aplay -D hw:0,0 -r 48000 -c 2 -f S16_LE -vv -i /dev/zero -q
arecord -D hw:0,0 -r 48000 -c 2 -f S16_LE -vv -i /dev/null -q
I will try to disable the low power to check it
Liviali155 commentedon Apr 9, 2020
It seems it has no low power clock item,I have no method to disable low-power clock

paulstelian97 commentedon Apr 9, 2020
Hm, the particular topology you mention in the issue shouldn't be affected at all by that commit if I read it correctly. @plbossart @tlauda can you take a look?
The commit contents says you manually copy one of the topologies (removing the -master and -44100 suffixes if there). The one without such a suffix should remain identical and thus this commit shouldn't affect it.
plbossart commentedon Apr 10, 2020
that bisect result looks like a false positive to me?
Liviali155 commentedon Apr 10, 2020
I retest it:
8b7f1fa fail
1ecf435 "./multiple-pause-resume.sh -r 2000" +"./multiple-pause-resume.sh -r 500" pass
7 remaining items
[-][BUG][APL]"error: ipc timed out for 0x60070000 size 12" when do Pause/Release: simultaneous playback/capture test[/-][+][BUG][APL]"ERROR dw_dma_get_data_size(): xrun detected" when do Pause/Release: simultaneous playback/capture test[/+][-][BUG][APL]"ERROR dw_dma_get_data_size(): xrun detected" when do Pause/Release: simultaneous playback/capture test[/-][+][BUG][APL]ipc error and error trace with "ERROR dw_dma_get_data_size(): xrun detected" when do Pause/Release: simultaneous playback/capture test[/+]Liviali155 commentedon Jul 24, 2020
Issue still can be reproduced with latest sof-dev(e1a25077)+master(44a65d8)on apl pcm512 when run multiple-pause-resume
dmesg_error.log
sof_error.log
dmesg0724.log
sof-logger0724.log
plbossart commentedon Jul 30, 2020
Issue #3256 seems to be a duplicate, but contains additional information that point to the DW DMA handling being the problem?
ktrzcinx commentedon Sep 3, 2020
The issue can't be reproduced with RVP-APL platform, bisect shows commit with topology changes, so it doesn't look like FW issue. I can't effectively handle this issue because of limited access to full-linux-stack apl platform.
mengdonglin commentedon Sep 8, 2020
@plbossart @lyakh #3289 has been merged. Can you help check if this issue can be reproduced on your UP2 with PCM512?
Suggest lower the priority to P2 as this topology is not a product one.
lyakh commentedon Sep 8, 2020
@mengdonglin @plbossart I've run a multiple-pause-resume.sh test with 25 repetitions (-r 25). The first attempt failed with a "device busy" error from aplay (or arecord). No errors in dmesg or in FW traces. The second attempt ran through successfully. So, I would say I cannot reproduce it. The log does seem to look a bit different from #3256 but it's possible that the switch to the timer scheduling domain has fixed this one too...
mengdonglin commentedon Sep 8, 2020
@lyakh Many thanks for the fix and double check! Let's close it.