Dominique Michel dominique.michel at citycable.ch
Sun Aug 13 10:46:35 UTC 2006

Le Wed, 9 Aug 2006 19:20:54 -0400,
Joshua Boyd <jdboyd at jdboyd.net> a écrit :

> I just upgraded my LFS 6.1 system from 2.6.12 (with preempt, but not the
> -rt patch) to 2.6.15-rt (enabling high resolution timers and PREEMPT_RT
> along the way), and now my audio driver is dropping interrupts every few
> seconds, something it wasn't doing before.
> I haven't configured rtlimits since the program runs as root anyway, and
> I'd like it to be free to hog quite a lot if need be.
> In my application (which runs in SCHED_FIFO), the audio thread runs at
> -10, while the video thread runs at -19.  I don't know if that is best,
> I just wanted them to be higher than the other threads.
> Also, outside forces, like a ssh connection, or a USB dongle connection
> cause the program to drop audio madly.  Is there some code I need to be
> adding to force such system tasks down rather than just elevating my own
> application? 
A rt kernel will be of almost no use if you don't fix the priorities.
You can use PAM-rlimits or the realtime-lsm module for that, and you
have to be in the audio group.

The audio group will have a higher priority and this is the right way
to do that.

You can take a lock at

PAM-rlimits is the new way of doing that, but if you want an very
low latency for intensive audio work as synthesis or filter, the
realtime.lsm will be better.

A very important issue with a rt kernel is at you must not have shared
IRQ with a such kernel. You can check it with
# cat /proc/interrupts
It is specially important for the sound and the video card.

If you are new with rt-kernel, I would recommend you to install an
audio distribution as Demudi, planet CCRMA, jacklab, musix, or the
gentoo audio pro overlay. They all have that rt stuff trimmed for you.

With usb audio card, the IRQ period of the USB bus is 1 msec. That
mean at you must use something as 48KHz 3 periods with jack (That will
be a multiple of that irq period) in order to get a low
latency with such sound cards.

And you MUST NOT be root in all cases with a rt-kernel.

More information about the Linux-audio-dev mailing list