[alsa-devel] XRUN happens too often.

Lee Revell rlrevell at joe-job.com
Thu Apr 10 06:54:33 CEST 2008


On Wed, Apr 9, 2008 at 11:29 PM, Rong-Jhe <r93922118 at ntu.edu.tw> wrote:
> Thanks to all that answer my question.
>  My application is receiving audio data from newtork and play it with ALSA
>  library.
>  The environment is in ARM not in PC. The same codes can not perform well in
>  ARM as in PC.
>  I have not seen the implementation of snd_pcm_writei(), and only read the
>  document of ALSA to use this function.
>  I guess snd_pcm_writei() will generate a thread that can write data into the
>  DMA of soundcard at each period.
>  This may explain why the duration of snd_pcm_writei() is not regular, and why
>  ALSA lib can use function call to implement mixing without a mixing server.

ALSA does not generate threads for you like this.  I was referring to
your application's audio thread, assuming that your app is indeed
multithreaded.

The duration probably varies because the call to snd_pcm_writei() will
block until there is enough space in the ALSA ringbuffer to receive
your data.

Lee


More information about the Alsa-devel mailing list