[x86-64] TBS5230 Driver

  • I need help in getting the driver for the TBS5230 device for my LE box. I can only detect the device with lsusb:

    Code
    Bus 003 Device 003: ID 734c:5230 TBS Technologies China

    My /etc/os-release is

    I would appreciate it very much if someone can build the driver for me. Many thanks in advance.

  • Hi,

    I have managed to build the TBS5230 driver on EndeavourOS (ArchLinux derivative) based on instructions given in https://github.com/tbsdtv/linux_media/wiki

    Now I don't know what to do. Which directory on my LE12.0.2 box can I place copies of dvb-usb-tbs5230.ko and cxd2878.ko. I would appreciate any advice.

    I have tried copying them into /lib/modules/6.6.71, but they disappear after a reboot because that directory is mounted in tmpfs.

    I also tried copying them to

    • /storage/.cache/kernel-overlays
    • /storage/.cache/kernel-overlays/lib/modules/6.6.71/kernel/drivers/media .../dvb-frontends/cxd2878.ko and .../usb/dvb-usb/dvb-usb-tbs5230.ko
    • /storage/.cache/kernel-overlays/lib/modules/6.6.71/base/kernel/drivers/media .../dvb-frontends/cxd2878.ko and .../usb/dvb-usb/dvb-usb-tbs5230.ko

    all without joy.

    Thanks.

  • Quote

    How do I install the TBS5230 driver that I have built into LE12.0.2?

    Even if you align the kernel version magic and manage to build the module on a different distro, it won't be usable on LE unless the LE kernel's module and symbol maps are updated to reference it (else the kernel doesn't know the module exists). The driver .ko and related map files need to be inside the KERNEL file which is decompressed on boot (and is thus read-only and not accessible from inside the OS, the SYSTEM file is the same). The normal and long-term sustainable way to patch drivers into the LE kernel is to compile a custom LE image with the driver changes provided to the buildsystem as diff patches, which are applied to the kernel source before the buildsystem compiles the kernel. The compiled kernel and all required structures are then rolled up into KERNEL which is part of the LE .img.gz or .tar file format we use for updates.

    NB: LE used to package Crazycat sources as a driver add-on, but we stopped including them because the Crazycat sources need to be aligned with the LE source version and there were regular periods of months before that happened, which held LE back from making needed kernel bumps. We got fed-up with that and now tell people to vote with their wallet and buy cards supported upstream, but the ability to build the driver add-ons has not been removed from the buildsystem. The kernel versions appear to be aligned right now, so you could also build your custom image with the driver add-on re-enabled and the Crazycat package.mk updated to use the latest version (githash) available. It's still a pile of jumping through hoops in our buildsystem, but might be marginally easier for a novice builder to figure out than extracting driver code from the TBS repo and generating diff patch files to use with our buildsystem.

    In case it's not obvious, I'm not volunteering myself to spoon-feed instructions for either option. If you're curious enough there's enough hints above to figure it out, and the LE wiki has basic instructions for self-building images.

    NB: These days I think TBS is a reference for "The BS" that customers need to go through to have a card work. Our general advice is to shift the DVB card and e.g. Tvheadend server to a box that runs a conventional distro where you can (re)compile modules for each kernel bump you choose to make (hint: you don't need to do it too often) using whatever instructions or garbage kernel the card vendor dictates: as long as it "works" you don't care. Then use an RPi5 to run pvr.hts as a simple/dumb client-only playback device elsewhere in the network.

    • NB: These days I think TBS is a reference for "The BS" that customers need to go through to have a card work. Our general advice is to shift the DVB card and e.g. Tvheadend server to a box that runs a conventional distro where you can (re)compile modules for each kernel bump you choose to make (hint: you don't need to do it too often) using whatever instructions or garbage kernel the card vendor dictates: as long as it "works" you don't care. Then use an RPi5 to run pvr.hts as a simple/dumb client-only playback device elsewhere in the network.

    I prefer to have just one entertainment box on the TV console.

    I attached a kernel patch that should allow you to build LE image with TBS 5230 driver.

    Thank you for the patch.

    I have several questions before I go with a custom LE image approach:

    1. Would the custom image work normally, just like the official image downloaded from the LE website? -- Install add-ons from Kodi and LE repositories, auto-update, scraping, subtitles downloading, etc.
    2. When the LE team releases a new version, I believe I can apply the same patch to the git branch and rebuild a new custom image.
      1. Can I update my LE box to the new custom image? I did not do a manual update from 12.0.1 to 12.0.2. So I don't know if the manual process would allow me to specify the location of the image.
      2. Would the updating preserve my library and add-ons? I don't want to repeat the setup.

    Thanks.

  • 1. Yes; except for auto-update of the LE image itself (which you don't want as it doesn't contain the TBS driver).

    2. Yes (to all Qs). Just scp the built image to /storage/.update on the box and reboot.

    It's worthwhile learning the git basics of committing a change (that adds the patch) to a local topic branch so that you can later git fetch upstream changes (when we publish a maintenance release) and rebase the local topic branch against our upstream changes before rebuilding the image to include the upstream changes.

    See https://wiki.libreelec.tv/development/git-tutorial