[Plugin] DVB-Driver


ich777

Recommended Posts

Actually the sundtek devices all work with unraid.

 

 

#1 Set up the driver on the host system

Open a terminal as root (console) and run:

cd /tmp
wget http://sundtek.de/media/sundtek_netinst.sh
chmod 777 sundtek_netinst.sh
./sundtek_netinst.sh -dockerhost

 

 

(this will only take care that some dummy nodes are created in /dev/dvb/, access control will be handled by major/minor numbers of the existing files. When the driver is started on the host it will exit directly due to the dockerhost flag and only create the nodes)

 

#2 Set up the driver inside the tvheadend docker

... install the tvheadend docker, add an extra device driver for /dev/bus/usb

open the host terminal and enter the tvheadend docker image:

 

docker exec -it tvheadend /bin/sh
cd /tmp
wget http://sundtek.de/media/sundtek_netinst.sh
chmod 777 sundtek_netinst.sh
./sundtek_netinst.sh -docker -use-custom-path /config

 

(this will rename the tvheadend binary to tvheadend.bin and put a script in between which will start the driver inside the docker - followed by the actual tvheadend binary).

 

#3 that's it restart the tvheadend docker.

 

Sundtek Dual USB DVB-S/S2/S2X:

 

unraid_sundtek.png.6dbf2395f7e9d1abe65e6bb3099fc5fc.png

Edited by Sundtek
Link to comment
31 minutes ago, JoergHH said:

I don't understand.
The exact opposite is claimed here:

https://sundtek.de/wiki/index.php?title=Docker#Unraid

 

The post is old, I have just updated the documentation today.

It always worked but the installation (without documentation) on that particular system might have been a little bit challenging.

I managed to install unraid in a Virtualbox VM today so I was able to add some documentation about it.

 

"Not supported" was the status before I put the documentation online.

Link to comment
39 minutes ago, Sundtek said:

The post is old, I have just updated the documentation today.

But then you also have to add at 1 that you have to do that on each reboot.
Nothing is persistent on Unraid since it loads itself into RAM on boot, that was also the reason why I offered to help with a plugin. :)

 

Or simply remove 1 and recommend only to install it directly in TVH

Link to comment
13 minutes ago, ich777 said:

Then you can install it like explained there but this has nothih to do with my DVB Plugin since it‘s not supported by this plugin. 😉

How about adding the Sundtek drivers to the plugin?
Otherwise we are talking about redundancies and that can't be in the sense of Limetech and the users.

Link to comment
17 minutes ago, JoergHH said:

How about adding the Sundtek drivers to the plugin?

I can‘t add them because I don‘t have any hardware on hand that I can test with and since those drivers are working completely different (no Kernel modules) I really want to make sure that they are working as expected.

 

As said above they are not supported by my plugin, I also think that Sundtek drivers should be made as a dedicated plugin.

Link to comment
On 10/27/2022 at 12:10 PM, ich777 said:

Yes, I know that because I've subscribed to that issue and also commented above, but no the build doesn't work with this workaround, I've already tried that.

Hmm,

it was possible for me to build the driver on a ubuntu 22.04 VM with the steps described in the thread.

Someone else modifed the v4l config, which could also be a possibility or do we running on some unraid specific problem ?

I'm not sure what's the proper way to build the drivers for unraid to support your efforts, i poked around but didn't find a documnetaion how to do this...

 

Link to comment
25 minutes ago, pk1057 said:

ubuntu 22.04 VM with the steps described in the thread.

Unraid uses a different Kernel version like the user in the GitHub thread.

 

Seems like no one is interested from TBS to do something.

 

I would strongly suggest to all TBS users to write the support directly if the plan to support Kernel 5.19+ and since Kernel 6 is now stable if the will even support that.

 

TBH I‘m a little bit dissapointed by them since I recommended their products and now it seems they are not interested in doing anything.

 

Think a little bit further if the „workaround“ breaks again woth a newer Kernel version it is basically the same.

 

BTW the user that managed to compile it stripped out much drivers and it is most likely the case that very much TBS drivers are missing.

Link to comment
22 minutes ago, ich777 said:

Unraid uses a different Kernel version like the user in the GitHub thread.

 

Seems like no one is interested from TBS to do something.

 

Ok,

the AUR package guys used the following:

https://aur.archlinux.org/packages/tbs-linux_media-git
sed -i s/^obj-\$\(CONFIG_VIDEO_TDA1997X\)/\#obj-\$\(CONFIG_VIDEO_TDA1997X\)/g "$srcdir/media/drivers/media/i2c/Makefile"

rm "$srcdir/media/drivers/media/rc/Makefile"

rm "$srcdir/media/drivers/media/usb/tm6000/Makefile"

rm "$srcdir/media_build/backports/rc-cec.patch"

touch "$srcdir/media/drivers/media/rc/Makefile"

touch "$srcdir/media/drivers/media/usb/tm6000/Makefile"

touch "$srcdir/media_build/backports/rc-cec.patch"

 

It seems always to boil down to the tm6000 driver

 

The official linux wiki from tbs does  also the sed replacements like the one in the thread.   

His only addition is the removal of the TM6000 (trident) driver section, so it seems a valid solution.

 

 

Edited by pk1057
Link to comment
10 hours ago, ich777 said:

I can‘t add them because I don‘t have any hardware on hand that I can test with and since those drivers are working completely different (no Kernel modules) I really want to make sure that they are working as expected.

 

As said above they are not supported by my plugin, I also think that Sundtek drivers should be made as a dedicated plugin.

 

All the Sundtek TV drivers needs on the host is the device nodes because docker uses them for access restriction as mentioned - it uses the major/minor ids (eg. in the list below major 212 minor 1 - n)

TVHeadend won't be allowed to access the device nodes if we only create them inside the docker. they have to be present on the host before starting the docker image.

 

And aside of that whenever unraid updates the kernel - it won't bother the sundtek driver - we have no kernel drivers. We simulate them aside the existing infrastructure (so we won't touch anything existing) using some very smart interfaces in Linux which have been there for over 2 decades too.

 

The driver is only doing a mknod on the host - do you have any better advise where to put that on the host?

The real driver is fully installed inside the docker.

 

ideally there should be a field somewhere asking how many device nodes do you want to create on the host?

 

 

mkdir -p /dev/dvb/adapter0
mkdir -p /dev/dvb/adapter1
#crwxrwxrwx 1 root root 212, 1 Dec 19 20:44 frontend0
#crwxrwxrwx 1 root root 212, 5 Dec 19 20:44 dvr0
#crwxrwxrwx 1 root root 212, 3 Dec 19 20:44 demux0
mknod /dev/dvb/adapter0/frontend0 c 212 1
mknod /dev/dvb/adapter0/dvr0 c 212 5
mknod /dev/dvb/adapter0/demux0 c 212 3
#crwxrwxrwx 1 root root 212,  7 Dec 19 20:44 frontend0
#crwxrwxrwx 1 root root 212, 11 Dec 19 20:44 dvr0
#crwxrwxrwx 1 root root 212,  9 Dec 19 20:44 demux0
mknod /dev/dvb/adapter1/frontend0 c 212 7
mknod /dev/dvb/adapter1/dvr0 c 212 11
mknod /dev/dvb/adapter1/demux0 c 212 9


 

or something like this:

#!/bin/bash
if [ "$#" -ne "1" ]; then
  echo "Argument $0 n"
  echo "         n.. number of adapters"
  exit 1
fi
n=$1
for i in $(seq 0 $(($n-1))); do
  mkdir -p /dev/dvb/adapter$i
  mknod /dev/dvb/adapter0/frontend0 c 212 $(($i*6+1))
  mknod /dev/dvb/adapter0/dvr0 c 212 $(($i*6+5))
  mknod /dev/dvb/adapter0/demux0 c 212 $(($i*6+3))
done

 

Edited by Sundtek
Link to comment
9 hours ago, Sundtek said:

And aside of that whenever unraid updates the kernel - it won't bother the sundtek driver - we have no kernel drivers.

That was already clear to me but everything on the host is not persistent across reboots.

 

9 hours ago, Sundtek said:

The driver is only doing a mknod on the host - do you have any better advise where to put that on the host?

You have to add that somewhere in /boot/config and run:

bash /boot/config/sundtek_netinst.sh -dockerhost

on every reboot, you can put that for example in the go file (/boot/config/go <- but please be careful with it since it basically starts the WebUI and everything else from Unraid at the end of the boot process, preferably I would put that before emhttp starts).

 

What does the -dockerhost option exactly? Does it need to download something from the Internet or does it simply create the devices?

 

As mentioned above, the easiest solution would be to create a plugin for that because then the users can download it from the CA App <- all applications for Unraid (Docker templates and Plugins) and don't have to worry about anything, then I think it would be also possible to install the driver on the host and the users can pass through the /dev/dvbX devices to the container as usual.

 

I will maybe pick up the DVB-C adapter that is available on the used market near me.

Link to comment
14 hours ago, pk1057 said:

so it seems a valid solution

@pika & @knex666 & @tknz & @Marolo & @fireplex & @pk1057

 

Good news for all TBS users!

 

I just asked Tom to include some necessary Kernel modules to Unraid which are needed to compile the TBS drivers and hopefully they make it into Unraid 6.11.2 so this basically means that the TBS driver package should be working again when Unraid 6.11.2 is released.

  • Like 7
  • Thanks 1
Link to comment
3 hours ago, ich777 said:

 

 

What does the -dockerhost option exactly? Does it need to download something from the Internet or does it simply create the devices?

 

 

 

it only creates the dvb dummy device nodes with mknod in the background - nothing else. It can be skipped if the device nodes are created another way.

 

Link to comment
2 minutes ago, Sundtek said:

it only creates the dvb dummy device nodes with mknod in the background - nothing else. It can be skipped if the device nodes are created another way.

Then it would be best to simply put the creation from the dummy devices in the go file at the end (/boot/config/go).

 

Anyways, I will try to get the one tuner from our local used market and see if I can create a plugin, will keep you updated.

Link to comment
2 minutes ago, JoergHH said:

Is the documentation up to date now and may I assume that the whole installation has to be repeated for a Unraid system update?

 

the documentation works, however ich777 said that we should put the mknod commands into /boot/config/go

that will eliminate step #1 of the install process; so the driver only would have to be installed in the docker image.

  • Like 1
Link to comment
Just now, Sundtek said:

the documentation works, however ich777 said that we should put the mknod commands into /boot/config/go

Exactly, because the go file is executed every time the server boots and with this you ensure they are there.

 

1 minute ago, Sundtek said:

that will eliminate step #1 of the install process; so the driver only would have to be installed in the docker image.

But what would be ultimately be my goal is to install everything on the host and then pass the "devices" /dev/dvbX to the container as usual (this should also work like if you pass through any other DVB  card to a container or am I wrong?) and also check if eg: /dev/dvb0 is already there and create a new device for at the next free /dev/dvbX slot.

Link to comment
8 minutes ago, JoergHH said:

whole installation has to be repeated for a Unraid system update?

As @Sundtek already pointed out not the whole installation, the creation from the dummy devices on the host should go to the go file and the installation in the TVH container is a one time thing as far as I understand it since the drivers are installed in the /config directory in the container.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.