Hi everyone,
I’m getting very frustrated trying to share my TV tuner with an Ubuntu 18.04 LXC container where I installed tvheadend. I don’t seem to be able to get the configuration right so that the TV tuner shows up in LXC, even after reading and following a variety of guides, both in the Turris documentation, this forum and elsewhere. Something is definitely wrong and I can’t figure out what. Any help is appreciated. Here is the configuration I have so far:
root@turris:~# lsusb
Bus 005 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 002: ID 15f4:0131 HanfTek
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 002: ID 1058:107c Western Digital Technologies, Inc.
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
root@turris:~# ls -l /dev/bus/usb/004
crw-rw-r-- 1 root root 189, 384 Feb 23 10:34 001
crw-rw-r-- 1 root root 189, 385 Feb 23 10:34 002
root@turris:~# ls -l /dev/dvb
drwxr-xr-x 2 root root 140 Feb 22 19:33 adapter0
root@turris:~# ls -l /dev/dvb/adapter0
crw-rw---- 1 root 44 212, 4 Feb 23 10:34 demux0
crw-rw---- 1 root 44 212, 5 Feb 23 10:34 dvr0
crw-rw---- 1 root 44 212, 3 Feb 23 10:34 frontend0
crw-rw---- 1 root 44 212, 19 Feb 23 10:34 frontend1
crw-rw---- 1 root 44 212, 7 Feb 23 10:34 net0
From this, I came up with this LXC configuration:
#TV Tuner
lxc.group.devices.allow = c 189:* rwm
lxc.mount.entry = /dev/bus/usb/004 dev/bus/usb/004 none bind,optional,create=dir 0 0
lxc.group.devices.allow = c 212:* rwm
lxc.mount.entry = /dev/dvb dev/dvb none bind,optional,create=dir 0 0
Some things to note:
– I’ve seen configs with both create=file and create=dir, which is confusing
– I’ve seen configs with both the USB primary ID and the secondary ID: /dev/bus/usb/004 vs /dev/bus/usb/004/002
– The Turris documentation advises lxc.group.devices.allow = c 188:* rwm for Omnia, which is confusing because on my device it’s 189, not 188.
– None of the instructions I’ve seen have the 0 0 after the dir instruction, yet if I don’t add them, the directories are not created in the LXC container. I’ve copied those from a working OpenMediaVault LXC container which does manage to read attached USB hard drives.
– Even though the directories are now present in the LXC container, the w_scan2 utility finds no adapter (yes, tvheadend is stopped). Tvheadend does not find any adapter either when the service is started.