[alsa-devel] Why does snd_seq_drain_output() need lots of time to execute?

Fons Adriaensen fons at linuxaudio.org
Fri Jan 27 13:03:13 CET 2012

On Fri, Jan 27, 2012 at 01:20:17AM +0100, Rafał Cieślak wrote:
> However, it seems that somehow I cannot change it. If I try using
> snd_seq_set_client_pool_output(), this gives absolutely no effect, and
> does not seem to make any effect, the pool size stays at 500 (even
> though the function returns 0)  (to check the pool size I look at
> /proc/asound/seq/clients, and it is always 500).

If you manage to fill a 500-event buffer, could that mean that
you are sending events a long time ahead of their due time ?

In that case the solution is to keep events in application buffers
until say half a second before they are really needed. In other
words let the app do the rough timing, and ALSA the fine one.

It requires a bit more logic, but it's probably needed anyway -
you can't expect kernel side ALSA to buffer e.g. a complete song.

Limiting the send-ahead time will also make the app more
responsive in case you have to stop and/or reposition the



Vor uns liegt ein weites Tal, die Sonne scheint - ein Glitzerstrahl.

More information about the Alsa-devel mailing list