IRQ Threading and Priorities
From FreeBoB
Only useful on -rt patched kernels that are configured with threaded IRQ's
In order for FreeBoB to be well behaved, you should use a kernel patched with the -rt patch of Ingo Molnar. One of the changes is that interrupt handlers become kernel threads with user-controllable priorities. This means that critical threads from user processes (such as Jack) can get higher priority than certain IRQ handlers (e.g. video card). This makes sure that hardware devices not in the critical audio chain, such as video cards, get no chance to delay the audio processing. That is, if your priorities are setup correctly.
The easiest way to setup these priorities is by using the rtirq script for this, which can be found Rui Nuno Capela's site (http://www.rncbc.org/jack/). To enable this on a PlanetCCRMA system, install the rtirq package.
For FreeBoB, you should assign a high IRQ priority to the irq of your host controller, i.e. the ohci1394 module. On a PlanetCCRMA system, this setup is done in /etc/sysconfig/rtirq.
This is how I (Pieter Palmers) have it configured:
#!/bin/sh # # Copyright (c) 2004-2005 rncbc aka Rui Nuno Capela. # All rights reserved. # # /etc/sysconfig/rtirq # # Configuration for IRQ thread tunning, # for realtime-preempt enabled kernels, # # IRQ thread service names # (space separeted list, from higher to lower priority). RTIRQ_NAME_LIST="rtc ohci1394 snd usb i8042" # Highest priority. RTIRQ_PRIO_HIGH=80 # Priority decrease step. RTIRQ_PRIO_DECR=5 # Whether to reset all IRQ threads to SCHED_OTHER. RTIRQ_RESET_ALL=0 # On kernel configurations that support it, # which services should be NOT threaded # (space separated list). RTIRQ_NON_THREADED="rtc ohci1394 snd"
When you run the rtirq init script, this is the output:
rtirq: start [rtc] irq=8 pid=233 prio=80: OK. rtirq: start [ohci1394] irq=11 pid=1177 prio=75: OK. rtirq: start [snd] irq=9 pid=15 prio=70: OK. rtirq: start [i8042] irq=1 pid=323 prio=60: OK. rtirq: start [i8042] irq=12 pid=251 prio=59: OK.
This means that the ohci card got a priority of 75. You shouldn't give jackd/libfreebob a higher priority than the OHCI card, because this card is 'feeding' jackd/libfreebob with the data it needs to work with. Causality is the key word here.
I then run jackd with a priority of 60, such that it's priority is higher than the non-audio devices, but lower than the audio devices.
