![](https://secure.gravatar.com/avatar/7b62b93403a10ada0f313281a849d35a.jpg?s=120&d=mm&r=g)
21 Nov
2007
21 Nov
'07
4:28 p.m.
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