You are here

rtirq conf

ahoy Rui,

first, thanks for all the great work you have done for GNU+Linux/FLOSS audio work. QjackCtl and rtirq are must-haves, and looking forward to Qtractor. hopefully we can make music to match it. thanks for making it possible.

i am running rtirq with Gentoo 2.6.33.7-rt29-libre #3 SMP PREEMPT RT x86_64 Intel(R) Core(TM)2 Duo CPU P8700 @ 2.53GHz Genuine Intel GNU/Linux (w/ irqbalance, CPUs on performance), and had some questions after updating to the most recent version 20090920, as well as seeing some posts about how to configure rtirq with the new Juju FireWire stack.

sorry for all the questions, but after finding conflicting posts and old info, i thought it would be good for others to have some issues addressed by the one who would know best.

1) does one need to add "firewire", "firewire_ohci", "firewire_core" to RTIRQ_NAME_LIST and RTIRQ_NON_THREADED in rtirq.conf? should references to the old FW stack (like "raw1394" and "ohci1394") be removed?

2) does something need to be added to RTIRQ_NAME_LIST and RTIRQ_NON_THREADED (or anything else in rtirq.conf) to account for the fact that a FireWire audio interface is connected via a PC ExpressCard? i had read here http://ubuntuforums.org/showpost.php?p=9348990&postcount=23 that "raw1394" had to be added. not sure what would need to be done for the new Juju FW stack?

3) on the new rtirq.conf file merged in, the RTIRQ_HIGH_LIST is still commented out, and its value is now "timer". just wondering if this should be commented out still?

4) after looking here http://subversion.ffado.org/wiki/IrqPriorities it seems like the many sirq threads, including the timer threads, should be pretty high after running rtirq. however, on my system, with my rtirq.conf inserted below, the [sirq-timer/0], [sirq-hrtimer/0], [sirq-tasklet/0] and others, which on the FFADO page are listed with a high rtprio, are all below 50. maybe these need to be added to RTIRQ_NAME_LIST, RTIRQ_NON_THREADED, or some other variable? i have listed my rtprio output here:


$ sudo ps -eLo rtprio,cls,pid,pri,nice,cmd | grep "FF" | sort -r
- TS 27610 19 0 grep --colour=auto FF
99 FF 7041 139 - [migration/1]
99 FF 3 139 - [migration/0]
99 FF 17 139 - [posixcputmr/1]
99 FF 14 139 - [posixcputmr/0]
90 FF 740 130 - [irq/8-rtc0]
88 FF 27409 128 - [irq/17-firewire]
78 FF 7067 118 - [irq/22-hda_inte]
76 FF 697 116 - [irq/16-uhci_hcd]
76 FF 689 116 - [irq/19-ehci_hcd]
75 FF 712 115 - [irq/18-uhci_hcd]
75 FF 692 115 - [irq/23-ehci_hcd]
74 FF 723 114 - [irq/1-i8042]
74 FF 703 114 - [irq/19-uhci_hcd]
73 FF 722 113 - [irq/12-i8042]
73 FF 709 113 - [irq/19-uhci_hcd]
73 FF 700 113 - [irq/21-uhci_hcd]
72 FF 706 112 - [irq/23-uhci_hcd]
50 FF 7092 90 - [irq/19-eth0]
50 FF 7068 90 - [irq/16-mmc0]
50 FF 7066 90 - [irq/16-i915@pci]
50 FF 663 90 - [irq/19-ahci]
50 FF 217 90 - [irq/9-acpi]
50 FF 19784 90 - [irq/16-ath9k]
50 FF 1282 90 - [irq/16-jmb38x_m]
49 FF 9 89 - [sirq-block-iopo]
49 FF 8 89 - [sirq-block/0]
49 FF 7 89 - [sirq-net-rx/0]
49 FF 7051 89 - [sirq-rcu/1]
49 FF 7050 89 - [sirq-hrtimer/1]
49 FF 7049 89 - [sirq-sched/1]
49 FF 7048 89 - [sirq-tasklet/1]
49 FF 7047 89 - [sirq-block-iopo]
49 FF 7046 89 - [sirq-block/1]
49 FF 7045 89 - [sirq-net-rx/1]
49 FF 7044 89 - [sirq-net-tx/1]
49 FF 7043 89 - [sirq-timer/1]
49 FF 7042 89 - [sirq-high/1]
49 FF 6 89 - [sirq-net-tx/0]
49 FF 5 89 - [sirq-timer/0]
49 FF 4 89 - [sirq-high/0]
49 FF 13 89 - [sirq-rcu/0]
49 FF 12 89 - [sirq-hrtimer/0]
49 FF 11 89 - [sirq-sched/0]
49 FF 10 89 - [sirq-tasklet/0]
1 FF 29 41 - [events/0]

thanks again for your work, and in advance for your support.

peace, wayne

my rtirq.conf:


# IRQ thread service names
# (space separated list, from higher to lower priority).
RTIRQ_NAME_LIST="rtc firewire raw1394 ohci1394 'HDA Intel' snd usb i8042"

# Highest priority.
RTIRQ_PRIO_HIGH=90

# Priority decrease step.
RTIRQ_PRIO_DECR=2

# 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 firewire raw1394 ohci1394 'HDA Intel' snd"

# Process names which will be forced to the
# highest realtime priority range (99-91)
# (space separated list, from highest to lower priority).
# RTIRQ_HIGH_LIST="timer"

Forums: 
rncbc's picture

if your main sound device is the firewire one, then i'll recommend you keep it straight and simple like this:

RTIRQ_NAME_LIST="rtc ohci1394 snd"

re. RTIRQ_NON_THREADED is a no-op on PREEMPT_RT kernels so please don't bother with it.

otoh, it would be somewhat insightful if you post the output of

cat /proc/interrupts

and

rtirq status

cheers

ahoy Rui,

thanks for the quick reply. in regards to your comment about RTIRQ_NAME_LIST:

+ does that still hold when using the new Juju FireWire stack, where there is no "ohci1394" as far as i can tell, but instead "firewire", in both /proc/interrupts, the soft IRQs, and lsmod?

+ i use both the FireWire interface and the internal HDA Intel soundcard, depending on where i am, though the FireWire more often. can i leave the 'HDA Intel' as well, or should they be changed depending on the hardware being used each time? the HDA Intel seems to be more XRUN-free for me with it listed in RTIRQ_NAME_LIST, though i am more concerned with the FireWire working best, since i need that for low latency recording.

here is the info you requested:


$ cat /proc/interrupts
CPU0 CPU1
0: 13810085 12938218 IO-APIC-edge timer
1: 12174 204 IO-APIC-edge i8042
8: 33 38 IO-APIC-edge rtc0
9: 26412 1460 IO-APIC-fasteoi acpi
12: 486879 239727 IO-APIC-edge i8042
16: 1345140 947 IO-APIC-fasteoi uhci_hcd:usb3, jmb38x_ms:slot0, ath9k, i915@pci:0000:00:02.0, mmc0
17: 7671126 7716254 IO-APIC-fasteoi firewire_ohci
18: 0 0 IO-APIC-fasteoi uhci_hcd:usb8
19: 213858 1943 IO-APIC-fasteoi ahci, ehci_hcd:usb1, uhci_hcd:usb5, uhci_hcd:usb7, eth0
21: 0 0 IO-APIC-fasteoi uhci_hcd:usb4
22: 1774 552 IO-APIC-fasteoi hda_intel
23: 31759 31196 IO-APIC-fasteoi ehci_hcd:usb2, uhci_hcd:usb6
NMI: 0 0 Non-maskable interrupts
LOC: 10711108 10892350 Local timer interrupts
SPU: 0 0 Spurious interrupts
PMI: 0 0 Performance monitoring interrupts
PND: 0 0 Performance pending work
RES: 1392987 1351155 Rescheduling interrupts
CAL: 348 311 Function call interrupts
TLB: 32096 38706 TLB shootdowns
TRM: 0 0 Thermal event interrupts
THR: 0 0 Threshold APIC interrupts
MCE: 0 0 Machine check exceptions
MCP: 49 49 Machine check polls
ERR: 3
MIS: 0

$ sudo /etc/init.d/rtirq status

PID CLS RTPRIO NI PRI %CPU STAT COMMAND
740 FF 90 - 130 0.0 S irq/8-rtc0
10284 FF 88 - 128 0.0 S irq/17-firewire
7687 FF 78 - 118 0.0 S irq/22-hda_inte
686 FF 76 - 116 0.0 S irq/19-ehci_hcd
697 FF 76 - 116 0.0 S irq/16-uhci_hcd
692 FF 75 - 115 0.0 S irq/23-ehci_hcd
712 FF 75 - 115 0.0 S irq/18-uhci_hcd
703 FF 74 - 114 0.0 S irq/19-uhci_hcd
723 FF 74 - 114 0.0 S irq/1-i8042
700 FF 73 - 113 0.0 S irq/21-uhci_hcd
709 FF 73 - 113 0.0 S irq/19-uhci_hcd
722 FF 73 - 113 0.0 S irq/12-i8042
706 FF 72 - 112 0.0 S irq/23-uhci_hcd
217 FF 50 - 90 0.0 S irq/9-acpi
664 FF 50 - 90 0.0 S irq/19-ahci
1296 FF 50 - 90 0.0 S irq/16-jmb38x_m
1344 FF 50 - 90 0.0 S irq/16-ath9k
7686 FF 50 - 90 0.0 S irq/16-i915@pci
7688 FF 50 - 90 0.0 S irq/16-mmc0
9554 FF 50 - 90 0.0 S irq/19-eth0
4 FF 49 - 89 0.0 S sirq-high/0
5 FF 49 - 89 0.0 S sirq-timer/0
6 FF 49 - 89 0.0 S sirq-net-tx/0
7 FF 49 - 89 0.0 S sirq-net-rx/0
8 FF 49 - 89 0.0 S sirq-block/0
9 FF 49 - 89 0.0 S sirq-block-iopo
10 FF 49 - 89 0.0 S sirq-tasklet/0
11 FF 49 - 89 0.0 S sirq-sched/0
12 FF 49 - 89 0.0 S sirq-hrtimer/0
13 FF 49 - 89 0.0 S sirq-rcu/0
7662 FF 49 - 89 0.0 S sirq-high/1
7663 FF 49 - 89 0.1 S sirq-timer/1
7664 FF 49 - 89 0.0 S sirq-net-tx/1
7665 FF 49 - 89 0.0 S sirq-net-rx/1
7666 FF 49 - 89 0.0 S sirq-block/1
7667 FF 49 - 89 0.0 S sirq-block-iopo
7668 FF 49 - 89 0.0 S sirq-tasklet/1
7669 FF 49 - 89 0.0 S sirq-sched/1
7670 FF 49 - 89 0.0 S sirq-hrtimer/1
7671 FF 49 - 89 0.0 S sirq-rcu/1

as you can see, the timer, hrtimer, sched, and tasklet threads are at a much lower rtprio than suggested here

http://subversion.ffado.org/wiki/IrqPriorities

maybe they need to be altered as well?

thanks again for your help and apps.

peace, Wayne

rncbc's picture

so, reading from your /proc/interrupts the correct configuration line should be, IMO:

RTIRQ_NAME_LIST="rtc firewire_ohci snd"

IMO because I have no experience whatsoever with firewire stuff, be it old or newer juju whatever :o)

also, if you leave just firewire instead of firewire_ohci it will be just fine as well, as the rtirq script is stupid enough to lookup for sub-strings instead of strict literal words ;)

cheers

OK, thanks again for the help. i set up RTIRQ_NAME_LIST as you suggested, though left in the 'HDA Intel' after "firewire" for keeping the internal soundcard up in real-time priority for when i am working without the FireWire interface.

i did notice that the rtirq script seems to be finding the various "firewire_xxxx" modules/etc. and decrementing the RTIRQ_PRIO_HIGH counter, even though these modules have no corresponding IRQ/tasklet handlers. thus, for my rtirq status, you can see that the decrementing real-time priority used by rtirq skips a few numbers:


Setting IRQ priorities: start [rtc] irq=8 pid=740 prio=90: OK.
Setting IRQ priorities: start [firewire] irq=17 pid=13815 prio=88: OK.
Setting IRQ priorities: start [HDA Intel] irq=22 pid=9391 prio=82: OK.

not sure if it is meant to be this way, or, as you indicated, the string matching is finding "firewire" in "firewire_ohci", "firewire_core", "firewire", etc. and decrementing the counter though there is nothing to do for some of these.

to get things more like they are recommended by FFADO http://subversion.ffado.org/wiki/IrqPriorities , i made the following changes to RTIRQ_HIGH_LIST:

RTIRQ_HIGH_LIST="hrtimer timer tasklet sched"

so far, things seem to be running stable with less XRUNS, but i have not tested much yet. will update this thread if anything changes.

thanks again for your help.

yPhil's picture

Hi everyone ! Hi Nuno !

Holidays are over, and a new version of my OS is out, yeah :) So I upgraded my main production rig from Mandriva 2010.2 to Mandriva 2011. On the plus side, mostly everything works and I could even compile the latest svn qtractor with a neat-looking collumn of "yes" flags :)
On the negative, I can't for the life of me allow myself to run with RT privileges. The dreaded

Cannot use real-time scheduling (RR/60)(1: Operation not permitted)
JackClient::AcquireSelfRealTime error

greets me at each launch.

So googling my night away I stumbled upon your rtirq package (via this) and installed it by pointing the urpmi installer to

http://www.rncbc.org/jack/rtirq-20110314-26.noarch.rpm

And found that it installed two files :

Name : rtirq Relocations: (not relocatable)
Version : 20110314 Vendor: (none)
Release : 26 Build Date: Mon 14 Mar 2011 10:29:08 AM WET
Install Date: Wed 21 Sep 2011 01:42:35 PM Build Host: gamma.rncbc.lan
Group : System Environment/Base Source RPM: rtirq-20110314-26.src.rpm
Size : 9477 License: GPL
Signature : (none)
Packager : rncbc
Summary : Realtime IRQ thread system tunning.
Architecture: noarch
Description :
Startup scripts for tunning the realtime scheduling policy and priority
of relevant IRQ service threads, featured for a realtime-preempt enabled
kernel configuration.
/etc/init.d/rtirq
/etc/sysconfig/rtirq

Now my questions :

1-Does rtirq allow me to do Real-Time audio on a "normal" kernel ? (That would be really cool)
2-How should rtirq be launched (ie by what process, at what time) ? Because right now, after installing it and reboot,


[root@localhost px]# rtirq status
bash: rtirq: command not found

I'm testing under both the 2.6.38 kernel that came with my distro and a 3.0.3 that seem to work well too. The latest RT kernel that I have at hand is a 2.6.33 and it definitely won't boot.

I spent all morning googling about the new 3.0 kernel and found nothing about scheduling, let alone real time... Normally I get away with adding myself to the audio group, and managing this group RT rights via /etc/security/limits.conf but then again, I have to install a RT kernel. Now if I could find one, that would be fine, but even better would be to learn that I can now manage applications/devices RT rights with a vanilla kernel :)

(PRE-EDIT)
OK Before I clicked "Post" I re-read the config file :

# Configuration for IRQ thread tunning,
# for realtime-preempt enabled kernels.

I guess this message is moot now, at least the 1st question :(
I suppose I have to compile my kernel... Sight... Did not do it since LILO, and I remember, that never really worked so well for me... And I understand that I have to *patch* it before... Have I done something *reeaaly* bad this summer ? I must have.

rncbc's picture

i think your problem is not related to rtirq, not even remotely :/

as you must know already, rtirq is supposed to help you fine tuning irq service threads priorities (whatever that is). this is a kernel feature only existing on the preempt_rt patched ones or on latest 2.6.39+ when started with "threadirqs" boot line option.

again, it doesn't seem to relate to your primary issue--you're missing system wide privileges to run processes with realtime scheduling, which is paramount for jackd, i may say.

i suspect that, as a consequence of your distro upgrade, the kernel was also upgraded, and probably the old limits.conf hack is not enough anymore.

could it be, a cgroups issue?

hth.
cheers

Add new comment