Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/dev/dvb passthrough #103

Closed
rucati opened this issue Feb 12, 2024 · 20 comments
Closed

/dev/dvb passthrough #103

rucati opened this issue Feb 12, 2024 · 20 comments
Assignees

Comments

@rucati
Copy link

rucati commented Feb 12, 2024

Problem/Motivation

Tvheadend doesn't see the active dvb-adapters

(Why the issue was filed)

Expected behavior

/dev/dvb/, /dev/dri/ would be respectively mapped to /dev/dvb/, /dev/dri/ inside the addon.

(What you expected to happen)

Actual behavior

(What actually happened)

no cards detected in tvheadend-addon

Steps to reproduce

  1. Debian 12 + supervised installed
  2. Latest linux_media_build to add dvb adapters on debian 12 -> "ls /dev/dvb" shows adapter0 -> adapter7

(How can someone else make/see it happen)

Proposed changes

/dev/dvb:/dev/dvb as in suggested docker-config from linuxserver.io?
Is there no firmware / linux_media needed in docker?

(If you have a proposed change, workaround or fix,
describe the rationale behind it)

I compiled minisatip on debian 12, minisatip correctly detects the cards and tvheadend can see these as sat>ip in the addon.

@dfigus dfigus self-assigned this Feb 12, 2024
@dfigus
Copy link
Owner

dfigus commented Feb 12, 2024

According to the config.yaml /dev/dvb & /dev/dri are mapped into the container:

- /dev/dvb
- /dev/dri

At least for /dev/dri/ the devices are available in my container. I don't have a DVB adapter here, hence I can't really reproduce it for /dev/dvb/. Can you check whether /dev/dri is available in your container?

@rucati
Copy link
Author

rucati commented Feb 13, 2024

Hi
Thanks for keeping updating the project (now 5.0.1) and your feedback!
I am a bit limited on tech-skills compared to you. Perhaps you have some advice:

  1. adapters are indeed visible in docker, dmesg in the container tells me the cards are recognized
    root@dae55a80-tvheadend:/$ dmesg | grep DVB
    [ 7.217327] TBSECP3 driver 0000:01:00.0: TurboSight TBS 6205 DVB-T/T2/C
    [ 7.257944] dvbdev: DVB: registering new adapter (TBSECP3 DVB Adapter)
    [ 7.491963] TBSECP3 driver 0000:01:00.0: DVB: registering adapter 0 frontend 0 (TurboSight TBS 6205 DVB-T/T2/C )...
    [ 7.492112] dvbdev: DVB: registering new adapter (TBSECP3 DVB Adapter)
    [ 7.666762] dvbdev: DVB: registering new adapter (nGene)
    [ 7.666769] ngene 0000:03:00.0: DVB: registering adapter 2 frontend 0 (STV090x Multistandard)...
    [ 7.684480] TBSECP3 driver 0000:01:00.0: DVB: registering adapter 1 frontend 0 (TurboSight TBS 6205 DVB-T/T2/C )...
    [ 7.686573] dvbdev: DVB: registering new adapter (TBSECP3 DVB Adapter)
    [ 7.725283] dvbdev: DVB: registering new adapter (nGene)
    [ 7.725289] ngene 0000:03:00.0: DVB: registering adapter 4 frontend 0 (STV090x Multistandard)...
    [ 7.931735] TBSECP3 driver 0000:01:00.0: DVB: registering adapter 3 frontend 0 (TurboSight TBS 6205 DVB-T/T2/C )...
    [ 7.967736] dvbdev: DVB: registering new adapter (TBSECP3 DVB Adapter)
    [ 8.087494] dvbdev: DVB: registering new adapter (nGene)
    [ 8.087501] ngene 0000:03:00.0: DVB: registering adapter 6 frontend 0 (STV090x Multistandard)...
    [ 8.201578] dvbdev: DVB: registering new adapter (nGene)
    [ 8.201585] ngene 0000:03:00.0: DVB: registering adapter 7 frontend 0 (STV090x Multistandard)...
    [ 8.219932] TBSECP3 driver 0000:01:00.0: DVB: registering adapter 5 frontend 0 (TurboSight TBS 6205 DVB-T/T2/C )...
    [ 8.220100] TBSECP3 driver 0000:01:00.0: TurboSight TBS 6205 DVB-T/T2/C : PCI 0000:01:00.0, IRQ 131, MMIO 0x91500000

  2. tvheadend still doesn't pickup the cards, because they are owned by root.
    see similar: /dev/dvb has incorrect permissions linuxserver/docker-tvheadend#44

  3. chmod -R 777 /dev/doesn't do the trick yet.

Thanks in advance!

UPDATE: this seems to be an old issue:
GauthamVarmaK/addon-tvheadend#45 (comment)
I already found the config.yaml. Adjusting this to:
https://github.com/marious1985/hassio-addons/blob/main/tvheadend/config.yaml

devices:

  • /dev/dvb/adapter0/demux0
  • /dev/dvb/adapter0/dvr0
  • /dev/dvb/adapter0/frontend0
  • /dev/dvb/adapter0/net0

...doesn't show the dvb-adapter. Also 1 out of 2 fritzbox/sat>ip is visible. Keeping / dev/dvb as in your config, keeps the fritzbox/sat>ip both visible in tvheadend.

@dfigus
Copy link
Owner

dfigus commented Feb 13, 2024

Nice, thanks for the details. I will have a deeper look into the other issue and check what I can do. Could you please let me know which DVB tuner you are using? In case it's not too expensive, I'll consider buying one 😄. Also what's your machine & architecture running HAOS?

@rucati
Copy link
Author

rucati commented Feb 13, 2024 via email

@obert0
Copy link

obert0 commented Feb 14, 2024

Hi, few days ago I post my problem on the link you refer too (GauthamVarmaK/addon-tvheadend#45 (comment)). Your addon config is a little bit different, but I dont think it matter for this issue.
I can made some test if you want from my setup.
Out of curiosity why did you remove WebGrabPlus from your addon?
Thank you!

@dfigus
Copy link
Owner

dfigus commented Feb 14, 2024

Hi You can see the card from the dmesg: a TBS and a DigitalDevices satix 2 If you are willing to invest time, I have a spare TBS here and I can send it to you. Regards R

@rucati: It looks like those are PCI express cards and I just run it on a PI4 - hence I can't use them 😞 .
@obert0: It looks like there are multiple issues causing DVB tuners not showing up. Your last comment in GauthamVarmaK/addon-tvheadend#45 (comment) looks like a firmware issue, however the one from this issue is different I think. I'm happy to try to solve all in my fork here so that we have a fully working tvheadend addon-on in the future 😄. But I would need everyone's help as I don't have DVB tuners...

Furthermore I created a discussion #107 about Webgrab+, let's discuss it there.

@dfigus
Copy link
Owner

dfigus commented Feb 14, 2024

@rucati I don't think it's a permission issue as in my addon TVHeadend runs as root and should therefore have all authorizations to access the devices. I just added the full device path into the config.yaml. Can you install the latest edge build (1aa136b or newer) from here https://github.com/dfigus/hassio-addons-edge and report whether this changes anything? Furthermore it looks like you don't have a firmware issue, correct (I'm just guessing here)?

@obert0 Maybe you could also give this a try to avoid the workaround of installing both addon-ons after each other. For the firmware issue, I would like to track this in a separate issue. Could you create a new one in my repository here?

@obert0
Copy link

obert0 commented Feb 14, 2024

Hi dfigus,
Yes I will create a new issue from my last post.
I have a forked version of the Gautham addon. I will try to install yours and give it a try. I will try tomorrow evening. I let you in touch.

@rucati
Copy link
Author

rucati commented Feb 15, 2024

Hi

current setup:
debian 12 on amd64 + supervised // hassio-addons-edge as proposed installed
dmesg on debian 12:

[ 7.314880] TBSECP3 driver 0000:01:00.0: TurboSight TBS 6205 DVB-T/T2/C
[ 7.326251] dvbdev: DVB: registering new adapter (TBSECP3 DVB Adapter)
[ 7.486372] TBSECP3 driver 0000:01:00.0: DVB: registering adapter 0 frontend 0 (TurboSight TBS 6205 DVB-T/T2/C )...
[ 7.486687] dvbdev: DVB: registering new adapter (TBSECP3 DVB Adapter)
[ 7.663958] TBSECP3 driver 0000:01:00.0: DVB: registering adapter 1 frontend 0 (TurboSight TBS 6205 DVB-T/T2/C )...
[ 7.664127] dvbdev: DVB: registering new adapter (TBSECP3 DVB Adapter)
[ 7.686611] dvbdev: DVB: registering new adapter (nGene)
[ 7.686618] ngene 0000:03:00.0: DVB: registering adapter 3 frontend 0 (STV090x Multistandard)...
[ 7.745980] dvbdev: DVB: registering new adapter (nGene)
[ 7.745987] ngene 0000:03:00.0: DVB: registering adapter 4 frontend 0 (STV090x Multistandard)...
[ 7.832755] TBSECP3 driver 0000:01:00.0: DVB: registering adapter 2 frontend 0 (TurboSight TBS 6205 DVB-T/T2/C )...
[ 7.832884] dvbdev: DVB: registering new adapter (TBSECP3 DVB Adapter)
[ 8.009646] TBSECP3 driver 0000:01:00.0: DVB: registering adapter 5 frontend 0 (TurboSight TBS 6205 DVB-T/T2/C )...
[ 8.009865] TBSECP3 driver 0000:01:00.0: TurboSight TBS 6205 DVB-T/T2/C : PCI 0000:01:00.0, IRQ 130, MMIO 0x91500000
[ 8.284072] dvbdev: DVB: registering new adapter (nGene)
[ 8.284078] ngene 0000:03:00.0: DVB: registering adapter 6 frontend 0 (STV090x Multistandard)...
[ 8.358617] dvbdev: DVB: registering new adapter (nGene)
[ 8.358635] ngene 0000:03:00.0: DVB: registering adapter 7 frontend 0 (STV090x Multistandard)...
[90330.572731] TBSECP3 driver 0000:01:00.0: DVB: adapter 0 frontend 0 frequency 0 out of range (48000000..870000000)
[90348.054846] TBSECP3 driver 0000:01:00.0: DVB: adapter 0 frontend 0 frequency 0 out of range (48000000..870000000)
[90451.439098] TBSECP3 driver 0000:01:00.0: DVB: adapter 0 frontend 0 frequency 0 out of range (48000000..870000000)

root@hassio:~# ls -l /dev/dvb
totaal 0
drwxr-xr-x 2 root root 120 14 feb 09:07 adapter0
drwxr-xr-x 2 root root 120 14 feb 09:07 adapter1
drwxr-xr-x 2 root root 120 14 feb 09:07 adapter2
drwxr-xr-x 2 root root 120 14 feb 09:07 adapter3
drwxr-xr-x 2 root root 120 14 feb 09:07 adapter4
drwxr-xr-x 2 root root 120 14 feb 09:07 adapter5
drwxr-xr-x 2 root root 120 14 feb 09:07 adapter6
drwxr-xr-x 2 root root 120 14 feb 09:07 adapter7

root@hassio:~# ls -l /dev/dvb/adapter0/

crw-rw---- 1 root video 212, 0 14 feb 09:07 demux0
crw-rw---- 1 root video 212, 1 14 feb 09:07 dvr0
crw-rw---- 1 root video 212, 3 14 feb 09:07 frontend0
crw-rw---- 1 root video 212, 2 14 feb 09:07 net0
root@hassio:~# ls -l /dev/dvb/adapter5
totaal 0
crw-rw---- 1 root video 212, 20 14 feb 09:07 demux0
crw-rw---- 1 root video 212, 21 14 feb 09:07 dvr0
crw-rw---- 1 root video 212, 23 14 feb 09:07 frontend0
crw-rw---- 1 root video 212, 22 14 feb 09:07 net0

into the container:
root@b8c699d3-tvheadend:/$ dmesg | grep DVB
[ 7.314880] TBSECP3 driver 0000:01:00.0: TurboSight TBS 6205 DVB-T/T2/C
[ 7.326251] dvbdev: DVB: registering new adapter (TBSECP3 DVB Adapter)
[ 7.486372] TBSECP3 driver 0000:01:00.0: DVB: registering adapter 0 frontend 0 (TurboSight TBS 6205 DVB-T/T2/C )...
[ 7.486687] dvbdev: DVB: registering new adapter (TBSECP3 DVB Adapter)
[ 7.663958] TBSECP3 driver 0000:01:00.0: DVB: registering adapter 1 frontend 0 (TurboSight TBS 6205 DVB-T/T2/C )...
[ 7.664127] dvbdev: DVB: registering new adapter (TBSECP3 DVB Adapter)
[ 7.686611] dvbdev: DVB: registering new adapter (nGene)
[ 7.686618] ngene 0000:03:00.0: DVB: registering adapter 3 frontend 0 (STV090x Multistandard)...
[ 7.745980] dvbdev: DVB: registering new adapter (nGene)
[ 7.745987] ngene 0000:03:00.0: DVB: registering adapter 4 frontend 0 (STV090x Multistandard)...
[ 7.832755] TBSECP3 driver 0000:01:00.0: DVB: registering adapter 2 frontend 0 (TurboSight TBS 6205 DVB-T/T2/C )...
[ 7.832884] dvbdev: DVB: registering new adapter (TBSECP3 DVB Adapter)
[ 8.009646] TBSECP3 driver 0000:01:00.0: DVB: registering adapter 5 frontend 0 (TurboSight TBS 6205 DVB-T/T2/C )...
[ 8.009865] TBSECP3 driver 0000:01:00.0: TurboSight TBS 6205 DVB-T/T2/C : PCI 0000:01:00.0, IRQ 130, MMIO 0x91500000
[ 8.284072] dvbdev: DVB: registering new adapter (nGene)
[ 8.284078] ngene 0000:03:00.0: DVB: registering adapter 6 frontend 0 (STV090x Multistandard)...
[ 8.358617] dvbdev: DVB: registering new adapter (nGene)
[ 8.358635] ngene 0000:03:00.0: DVB: registering adapter 7 frontend 0 (STV090x Multistandard)...
[90330.572731] TBSECP3 driver 0000:01:00.0: DVB: adapter 0 frontend 0 frequency 0 out of range (48000000..870000000)
[90348.054846] TBSECP3 driver 0000:01:00.0: DVB: adapter 0 frontend 0 frequency 0 out of range (48000000..870000000)
[90451.439098] TBSECP3 driver 0000:01:00.0: DVB: adapter 0 frontend 0 frequency 0 out of range (48000000..870000000)

This still looks as expected.

STEP 2: checking whether tvheadend sees the adapter:
afbeelding

Yes!

Conclusion: I am pretty confident that this isn't a firmware/driver issue. I also tried to change the config.yaml and add all my adapters (0->7), then restart tvheadend, but that doesn't work. Still 1 adapter visible.
Something like marius his addon might be an option? See: GauthamVarmaK/addon-tvheadend#45 (comment)

Extra: I also have a spare TVb-dvb-s2... let me know if your are interested

@dfigus
Copy link
Owner

dfigus commented Feb 15, 2024

@rucati Thanks for testing this. So I'm still a bit puzzled why the generic device mapping of /dev/dvb does not work here... I did some research via google, but couldn't get hint on the strange behavior. I could add all of the adapters but that looks like a hacky solution and I hope there is a better way of doing it... I hope 😕 .

Do you still have the other 5.0.1 version installed where it does not work? Can you compare the permissions on /dev/dvb/ and all sub entities to the edge version where the adapter0 is working? I also guess in the edge version only adapter0 is visible, whereas in 5.0.1 all adapters are visible, correct?

Furthermore we might also try add some privileged capabilities to the addon and see whether this resolves the issue.

Regarding firmware: As you are running HA supervised, the firmware is already available during boot. The issue from obert0 is due to the missing firmware in HA OS during the early boot stage and it seems that there is currently no way in HA OS for this. Hence a unplug & re-plug works as then the firmware is available.

Regarding your TVB-DVB-S2: I could only use it if this is a USB dongle as I don't have a PC with PCIE slot for testing...

@rucati
Copy link
Author

rucati commented Feb 15, 2024

Hi

Short: permissions seem to be identical, (see below) it is just a matter of explicitly adding the adapter.

  1. Perhaps rebuilding with the changed settings? In other words: can I change config.yaml and rebuild docker, so it picks up my adjustments (= being adapter0 to adapter7)? How do I do this?
    If I change config.yaml and add all adapters, then restart the addon -> I only see the first adapter, as your config defines. So that's not an option.

  2. In my previous post, I mentioned comment 45 => someone added a custom config on top of GauthamVarMak's docker. Could this work? Procedure is like: installing your default repository, then changing to another repository, which only changes the config.yaml. See: DVB Adaptors not detected GauthamVarmaK/addon-tvheadend#45 (comment)

Fact: every adapter must be explicitly added to the config. 5.0.1 doesn't show any local adapter.
TVB-DVB-S2 is a USB-dongle.

Running edge:

only the first adapter is visible, apart from other sat>ip-servers (see screenshot). Obviously, as you explicitly added the first adapter in config.yaml, but it works! Permissions underneath the screenshot:
afbeelding

root@b8c699d3-tvheadend:/$ ls -l /dev/dvb
total 0
drwxr-xr-x 2 root root 120 Feb 14 09:07 adapter0
drwxr-xr-x 2 root root 120 Feb 14 09:07 adapter1
drwxr-xr-x 2 root root 120 Feb 14 09:07 adapter2
drwxr-xr-x 2 root root 120 Feb 14 09:07 adapter3
drwxr-xr-x 2 root root 120 Feb 14 09:07 adapter4
drwxr-xr-x 2 root root 120 Feb 14 09:07 adapter5
drwxr-xr-x 2 root root 120 Feb 14 09:07 adapter6
drwxr-xr-x 2 root root 120 Feb 14 09:07 adapter7
root@b8c699d3-tvheadend:/$ ls -l /dev/dvb/adapter0/
total 0
crw-rw---- 1 root 44 212, 0 Feb 14 09:07 demux0
crw-rw---- 1 root 44 212, 1 Feb 14 09:07 dvr0
crw-rw---- 1 root 44 212, 3 Feb 14 09:07 frontend0
crw-rw---- 1 root 44 212, 2 Feb 14 09:07 net0

44 = group video from my debian host, the addon doesn't know this group.

Running 5.0.1:

afbeelding

root@dae55a80-tvheadend:/$ ls -l /dev/dvb/
total 0
drwxr-xr-x 2 root root 120 Feb 14 09:07 adapter0
drwxr-xr-x 2 root root 120 Feb 14 09:07 adapter1
drwxr-xr-x 2 root root 120 Feb 14 09:07 adapter2
drwxr-xr-x 2 root root 120 Feb 14 09:07 adapter3
drwxr-xr-x 2 root root 120 Feb 14 09:07 adapter4
drwxr-xr-x 2 root root 120 Feb 14 09:07 adapter5
drwxr-xr-x 2 root root 120 Feb 14 09:07 adapter6
drwxr-xr-x 2 root root 120 Feb 14 09:07 adapter7
root@dae55a80-tvheadend:/$ ls -l /dev/dvb/adapter0/
total 0
crw-rw---- 1 root 44 212, 0 Feb 14 09:07 demux0
crw-rw---- 1 root 44 212, 1 Feb 14 09:07 dvr0
crw-rw---- 1 root 44 212, 3 Feb 14 09:07 frontend0
crw-rw---- 1 root 44 212, 2 Feb 14 09:07 net0

@rucati
Copy link
Author

rucati commented Feb 15, 2024

Hi

Easy solution: keep your config as is, I can test it and adjust the config.yaml to my settings. Then I copy this into the ../addons/local/ and install it from there! I tested this and so I have all my adaters listed.

In my test, I added 2 adapters and now they are listed. This is an acceptable way to keep your repository consistent.

afbeelding

Send me an email about the usb-dongle, if interested.

@rucati
Copy link
Author

rucati commented Feb 15, 2024

This approach works, as suggested in See: GauthamVarmaK/addon-tvheadend#45 (comment)

First install your repo, copy into local, make changes and then install/start this local copy.

afbeelding

1 issue: if I use 5.0.1 and make the changes to config.yaml, my last fritzbox is not visible anymore. Using edge (see screenshot) shows all adapters!

@obert0
Copy link

obert0 commented Feb 16, 2024

Hi, I tested both current version and edge. I succeed to make my tuner work on the edge version only with the steps of my other post. (I have just 1 tuner)
On the other build I use I declare the dvb like that with succes: "- dev/dvb/". Maybe you can try that and it will get all the adaptor's present.

@rucati
Copy link
Author

rucati commented Feb 16, 2024

@obert0 In vain, the trailing slash doesn't make my adapters visible. For now, this works:

  1. installing the edge-branch
  2. copy it to local and adjust the config.yaml
  3. install and run this local branch with all adapters

BUT I also follow / use addons from here: https://github.com/alexbelgium/hassio-addons/tree/master/paperless_ngx

His json-file sums up a lot of possible hardware, depending on your system, it takes what works.

ALSO it includes a config-path so you can add a smb-path to store recordings, apart from your local disk.

@dfigus can a config-option to add an export-dir in the docker environment be added?
(Like the above link) This allows recordings to be saved on a NAS.

On top, they include multiple hardware options in their json, so it matches somehow with what your system has on offer (1 dvb-adapter or 2 dvb-adapters, of even 8...)

@dfigus
Copy link
Owner

dfigus commented Feb 16, 2024

@obert0 In vain, the trailing slash doesn't make my adapters visible. For now, this works:

  1. installing the edge-branch
  2. copy it to local and adjust the config.yaml
  3. install and run this local branch with all adapters

BUT I also follow / use addons from here: https://github.com/alexbelgium/hassio-addons/tree/master/paperless_ngx

His json-file sums up a lot of possible hardware, depending on your system, it takes what works.

So to sum it up the config.yaml would really need to list all possible adapters with all sub entities. So maybe I'll add 10 adapters in the config and hope this is suitable for all - I don't have a problem with that as it does not break in case there is no DVB adapters at all (as in my setup). I still wonder why the linuxserver image works with just /dev/dvb (as far as I remember you said it's working for you). Hence I'm not giving up on this topic 😄. I hope with your spare DVB adapter I can figure it out.

On top, they include multiple hardware options in their json, so it matches somehow with what your system has on offer (1 dvb-adapter or 2 dvb-adapters, of even 8...)

Do you mean this section here:
https://github.com/alexbelgium/hassio-addons/blob/122815cea7437dfd45118fb8a306ebb831dce616/paperless_ngx/config.json#L8-L65
For example many /dev/sd* are listed here and in most systems only few like sda might be there. Is this what you mean with that?

ALSO it includes a config-path so you can add a smb-path to store recordings, apart from your local disk.

@dfigus can a config-option to add an export-dir in the docker environment be added? (Like the above link) This allows recordings to be saved on a NAS.

Let's discuss this in a separate discussion #112 to keep the issue focused on the dvb adapters.

@dfigus
Copy link
Owner

dfigus commented Feb 16, 2024

@rucati Just to add: I would not recommend to copy it to local and then adjust the config.yaml. As long as you keep the image pointing to my repository it will fetch the my image, which could get out of sync with the config.yaml and hence strange behavior.

I'll add the other adapters in a fresh edge build 2571e8f so you can test it.

@rucati
Copy link
Author

rucati commented Feb 16, 2024 via email

@dfigus
Copy link
Owner

dfigus commented Feb 20, 2024

@rucati I released the updated config.yaml with 9 adapters in 5.0.2, so this should enable all your 8 adapters. Can you please report back if also your Fritz Satip tuners are still fully operational?

@rucati
Copy link
Author

rucati commented Feb 25, 2024

Hi

I moved from edge to 5.0.2 and everything works as expected
afbeelding

This issue can be closed. Enjoy TBS-compiling :-)

@dfigus dfigus closed this as completed Feb 25, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants