addon-tvheadend
addon-tvheadend copied to clipboard
DVB Adaptors not detected
Problem/Motivation
Hi I like the addon. I currently use a stand alone container for tv headend.
Expected behavior
Use my tv cards as I can use them with the linuxserver/tvheadend:latest container

Actual behavior
I installed the addon but my tv cards are not detected. I saw that you mounted in the container as /dev but when I ran the setup no tv cards show up. Drivers are installed on the host and the linuxserver/tvheadend:latest can detect the cards.
Steps to reproduce
Shut down running stand alone container Install addon Ran Setup No tv cards
Proposed changes
I checked the config of the addon container and there the devices are not mapped to the container

Maybe the devices are not shared by the /dev mount? This is my stand alone container config. I can share more if you like.

Thanks for letting me know & Congrats on your first issue here!!
I previously assumed mapping RAW USB into the container should be enough for the DVB Adapters to be accessible from within the container. However, it didn't seem to work (Similar issue: #32). For context, I don't have a DVB Adapter/service.
Addon versions starting with v2.1.0 and above now explicitly mount /dev/dvb/ and /dev/dri/ inside the container. Give it a try and let me know of any issue. Also, feel free to fork it, make changes and open a pull if u wish to make some improvements in general.
Hi @GauthamVarmaK i updated the addon but the devices are not mounted. Please check my screenshot taken after the the update to 2.1.1

I made a tiny modification in v2.1.2, could you give it a try and get back?
Hi unfortunately it is still no device mounted:

Maybe mounting /dev / and devices is disturbing the mount of the devices:

I just discovered all addons mount /dev by default.
Could u run this:
ls -al /dev/dvb /dev/dri
- Inside the container
- Outside on the host machine
And send back the result of both?
[Why I am asking for context: If the permissions are not same, apparmor.txt could be the culprit, else some permissions issue within the container, or TVHeadend having some absurd issue connecting or something else]
sure :-) this is within the container:
an this is from host system Debian Bullseye:

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!
Hey @GauthamVarmaK any news on the issue? Kind regards from Hamburg Mathias
Hmmm....I have just come across this ticket - think I am experiencing exactly the same problem. From the host OS (HA OS) I can see the devices fine, but TVheadend, for some reason, does not detect them
Hey there all, I would like to report this behavior as well. I'm running Home Assistant OS on raspberry Pi 4 B. I have the latest versions of both the OS and the add-on. This is what I get when I run the aforementioned command from the OS (through terminal add-on)
➜ ~ ls -al /dev/dvb /dev/dri
ls: cannot access '/dev/dri': No such file or directory
/dev/dvb:
total 0
drwxr-xr-x 3 root root 60 Dec 30 23:14 .
drwxr-xr-x 19 root root 3980 Dec 30 23:14 ..
drwxr-xr-x 2 root root 120 Dec 30 23:14 adapter0
I am not able to (or don't know how) to access into docker container and run the same command
I have tried
docker pull 835b5c91_tvheadend
But I cannot get inside...
I hope there will be progress on this add-on as it might be the best way for me and many of us to setup multicast tv-server on the same machine that is running HA.
Cheers!
I am not 100% sure of the issue, but I suspect it is a permissions issue within the container. Potential fix could be a replication of the permissions model from the linuxserver images.
Also one difference between the linuxserver images and this addon is that here we use a stable packaged version of TVHeadend, v4.28 to be precise, which is old as compared to building it of latest sources like linuxserver images do. But that shouldn't make much of a difference in this case of DVB Adapters.
I am currently busy with my coursework and many other events, and hence unable to spend much time maintaining the addon. Apologies on that front. Anyone who is free/willing to, try copying the permissions model from linuxserver images or any other potential fix, please feel free to star, fork and open a PR!
@GauthamVarmaK, you're right. It is a permission issue. I did manage to get it working but (there is always one) in neither secure nor clean way:
- removed https://github.com/GauthamVarmaK/addon-tvheadend/blob/main/tvheadend/config.yaml#L15-L17
- added:
full_access: trueand disable addon protection as per https://developers.home-assistant.io/docs/add-ons/configuration/
Hopefully it is a nudge...

Thats great news!!
Give full access to hardware like the privileged mode in Docker. Works only for not protected add-ons. Consider using other add-on options instead of this, like
devices. If you enable this option, don't add devices,uart,usborgpiothis is not needed
However I want to see if we can narrow down the permissions granted to only those necessary for its operation.
During various versions we had either usb or devices but both didn't work as per few others.
Could you instead try setting privileged with a list of NET_ADMIN, SYS_ADMIN, SYS_RAWIO and check if it works?
[https://developers.home-assistant.io/docs/add-ons/configuration/]
Hey that’s sounds good.Unfortunately I am not so advanced with the config but I can test. Please let me know if I can assist. Many thanks from Germany
Any progress on this issue?
Same problem here: USB DVB Stick is listed in HA tvheadend addon docker container (/dev/dvb/adapter0/), but the addon does not recognize it.
Unfortunately i am not experienced enough to get apply scavaras solution.
Fwiw, simply because I don't have time to properly test and make PR, here are some diffs. As per @GauthamVarmaK suggestion, I did try privileged setting and it does work as long as addon protection is disabled. Also, with recent HA update, some changes are needed in Dockerfile as well.
config.yaml
17,22d14
< hassio_role: admin
< hassio_api: true
< privileged:
< - NET_ADMIN
< - SYS_ADMIN
< - SYS_RAWIO
Dockerfile
13,14c13,14
< libxml2-dev=2.9.13-r0 \
< libxslt-dev=1.1.35-r0 \
---
> libxml2-dev=2.9.12-r2 \
> libxslt-dev=1.1.34-r1 \
19c19
< libxslt=1.1.35-r0 \
---
> libxslt=1.1.34-r1 \
57d56
@GauthamVarmaK Can I maybe contribute/help a bit? I have an AverMedia TD310 DVB-C/T/T2 USB stick which works nicely when connected to my Raspberry Pi 4 as long as it runs Raspberry Pi OS and tvheadend and has these 3 firmware files saved under /lib/firmware/
https://github.com/OpenELEC/dvb-firmware/raw/master/firmware/dvb-usb-it9303-01.fw
https://github.com/OpenELEC/dvb-firmware/raw/master/firmware/dvb-demod-si2168-02.fw
https://github.com/OpenELEC/dvb-firmware/raw/master/firmware/dvb-demod-si2168-b40-01.fw
However, when I use Home Assistant OS and your Tvheadend add-on, the stick is not recognized. First, I would like to know how I can "tail -f" when pluggin it in to see what happens. On plain Raspberry Pi OS, this would be tail -f /var/log/messages. However, on HA OS (despite reading various docu & FAQs), I could not find a way to see anything when plugging the stick in. Therefore, I do not know, if some firmware file(s) is/are missing. If they were, where should I store them, and would the Tvheadend add-on and/or the HA OS recognize them at all?
So far, I cannot setup the Tvheadend add-on with the DVB-C/T/T2 stick, as nothing is shown in the WebGUI config under the DVB inputs/TV adapters.
Thanks for pointing me into the right direction! :)
@GauthamVarmaK Can I maybe contribute/help a bit? I have an AverMedia TD310 DVB-C/T/T2 USB stick which works nicely when connected to my Raspberry Pi 4 as long as it runs Raspberry Pi OS and tvheadend and has these 3 firmware files saved under /lib/firmware/
https://github.com/OpenELEC/dvb-firmware/raw/master/firmware/dvb-usb-it9303-01.fw https://github.com/OpenELEC/dvb-firmware/raw/master/firmware/dvb-demod-si2168-02.fw https://github.com/OpenELEC/dvb-firmware/raw/master/firmware/dvb-demod-si2168-b40-01.fwHowever, when I use Home Assistant OS and your Tvheadend add-on, the stick is not recognized. First, I would like to know how I can "tail -f" when pluggin it in to see what happens. On plain Raspberry Pi OS, this would be
tail -f /var/log/messages. However, on HA OS (despite reading various docu & FAQs), I could not find a way to see anything when plugging the stick in. Therefore, I do not know, if some firmware file(s) is/are missing. If they were, where should I store them, and would the Tvheadend add-on and/or the HA OS recognize them at all?So far, I cannot setup the Tvheadend add-on with the DVB-C/T/T2 stick, as nothing is shown in the WebGUI config under the DVB inputs/TV adapters.
Thanks for pointing me into the right direction! :)
I´m digging the same thing with a USB DVB-S2 device. If you use the COMMUNITY SSH & Terminal AddOn you can issue "dmesg" and get your kernel logs.
Mine look like
`dmesg | egrep "firmware|dvb|frontend|usb"
[ 2.701724] usb 1-2.1: New USB device found, idVendor=9022, idProduct=d660, bcdDevice= 0.01
[ 2.701753] usb 1-2.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 2.717649] usbcore: registered new interface driver btusb`
Looks for me like it is unable to either start a driver or detect the right firmware.
So, was digging deeper and my Teevi S660 was not loading the driver for the frontend device. Finally i gave up with this one and switched to a Hauppauge BTW, HASSOS might not ship with all dvb firmware required so i was only able to get it running on a supervised installation.
Hello. Does anyone have an idea what is wrong.
from dmesg:
[ 4.349112] dvbdev: DVB: registering new adapter (CXD2880)
[ 4.389547] cxd2880: cxd2880_attach: CXD2880 driver version: Ver 1.4.1 - 1.0.5
[ 4.389701] cxd2880 spi0.0: DVB: registering adapter 0 frontend 0 (Sony CXD2880)...
[ 4.408078] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[ 4.410180] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[ 4.417802] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Nov 1 2021 00:37:25 version 7.45.241 (1a2f2fa CY) FWID 01-703fd60
[ 4.508013] cxd2880_spi: cxd2880_spi_probe: Sony CXD2880 has successfully attached.
and from ls:
[core-ssh ~]$ ls -al /dev/dvb /dev/dri /dev/dri: total 0 drwxr-xr-x 3 root root 120 Jun 2 2022 . drwxr-xr-x 18 root root 4160 Jun 2 2022 .. drwxr-xr-x 2 root root 100 Dec 16 20:34 by-path crw-rw---- 1 root netdev 226, 0 Jun 2 2022 card0 crw-rw---- 1 root netdev 226, 1 Dec 16 20:34 card1 crw-rw-rw- 1 root 103 226, 128 Jun 2 2022 renderD128
/dev/dvb: total 0 drwxr-xr-x 3 root root 60 Jun 2 2022 . drwxr-xr-x 18 root root 4160 Jun 2 2022 .. drwxr-xr-x 2 root root 100 Jun 2 2022 adapter0
TvHeadend log:
[s6-init] making user provided files available at /var/run/s6/etc...exited 0. [s6-init] ensuring user provided files have correct perms...exited 0. [fix-attrs.d] applying ownership & permissions fixes... [fix-attrs.d] done. [cont-init.d] executing container initialization scripts... [cont-init.d] 00-banner.sh: executing...
Add-on: TVHeadend TV streaming server and recorder.
Add-on version: 2.3.0 You are running the latest version of this add-on. System: Home Assistant OS 9.4 (aarch64 / raspberrypi4-64) Home Assistant Core: 2022.12.6 Home Assistant Supervisor: 2022.11.2
Please, share the above information when looking for help or support in, e.g., GitHub, forums or the Discord chat.
[cont-init.d] 00-banner.sh: exited 0. [cont-init.d] 01-log-level.sh: executing... [cont-init.d] 01-log-level.sh: exited 0. [cont-init.d] customizations.sh: executing... [cont-init.d] customizations.sh: exited 0. [cont-init.d] tvheadend.sh: executing... [08:11:36] INFO: [Webgrab+] Webgrab+ already installed [08:11:36] INFO: [Webgrab+] Setup completed without errors!! [cont-init.d] tvheadend.sh: exited 0. [cont-init.d] done. [services.d] starting services [services.d] done. [08:11:36] INFO: Starting TVHeadend... 2022-12-17 08:11:36.483 [ INFO] main: Log started 2022-12-17 08:11:36.485 [ INFO] http: Starting HTTP server 0.0.0.0:9981 2022-12-17 08:11:36.486 [ INFO] htsp: Starting HTSP server 0.0.0.0:9982 2022-12-17 08:11:36.490 [ INFO] config: loaded 2022-12-17 08:11:36.491 [ INFO] config: scanfile (re)initialization with path
2022-12-17 08:11:37.004 [ INFO] scanfile: DVB-S - loaded 1 regions with 115 networks 2022-12-17 08:11:37.004 [ INFO] scanfile: DVB-T - loaded 44 regions with 1124 networks 2022-12-17 08:11:37.004 [ INFO] scanfile: DVB-C - loaded 19 regions with 64 networks 2022-12-17 08:11:37.004 [ INFO] scanfile: ATSC-T - loaded 2 regions with 12 networks 2022-12-17 08:11:37.004 [ INFO] scanfile: ATSC-C - loaded 1 regions with 5 networks 2022-12-17 08:11:37.004 [ INFO] scanfile: ISDB-T - loaded 2 regions with 1297 networks 2022-12-17 08:11:38.520 [ INFO] dvr: Creating new configuration '' 2022-12-17 08:11:38.525 [ INFO] csa: Using 32bit parallel descrambling 2022-12-17 08:11:38.526 [ INFO] descrambler: adding CAID 2600 as constant crypto-word (BISS) 2022-12-17 08:11:38.526 [ INFO] epggrab: module eit created 2022-12-17 08:11:38.526 [ INFO] epggrab: module uk_freesat created 2022-12-17 08:11:38.526 [ INFO] epggrab: module uk_freeview created 2022-12-17 08:11:38.526 [ INFO] epggrab: module nz_freeview created 2022-12-17 08:11:38.527 [ INFO] epggrab: module viasat_baltic created 2022-12-17 08:11:38.527 [ INFO] epggrab: module Bulsatcom_39E created 2022-12-17 08:11:38.527 [ INFO] epggrab: module psip created 2022-12-17 08:11:38.541 [ INFO] epggrab: module opentv-skyit created 2022-12-17 08:11:38.544 [ INFO] epggrab: module opentv-skyuk created 2022-12-17 08:11:38.545 [ INFO] epggrab: module opentv-skynz created 2022-12-17 08:11:38.545 [ INFO] epggrab: module opentv-ausat created 2022-12-17 08:11:38.547 [ INFO] epggrab: module pyepg created 2022-12-17 08:11:38.547 [ INFO] epggrab: module xmltv created 2022-12-17 08:11:38.551 [ INFO] epgdb: gzip format detected, inflating (ratio 72.3% deflated size 138) 2022-12-17 08:11:38.551 [ INFO] epgdb: parsing 191 bytes 2022-12-17 08:11:38.551 [ INFO] epgdb: loaded v2 2022-12-17 08:11:38.551 [ INFO] epgdb: config 1 2022-12-17 08:11:38.551 [ INFO] epgdb: brands 0 2022-12-17 08:11:38.551 [ INFO] epgdb: seasons 0 2022-12-17 08:11:38.551 [ INFO] epgdb: episodes 0 2022-12-17 08:11:38.551 [ INFO] epgdb: broadcasts 0 2022-12-17 08:11:38.552 [ NOTICE] START: HTS Tvheadend version 4.2.8 started, running as PID:368 UID:0 GID:0, CWD:/run/s6/services/tvheadend CNF:/config/tvheadend
and

No adapter in Tvheadend. I use RaspberryPi DVB TV uHAT. On other systems (RaspberyPi OS or Kodi) works fine.
I experienced the same issue, and found the solution here: https://community.home-assistant.io/t/addon-dev-dvb-problem/340528/4
Just want to let you know that issue is not fixed. Standalone container works, hassio addon dont see adapters
@weidi @GauthamVarmaK Please consider my post over there: https://github.com/home-assistant/operating-system/issues/1157#issuecomment-1484044682
How can I ensure that the necessary drivers remain in /lib/firmware/ after a system restart? Without these drivers, TVHeadend does not detect my DVB-C/T2 USB stick plugged to a Raspberry Pi 4 running a standard Home Assistant installation with the TVHeadend addon. Any help is very much appreciated. Thank you!
PS: Does this help? https://github.com/home-assistant/operating-system/issues/2222#issuecomment-1308959053 A permanent solution to be able to have drivers stored in /lib/firmware would be great, but that seems to be something beyond the TVHeadend addon.
@7wells I've seen your struggles around the different issue trackers/forums as I have been fighting this myself. As I was poking around and found my way into the host filesystem, I saw there was a broken symlink at /lib/firmware/updates which points to /mnt/data/supervisor/firmware/. I accessed the supervisor container, created /data/firmware/ and copied a missing firmware file into it (v4l-cx231xx-avcore-01.fw), and saw the symlink was no longer broken. When I re-plugged my USB adapter and checked dmesg, I saw it picks up the file.
So that sounds like a good solution to get firmware files into place, but since it comes from a container's filesystem, it probably(?) won't work until the host is up, then the container comes up, and then the USB device is hotplugged.
Regarding the devices being inaccessible within the container, I'm still experiencing that while using the addon. When I shell into the tvheadend container, I can see /dev/dvb/adapter0/ and devices underneath it, but all attempts to access the devices gives me permission denied. If I access the same devices from the host, no permission denied. ~~This doesn't really add much since we know it appears to be a container permissions issue, but is there a nice/easy way to change permissions to test the currently running add-on without having to clone the repo and build myself?~~
After reading the comments again I see what others mentioned: explicitly listing each device under /dev/dvb/adapter0/ (so dvr0, demux0, frontend0, net0) in the devices section was the only change I needed to make to config.yaml. The Dockerfile needed some massaging for dependencies, but there were no extra permissions needed to grant to the add-on.
The obvious problem is we probably can't guess every combination of every adapter combo. I tried permutations using wildcards, etc, but no dice. Is there another, nicer solution?
Hello @GauthamVarmaK , I had the same issue and tvheadent dont showed my TV adapter (Raspberry Pi TV HAT) In the system I saw adapter mounted: /dev/dvb/adapter0/demux0 /dev/dvb/adapter0/dvr0 /dev/dvb/adapter0/frontend0
and in the Tvheadent nothing.
After reading the comments I tryed change file config.yaml for Tvheadend. From devices:
- /dev/dvb
- /dev/dri
To devices:
- /dev/dvb/adapter0/demux0
- /dev/dvb/adapter0/dvr0
- /dev/dvb/adapter0/frontend0
- /dev/dvb/adapter0/net0
And all seems good, I see TV adapter and all works fine.
My questions is: Do you can add this devices to the config.yaml or maybe best solution is add the ability to the change options in the addons configuration on Home Assitant? Same as system_packages and init_commands in Addons configuration. After that each user will be able to chaged name driver setting easly.
Thank you
Hello @GauthamVarmaK , I had the same issue and tvheadent dont showed my TV adapter (Raspberry Pi TV HAT) In the system I saw adapter mounted: /dev/dvb/adapter0/demux0 /dev/dvb/adapter0/dvr0 /dev/dvb/adapter0/frontend0
and in the Tvheadent nothing.
After reading the comments I tryed change file config.yaml for Tvheadend. From devices:
- /dev/dvb
- /dev/dri
To devices:
- /dev/dvb/adapter0/demux0
- /dev/dvb/adapter0/dvr0
- /dev/dvb/adapter0/frontend0
- /dev/dvb/adapter0/net0
And all seems good, I see TV adapter and all works fine.
My questions is: Do you can add this devices to the config.yaml or maybe best solution is add the ability to the change options in the addons configuration on Home Assitant? Same as system_packages and init_commands in Addons configuration. After that each user will be able to chaged name driver setting easly.
Thank you
How can I change the config.yaml in home assistant OS(supervisor)? Thanks
Hello @GauthamVarmaK , I had the same issue and tvheadent dont showed my TV adapter (Raspberry Pi TV HAT) In the system I saw adapter mounted: /dev/dvb/adapter0/demux0 /dev/dvb/adapter0/dvr0 /dev/dvb/adapter0/frontend0 and in the Tvheadent nothing. After reading the comments I tryed change file config.yaml for Tvheadend. From devices:
- /dev/dvb
- /dev/dri
To devices:
- /dev/dvb/adapter0/demux0
- /dev/dvb/adapter0/dvr0
- /dev/dvb/adapter0/frontend0
- /dev/dvb/adapter0/net0
And all seems good, I see TV adapter and all works fine. My questions is: Do you can add this devices to the config.yaml or maybe best solution is add the ability to the change options in the addons configuration on Home Assitant? Same as system_packages and init_commands in Addons configuration. After that each user will be able to chaged name driver setting easly. Thank you
How can I change the config.yaml in home assistant OS(supervisor)? Thanks
Hello @jonagi , I have tried to do different changes, but after I restarted hassio, the configuration was the same as before changes.
How you can do it, the easiest way is:
-
first, install Tvheadent from repository: https://github.com/GauthamVarmaK/addon-tvheadend and do first run. All updates will be downloaded and installed.
-
than remove Tvheadent and install again from this repository: https://github.com/marious1985/hassio-addons Now there is DVB adapter in Tvheadent. (DVB adapter have to installed drivers)
The first step is important, the second repository doesn't download updates.
Second repository have different config.yaml:
/dev/dvb/adapter0/demux0
/dev/dvb/adapter0/dvr0
/dev/dvb/adapter0/frontend0
/dev/dvb/adapter0/net0
I hope the config will be fixed and I will be able to use the original repository in the future.
Hello!
Is there any progress? I have the same problem, i.e. the device shows up in warm state but does not show up in tvheadend's GUI.
The config.yaml mentioned in this issue - where is it located?
Is there some script available that could automate the necessary steps to make it work? Does this script need to be stored via ssh port 22222 (i.e. the underlying system)?
PS:
# ls -al /dev/dvb /dev/dri
/dev/dri:
total 0
drwxr-xr-x 3 root root 120 Apr 4 2023 .
drwxr-xr-x 17 root root 4040 Dec 3 07:38 ..
drwxr-xr-x 2 root root 100 Apr 4 2023 by-path
crw-rw---- 1 root video 226, 0 Apr 4 2023 card0
crw-rw---- 1 root video 226, 1 Apr 4 2023 card1
crw-rw-rw- 1 root render 226, 128 Apr 4 2023 renderD128
/dev/dvb:
total 0
drwxr-xr-x 3 root root 60 Dec 3 07:38 .
drwxr-xr-x 17 root root 4040 Dec 3 07:38 ..
drwxr-xr-x 2 root root 120 Dec 3 07:38 adapter0
# ls -al /dev/dri/by-path/
total 0
drwxr-xr-x 2 root root 100 Apr 4 2023 .
drwxr-xr-x 3 root root 120 Apr 4 2023 ..
lrwxrwxrwx 1 root root 8 Apr 4 2023 platform-fec00000.v3d-card -> ../card0
lrwxrwxrwx 1 root root 13 Apr 4 2023 platform-fec00000.v3d-render -> ../renderD128
lrwxrwxrwx 1 root root 8 Apr 4 2023 platform-gpu-card -> ../card1
# ls -al /dev/dvb/adapter0/
total 0
drwxr-xr-x 2 root root 120 Dec 3 07:38 .
drwxr-xr-x 3 root root 60 Dec 3 07:38 ..
crw-rw---- 1 root video 212, 0 Dec 3 07:38 demux0
crw-rw---- 1 root video 212, 1 Dec 3 07:38 dvr0
crw-rw---- 1 root video 212, 3 Dec 3 07:38 frontend0
crw-rw---- 1 root video 212, 2 Dec 3 07:38 net0
Hello @LuckyLuckeCZ
Did you directly edit this file ...
/mnt/data/supervisor/addons/git/835b5c91/tvheadend/config.yaml
... or was anything else necessary?
I only replaced the lines ...
- /dev/dvb
- /dev/dri
... by these lines ...
- /dev/dvb/adapter0/demux0
- /dev/dvb/adapter0/dvr0
- /dev/dvb/adapter0/frontend0
- /dev/dvb/adapter0/net0
- /dev/dri
I restarted the whole system, and the log shows me that my DVB-T2 USB stick is in warm state. However, it still does not show up in the WebGUI of tvheadend.
Thanks a lot for your help! ❤️