TBS Technologies is a company that specializes in digital TV tuner cards for PC, and recently they’ve also worked on ARM based boards or devices such as the Matrix 2. The company has sent me one of their TBS5520 USB tuner board and box supporting DVB-T2, DVB-S2, DVB-C and ISDB-T for evaluation, as well as some Linux drivers. Today, I’ll provide some specifications, take some pictures, and show how I compiled and installed the drivers in my Ubuntu 14.04 computer.
TBS5520 is a multi-standard USB tuner with the following features:
- USB – USB 2.0 device port
- Antenna connectors – 1x LNB IN, 1x RF IN
- Symbol rate: 1~45Msps;
- DVB-S2: 8PSK: 3/5, 2/3, 3/4, 4/5, 5/6, 8/9, 9/10;
- DVB-S: QPSK: 1/2, 2/3, 3/4, 5/6, 7/8
- Receiving channel: VHF band, UHF band;
- Bandwidth: 1.7,5, 6, 7, 8 MHz;
- FEC: QPSK, 16QAM, 64QAM, 256QAM
- FFT mode: 1K, 2K, 4K, 8K, 16K, 32K
- Code rate: 1/2, 3/5, 2/3, 3/4, 4/5, 5/6, 7/8
- RF-Input impedance: 75Ω (IEC-DIN female)
- DVB-C & ITU J83 A/B/C
- Frequency range: 47~862 MHz
- Signal level: -65~-10dBm
- Symbol rate: 0.87 to 9Mbaud
- QAM modes: 16QAM, 32QAM, 64QAM, 128QAM, 256QAM
- Supported modes: 1, 2, 3
- Bandwidth: 6 MHz, 7MHz, 8MHz
- QAM modes: DQPSK, QPSK, 16QAM, 64QAM
- Code rate: 1/2, 2/3, 3/4, 5/6, 7/8
- Misc – IR receiver, power LED
- Dimensions – ~ 8 x 6 cm
The first time I received the board with a cable with Y USB cable.
The shield is soldered, so I could not check the details of the tuner from the hardware, but as we”l see below with drivers to hardware includes RafaelMicro R848 multi-standard tuner and AVL6882 demodulator.
The kit has the same tuner board in a case, as well as the Y USB cable, a remote control, an indoor antenna, a coaxial to F-cable adapter, and a DVD with some documentation and software.
I’m running Ubuntu 14.04.3 with kernel 3.18.xx on my computer, and if you connect the tuner, the USB is recognized:
[ 606.681622] usb 5-2.2: new high-speed USB device number 9 using ehci-pci
[ 606.774049] usb 5-2.2: New USB device found, idVendor=734c, idProduct=5520
[ 606.774057] usb 5-2.2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
But you don’t get anything in /dev/dvb, so you’ll need some drivers. So TBS provided me with a patch for Linux 3.x (Linux 4.x is currently WIP), and told me to “build it the usual way”. So I decided to do so on my computer instead of an ARM board, as I thought it might be easier…
I basically followed the instructions I wrote in “How to build a single kernel driver in Ubuntu“. I had already installed Linux 3.18.0 for this, but I first upgraded to a more recent Linux 3.18.23 version:
sudo dpkg -i linux-headers-3.18.23-*.deb linux-image-3.18.23-*.deb
After installation, I rebooted my machine to make use of the update kernel, and downloaded Ubuntu Linux source code in order to patch it and build the drivers.
mkdir -p ~/edev/tbs
git clone git://git.launchpad.net/~ubuntu-kernel-test/ubuntu/+source/linux/+git/mainline-crack v3.18.23
At this stage, the source is set to the latest working version
So you’ll want to switch to the tag/branch of the kernel installed on your computer to avoid “invalid format” error when inserting the modules.
git checkout v3.18.23
Checking out files: 100% (27466/27466), done.
Note: checking out 'v3.18.23'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b new_branch_name
HEAD is now at 8341455... Linux 3.18.23
Let’s make sure we’ve indeed switched to 3.18.23.
Now I’ll download and apply Ubuntu specific patchsets:
patch -p2 < ../0001-base-packaging.patch
patch -p2 < ../0002-debian-changelog.patch
patch -p2 < ../0003-configs-based-on-Ubuntu-3.18.0-7.8.patch
Before applying TBS5520 patch to the source tree:
patch -p1 < ../../tbs5520.patch
patching file drivers/media/dvb-frontends/AVL_Demod_Patch_DVBCFw_.h
patching file drivers/media/dvb-frontends/AVL_Demod_Patch_DVBSxFw_.h
patching file drivers/media/dvb-frontends/AVL_Demod_Patch_DVBTxFw_.h
patching file drivers/media/dvb-frontends/Kconfig
Hunk #1 succeeded at 793 (offset -22 lines).
patching file drivers/media/dvb-frontends/Makefile
Hunk #1 succeeded at 116 (offset -2 lines).
patching file drivers/media/dvb-frontends/avl6882.c
patching file drivers/media/dvb-frontends/avl6882.h
patching file drivers/media/dvb-frontends/avl6882_priv.h
patching file drivers/media/tuners/Kconfig
Hunk #1 succeeded at 274 (offset -3 lines).
patching file drivers/media/tuners/Makefile
Hunk #1 FAILED at 41.
1 out of 1 hunk FAILED -- saving rejects to file drivers/media/tuners/Makefile.rej
patching file drivers/media/tuners/r848.c
patching file drivers/media/tuners/r848.h
patching file drivers/media/tuners/r848_priv.h
patching file drivers/media/usb/dvb-usb/Kconfig
patching file drivers/media/usb/dvb-usb/Makefile
patching file drivers/media/usb/dvb-usb/tbs5520.c
patching file drivers/media/usb/dvb-usb/tbs5520.h
Patching failed, but it was only a small issue, so you can manually edit drivers/media/tuners/Makefile to add the line with r848:
obj-$(CONFIG_MEDIA_TUNER_QM1D1C0042) += qm1d1c0042.o
obj-$(CONFIG_MEDIA_TUNER_R848) += r848.o
ccflags-y += -I$(srctree)/drivers/media/dvb-core
ccflags-y += -I$(srctree)/drivers/media/dvb-frontends
Let start the actually build procedure with make olconfig, which should ask about Turbosight TBS5520 support.:
Azurewave DVB-S/S2 USB2.0 AZ6027 support (DVB_USB_AZ6027) [M/n/?] m
Technisat DVB-S/S2 USB2.0 support (DVB_USB_TECHNISAT_USB2) [M/n/?] m
Turbosight TBS5520 support (DVB_USB_TBS5520) [N/m/?] (NEW)
Build TBS5520 drivers as modules by entering “m”, and carry on with the procedure:
cp -v /usr/src/linux-headers-3.18.23-031823-generic/Module.symvers .
All good. Then I tried to build the modules one by one, as with the serial drivers I used in the previous instructions, but it did not work…
make -C /lib/modules/$(uname -r)/build M=$(pwd) modules
make: Entering directory `/usr/src/linux-headers-3.18.23-031823-generic'
CC [M] /home/jaufranc/edev/tbs/linux/v3.18/drivers/media/usb/dvb-usb/dvb-usb-firmware.o
In file included from /home/jaufranc/edev/tbs/linux/v3.18/drivers/media/usb/dvb-usb/dvb-usb-common.h:12:0,
/home/jaufranc/edev/tbs/linux/v3.18/drivers/media/usb/dvb-usb/dvb-usb.h:19:26: fatal error: dvb_frontend.h: No such file or directory
Eventually, I did not find a solution, and TBS was not very helpful, except they told me the media tree drivers were a pain to build, and eventually mentioned I’d also need a firmware file (dvb-usb-tbsqbox-id5520.fw) and copy it to /lib/firmware… .
So I decided to just build the complete kernel and install all modules and firmware:
sudo make modules_install
cp dvb-usb-tbsqbox-id5520.fw /lib/firmware/
All modules where built into /lib/modules/3.18.23+/ directory, and i first tried to load the modules manually
sudo insmod avl6882.ko
sudo insmod r848.ko
sudo modprobe dvb-core
sudo modprobe dvb-usb
sudo insmod dvb-usb-tbs5520.ko
dvb-usb: found a 'TBS 5520 USB2.0' in cold state, will try to load a firmware
[ 8681.671885] usb 5-2.2: Direct firmware load for dvb-usb-tbs5520-01.fw failed with error -2
[ 8681.671889] dvb-usb: did not find the firmware file. (dvb-usb-tbs5520-01.fw) Please see linux/Documentation/dvb/ for more details on firmware-problems. (-2)
[ 8681.671920] usbcore: registered new interface driver tbs5520
sudo ln -s dvb-usb-tbsqbox-id5520.fw dvb-usb-tbs5520-01.fw
cd /lib/modules/$(uname -r)/kernel/drivers
sudo mv media/ media_backup
sudo ln -s media/ /lib/modules/$(uname -r)/kernel/drivers/media
Then I rebooted the machine, all drivers were automatically loaded successfully, and I got a dvb adapter:
ls -l /dev/dvb
drwxr-xr-x 2 root root 100 Nov 14 16:51 adapter0
InitiallyHowever the output of dmesg appears suspicious:
[ 9451.398462] usb 5-2.1: new high-speed USB device number 12 using ehci-pci
[ 9451.490820] usb 5-2.1: New USB device found, idVendor=734c, idProduct=5520
[ 9451.490828] usb 5-2.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 9451.533680] Request for unknown module key 'Magrathea: Glacier signing key: 4e55adfaa773869b640a4ee3c9774a582d09d643' err -11
[ 9451.534052] dvb-usb: found a 'TBS 5520 USB2.0' in cold state, will try to load a firmware
[ 9451.535003] dvb-usb: downloading firmware from file 'dvb-usb-tbs5520-01.fw'
[ 9451.535006] tbs5520: start downloading tbs5520 firmware
[ 9451.648172] usb 5-2.1: USB disconnect, device number 12
[ 9451.654195] tbs5520: end downloading tbs5520 firmware
[ 9451.654212] dvb-usb: found a 'TBS 5520 USB2.0' in warm state.
[ 9451.654348] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
[ 9451.654384] DVB: registering new adapter (TBS 5520 USB2.0)
[ 9451.654389] dvb-usb: MAC address: 00:00:00:00:00:00
[ 9451.663373] Request for unknown module key 'Magrathea: Glacier signing key: 4e55adfaa773869b640a4ee3c9774a582d09d643' err -11
[ 9451.664051] i2c i2c-3: avl6882: attach failed family id mismatch
[ 9451.664057] TBS5520: frontend attach failed
[ 9451.664059] dvb-usb: no frontend was attached by 'TBS 5520 USB2.0'
[ 9451.664136] input: IR-receiver inside an USB DVB receiver as /devices/pci0000:00/0000:00:16.2/usb5/5-2/5-2.1/input/input22
[ 9451.664509] dvb-usb: schedule remote query interval to 150 msecs.
[ 9451.664513] dvb-usb: TBS 5520 USB2.0 successfully initialized and connected.
[ 9451.664548] usbcore: registered new interface driver tbs5520
[ 9451.722781] dvb-usb: TBS 5520 USB2.0 successfully deinitialized and disconnected.
[ 9453.316364] usb 5-2.1: new high-speed USB device number 13 using ehci-pci
[ 9453.408646] usb 5-2.1: New USB device found, idVendor=734c, idProduct=5520
[ 9453.408652] usb 5-2.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 9453.409072] dvb-usb: found a 'TBS 5520 USB2.0' in cold state, will try to load a firmware
[ 9453.409121] dvb-usb: downloading firmware from file 'dvb-usb-tbs5520-01.fw'
[ 9453.409124] tbs5520: start downloading tbs5520 firmware
[ 9453.528136] tbs5520: end downloading tbs5520 firmware
[ 9453.528153] dvb-usb: found a 'TBS 5520 USB2.0' in warm state.
[ 9453.528277] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
[ 9622.541277] DVB: registering new adapter (TBS 5520 USB2.0)
[ 9622.541283] dvb-usb: MAC address: 00:00:00:00:00:00
[ 9622.633219] i2c i2c-3: avl6882: attach failed family id mismatch
[ 9622.633233] TBS5520: frontend attach failed
[ 9622.633237] dvb-usb: no frontend was attached by 'TBS 5520 USB2.0'
[ 9622.662480] input: IR-receiver inside an USB DVB receiver as /devices/pci0000:00/0000:00:16.2/usb5/5-2/5-2.1/input/input65
[ 9622.662603] dvb-usb: schedule remote query interval to 150 msecs.
[ 9622.662607] dvb-usb: TBS 5520 USB2.0 successfully initialized and connected.
[ 9622.664354] usb 5-2.1: USB disconnect, device number 55
[ 9622.714569] dvb-usb: TBS 5520 USB2.0 successfully deinitialized and disconnected.
[ 9622.862744] systemd-udevd: Failed to apply ACL on /dev/dvb/adapter0/demux0: No such file or directory
[ 9622.862767] systemd-udevd: Failed to apply ACL on /dev/dvb/adapter0/demux0: No such file or directory
[ 9622.863617] systemd-udevd: Failed to apply ACL on /dev/dvb/adapter0/dvr0: No such file or directory
[ 9622.863639] systemd-udevd: Failed to apply ACL on /dev/dvb/adapter0/dvr0: No such file or directory
[ 9622.864932] systemd-udevd: Failed to apply ACL on /dev/dvb/adapter0/net0: No such file or directory
[ 9622.864952] systemd-udevd: Failed to apply ACL on /dev/dvb/adapter0/net0: No such file or directory
[ 9624.188617] usb 5-2.1: new high-speed USB device number 56 using ehci-pci
[ 9624.280959] usb 5-2.1: New USB device found, idVendor=734c, idProduct=5520
[ 9624.280968] usb 5-2.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 9624.281467] dvb-usb: found a 'TBS 5520 USB2.0' in cold state, will try to load a firmware
[ 9624.281545] dvb-usb: downloading firmware from file 'dvb-usb-tbs5520-01.fw'
[ 9624.281550] tbs5520: start downloading tbs5520 firmware
[ 9624.400378] tbs5520: end downloading tbs5520 firmware
[ 9624.400400] dvb-usb: found a 'TBS 5520 USB2.0' in warm state.
[ 9624.400491] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
[ 9624.415314] DVB: registering new adapter (TBS 5520 USB2.0)
[ 9624.415322] dvb-usb: MAC address: 00:00:00:00:00:00
There are some i2c errors, the MAC address is set to 00:00:00:00:00:00, and some systemd errors are popping up too. And soon after, I noticed /dev/dvb/adapter0 would just appear and disappear in loop.
The next step will be to find a solution to this issue, and get a DVB-T2 video stream likely with TvHeadEnd.
Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.
|Support CNX Software - Donate via PayPal or cryptocurrencies, become a Patron on Patreon, or buy review samples|