High,

I've been fighting a long battle against xruns, and the available help
on the net is not all too hot.  So I'll just say what seemed to do the
trick in Ubuntu with jackd.

sudo apt-get install jackd linux-rt rtirq-init

Boot the realtime kernel (it is possible that you'll get away without
doing that, but I have no relevant experience).

Of course, the user needs to be group audio (which gives him some
realtime capabilities through /etc/security/limits.d/audio.conf created
by the postinst script of jackd).

Now when you do something like "service rtirq restart", you get
something like

Setting IRQ priorities: start [rtc] irq=8 pid=646 prio=90: OK.
Setting IRQ priorities: start [RME Hammerfall DSP + Multiface] irq=5 pid=3630 
prio=85: OK.
Setting IRQ priorities: start [RME Hammerfall DSP + Multiface] irq=5 pid=7154 
prio=84: OK.
Setting IRQ priorities: start [RME Hammerfall DSP + Multiface] irq=5 pid=7565 
prio=83: OK.
Setting IRQ priorities: start [uhci_hcd] irq=11 pid=617 prio=80: OK.
Setting IRQ priorities: start [uhci_hcd] irq=11 pid=621 prio=79: OK.
Setting IRQ priorities: start [uhci_hcd] irq=11 pid=625 prio=78: OK.
Setting IRQ priorities: start [ehci_hcd] irq=11 pid=611 prio=80: OK.
Setting IRQ priorities: start [i8042] irq=1 pid=634 prio=75: OK.
Setting IRQ priorities: start [i8042] irq=12 pid=633 prio=74: OK.

Now start jackd (like with qjackctl) and give it a realtime priority
just below the soundcard which should be close to the top of the list,
below rtc.  In the above case, priority 82 should be fine.

There may be other things you want to do, like assigning interrupts
differently in your BIOS.  But the important thing are the tasklet
priorities for the interrupt servicing.

The realtime kernel alone will not buy you much.  Neither will do
running jackd with realtime priorities. Neither will just setting the
IRQ priorities right without moving jackd's realtime priority to a
level matching the task.

When you are recording to disk and so on, you might need to take a look
at more involved priorities (the client program needs to get the data
away).  If you have Firewire or USB soundcards, the respective
interfaces need to be services with priority as well.  Chances are that
rtirq-init picks good priorities for that case as well.  If it doesn't,
bug reports seem to be in order.

It is somewhat sobering that the earliest kernel version for which this
is supposed to work (priorities per IRQ client tasklet rather than per
IRQ) is 2.6.31-rt (namely starting with Lucid).  I have no idea how
people used Linux for recording before that, in particular with Laptops
where juggling IRQs to be separate is not typically easy.

-- 
David Kastrup


------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user

Reply via email to