Project

General

Profile

[SOLVED] TBS Open Source Linux Driver

Added by Marc Ominus about 2 months ago

So I decided to get a Black Friday deal/new M.2 SSD and replace/install new system on my 9020M with
- 3 x DVB-T2 (PCTV 290e x 2, 292e x 1)
- 1 x DVB-S2X (TBS5520SE Multi-standard Universal TV Tuner USB Box)

I have installed Debian 11 (headless):

uname -a
Linux OptiPlex9020M 5.10.0-9-amd64 #1 SMP Debian 5.10.70-1 (2021-09-30) x86_64 GNU/Linux

Got my PCTV sticks working:

cd /lib/firmware
sudo wget http://palosaari.fi/linux/v4l-dvb/firmware/Si2168/Si2168-D60/6.0.1/dvb-demod-si2168-d60-01.fw
sudo wget http://palosaari.fi/linux/v4l-dvb/firmware/Si2168/Si2168-B40/4.0.25/dvb-demod-si2168-b40-01.fw
sudo wget http://palosaari.fi/linux/v4l-dvb/firmware/Si2168/Si2168-A30/3f2bc2c63285ef9323cce8689ef8a6cb/dvb-demod-si2168-a30-01.fw
sudo wget http://palosaari.fi/linux/v4l-dvb/firmware/Si2168/Si2168-A20/32e06713b33915f674bfb2c209beaea5/dvb-demod-si2168-a20-01.fw
sudo wget http://palosaari.fi/linux/v4l-dvb/firmware/Si2168/dvb-demod-si2168-01.fw
sudo wget http://palosaari.fi/linux/v4l-dvb/firmware/Si2168/dvb-demod-si2168-02.fw

But the TBS Open source Linux Driver is pain in the back side to get working.
After installing it, all the tuner have gone missing :( Here is what I did
as per instructions from their website:
https://github.com/tbsdtv/linux_media/wiki

sudo -i
apt install linux-headers-$(uname -r)
apt install libproc-processtable-perl patchutils gcc build-essential git libdigest-sha-perl build-essential subversion mercurial openssl gettext libssl-dev screen libv4l-dev -y
mkdir tbsdriver; cd tbsdriver
git clone https://github.com/tbsdtv/media_build.git
git clone --depth=1 https://github.com/tbsdtv/linux_media.git -b latest ./media
cd media_build
make dir DIR=../media
make distclean
lscpu | grep -E '^Thread|^Core|^Socket|^CPU\('
make -j4

During compiling error come up:

No file to patch.  Skipping patch.
1 out of 1 hunk ignored
make[2]: *** [Makefile:133: apply_patches] Error 1
make[2]: Leaving directory '/root/tbsdriver/media_build/linux'
Preparing to compile for kernel version 5.10.0

***WARNING:*** You do not have the full kernel sources installed.
This does not prevent you from building the v4l-dvb tree if you have the
kernel headers, but the full kernel source may be required in order to use
make menuconfig / xconfig / qconfig.

If you are experiencing problems building the v4l-dvb tree, please try
building against a vanilla kernel before reporting a bug.

Vanilla kernels are available at http://kernel.org.
On most distros, this will compile a newly downloaded kernel:

cp /boot/config-`uname -r` <your kernel dir>/.config
cd <your kernel dir>
make all modules_install install

Please see your distro's web site for instructions to build a new kernel.

WARNING: This is the V4L/DVB backport tree, with experimental drivers
     backported to run on legacy kernels from the development tree at:
        http://git.linuxtv.org/media-tree.git.
     It is generally safe to use it for testing a new driver or
     feature, but its usage on production environments is risky.
     Don't use it in production. You've been warned.
File not found: ../linux/drivers/media/Kconfig at ./scripts/make_kconfig.pl line 302.
No kernel files. You need to run "make download untar" or "make dir DIR=<your_git_source_dir>" first!
exit 1
make[1]: *** [Makefile:6: def] Error 1
make[1]: Leaving directory '/root/tbsdriver/media_build/v4l'
make: *** [Makefile:26: all] Error 2

So I have run as requested:

make download untar
make -j4

It then finished compiling with the following

        v4l2-fwnode.ko v4l2-dv-timings.ko v4l2-mem2mem.ko 
        v4l2-async.ko videodev.ko videobuf-core.ko 
        videobuf-dma-contig.ko videobuf-dma-sg.ko 
    pci/pt1/: earth-pt1.ko 
    pci/saa716x/: saa716x_hybrid.ko saa716x_tbs-dvb.ko saa716x_core.ko 
    usb/pvrusb2/: pvrusb2.ko 
    pci/tbsci/: tbs_pcie-ci.ko 
    common/v4l2-tpg/: v4l2-tpg.ko 
    usb/au0828/: au0828.ko 
    usb/ttusb-dec/: ttusb_dec.ko ttusbdecfe.ko 
    i2c/m5mols/: m5mols.ko 
    dvb-frontends/cxd2880/: cxd2880.ko 
    common/saa7146/: saa7146.ko saa7146_vv.ko 
    usb/hackrf/: hackrf.ko 
    platform/atmel/: atmel-isc-base.ko 
    pci/meye/: meye.ko 
/sbin/depmod -a 5.10.0-9-amd64 
make -C firmware install
make[2]: Entering directory '/root/tbsdriver/media_build/v4l/firmware'
Installing firmwares at /lib/firmware: 
make[2]: Leaving directory '/root/tbsdriver/media_build/v4l/firmware'
make[1]: Leaving directory '/root/tbsdriver/media_build/v4l'

So I installed it:

make install

Then install “firmware” and after reboot all the tuners are missing .... :(

wget http://www.tbsdtv.com/download/document/linux/tbs-tuner-firmwares_v1.0.tar.bz2
tar jxvf tbs-tuner-firmwares_v1.0.tar.bz2 -C /lib/firmware/
reboot

There is no other kernels installed on my system:

~$ apt-mark showauto 'linux-image-.*'
linux-image-5.10.0-9-amd64

I have tried below, but still no luck, all the DVB tuners are missing:

rm -rf /lib/modules/`uname -r`/kernel/drivers/media/*
cd ~/tbsdriver/media_build
make install
reboot

# cat ~/tbsdriver/media_build/linux/.patches_applied
#5.10.0-9-amd64
v5.10_vb2_dma_buf_map.patch
v5.11_isa.patch
v5.12_uvc.patch
v5.14_bus_void_return.patch
rc-cec.patch
ccs.patch
drx39xxj.patch
debug.patch
pr_fmt.patch
api_version.patch

Any advised would be greatly apprenticed.
Thank you.


Replies (6)

RE: TBS Open Source Linux Driver - Added by Marc Ominus about 2 months ago

Just tried "drv-tbs.sh" script as well:

sudo -i
curl https://tvheadend.org/attachments/download/9050/drv-tbs.sh | bash

Compiled, I have rebooted but nothing :( still no tuners:

[email protected]:~# lsusb
Bus 004 Device 002: ID 8087:8000 Intel Corp. Integrated Rate Matching Hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 002: ID 8087:8008 Intel Corp. Integrated Rate Matching Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 734c:5521 TBS Technologies China 
Bus 001 Device 004: ID 2013:025f PCTV Systems tripleStick 292e
Bus 001 Device 003: ID 2013:024f PCTV Systems nanoStick T2 290e
Bus 001 Device 006: ID 2013:024f PCTV Systems nanoStick T2 290e
Bus 001 Device 002: ID 046d:c31c Logitech, Inc. Keyboard K120
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
[email protected]:~# dmesg | egrep "firmware|dvb|frontend" 
[    0.073488] Spectre V2 : Enabling Restricted Speculation for firmware calls

[email protected]:~# tree /dev/dvb
/dev/dvb [error opening dir]

0 directories, 0 files

RE: TBS Open Source Linux Driver - Added by saen acro about 2 months ago

Is this a UEFI install with enabled Secure Boot?

RE: TBS Open Source Linux Driver - Added by Marc Ominus about 2 months ago

Yes, UEFI was my last install Debian 9, but I have enabled Secure Boot on this new installation as Debian 11 support it (well since Debian 10).

What is the solution?

Disable Secure Boot, install the "TBS Open Source Linux Driver", reboot and re-enable Secure Boot or something more complex?

RE: TBS Open Source Linux Driver - Added by saen acro about 2 months ago

Reinstall without uefi and secure boot.
No way to load unsigned driver in uefi + secure boot.

RE: TBS Open Source Linux Driver - Added by Marc Ominus about 2 months ago

saen acro wrote:

Reinstall without uefi and secure boot.
No way to load unsigned driver in uefi + secure boot.

Thanx @saen acro

Just out of interest I have disabled "Secure Boot" (SB) and rebooted,
and viola all the tuners are back and working ....

Anyone tried to sign kernel after Installing/Upgrading TBS Open Source Linux Drivers?
I have found few posts, may give it a try ...

https://gloveboxes.github.io/Ubuntu-for-Azure-Developers/docs/signing-kernel-for-secure-boot.html
https://ubuntu.com/blog/how-to-sign-things-for-secure-boot
https://askubuntu.com/questions/1096481/unsigned-kernel-and-secure-boot

I am still using UEFI and all works, why do recommend Legacy BIOS over UEFI?

RE: [SOLVED] TBS Open Source Linux Driver - Added by saen acro about 2 months ago

Becouse with positives form 16 bit Bios to 64 bit UEFI
in gen 11 intel forbit secureboot stoping and removed legacy support
no mo tuner install possible

https://github.com/tbsdtv/linux_media/issues/208

    (1-6/6)