Re: XRUN happens too often.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Rong-Jhe wrote:
> buffer size = 9408 frames
>
> A sample in 16-bit, two channels is 4 bytes.
> I allocate a audio data of 9408x4=37632 bytes.
>
> audio_data=malloc(buffer_size*4);
>
> This audio_data buffer will receive audio data from the network.
> If this buffer is full, I use snd_pcm_writei( ) to put the buffer into the pcm.

When this buffer is full, the device buffer is completely empty,
and even the slightest delay will result in an underrun.

Write data to the device buffer immediately when you receive it.


HTH
Clemens
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux