Do you run one or more TBS PCIe cards under Linux? Check your IRQs…

The other night I happened to have a ssh session open to a TVHeadEnd backend system (running Debian Linux) when this message appeared:

Message from syslogd@backend at Nov 6 23:03:02 …
kernel:[452276.219160] Disabling IRQ #16

And then the satellite card essentially stopped working – it would act like it was receiving signals, but they were all complete garbage until I rebooted the system.

It turns out that the system was putting several things on IRQ #16, as revealed by cat /proc/interrupts

 16:    1669004          0          0          0  IR-IO-APIC-fasteoi   ehci_hcd:usb1, SAA716x Core, SAA716x Core, snd_hda_intel

In searching for a solution to this, I came across this thread (and also this thread), which informed me that the TBS cards were using the old style of interrupts, and that it would be a good idea to change that so they use the newer PCI-MSI-edge type. The procedure for doing that is simple, and easily reversible if it doesn’t work.

First do this from a Linux command prompt:

lsmod | grep -i SAA716

You should see several lines containing a string such as saa716x_tbs_dvb – assuming this is the string you see, then do this:

sudo touch /etc/modprobe.d/tbs.conf
sudo echo options saa716x_tbs_dvb int_type=1 > /etc/modprobe.d/tbs.conf

If you prefer you can use a text editor such as nano to insert the single line options saa716x_tbs_dvb int_type=1 into the /etc/modprobe.d/tbs.conf file (this might be safer, since it will allow you to first verify that this file is currently empty rather than blindly overwriting it as shown above). Note that the center part of that string (saa716x_tbs_dvb) should match the string(s) you saw in the previous step.

EDIT:  As noted in cband’s comment on this article:

If you have a newer TBS card such as a TBS6905, or a mix of older and newer ones, then you need TWO lines in /etc/modprobe.d/tbs.conf:

options tbs_pcie-dvb tbs_int_type=1
options saa716x_tbs-dvb int_type=1

Next, reboot the system. When it comes back up, do cat /proc/interrupts again. You should now find the TBS cards on separate interrupts, indicated as IR-PCI-MSI-edge instead of IR-IO-APIC-fasteoi or whatever they were before. In this case…

 16:         29          0          0          0  IR-IO-APIC-fasteoi   ehci_hcd:usb3, snd_hda_intel


 46:       7973          0          0          0  IR-PCI-MSI-edge      SAA716x Core


 48:       3914          0          0          0  IR-PCI-MSI-edge      SAA716x Core

There are two TBS cards in this particular backend, which is why two interrupts are being used (and why SAA716x Core appeared twice on the IRQ 16 line prior to the change). Just FYI, you can get a more much more detailed report on what is is routed to each IRQ by running lspci -vv from the Linux command prompt, though that may be too much information for most regular users.

If it doesn’t work for any reason, just delete the /etc/modprobe.d/tbs.conf file and reboot, and you will be back to the way it was before.

My suspicion is that doing this will fix some weirdness that may very occasionally occur when using TBS cards with TVHeadEnd. Why no one tells you to do this as part of the driver installation instructions, particularly on Debian-based systems, is anyone’s guess, but if you are running TBS cards under Linux it might be worth your time to check this, assuming you want a more reliable system.

By the way, I am NOT a Linux guru by any stretch of the imagination, so please don’t ask me how any of the above Linux commands work – save those types of questions for your favorite Linux forum, please!

If you found this article useful you may also like:
A bash script to rebuild the TBS tuner drivers after Linux kernel updates


One thought on “Do you run one or more TBS PCIe cards under Linux? Check your IRQs…

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s