You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG][GLK][Capture] Overrun during pause-release #1578
Describe the bug
System shows I/O error when pause arecord then resume. Similar behaviour with all arecord devices. Looks like a pipeline overrun when the user releases pause.
@tlauda FYI. what I notice is that on GLK, the first dai_copy() after release ends up in a overrun because dd->dma_buffer->free is always 0. Could you please take a look?
@mrajwa@ranj063 I think you hit 2 kinds of xrun here, they are both because of copy_bytes == 0:
copy_bytes = MIN(avail_bytes, dd->dma_buffer->free),
but @ranj063's case is dd->dma_buffer->free == 0 after pause/release, and @mrajwa's case is avail_bytes from dw-dma driver is 0.
For the former case, we can check how it handled the pausing(e.g. does the last pipeline_copy() is finished before paused? if the dai_copy() is done but the downstream copying(e.g. volume_copy()) is not run, then the dd->dma_buffer may be full).
For the latter case, looks like the logic for chan->ptr_data.current_ptr for capture(without preload) stream is problematic, but let's wait for the author @tlauda's confirm.
@ranj063 Could you share FW logs? What is the sequence from kernel perspective on pause/release? What stream bits are you setting?
@YvonneYang2 In your logs I see that you are doing stop/start instead of pause/release. It looks like there is some kind of host pointer mismatch after such sequence.
Edit: However in dmesg I see pause/release. Are you sure that dmesg and logger logs are from the same scenario?
@ranj063 Logs in thesofproject/linux#1022 are from the older version of FW without couple of crucial fixes. I need logs from the current master as I cannot reproduce the issue with slim driver.
This issue still can be reproduced on byt nocodec platform today, but the reproduction rate is very low (about 1/20), also have not observed obvious error trace from dmesg and sof-logger . output
Activity
ranj063 commentedon Jun 20, 2019
@tlauda FYI. what I notice is that on GLK, the first dai_copy() after release ends up in a overrun because dd->dma_buffer->free is always 0. Could you please take a look?
ranj063 commentedon Jun 20, 2019
@michalgrodzicki could you please assign someone to take a into this?
mrajwa commentedon Jun 20, 2019
@ranj063 looks like we are facing the same issue on in KWD although conditions are a bit different. Have you spotted commit which causes it?
ranj063 commentedon Jun 20, 2019
@mrajwa no I am not sure when this feature ever worked on GLK. I'll try to find out today.
keyonjie commentedon Jun 21, 2019
@mrajwa @ranj063 I think you hit 2 kinds of xrun here, they are both because of copy_bytes == 0:
copy_bytes = MIN(avail_bytes, dd->dma_buffer->free),
but @ranj063's case is dd->dma_buffer->free == 0 after pause/release, and @mrajwa's case is avail_bytes from dw-dma driver is 0.
For the former case, we can check how it handled the pausing(e.g. does the last pipeline_copy() is finished before paused? if the dai_copy() is done but the downstream copying(e.g. volume_copy()) is not run, then the dd->dma_buffer may be full).
For the latter case, looks like the logic for chan->ptr_data.current_ptr for capture(without preload) stream is problematic, but let's wait for the author @tlauda's confirm.
ranj063 commentedon Jun 21, 2019
@mrajwa I've gone back as far as a month and I still can reproduce this issue.
YvonneYang2 commentedon Jun 24, 2019
Issue reproduced when stop via "ctrl + z" , then resume via command "fg".
Test recipe:
Firmware: 767a81b-2 https://github.com/thesofproject/sof/tree/master
Kernel: 0087d4a-2 https://github.com/thesofproject/linux/commits/topic/sof-dev
Topology: file: sof-glk-da7219.tplg same as firmware
platform :GLK
console
xrun_error_dmesg.log
xrun_error_logger.log
tlauda commentedon Jun 24, 2019
@ranj063 Could you share FW logs? What is the sequence from kernel perspective on pause/release? What stream bits are you setting?
@YvonneYang2 In your logs I see that you are doing stop/start instead of pause/release. It looks like there is some kind of host pointer mismatch after such sequence.
Edit: However in dmesg I see pause/release. Are you sure that dmesg and logger logs are from the same scenario?
ranj063 commentedon Jun 24, 2019
@tlauda the firmware logs are in thesofproject/linux#1022
For the sequence, please refer to https://github.com/thesofproject/linux/blob/0087d4afe31bad40a0f365b774547fd69124d58c/sound/soc/sof/intel/hda-stream.c#L215
tlauda commentedon Jun 24, 2019
@ranj063 Logs in thesofproject/linux#1022 are from the older version of FW without couple of crucial fixes. I need logs from the current master as I cannot reproduce the issue with slim driver.
46 remaining items
tlauda commentedon Aug 8, 2019
@mengdonglin @YvonneYang2 Fixed on BYT with #1715. GLK debug still in progress.
Jiangxinx commentedon Aug 9, 2019
Can not be reproduced with #1715 on BYT platform.
mengdonglin commentedon Aug 10, 2019
@tlauda thank you! Please notify us when your new #1722 is merged.
Jiangxinx commentedon Aug 21, 2019
Can not be reproduced with #1722 on BYT rt5682 platform.
YvonneYang2 commentedon Aug 26, 2019
Can still reproduce the bug on glk platform with #1722
dengyangchao commentedon Aug 26, 2019
issue can reproduce on CFL
Reproduce rate
1/113
Test recipe
Firmware: 66da4e8 https://github.com/thesofproject/sof/commits/master
Kernel: 2a22b94 https://github.com/thesofproject/linux/commits/topic/sof-dev
Topology: file: tools/topology/sof-hda-generic-4ch.tplg same as firmware
platform:CFL
[-][BUG] Overrun during pause-release[/-][+][BUG][GLK] Overrun during pause-release[/+]tlauda commentedon Aug 26, 2019
Issue for cAVS 1.8 created here: #1760.
YvonneYang2 commentedon Aug 27, 2019
Issue can be reproduced with steps as below on GLK platform as #1677 (comment) said, but tried to apply thesofproject/linux#1070 , issue is gone.
To reproduce
Jiangxinx commentedon Aug 29, 2019
This issue still can be reproduced on byt nocodec platform today, but the reproduction rate is very low (about 1/20), also have not observed obvious error trace from dmesg and sof-logger .
output
dmesg
sof-logger
Test recipe
Firmware: 7791303 https://github.com/thesofproject/sof/commits/master
Kernel: f95e4eb https://github.com/thesofproject/linux/commits/topic/sof-dev
Topology: sof-byt-nocodec.tplg
platform:BYT
[-][BUG][GLK] Overrun during pause-release[/-][+][BUG][GLK][Capture] Overrun during pause-release[/+]