[alsa-devel] XRUN handling

James Courtier-Dutton james.dutton at gmail.com
Tue Jul 6 18:16:42 CEST 2010


On 6 July 2010 06:03, melwyn lobo <linux.melwyn at gmail.com> wrote:
> Hi all,
> I have noticed when an Xrun occurs, the bytes between the hw_ptr and
> appl_ptr are not copied when both hw and appl pointers are reset in
> snd_pcm_prepare().
>
> Is my analysis correct? If so how do we ensure correct behaviour ie
> byte accuracy after Xrun.
>

When an Xrun occurs, all bets are off. You should reset the sound card
buffers and start again.
The best thing to do is try to track down why the Xrun occurs in the
first place and stop it happening.
It most likely occurs because some other device is keeping the CPU
from servicing the interrupt correctly.
Normally graphics card drivers, hard disk drivers or file system code
causes this problem.
Look at low latency and real time patches for the Linux kernel.

Kind Regards

James


More information about the Alsa-devel mailing list