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

EDIT: Updated in August, 2020 to reflect changes necessitated by use of the newer open source drivers as opposed to the older proprietary ones.

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

Or, particularly if you are running newer model TBS cards and/or the newer open source TBS drivers, try

lsmod | grep -i tbs

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

This has changed again with the use of the newer open source drivers. If you are using the open source TBS drivers then the lines you need to use may be as follows:

options saa716x_tbs_dvb int_type=1
options tbsecp3 int_type=1

Note that while the first line may look the same as a line in the previous examples it is not – an underscore replaces a hyphen. Those are the two lines that worked in an installation running Ubuntu 20.04 and using the newer open source drivers, but you may need something different. This is why running lsmod | grep -i tbs is important – while you certainly won’t need every string you see in the results of running that command, a string that’s not shown in that output probably won’t do anything. It may wind up being just a process of trial and error to pick the correct strings to use.

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).

This is from a system running Ubuntu 20.04, and using the newer open source drivers, with four TBS cards…

 16:          0         29          0          0  IR-IO-APIC  16-fasteoi   ehci_hcd:usb1

…..

 38:          0    4684326          0          0  IR-PCI-MSI 1048576-edge      tbsecp3
 39:          0          0          0          0  IR-PCI-MSI 524288-edge      SAA716x Core
 40:          0          0          0    1206829  IR-PCI-MSI 2097152-edge      tbsecp3
 41:    3066445          0          0          0  IR-PCI-MSI 2621440-edge      tbsecp3

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/Ubuntu-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…

  1. 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

    As mentioned in the above article use

    cat /proc/interrupts

    to make sure it worked.

    See http://www.tbsdtv.com/forum/viewtopic.php?f=168&t=9473 for the discussion on this.

    cband

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.