In this article I will show you how to install tvheadend in Debian LXC container on Turris 1.x and on Turris Omnia
Why do you want to use LXC container and why I will show you how to install in it? That's a good question! Answer for this question you can find here: https://www.turris.cz/doc/en/public/lxc_for_beginners
apt-get install git dpkg-dev debhelper pkg-config gettext libavahi-client-dev libssl-dev zlib1g-dev libcurl4-gnutls-dev liburiparser-dev python curl cmake dvb-apps libavfilter-dev libpcre2-dev libpcre3-dev libx264-dev libx265-dev libvpx-dev libopus-dev ffmpeg lib libdvbcsa-dev python-requests
apt-get install git dpkg-dev debhelper pkg-config gettext libavahi-client-dev libssl-dev zlib1g-dev wget libcurl4-gnutls-dev liburiparser-dev python curl cmake dvb-apps libpcre2-dev libpcre3-dev python-requests
Now you will need to download TVHeadend from Github repository.
git clone https://github.com/tvheadend/tvheadend.git
We will use script: Autobuild.sh, which is the easiest way how to compile and install TVHeadend.
If you want compile TVHeadend with some parameter or parameters, now it's the time:
In my case I compiled it with parameter “-enable-dvben50221”, which adds direct support for HW CAMs
Turris 1.x (it's necessary to install it with parameter –disable-ffmpeg_static):
Omnia (I couldn't make it to compile it with H.265/HEVC. Hopefully soon I will find way how to install it with it):
AUTOBUILD_CONFIGURE_EXTRA=--disable-libx265\ --disable-libx265_static\ --disable-libvpx\ --disable-libvpx_static ./Autobuild.sh
If you want to compile it w/o parameter or parameters, you can do it, but I need to warn you. Some errors can appears and unfortunately you will need to use Google to help you or you can beg someone to help you.
It will take around 10 minutes to be done.
You should see these rows, if everything is OK.
doozer-versioned-artifact:/root/tvheadend/../tvheadend-dbg_4.3-596~gdae932241_powerpcspe.deb:deb:application/x-deb:tvheadend-dbg_4.3-596~gdae932241_powerpcspe.deb doozer-versioned-artifact:/root/tvheadend/../tvheadend_4.3-596~gdae932241_powerpcspe.deb:deb:application/x-deb:tvheadend_4.3-596~gdae932241_powerpcspe.deb doozer-versioned-artifact:/root/tvheadend/../tvheadend_4.3-596~gdae932241_powerpcspe.changes:changes:text/plain:tvheadend_4.3-596~gdae932241_powerpcspe.changes
doozer-versioned-artifact:/root/tvheadend/../tvheadend-dbg_4.3-596~gdae932241_armhf.deb:deb:application/x-deb:tvheadend-dbg_4.3-596~gdae932241_powerpcspe.deb doozer-versioned-artifact:/root/tvheadend/../tvheadend_4.3-596~gdae932241_armhf.deb:deb:application/x-deb:tvheadend_4.3-596~gdae932241_powerpcspe.deb doozer-versioned-artifact:/root/tvheadend/../tvheadend_4.3-596~gdae932241_powerpcspe.changes:changes:text/plain:tvheadend_4.3-596~gdae932241_armhf.changes
From above output you will need to take this name for:
Turris 1.x: tvheadend_4.3-596~gdae932241_powerpcspe.deb
(in your case there will be different numbers, so pay attention to it and replace it with your numbers) and you need to install it otherwise you can't install file, which doesn't exist.
cd dpkg -i tvheadend_4.3-596~gdae932241_powerpcspe.deb
cd dpkg -i tvheadend_4.3-596~gdae932241_armhf.deb
During the install you would be ask to create account of superuser. This superuser account can not be modified from within TVHeadend itself! If you want to change it, you need to reconfigure the Debian package with this command sudo dpkg-reconfigure tvheadend or you can reinstall TVHeadend.
Password aren't not shown even they're filled.
Install should be done and now you can visit
web administration here and use wizard: http://IPaddressofLXCcontainer:9981
When you will login as first time you will see settings wizard. Use it. If you don't see your tuner in 3rd step. There's something wrong and you will need to locate LXC config file and add there few lines.
file config (should be in this path
/mnt/disk/lxc-containers/debian if you did it exactly same as I wrote it in this article: https://www.turris.cz/doc/cs/public/lxc - sorry it's in Czech for now. Hopefully I will translate it soon) and you need to add these rows:
lxc.group.devices.allow = c 212:* rwm lxc.mount.entry = /dev/dvb dev/dvb none bind,optional,create=dir lxc.mount.entry = /dev/bus/usb/001 dev/bus/usb/001 none bind,optional,create=dir
Turris Omnia: it should be in
/path/of/your/lxc-container and you should add these rows.
lxc.group.devices.allow = c 188:* rwm lxc.mount.entry = /dev/dvb dev/dvb none bind,optional,create=dir lxc.mount.entry = /dev/bus/usb/001 dev/bus/usb/001 none bind,optional,create=dir
If it doesn't help, then please go to bottom of this article and contact author of this article.
If you don't want TVHeadend, you can remove it by:
apt-get remove tvheadend
Do you know how to improve TVHeadend or do you want help?
Go to the channel #hts on IRC Freenode server, where you can share your ideas and ask for help. Btw IRC is not live support, so please be patient or you can request features on their website: https://tvheadend.org
If you notice some grammar mistake here or you didn't understand something. Please let me know privately on Turris forum - Pepe and I will try to improve my article.