janbar / tbs-dvb-driver

dkms build of TBS driver (pcie cards) with the stable branch of linux media stack
3 stars 0 forks source link

fails on Ubuntu 24.10 (6.11 kernel). #1

Open ashleyw-gh opened 2 weeks ago

ashleyw-gh commented 2 weeks ago

love your work. Any chance you could modify this to work on latest 24.10 Ubuntu release?

# uname -a
Linux ?????? 6.11.0-8-generic #8-Ubuntu SMP PREEMPT_DYNAMIC Mon Sep 16 13:41:20 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
# dkms build tbs-dvb-driver/6.8
Sign command: /usr/bin/kmodsign
Signing key: /var/lib/shim-signed/mok/MOK.priv
Public certificate (MOK): /var/lib/shim-signed/mok/MOK.der

Building module:
Cleaning build area...
make -j6 KERNELRELEASE=6.11.0-8-generic -C drivers KERNELDIR=/lib/modules/6.11.0-8-generic/build...(bad exit status: 2)
ERROR (dkms apport): binary package for tbs-dvb-driver: 6.8 not found
Error! Bad return status for module build on kernel: 6.11.0-8-generic (x86_64)
Consult /var/lib/dkms/tbs-dvb-driver/6.8/build/make.log for more information.

log file show;

/var/lib/dkms/tbs-dvb-driver/6.8/build/drivers/src/si2168.c:916:15: error: too many arguments to function ‘i2c_mux_add_adapter’
  916 |         ret = i2c_mux_add_adapter(dev->muxc, 0, 0, 0);
      |               ^~~~~~~~~~~~~~~~~~~
In file included from /var/lib/dkms/tbs-dvb-driver/6.8/build/drivers/src/si2168_priv.h:14,
                 from /var/lib/dkms/tbs-dvb-driver/6.8/build/drivers/src/si2168.c:11:
./include/linux/i2c-mux.h:58:5: note: declared here
   58 | int i2c_mux_add_adapter(struct i2c_mux_core *muxc,
      |     ^~~~~~~~~~~~~~~~~~~
/var/lib/dkms/tbs-dvb-driver/6.8/build/drivers/src/si2183.c: In function ‘si2183_probe’:
/var/lib/dkms/tbs-dvb-driver/6.8/build/drivers/src/si2183.c:1740:23: error: too many arguments to function ‘i2c_mux_add_adapter’

An old build script I used to use seems to work fine but this isn't a DKMS script so I need to run this manually after each kernel update;

#!/bin/bash

cd /root
rm -r -f tbsdriver
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

# from https://forums.gentoo.org/viewtopic-p-8363634.html
cat << 'EOF' >v4l/.config
CONFIG_RATIONAL=y
CONFIG_NET=y
CONFIG_FB_CFB_COPYAREA=m
CONFIG_PNP=y
CONFIG_FIREWIRE=m
CONFIG_MMU=y
CONFIG_TTY=y
CONFIG_GENERIC_ALLOCATOR=y
CONFIG_DMA_SHARED_BUFFER=y
CONFIG_HAS_DMA=y
CONFIG_CRC32=y
CONFIG_SYSFS=y
CONFIG_I2C_MUX=m
CONFIG_HAVE_CLK=y
CONFIG_SND_PCM=m
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_REGMAP_I2C=y
CONFIG_I2C=y
CONFIG_PCI_MSI=y
CONFIG_ACPI=y
CONFIG_NEW_LEDS=y
CONFIG_FONT_8x16=y
CONFIG_MODULES=y
CONFIG_FB_CFB_FILLRECT=m
CONFIG_ISA_DMA_API=y
CONFIG_FW_LOADER=y
CONFIG_LEDS_CLASS=y
CONFIG_PCI=y
CONFIG_VIRT_TO_BUS=y
CONFIG_I2C_ALGOBIT=m
CONFIG_INPUT_EVDEV=y
CONFIG_COMMON_CLK=y
CONFIG_FONT_SUPPORT=m
CONFIG_USB=y
CONFIG_FB=m
CONFIG_FB_CFB_IMAGEBLIT=m
CONFIG_HDMI=y
CONFIG_SND=y
CONFIG_HAS_IOMEM=y
CONFIG_INET=y
CONFIG_BITREVERSE=y
CONFIG_X86=y
CONFIG_SERIO=y
CONFIG_INPUT=y
CONFIG_REGMAP=y
CONFIG_USB_ACM=m
CONFIG_DEBUG_FS=y
CONFIG_MEDIA_SUPPORT=m
CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y
CONFIG_CEC_CORE=m
CONFIG_MEDIA_CEC_SUPPORT=y
CONFIG_USB_PULSE8_CEC=m
CONFIG_DVB_CORE=m
CONFIG_DVB_NET=y
CONFIG_DVB_MAX_ADAPTERS=48
CONFIG_DVB_DYNAMIC_MINORS=y
CONFIG_MEDIA_PCI_SUPPORT=y
CONFIG_DVB_TBSECP3=m
CONFIG_DVB_PLATFORM_DRIVERS=y
CONFIG_MEDIA_SUBDRV_AUTOSELECT=y
CONFIG_MEDIA_ATTACH=y
CONFIG_MEDIA_TUNER=m
CONFIG_MEDIA_TUNER_SIMPLE=m
CONFIG_MEDIA_TUNER_SI2157=m
CONFIG_DVB_SI2168=m
CONFIG_DVB_TAS2101=m
CONFIG_MISC_DEVICES=y
CONFIG_ALTERA_STAPL=m
EOF

make -j4
make install
cd /root
rm -f tbs-tuner-firmwares_v1.0.tar.bz2
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
janbar commented 2 weeks ago

I will create a new branch for kernel 6.10 and up (6.11).

janbar commented 2 weeks ago

It should work with the latest update

ashleyw-gh commented 2 weeks ago

thanks, it compiles fine but sadly after a reboot the message in dmsg is as follows;

[    3.834945] tbsecp3: disagrees about version of symbol dvb_frontend_detach
[    3.834947] tbsecp3: Unknown symbol dvb_frontend_detach (err -22)
[    3.834961] tbsecp3: disagrees about version of symbol dvb_unregister_frontend
janbar commented 2 weeks ago

Until I haven't a physical host with linux-6.10 and with a plugged tbs card, I cannot test it. I will try to check about the reported errors.

janbar commented 2 weeks ago

Yep, I guess you haven't deinstall the tbs drivers before reinstalling the dkms driver. When installing the tbs drivers , an unstable media stack is deployed in the tree of the kernel. So be sure you have uninstalled and cleaned all things installed with the tbs drivers script, and rebooted, before rerun the dkms install.

Loading all modules in a virtual host (ubuntu 24.10/Linux-6.11) works. But I cannot test it more, because for now I don't use real hardware with kernel 6.10 or 6.11.

ashleyw-gh commented 1 week ago

thanks, I have tried various approaches of removing the original tbs driver and the dkms compiled driver, and I can't figure things out. So guess when I have some time, I'll need to test on a free install of Ubuntu 24.10 with out a prior TBS driver installed (or previous dkms driver).

janbar commented 1 week ago

I made a test booting with an usb key containing the live Ubuntu 24.10.

root@ubuntu:~# uname -a
Linux ubuntu 6.11.0-8-generic #8-Ubuntu SMP PREEMPT_DYNAMIC Mon Sep 16 13:41:20 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

So I installed the compiler and dkms, then I launched the dkms install of the driver on the live OS, and it works perfectly:

modprobe tbsecp3

[ 1340.831820] TBSECP3 driver 0000:01:00.0: TurboSight TBS 6281SE DVB-T/T2/C 
[ 1340.833000] dvbdev: DVB: registering new adapter (TBSECP3 DVB Adapter)
[ 1340.928541] TBSECP3 driver 0000:01:00.0: MAC address 00:22:ab:b2:1e:6c
[ 1340.939029] i2c i2c-5: Added multiplexed i2c bus 8
[ 1340.939041] si2168 5-0064: Silicon Labs Si2168-B40 successfully identified
[ 1340.939044] si2168 5-0064: firmware version: B 4.0.2
[ 1340.944517] si2157 8-0060: Silicon Labs Si2157 successfully attached
[ 1340.944555] TBSECP3 driver 0000:01:00.0: DVB: registering adapter 0 frontend 0 (TurboSight TBS 6281SE DVB-T/T2/C )...
[ 1340.944738] dvbdev: DVB: registering new adapter (TBSECP3 DVB Adapter)
[ 1341.043153] TBSECP3 driver 0000:01:00.0: MAC address 00:22:ab:b2:1e:6d
[ 1341.054146] i2c i2c-6: Added multiplexed i2c bus 9
[ 1341.054159] si2168 6-0064: Silicon Labs Si2168-B40 successfully identified
[ 1341.054163] si2168 6-0064: firmware version: B 4.0.2
[ 1341.060214] si2157 9-0060: Silicon Labs Si2157 successfully attached
[ 1341.060255] TBSECP3 driver 0000:01:00.0: DVB: registering adapter 1 frontend 0 (TurboSight TBS 6281SE DVB-T/T2/C )...
[ 1341.060366] TBSECP3 driver 0000:01:00.0: TurboSight TBS 6281SE DVB-T/T2/C : PCI 0000:01:00.0, IRQ 137, MMIO 0xa1300000

Running a w-scan, it loads the demodulators, and found all channels:

[ 1564.702698] si2168 5-0064: downloading firmware from file 'dvb-demod-si2168-b40-01.fw'
[ 1566.799621] si2168 5-0064: firmware version: B 4.0.25
[ 1566.821249] si2168 5-0064: downloading firmware from file 'dvb-demod-si2168-b40-01.fw'
[ 1568.947536] si2168 5-0064: firmware version: B 4.0.25

Good to know I can check the driver using a live OS. 👍

So the problem is you have broken the kernel modules tree by installing the drivers from tbs. As I said before you have to clean the modules tree (/lib/modules/6.11.0-8-generic/), by removing completely all things the tbs script has installed. If you don't know what to cleanup, simply remove the folder /lib/modules/6.11.0-8-generic, and reinstall the packages: linux-modules-generic, linux-modules-extra-generic, linux-headers-generic

ashleyw-gh commented 1 week ago

Thanks. I switched to use branch 6.10 and all working fine now (I ended up also rebuilding my server.from 24.10 media to avoid any package conflicts). Thanks again.