[alsa-devel] Problem when using silence 'trick'

Clemens Ladisch clemens at ladisch.de
Mon Feb 28 09:34:14 CET 2011


Bryan Ischo wrote:
> [...] when I use the "default" device with my silence
> technique, I have no problem playing multiple audio streams
> simultaneously by opening the "default" device multiple times and
> simultaneously playing streams into the different devices.  BUT,
> whenever I cannot deliver audio fast enough to a stream, and the silence
> trick takes over and the stream plays some silence - boom, the device
> goes silent forever.

I tried to reproduce this with mplayer (which uses the same technique),
but couldn't.

Have a look at mplayer's ALSA output driver here:
<http://git.ffmpeg.org/?p=mplayer;a=blob;hb=master;f=libao2/ao_alsa.c>
It regularly calls get_delay() before writing samples, and there uses
snd_pcm_forward() to catch up if an underrun has occurred.

> My apologies for sending this to the wrong mailing list.  When I read
> that alsa-devel was for "work on ... an ALSA application", I assumed
> that this was any application; but now I realize that it is probably for
> official ALSA tools, not general third party applications that are not
> associated with the ALSA project.

This list is correct for questions about the ALSA API.


Regards,
Clemens


More information about the Alsa-devel mailing list