[alsa-devel] [RFC] ALSA: Reduce delay for a blocking pcm_drain.

Dylan Reid dgreid at chromium.org
Mon Sep 30 18:20:14 CEST 2013

On Mon, Sep 30, 2013 at 1:45 AM, Clemens Ladisch <clemens at ladisch.de> wrote:
> Dylan Reid wrote:
>> This patch addresses two issues related to calling snd_pcm_drain.
>> If no_period_wakeup is set, then snd_pcm_drain would wait
>> MAX_SCHEDULE_TIMEOUT jiffies, without a wakeup pending this will leave
>> the calling task blocked indefinitely.
> no_period_wakeup is used by applications that do _not_ want to use any
> of ALSA's blocking functions (and thus want to avoid the interrupt
> overhead) and use their own timers instead.  This also applies to
> snd_pcm_drain.
> Is there any actual application that tries to use snd_pcm_drain together
> with no_period_wakeup?

Not a real one.  I am using no_period_wakeup and looking for an easy
way to flush at the end.  User space already knows the buffer level,
so it can wait for the appropriate time and wait for an underrun just
as easily.  Thanks for the explanation all.


More information about the Alsa-devel mailing list