[alsa-devel] Broken playback

Clemens Ladisch cladisch at fastmail.net
Wed Nov 21 16:28:27 CET 2007


Gabriele Melia wrote:
> i have already tried to read and decode some data in order to accumulate
> 1 second of data to prevent broken audio,
> but nothing change, analysing the issue i have found that broken audio
> comes when the snd_pcm_writei is called with a size that is 5000. So it
> takes time to dispach all this size.

Try non-blocking mode (see the snd_pcm_nonblock function).  In non-
blocking mode, the writei call will only write as much data as can be
written without waiting (or returns -EAGAIN if the buffer is already
full at the moment).


HTH
Clemens


More information about the Alsa-devel mailing list