Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG][TGL][v7.0-rc10]Wov will repeat about 1~2s of the end of recorded file #3189

Closed
Liviali155 opened this issue Jul 15, 2020 · 14 comments
Closed
Assignees
Labels
alsa-utils Issues caused by alsa-utils bug Something isn't working as expected Fix confirmed Fix for the issue has been found and verified JSL Applies to Jasper Lake platform Keyword Detection Applies to Keyword Detection P2 Critical bugs or normal features TGL Applies to Tiger Lake

Comments

@Liviali155
Copy link

Liviali155 commented Jul 15, 2020

Describe the bug
Wov will repeat about 1~2s of the end of recorded file

To Reproduce
1."sudo reboot" to reboot system
2.arecord -Dhw:0,100 -M -N -f s32_le -r 16000 -i -vvv -c2 --buffer-size=96000 ./tmp.wav

Reproduce Rate
1/3

Expected behavior
Recorded file normal

Impact
Wov will repeat about 1~2s of the end of recorded file

Environment
Kernel:https://github.com/keyonjie/linux/commits/keyon-002(commit:082d5f6f2334824388b2e80de98e1f501106b756)
Firmware:https://github.com/thesofproject/sof/commits/releases/tgl/v7.0-rc10 ,(commit: fb801c8)

TPLG:sof-tgl-max98373-rt5682.tplg
Platform:Chromebook with codec 98373 in I2S mode.

dmesg0715.log
sof-logger0715.log
tmp.zip

@Liviali155 Liviali155 added bug Something isn't working as expected TGL Applies to Tiger Lake labels Jul 15, 2020
@ClarexZhou
Copy link

@ClarexZhou
Copy link

ClarexZhou commented Jul 20, 2020

Error only occurred when stop capture via CTRL+C, error not occurred if run and stop stream via -d 10, arecord -Dhw:0,100 -M -N -f s32_le -r 16000 -d 10 -i -vv -c2 --buffer-size=96000 ./tmp.wav, verified 10 interactions

@slawblauciak slawblauciak added the P2 Critical bugs or normal features label Jul 21, 2020
@keyonjie
Copy link
Contributor

Hi @mrajwa this issue can be reproduced with 98357a machine on S0 also, please try it more times(3~5 times) to reproduce it.

@mengdonglin mengdonglin added the Keyword Detection Applies to Keyword Detection label Jul 28, 2020
@slawblauciak
Copy link
Collaborator

To be clarified with the Chrome team, if forceful stopping of the pipeline is to be supported.

@Liviali155
Copy link
Author

Liviali155 commented Jul 29, 2020

@Liviali155 Liviali155 added the JSL Applies to Jasper Lake platform label Jul 29, 2020
@slawblauciak
Copy link
Collaborator

When the user forcefully stops the pipeline during draining, the flow of data is aborted. There's no likely scenario that could cause the firmware to keep sending repeating data afterwards. I would recommend verifying the way the buffer read in the driver.

@mwasko
Copy link
Contributor

mwasko commented Aug 3, 2020

@ranj063 can we ask for SOF driver expertise? The initial FW debug indicate problem at driver/kernel layer

@ranj063
Copy link
Collaborator

ranj063 commented Aug 3, 2020

@ranj063 can we ask for SOF driver expertise? The initial FW debug indicate problem at driver/kernel layer

@mrajwa checking at my end but can you please elaborate on which part of your debug indicated a driver problem?

@mrajwa
Copy link
Contributor

mrajwa commented Aug 4, 2020

@ranj063, FW pipeline is stopped but yet application gets additional data - clearly layers above FW copy more than they should.

@mrajwa
Copy link
Contributor

mrajwa commented Aug 7, 2020

This is the application bug I have already submitted patches to ALSA, @lgirdwood I think we can close it.

@keyonjie
Copy link
Contributor

Thanks for spotting this and providing solution, it is really nice catch! I added some comments about refining the PR alsa-project/alsa-utils#51, @perexg can you help to take a look?

@slawblauciak slawblauciak added the Fix confirmed Fix for the issue has been found and verified label Aug 10, 2020
@slawblauciak
Copy link
Collaborator

Will close when the PR gets merged.

@mengdonglin mengdonglin added this to the v1.6 milestone Aug 20, 2020
@mengdonglin mengdonglin added the alsa-utils Issues caused by alsa-utils label Sep 1, 2020
@mengdonglin mengdonglin removed this from the v1.6 milestone Sep 1, 2020
mrajwa added a commit to mrajwa/alsa-utils that referenced this issue Oct 6, 2020
This patch changes the logic of pcm_readv() when abort signal has been
detected. During such condition we should return the amount of frames
actually read instead of the size requested by caller.

Currently functions pcm_read() and pcm_readv() when aborted (in_aborting
flag set) return the amount of requested frames instead of those actually
read prior to interrupt. The consequence of this is repetition of recent X
frames where X stands for amount of frames in one period. This problem is
barely visible or rather audible when the period is small like few
milliseconds because repetition of 1 [ms] of data is not-noticeable
however if we use buffer and period sizes in seconds then the problem
becomes apparent.

Example issue -> thesofproject/sof#3189

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
perexg pushed a commit to alsa-project/alsa-utils that referenced this issue Oct 6, 2020
This patch changes the logic of pcm_readv() when abort signal has been
detected. During such condition we should return the amount of frames
actually read instead of the size requested by caller.

Currently functions pcm_read() and pcm_readv() when aborted (in_aborting
flag set) return the amount of requested frames instead of those actually
read prior to interrupt. The consequence of this is repetition of recent X
frames where X stands for amount of frames in one period. This problem is
barely visible or rather audible when the period is small like few
milliseconds because repetition of 1 [ms] of data is not-noticeable
however if we use buffer and period sizes in seconds then the problem
becomes apparent.

Example issue -> thesofproject/sof#3189

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
@mrajwa
Copy link
Contributor

mrajwa commented Oct 12, 2020

PR on alsa-utils has been merged, can we close it now?

@keyonjie
Copy link
Contributor

PR on alsa-utils has been merged, can we close it now?

yes, think so, thanks for proceeded it.

@mrajwa mrajwa closed this as completed Oct 12, 2020
lgirdwood pushed a commit to thesofproject/alsa-utils that referenced this issue Dec 3, 2020
This patch changes the logic of pcm_readv() when abort signal has been
detected. During such condition we should return the amount of frames
actually read instead of the size requested by caller.

Currently functions pcm_read() and pcm_readv() when aborted (in_aborting
flag set) return the amount of requested frames instead of those actually
read prior to interrupt. The consequence of this is repetition of recent X
frames where X stands for amount of frames in one period. This problem is
barely visible or rather audible when the period is small like few
milliseconds because repetition of 1 [ms] of data is not-noticeable
however if we use buffer and period sizes in seconds then the problem
becomes apparent.

Example issue -> thesofproject/sof#3189

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alsa-utils Issues caused by alsa-utils bug Something isn't working as expected Fix confirmed Fix for the issue has been found and verified JSL Applies to Jasper Lake platform Keyword Detection Applies to Keyword Detection P2 Critical bugs or normal features TGL Applies to Tiger Lake
Projects
None yet
Development

No branches or pull requests

8 participants