Message ID | s5hzi2r738x.wl-tiwai@suse.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
> We have to skip the avail_min check during draining. It's already > done in the kernel code, but forgotten in alsa-lib side. > The fix patch is below. Perfect. Thanks a lot. So I am waiting for your patch and will then adapt/test the JACK implementation with draining. Best regards Timo
diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c index ed47cb516c73..11aec8052135 100644 --- a/src/pcm/pcm.c +++ b/src/pcm/pcm.c @@ -2751,7 +2751,9 @@ int __snd_pcm_wait_in_lock(snd_pcm_t *pcm, int timeout) { int err; - if (!snd_pcm_may_wait_for_avail_min(pcm, snd_pcm_mmap_avail(pcm))) { + /* NOTE: avail_min check can be skipped during draining */ + if (__snd_pcm_state(pcm) != SND_PCM_STATE_DRAINING && + !snd_pcm_may_wait_for_avail_min(pcm, snd_pcm_mmap_avail(pcm))) { /* check more precisely */ err = pcm_state_to_error(__snd_pcm_state(pcm)); return err < 0 ? err : 1;