Let's start with backend and frontend concept. We'll need both to watch TV. You can also think the backend as a server and the frontend as a client, but that's a slight simplification.
The backend will handle all the TV related activity, such as tuning the channels, managing recordings, handling the program guide (EPG) etc. The frontend is typically running on a device that will interact with the end user, ie. the person watching the TV. There can be several frontend connected to the same backend at the same time. The frontend will receive the video stream from the backend using IP transmission.
In our case, we run the backend and the frontend on the same OpenELEC machine. The backend is a software called Tvheadend and the frontend is a Tvheadend client in the XBMC. It's good to understand the relation between the frontend and the backend. The backend needs to work before there's even point to try to configure the frontend.
Before you can watch live TV, you will need to attach a working tuner to your HTPC. See the list of supported TV tuners here. The support for the tuner must exist in the operating system - the Tvheadend software itself does not need to support any specific tuner itself.
If your tuner is not listed, try anyway and let us know how does it work! There are also some unofficial OpenELEC builds that add support to alternative tuners - search the OE forums for links to those.
OpenELEC currently ships with Tvheadend 3.4 backend software. There are others available as well, but they're not covered by this article. You will need to enable the addon from the settings, so select
Settings -> Add-ons -> Services -> tvheadend and enable it.
It should be working now, but in case not, reboot the system first.
Now you need to know the IP address of your OpenELEC PC. Look at the OpenELEC settings to find that and open your browser on another PC on the same network and point it to address
Now you should configure the tuners.
If your tuner hardware is not detected or is having issues, check the last chapter for troubleshooting.
You will see a window like this. Now you will want to click on
Add DVB Network by location.
From the menus select your location and the type of signal you are trying to receive. In this example we're using a generic list for QAM, a US signal for cable TV. Then click
Add DVB Network at the bottom
Wait for the number under Muxes awaiting initial scan to reach zero. If the number under Services is also zero, then that means Tvheadend has not picked up any channels. You may need to check your hardware or if you've selected the right signal type (step 5)
Map DVB services to channels. You should now be able to pick up TV channels in XBMC once you configure the Tvheadend add-on configuration in the next section.
These steps and pictures were borrowed from XBMC Wiki.
Now the backend is done and you should have a list of channels visible in the backend. You can continue to the frontend configuration part.
Now the backend is ok, we need to install and configure the frontend. Go to
Settings -> Add-ons and find Tvheadend HTSP Client under PVR clients and then install/enable it.
The default settings should be fine.
Now go to
Settings -> Live TV -> Live TV Enabled. The front end will connect to the backend and retrieve a channel list - you should now be able to watch live TV through the XBMC menus. It may take a while before the EPG data is updated if it is provided with the DVB signal.
I cannot see my tuner in Tvheadend
Make sure that it is supported, we maintain a list of supported tuners here. If it is on the list, reboot the machine and try again. Sometimes the tuner requires more time to come online before Tvheadend starts. See the chapter below for help. If the tuner is not on the list of supported tuners, run the following commands after you've logged in with SSH:
lsusb -v | pastebinit (for USB tuners)
lspci -v -nn | pastebinit (for PCI tuners)
dmesg | pastebinit (for all tuners)
You should be able to see in the dmesg output that the driver for your tuner is loading if is supported. If you can see nothing there, it most likely is not supported by the Linux kernel used in your OpenELEC. New devices are constantly added to Linux, so it's good to check the Linux TV wiki here. You can also paste the links you got to the forum and ask for help.
Tvheadend starts too quickly
Sometimes it can happen that Tvheadend starts before the tuner drivers have started up. For Tvheadend to work correctly, the tuner should be usable already when Tvheadend starts. There is an option that delays the startup of Tvheadend until the drivers are loaded. In the Tvheadend settings
Settings -> Addons -> Installed -> Services -> Tvheadend -> Configure you have an option to wait for frontend initialization. Start by setting the amount of frontends to wait for to 1. If you have more than one tuner, you can increase the value if needed. Just keep in mind that if you configure OpenELEC to wait for a number of tuners and then suddenly you have not plugged in the amount of tuners configured here Tvheadend will not start!
Add DVB Network by locationmake sure you chose the correct location. You can also manually add the muxes to Tvheadend, but you need to know the frequencies. You can find out the frequencies usually online on the broadcasting company's website.
w_scanutility. You'll need to install it from the unofficial add-on repository, disable live TV (backend add-on especially) and reboot. After that, run on the command line the following:
w_scan -c <country_code> -f <Type>
w_scan -c FI -ft. For details how to run
w_scanon different kind of systems, check the examples here.
w_scanwill take a few minutes and go through the different frequencies and tries to find channels. You can then input the muxes that
w_scanfinds into Tvheadend.