ALSA: pcm: Don't issue XRUN during draining
PATCH 1/1 ALSA: pcm: Don't issue XRUN during draining
snd_pcm_stop_xrun() checks the stream status with snd_pcm_running() helper, but this isn't really correct; namely, snd_pcm_running() returns true also when the stream is in draining, but in principle, the xrun at draining means nothing but the draining finished. Hence, we shouldn't issue XRUN when it happens during draining.
That is, for a proper state check, we should check the state only for SNDRV_PCM_STATE_RUNNING, instead.
Fixes 1fb8510cdb5b ("ALSA: pcm: Add snd_pcm_stop_xrun() helper")
Signed-off-by Takashi Iwai <[email protected]>
--- sound/core/pcm_native.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
sound/core/pcm_native.c +2 -1
@@ -1577,7 +1577,8 @@ int snd_pcm_drain_done(struct snd_pcm_substream *substream)int snd_pcm_stop_xrun (struct snd_pcm_substream *substream) {guard (pcm_stream_lock_irqsave)(substream); -if (substream->runtime &&snd_pcm_running (substream)) +if (substream->runtime && + substream->runtime->state ==SNDRV_PCM_STATE_RUNNING )__snd_pcm_xrun (substream);return 0 ; }
Signature · 1 line
2.43.0