]> git.alsa-project.org Git - alsa-utils.git/commit
aplay: pcm_readv(): return read samples instead of requested upon abort
authorMarcin Rajwa <marcin.rajwa@linux.intel.com>
Fri, 7 Aug 2020 13:56:05 +0000 (15:56 +0200)
committerJaroslav Kysela <perex@perex.cz>
Tue, 6 Oct 2020 10:58:20 +0000 (12:58 +0200)
commitbc7a944c50239faf41619826ae914081034f83fe
treef40683bf46310a1026caefe5ffe5fcd42f78d8b3
parent8572c0c427dec358e6070659032230966d0dd0ca
aplay: pcm_readv(): return read samples instead of requested upon abort

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>
aplay/aplay.c