TBS driver installation

From LinuxTVWiki
Jump to: navigation, search

A number of capture devices from TBS Technologies have a common setup process.

Open-source drivers

The open source driver is available here. These instructions are taken directly from those pages.

It does not currently support the remote control, but SD and HD reception is working and appears to be stable and quicker to change channels than the official TBS version. As of 2014-11-27, this driver was tested with success with DVB-T transmitters in Europe. And DVB-T2 transmitters in United-Kingdom and France (only experimental DVB-T2 transmitters at Eiffel tower in Paris in France for UHD TV (AAC+HVEC)).

It does not currently support the TBS6205.

Building the Open Source Driver

These instructions are taken from here:

 git clone https://github.com/ljalves/media_build.git
 git clone --depth=1 https://github.com/ljalves/linux_media.git -b latest ./media
 cd media_build
 make dir DIR=../media
 make distclean
 make
 sudo make install

If your card uses the saa716x_budget kernel module, you need to set up the configuration options for it. You can check if it does using:

dmesg | grep -i saa716

You will see something like this if it does:

 [19659.585518] DVB: registering new adapter (SAA716x dvb adapter)
 [19660.201340] SAA716x Budget 0000:02:00.0: DVB: registering adapter 0 frontend 0 (Sony CXD2820R)...
 [19660.202234] DVB: registering new adapter (SAA716x dvb adapter)
 [19660.212991] SAA716x Budget 0000:02:00.0: DVB: registering adapter 1 frontend 0 (Sony CXD2820R)...

Next check if the configuration has already been added using:

 grep saa716x /etc/modprobe.d/*

You will see something like this if it is:

 /etc/modprobe.d/saa716x_budget.conf:options saa716x_budget int_type=1

If it is not there, create a file containing the config:

 sudo sh -c 'echo options saa716x_budget int_type=1 > /etc/modprobe.d/saa716x_budget.conf'

See also TBS_driver_installation#IRQ_Issues for module config of the closed source drivers.

Loading the Modules

The simplest option is to reboot, but if you would rather not, execute these commands:

 sudo make rmmod
 sudo modprobe saa716x_budget int_type=1

Identification / Check module loaded correctly

Note : "Capabilities" information are only show if you use the root account, else you will have "Capabilities: <access denied>".

With kernel 3.14.24 and Mageia Linux.

# lspci -v | grep --after-context=10 7160
04:00.0 Multimedia controller: Philips Semiconductors SAA7160 (rev 03)
       Subsystem: Device 6280:0011
       Flags: bus master, fast devsel, latency 0, IRQ 18
       Memory at e0300000 (64-bit, non-prefetchable) [size=1M]
       Capabilities: [40] MSI: Enable- Count=1/32 Maskable- 64bit+
       Capabilities: [50] Express Endpoint, MSI 00
       Capabilities: [74] Power Management version 2
       Capabilities: [80] Vendor Specific Information: Len=50 <?>
       Capabilities: [100] Vendor Specific Information: ID=0000 Rev=0 Len=088 <?>
       Kernel driver in use: SAA716x Budget
       Kernel modules: saa716x_budget

You need to see the 2 following lines that show that the SAA716x driver for the TBS TV card is loaded :

       Kernel driver in use: SAA716x Budget
       Kernel modules: saa716x_budget 

Check if dvb adaptor nodes are created

Now, if the SAA716x driver is loaded, the dvb adaptor nodes should now exist

ls -al /dev/dvb
drwxr-xr-x  4 root root   80 oct.  23 08:37 ./
drwxr-xr-x 19 root root 4140 oct.  23 08:40 ../
drwxr-xr-x  2 root root  120 oct.  23 08:37 adapter0/
drwxr-xr-x  2 root root  120 oct.  23 08:37 adapter1/
# lsdvb
               lsdvb: Simple utility to list PCI/PCIe DVB devices
               Version: 0.0.4
               Copyright (C) Manu Abraham
SAA716x Budget (1131:7160 6280:11) on PCI Domain:0 Bus:4 Device:0 Function:0
       DEVICE:0 ADAPTER:0 FRONTEND:0 (Sony CXD2820R) 
                FE_OFDM Fmin=48MHz Fmax=864MHz
       DEVICE:0 ADAPTER:1 FRONTEND:0 (Sony CXD2820R) 
                FE_OFDM Fmin=48MHz Fmax=864MHz

Linux kernel modules loaded

  • DVB Tuner card part only

We can saw the driver modules needed by TBS TV card : saa716x_budget, tda18212, cxd2820r.

# lsmod
...
tda18212               13180  2 
regmap_i2c             12915  1 tda18212
...
saa716x_budget         34859  0 
tas2101                19952  1 saa716x_budget
cxd2820r               31562  1 saa716x_budget
mb86a16                27647  1 saa716x_budget
cx24117                25174  1 saa716x_budget
saa716x_core           71005  1 saa716x_budget
stv090x                70354  1 saa716x_budget
dvb_core              117590  3 saa716x_core,saa716x_budget,cxd2820r
i2c_mux                12896  1 tas2101
...
i2c_core               40643  19 drm,i2c_i801,i2c_mux,saa716x_core,mb86a16,saa716x_budget,regmap_i2c,tas2101,i2c_algo_bit,stv090x,cxd2820r,nvidia,v4l2_common,tveeprom,tda18212,videode

Troubleshooting

If you find module load errors like "module has wrong symbol version" means that there still are old modules from your previous media tree installation (usually duplicated modules in two different places).

 sudo rm -rf /lib/modules/`uname -r`/kernel/drivers/media/*

Upgrading Sources and Re-installing

 cd media
 git remote update
 git pull
 cd ../media_build
 git remote update
 git pull
 make
 sudo make install

You should now reboot or unload/reload the modules manually.

Supporting the Open Source Driver

Any help that you can give to Luis or crazycat69 (another contributor to the project) through testing, patches or getting the driver merged into the upstream code will (hopefully) be appreciated.

Luis also has a donate link on github.

Closed-source drivers

Proprietary drivers are available from the TBS website.

Installing drivers

As of 3 January 2016, the latest version is 151229.

0. Download the drivers

1. Extract the ZIP file tbs-linux-drivers_v[VERSION NUMBER].zip.

mkdir tbs-linux-drivers
cd tbs-linux-drivers
unzip ../tbs-linux-drivers_v[VERSION_NUMBER].zip

2. Extract linux-tbs-drivers.tar.bz2 archive

bzcat linux-tbs-drivers.tar.bz2 | tar xv

3. Change to driver package directory

cd linux-tbs-drivers

3a. Fix the file permissions

At this point, the supplied tar.bz2 is completely knackered in respect of the file permissions. To fix run

 find -type d -exec chmod 755 \{\} \;
 find -type f | xargs chmod 644
 find -name '*.sh' | xargs chmod 755
 find -name '*.pl' | xargs chmod 755

4. Select platform architecture

for x86 kernel 3.x (x86 32 bit installations of kernel 3.x)

./v4l/tbs-x86_r3.sh

or for x86 kernel 2.6.x (x86 32 bit installations of kernel 2.6.x)

./v4l/tbs-x86.sh

or for any x86_64 kernel (x86 64 bit installations of Linux)

./v4l/tbs-x86_64.sh

You should then receive a message along these lines:

TBS drivers configured for [NAME OF PLATFORM] platform.

5. Build the driver.

Recompiles v4l for a wide range of cards, currently about 500; will take many minutes.

We're ready to build; add -j3 parameter for make command line for a faster build on a dual core machine, -j5 on a quad core machine, etc.

make

If you get -bash: make: command not found, then sudo apt-get install build-essential

6. Install driver. Existing drivers for other v4l related hardware, such as lirc could also get updated.

sudo make install

7. Load newly installed driver

sudo modprobe -v tbs62x0fe

8. Check it loaded correctly

tail /var/log/syslog

You should get a message about tainting the kernel. This is fine.

kernel: tbs62x0fe: module license 'TurboSight Proprietary' taints kernel.

Running dmesg | tail should end with something along these lines:

[ 7330.361868] tbs62x0fe: module license 'TurboSight Proprietary' taints kernel.
[ 7330.361875] Disabling lock debugging due to kernel taint

dvb adaptor nodes should now exist

ls -al /dev/dvb 
drwxr-xr-x  2 root root  120 Jul  9 21:12 adapter0
drwxr-xr-x  2 root root  120 Jul  9 21:12 adapter1
drwxr-xr-x  2 root root  120 Jul  9 21:12 adapter2
drwxr-xr-x  2 root root  120 Jul  9 21:12 adapter3


# lsdvb
   lsdvb: Simple utility to list PCI/PCIe DVB devices
   Version: 0.0.4
   Copyright (C) Manu Abraham
SAA716x TBS (1131:7160 6280:11) on PCI Domain:0 Bus:4 Device:0 Function:0
       DEVICE:0 ADAPTER:0 FRONTEND:0 (TurboSight TBS 62x0 DVBT/T2 frontend) 
                FE_OFDM Fmin=47MHz Fmax=870MHz
       DEVICE:0 ADAPTER:1 FRONTEND:0 (TurboSight TBS 62x0 DVBT/T2 frontend) 
                FE_OFDM Fmin=47MHz Fmax=870MHz

Troubleshooting

Compilation problems

make[3]: *** No rule to make target `tbs8921ctrl.o', needed by `v4l/media.o'.  Stop.

Did you select the correct platform in step 4 above?

During compilation:

make[1]: *** No rule to make target `.myconfig', needed by `config-compat.h'. Stop.

Make sure you have the right C header files installed for your Linux kernel version.

Problems after kernel update

Some weeks later your /dev/dvb directory has disappeared? Perhaps your kernel was updated, and your machine rebooted. The driver needs to be recompiled.

If you just run make, it will try to compile against the old kernel headers, so first run

make distclean

Then go back to step 4.

Deleting media drivers directory to resolve conflicts

Some users have found that deleting the whole kernel media drivers folder and then compiling can resolve conflicts.

This process will fix issues resulting in "disagrees about version of symbol dvb_frontend_detach" messages in the dmesg output.

Instructions for this can be found in the TBS forum. They are as follows:

  1. First remove the existing media modules:
    sudo rm -rf /lib/modules/$(uname -r)/kernel/drivers/media/
  2. Then reinstall the modules, following steps 3 and 6 above.

Compatibility with other cards

As noted above you should remove the kernel's existing media drivers before installing the TBS driver package, I omitted this step when installing the drivers and whilst the card worked fine (Mythtv 0.27/Debian 7) my other DVB-S2 tuner card would fail to initialize on start up. There were no obvious messages in the dmesg output indicating symbol issues, the card simply wouldn't work. Once I removed the media directory before installing the TBS drivers the card worked correctly. (The driver in the v4l tree used by the TBS drivers was actually a different name than the one in the Linux kernel I had installed).

Fighting with another tuner card in load order at boot time - See http://www.tbsdtv.com/forum/viewtopic.php?f=62&t=7747. Additionally it's worth noting that the TBS drivers don't appear to support the 'adapter_nr' argument.

Fix UDEV problems :
Device nodes and character devices
Notes for configuring udev rules for em28xx USB capture card
Linux: howto avoid video devices getting mixed up after reboot, using udev rules
About udev rules
Statically Assign /dev Nodes to Hardware Devices in Linux
/dev/video0 problem


IRQ Issues

After an extended period the combined TBS driver may crash with messages (check using dmesg) such as:

 irq 16: nobody cared (try booting with the "irqpoll" option)
 ...
 Disabling IRQ #16

This will render the device inoperable until rebooting (including IR receiver), meaning it won't be able to record anything.

This can be resolved by configuring the driver to use MSI instead of IRQ:

 sudo sh -c 'echo options saa716x_tbs_dvb int_type=1 > /etc/modprobe.d/tbs.conf'

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

See this TBS forum thread and this blog post for more details.

Changelog

Old releases for drivers if you have problem with your kernel:

  • v141019 (2014-10-19)

http://www.tbsdtv.com/download/document/common/tbs-linux-drivers_v141019.zip

Changelog :
TBS6280 Linux Driver is updated to v141019., which has below updating:
* Fix numerous bugs from the previous release
  • v140707 (2014-07-07)

http://www.tbsdtv.com/download/document/common/tbs-linux-drivers_v140707.zip

Changelog :
TBS6280 Linux Driver is updated to v140707., which has below updating:
* improve work of TBS 5990
* add support for latest hardware revisions of TBS 5220, TBS 5881, TBS 5281
* numerous improvements in bug fixes in drivers for TBS 6221, TBS6281, TBS 6285 and TBS 6290
  • v140425 (2014-04-25)

http://www.tbsdtv.com/download/document/common/tbs-linux-drivers_v140425.zip

Changelog :
TBS6280 Linux Driver is updated to v140425., which has below updating:
* Fixed the TBS6928SE ID problem
  • v140323 (2014-03-23)

http://www.tbsdtv.com/download/document/common/tbs-linux-drivers_v140323.zip

Changelog :
TBS6280 Linux Driver is updated to v140323., which has below updating:
* Add support for 5922SE
* Add proper support for retail version of 6922SE
* Add T2 lite support for latest hardware revision of 6221, 6281, 6285
* Add "ClearQAM" (J83B) US Digital Cable support to DVB-C driver for latest T2 lite hardware revision of 6221, 6281, 6285
  • v140113 (2014-01-13)

http://tbsdtv.com/download/document/common/tbs-linux-drivers_v140113.zip

Changelog :
TBS6280 Linux Driver is updated to v140113, which has below updating: 
* Improve compatibility with the upcoming Linux kernel 3.13.x
* Add full support (both DVBT/T2 and DVBC are supported) for TBS 5281 
  • v130927 (2013-09-27)

http://www.tbsdtv.com/download/document/common/tbs-linux-drivers_v130927.zip

Changelog :
TBS6280 Linux Driver is updated to v130927, which has below updating:
* Add DVB-C driver for TBS 6221, 6281, 6285, 5220, 5881
* Finalize DVB-T/T2 driver for TBS 6221, 6281, 6285, 5220, 5881
* Improve software compatibility for all DVB-C products
* Improve software compatibility for all DVB-T/T2 products
* Make power control for TBS 6984 more reliable
  • v130802 (2013-08-02)

http://www.tbsdtv.com/download/document/common/tbs-linux-drivers_v130802.zip

Changelog :
TBS6280 Linux Driver is updated to v130802, which has below updating:
* improve compatibility with Linux kernel version 3.10
* preliminary support for Linux kernel version 3.11
* add support for all revisions of TBS 6982
* add support for all revisions of TBS 6928SE
* add PLP (Physical Layer Pipe) support for 6220, 6280, 6284 (PLP, see http://en.wikipedia.org/wiki/DVB-T2#Technical_details)
* fix bug for DVB-C products (TBS 6618, TBS 6680, TBS 5680 and DVB-C USB Stick): improve performance in some DVB-C networks
  • v130506 (2013-05-06)

http://www.tbsdtv.com/download/document/common/tbs-linux-drivers_v130506.zip

Changelog :
TBS6280 Linux Driver is updated to v130506, which has below updating:
* Further improve compatibility with 32-bit Linux kernels version 3.8.x and 3.9.x.
* Add module parameter "enable_ir" that allows disabling IR support for TBS cards.
  • v121119 (2012-11-19)

http://www.tbsdtv.com/download/document/common/tbs-linux-drivers_v121119.zip

Changelog :
TBS6280 Linux Driver is updated to v121119, which has belowed updating:
* Add support for dBm reporting with TBS 6922.
* Improve performance of TBS 6922 and TBS 6985 in case lock can't be acquired.
  • v120617 (2012-06-17)

http://www.tbsdtv.com/download/document/common/tbs-linux-drivers_v120617.zip

Changelog :
TBS6280 linux driver is updated to v120617:
A) Add driver and software downloand for TBS5880.
B) Add DVB-C driver support for TBS6220, TBS6280 and TBS6284.
  • v120503 (2012-05-03)

http://www.tbsdtv.com/download/document/common/tbs-linux-drivers_v120503.zip

Changelog :
BS6280 linux driver is updated to v120503:
A) Add driver and software downloand for TBS5880.
B) Add DVB-C driver support for TBS6220, TBS6280 and TBS6284.
  • v120412 (2012-04-12)

http://www.tbsdtv.com/download/document/common/tbs-linux-drivers_v120412.zip

Changelog :
TBS6280 linux driver is updated to v120412, any Linux kernel version in the range 2.6.31 to 3.2.x and any Linux distribution is supported.
  • v120216 (2012-02-16)

http://www.tbsdtv.com/download/document/common/tbs-linux-drivers_v120216.zip

Changelog :
TBS6280 linux driver is updated to v120216, any Linux kernel version in the range 2.6.31 to 3.2.x and any Linux distribution is supported.