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 <tiwai@xxxxxxx>
---
sound/core/pcm_native.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 381a476a1045..7bcca443e333 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -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;
}
--
2.43.0
[Index of Archives]
[Pulseaudio]
[Linux Audio Users]
[ALSA Devel]
[Fedora Desktop]
[Fedora SELinux]
[Big List of Linux Books]
[Yosemite News]
[KDE Users]