The never final, always subject to revision article on how to build a Satellite TV PVR distribution system using Tvheadend


I’ve wanted to write an article to help new users set up a working PVR backend system for our peculiar type of North American free-to-air satellite for quite some time, but have never felt as though I had the all the pieces to do it right. I finally decided that the only way it would ever get written is if I start it, and then add to it as I remember things I had to do, or find out new things I should have done. Therefore, this article should probably never be considered finished – there is always the chance that I will edit it or add to it. And if you leave a comment on the article, I just might incorporate your comments into one of the edits.

First of all, I should probably explain why you would want to build a Satellite TV PVR distribution system using Tvheadend. And actually, it’s probably easier to explain why you wouldn’t want to do this. You probably would not want to do this if:

  • You have a very limited budget for satellite TV and don’t want to invest in any new equipment.
  • You have, or plan to purchase, a standalone satellite TV receiver that will receive all the satellite channels you’d like to receive.
  • You don’t care about recording shows, or your satellite TV receiver gives you a reliable way to record shows.
  • You never want to watch live TV or recordings on any TV’s or devices except for the TV directly connected to your satellite receiver.
  • You never have scheduling conflicts where you cannot watch or record a show you’d like to see because your receiver’s tuner is already in use.
  • You don’t have multiple dishes, or you do have more than one dish but a simple DiSEqC and/or tone switch meets your needs for connecting your dishes.
  • You either don’t care about the types of signals that some find difficult to receive, such as 4:2:2 or 16APSK, or your satellite receiver allows you to receive such signals.
  • Your receiver gives you a reliable way to schedule shows you want to record, and doesn’t make you wish you had a better guide (or any guide at all) to use when scheduling recordings.
  • If you use a regular TV antenna for local channels, your receiver also allows you to watch or record shows from those channels, or you have another way to record shows from those channels.
  • You are under the impression that this type of system will let you pirate signals from subscription satellite TV services. It won’t, particularly in North America. This is only for unencrypted free and legal satellite TV.

If the first item on the above list is true, then you probably should stop reading now. Building a backend system for satellite TV doesn’t need to be super expensive, particularly if you have a local source for gently used desktop computers that are new enough to have PCIe card slots (note the “e”, the older PCI slots won’t work), and there are compromises you can make to bring the cost even lower, but if you are living paycheck to paycheck then this might be a major expenditure for you. The one advantage of standalone free-to-air (FTA) satellite receivers is that they are dirt cheap nowadays, although that usually also means the quality is not that high. But at those prices (sometimes less than $50) you could try a few and still come out ahead.

Otherwise, if any of the other items on the above list is NOT true for you, then you probably will want to read on.

While writing this article I have made the assumption that the reader already has some experience with C-band and/or Ku-band satellite TV, and already has one or more satellite dishes and a satellite TV receiver. Therefore, I will not be explaining some of the essentials of setting up a satellite dish, peaking the dish and LNB for best reception, etc. It would be my recommendation that even if you know you want to do what is described in this article, you at least start out with a cheap standalone free-to-air (FTA) satellite receiver and get your feet wet with that. It is much more difficult to set up and tune a new dish for peak reception if you don’t have a FTA receiver available, so you can see if you’re getting a good signal from your dish(es).


I need to cover this early because there is still a lot of confusion about this. For those of you used to computers and networking, you can think of the backend as roughly analogous to a server, and the frontend as roughly analogous to a client. A better way to describe this is as follows, but please keep in mind that these are generalizations and that certain specific setups may not fit into the mold I am about to describe.

As I wrote in the article, What is the best backend software to use for a Free-To-Air satellite TV system?,

If you use a program like Kodi to watch live or recorded television, you’re probably already familiar with the backend/fronted model. To put is simply, the backend is a server that communicates with the tuners, such as a tuner card or USB-connected tuner, or even a network tuner such as a HDHomeRun. The backend system can sit anywhere on the local network and communicates with one or many frontends. The backend handles streaming live programming, or recording it for viewing at a later time. In contrast, the frontend is run on a computer that often connects to a television set via a HDMI cable. It displays live or recorded programming, and usually gives the user a way to schedule programs for recording and perform some other administrative tasks. Some tasks can be performed from either the backend or frontend, some from the backend only, and some from the frontend only. But generally speaking, the frontend is what the user most commonly interacts with after the initial configuration is finished.

But remember, it is the backend that performs the crucial task of communicating with the tuners, which includes sending any control commands that might be necessary. So, for example, if you have any switches (DiSEqC or 22kHz tone) between the tuner and your LNB’s, the backend will control them. If you have a USALS or DiSEqC controlled motor, the backend will need to deal with that as well.


Note that it is usually possible to run a backend and a frontend on the same computer – you don’t need two computers for the purpose, and if the backend computer has a HDMI output and is in a location close enough to your TV that you can connect a HDMI cable between the two, there’s generally no reason not to run a frontend program on the same system as the backend. Some software installers set up a backend and frontend by default.

In other words, the backend is the “brains” of your setup. The client software, which for most users is Kodi, interacts with the backend. This article is NOT about the client software, however. The only thing I will say here about Kodi is that you should NEVER buy a small box that comes pre-loaded with Kodi at a county fair or from someone on Craigslist, or in some equally questionable situation where the seller can take your money and disappear. These boxes are typically sold with a number of piracy addons included, most of which are unsupported and some of which can be a security risk for that system and for others on your local network. The mere use of those addons can also make you guilty of copyright infringement, which could cause you to incur legal fees or financial penalties, or could get your Internet service shut off. Just because you might know someone who uses such a box and hasn’t yet had any of those issues doesn’t mean it won’t happen to you. The Kodi developers hate these boxes because they say it gives the Kodi project a bad name; of course it must also be said that a few of the Kodi developers are perfectly capable of giving the Kodi project a bad name without any outside help, but that’s a whole other discussion. It’s okay to use a small, inexpensive box for Kodi, but it should be one on which YOU install the operating system (Windows or Ubuntu Linux, for example) and where YOU install Kodi, and and you do NOT install addons from any dicey repositories, or for that matter addons from any source other than the official Kodi repositories.

Most users have only one backend system (in this case it will be the system running Tvheadend), but will have one or more frontend systems, only one of which may be on the same computer as the backend. A frontend system can be a dedicated computer connected to a television receiver, in which case it’s sometimes referred to as a HTPC (Home Theater PC), or simply the Kodi software running on a general purpose computer, a tablet computer, or possibly even a phone. Kodi runs on many different platforms, so it’s possible to have many different types of frontend systems. And that’s all I will say about frontends for the moment.


There are many possible choices here, but I recommend a standard desktop style computer that contains a motherboard with at least three or four PCIe card slots (again, note the “e”, the older PCI slots aren’t compatible with the newer PCIe cards). You only need one PCIe card slot for each PCIe card you will install, but once you get your first tuner card working successfully there’s at least a chance you will want more sooner or later. Speaking of which, you will need one or more DVB-S2 tuner cards. In North America, if you don’t want to import cards directly from overseas, your choices are for tuner cards are somewhat limited, and you will probably wind up using the ones made by TBS Technologies, only because they are the most readily available.

Let me once again quote from my earlier article (the same one I quoted from above):

Also, you need to be aware of the limitations of various tuners. Some older DVB-S tuners cannot receive DVB-S2 signals, and some DVB-S2 cards cannot receive 16APSK signals (if you really want to receive one of the handful of 16APSK signals on North American satellites, and you are considering the purchase of a TBS tuner card, it is strongly recommended that you purchase one of the “professional” grade models). Some tuner brands do not support their tuners with updated drivers, meaning that people may recommend you use some unofficial driver from a questionable source. Or, if you want to use more than one tuner card from the same manufacturer or of the same model in the same backend system, you may find that’s impossible because the driver programmers apparently never anticipated that someone might like their tuners enough to want to buy a second one (I guess that lets you know what they think of their product). The may be certain tuner models that will not work at all under Linux (you can find lists of DVB-S2 tuners known to work in Linux by following the links on this page, but just because a particular tuner isn’t mentioned does not necessarily mean it won’t work – it may just be that no one ever bothered to add it to the page). Problems caused by tuners or by tuner drivers will likely affect any backend software you might choose to use.

With TBS tuner cards in particular, you need to be careful that they are not sharing interrupts (IRQs) with other hardware devices in your system. Also, if you have a newer model TBS card and find that it will not scan muxes to find channels, try this. If you find that many of your recordings have bad timing information, and it’s not due to a weak signal, it is sometimes possible to fix that by changing a setting in Tvheadend.

If you start asking around about which tuner you should purchase, please keep in mind that the “Linux snobs” (the type that will only point you to man pages and Google when you need help) may prefer a particular piece of hardware, but only because they’ve had enough Linux experience to work around any issues they encounter. Just because they could get a particular tuner to sing and dance doesn’t mean that you can, unless you have a similar level of Linux experience. If you ask in a Linux forum which tuner is best, and make a purchasing decision based on the responses you receive, and you are relatively inexperienced with Linux (or you are simply not a Linux devotee), there is a real good chance that you that you will not be happy with your purchase. One tip, no matter how much they may be recommended by a particular user or group of users, avoid older PCI cards – any tuner cards you purchase now should be PCIe (note the “e”) cards.

Unfortunately, not all PCIe tuner cards are compatible with all motherboards. I’ve had good luck with a MSI motherboard (specifically the model B85M-G43, although I’m sure many other models will work equally well), but when I had tried using the same tuner card in a particular Gigabyte motherboard it would not work. A real Linux expert perhaps could have figured out the reason why, but since I’m not a Linux expert it was a lot easier to just try a different motherboard. Had I known about this thread in the TBS forum, I might have tried the suggestion there to see if I could get it to work.

There are also USB-connected external tuners, and while some users have had no problems using these, several others have reported problems with overheating leading to premature failure. Also, with certain USB-connected tuners there is an extra step of installing firmware, in addition to the drivers, at least when using Linux as the operating system. I’ve never used a USB-connected tuner, but if you decide to try one, I’d at least keep it in a well-ventilated place.

If you want to build a reliable system, I definitely recommend a desktop computer that will accept the PCIe cards. If you choose to “cheap out” and use something smaller, at least please be sure it does not have an ARM-based processor. You can get Tvheadend to run on such systems, but certain things will be more difficult than they should be, and you may also find you have more bad recordings and other weird issues. Note that you don’t need a high-powered gaming computer to run Tvheadend, in fact most of what Tvheadend does will not put much stress on the CPU(s). An older standard desktop model will probably work just fine, as long as it has the PCIe card slots. The computer must be capable of running Linux, so generally speaking, that leaves out boxes that run Android only.

Although there may have been some custom builds of Tvheadend for specific smaller devices, I recommend that new users avoid them. Once you have built your first Tvheadend system and see how it works, then you’re ready for the challenge of installing it on something smaller and with fewer resources, if that’s what floats your boat. But when starting out, you don’t need any additional challenges. Remember, a system that works fine for terrestrial television may not be at all suitable for free-to-air satellite TV reception, due to the difficulty of installing drivers required by the tuner cards, or the difficulty of installing and running additional software required to get program guide data.

At the time I am writing this I suggest using TBS tuner cards. The “consumer grade” ones are fine for most transponders but if you are going to try to receive anything in 16APSK or 32APSK format, I strongly recommend going with a “professional grade” card (this will also be true if you are going to try receiving C-band signals on a 6-foot or smaller dish). Each card will have between one and four tuners, and unless you are restricted in some way as to the number of dishes you can have on your property, you might want to think about getting a quad (four) tuner model. You may find that even four tuners aren’t enough, but if you can afford it I’d at least start out with a quad tuner card. If money is no object, I’d start with the TBS6908 Professional DVB-S2 Quad Tuner PCIe Card. When paired with a 10 foot (or larger) dish and a good LNB you should be able to receive just about any unencrypted service up there. However, many users will opt for a less expensive “consumer grade” model, and that’s fine, just don’t expect great results on “difficult” signals such as 16APSK or 32APSK signals.

Beware of satellite dealers that have old stock they are trying to sell. In some cases the older cards work perfectly fine, but may not receive newer formats (a card that only receives DVB-S, and not DVB-S2 is nearly worthless nowadays). In other cases the cards may be dogs that no one would buy because they never worked that well, or ONLY worked well for extreme Linux geeks that dream in code and talk in a language that you or I would only understand about 10% of, at best. The sort of people who can write their own drivers for tuner cards, in other words. Such people can make some of the more obscure tuner cards sing and dance, figuratively speaking, but their preferred choice for tuner cards may not be the best choice for you if, like most of us, you intend to use the stock drivers provided with the device. I hate saying anything bad about these guys, because I’m sure they are extremely intelligent, but they should probably never give advice to us mere mortals on which tuner cards to buy, because we just want something that works without a lot of fuss, and we don’t want to have to rewrite the tuner driver or poke around in the bowels of Linux to make a tuner card work!

Speaking of tuner card drivers, if you are somewhat more of a Linux expert than I (which isn’t exactly a high standard, since I struggle with Linux), you should be aware that TBS DVB-S2 tuner users may now be able to use open source drivers.


In order to install Tvheadend you will first need to install the Linux operating system. If you don’t plan on using the same computer for both your backend and frontend, I suggest using Ubuntu Server. You do not need a desktop on your backend server. However, if you also want to install Kodi on the same computer, then install regular Ubuntu. In either case you should install a Long-Term Support (LTS) release, so you’re not forced to upgrade the software prematurely.

If you are using TBS tuner cards, I have found it necessary to do this after installing Ubuntu, in order to avoid serious errors while building the drivers (at least this was true under Ubuntu 14.04):

sudo apt-get update
sudo apt-get install linux-headers-`uname -r`
sudo apt-get install make gcc

I’m not sure whether it’s still necessary to do this under Ubuntu 16.04, though it probably couldn’t hurt. Even after that, you may see warnings and other notices while the TBS drivers are compiling, but usually they will still work.

One thing I would like to warn you about is that there are distributions out there called “OpenElec” or “LibreElec.” I most emphatically DO NOT recommend these, unless you simply must have the absolute easiest installation, and you don’t care about the fact that you won’t be able to get to a Linux command prompt easily. And before you say you don’t care about that, please understand there will be consequences, such as not being easily able to get program guide data (and that is doubly true if you also ignored my advice not to use an ARM-based processor). Quoting Robert Cameron in the Tvheadend forum:

… And if you do decide to go with a PVR, for everyone’s sake please ditch LibreELEC: it is a poor excuse for a proper OS and will cause you nothing but problems trying to work around its limitations (such as inability to easily upgrade core components, like a current and proper build of Tvheadend).

If you are installing something for a senior citizen that knows absolutely nothing about computers, doesn’t want to know anything about them, will just accept any limitations they encounter because they don’t know any better, AND you won’t be around to help them at all, then maybe you can make a case for using one of the “-Elec” distributions, but please don’t come crying when you are frustrated as hell because you can’t do anything in Linux. Please use a LTS build of Ubuntu Server or Ubuntu Desktop if you don’t like dealing with problems.

Assuming you have followed the manufacturer’s instructions while installing your tuner card, you will probably find that you need to install drivers for your tuner, and they should have given you the driver software or shown you where to get it online. Once again I will quote from my earlier article:

One downside of using any Linux-based backend is that you may need to install drivers, either to get your tuner to work at all, or to get it to work at peak efficiency. And if you are used to installing drivers in Windows, where it’s more or less a point-and-click type of operation, you may find that the procedure for doing it under Linux is a bit off-putting. For certain tuner brands, it is not very difficult if you can follow instructions (for example, this page explains how to do a TBS driver install under Ubuntu 11.10, 12.04, 12.10 and 13.04 (TBS6921 and other)). But not everyone finds it easy; sometimes there are entire forum threads about driver installation. If you’ve never touched Linux before in your life, then you may want to seek help from an experienced Linux user. Make sure you watch how it’s done and take notes, because you will likely need to do it again if you ever upgrade the Linux kernel on your system (and Ubuntu loves to push kernel updates every so often, so don’t just blindly accept a software update 10 minutes before you have something scheduled to record!). This bash script can help simplify the task of rebuilding the TBS drivers after a kernel update.

Note that the bash script mentioned in the previous paragraph is for building the standard closed-source TBS tuner drivers. If you choose to use the open source drivers, you’re probably enough of a Linux expert to know how to rebuild them without needing a script (but if you happen to find one, please let me know in the comments!).

After you have installed the drivers and rebooted the system, you can discover whether your tuner cards are being recognized by the operating system by using either or both of these two commands:

dmesg | grep -i dvb
ls -l /dev/dvb

If you have installed TBS Tuner cards, before you go any further please read these articles, which will help you avoid some pitfalls down the road:

At the very least, TBS card owners should read the first article in the above list now, and keep the others in mind for future reference.

Also, if you are using a version of Ubuntu newer than 14.04, it may have come with the package unattended-upgrades installed by default.  With the default settings, this package will install certain types of updates automatically, including Linux kernel updates.  The problem with that is that if you have received a kernel update and then reboot the system for any reason, and you have not reinstalled the TBS drivers since the update was installed, it will use the new kernel and you will not have any tuners available (so you will not be able to view channels, and scheduled recordings might be missed).  And if you ssh into the system it will print *** System restart required *** in your terminal window, which might cause you to reboot the system without thinking about the fact that you then need to reinstall the drivers.  To avoid this problem, you may wish to disable unattended upgrades.  The easiest way to do this is to edit the file /etc/apt/apt.conf.d/50unattended-upgrades and comment out the lines that are allowing the upgrades, such as these:

// “${distro_id}:${distro_codename}”;
// “${distro_id}:${distro_codename}-security”;
// “${distro_id}ESM:${distro_codename}”;

If any of these lines do not have the // characters at the start, place them there and save the file. Note you will probably need to use sudo to edit this file, for example sudo nano /etc/apt/apt.conf.d/50unattended-upgrades. See this page for more information on disabling unattended upgrades, though I do not recommend the “Method Three” shown there.

Once you have installed the tuner drivers and verified that the operating system can detect them, it is time to install Tvheadend. Before we go any further, I should point out that Tvheadend is an evolving program, and as with many programs, when newer versions are released, configuration options may change, and often new options are added. In most cases, if you see a new option and you don’t know what it’s for, you can safely leave it at the default setting. While writing this article I am using Tvheadend 4.0.9, which is the current stable version. There have long been rumors of an upcoming 4.2 release, but it hasn’t happened yet and when it is released, it will probably be some time before I get around to installing it. When it does appear, I’m sure the interface will be changed up in some ways. I have heard, for example, that there will be a configuration wizard that will make configuration easier. While I hope that’s true, I have my doubts about it including a setup for North American free-to-air satellite channels. My guess is that we in North America will need to skip the wizard, and use the manual configuration as I will explain here. I hope I’m wrong about that; it would be great if this process were easier.

The installation instructions for installing Tvheadend under Ubuntu are here. You will need to choose a repository, and I suggest either the “stable” or “unstable” repositories. In the case of Tvheadend, “unstable” isn’t all that unstable, compared to what that means in some other software projects. Many people run the unstable version to get the latest software improvements, but that is entirely up to you. If you have very little familiarity with Linux, then it’s probably best to stick to the stable version. I am currently running the stable version (4.0.9) as I write this.


There are many videos and web pages on configuring Tvheadend, and many of them will confuse you more than help you, especially if it’s your first exposure to Tvheadend. That is because they were either based on old versions of Tvheadend, which had a somewhat different interface, or because they assume that Tvheadend is running on an OpenElec or LibreElec system, which as mentioned above is not recommended. Or, they may have been intended for terrestrial TV viewers, which has a slightly different configuration, or for the European version of free-to-air satellite, which is different in many ways from what we have in North America (for a decent explanation of the differences, there is a Wikipedia article on Free-To-Air – just skip to the section on North America and read that entire section).

Setting up Tvheadend for the North American style of Free-To-Air satellite is in some ways similar to configuring it for over-the-air reception using an ATSC tuner, but there are some important differences. In most cases setup will be a lot more manual because you will need to enter in the details for each satellite and each transponder manually.

There are a couple of terms that Tvheadend uses that may confuse you during configuration. One is “Networks”, and the other is “Muxes”. These easiest way to think about these is as follows:

A “Network” in most cases will be associated with a single satellite, whether you have one or more LNB’s (or LNB outputs, in the case of dual or quad output LNB’s) receiving from that satellite. So for example, if you have two dishes and one is pointed at Galaxy 19 and the other at AMC 21, you would make two networks and call them “Galaxy 19” or “G19”, and “AMC 21” or just “A21”. The name is not important, so use something meaningful to you, and in most cases that will be the satellite name. You could also use positions, such as “97W” and “125W”. The point is, the word “Network” has nothing to do with what we think of as a television network, instead it is all the sources that have the same transponders available. So, if for some reason you have two dishes aimed at the same satellite and they could receive the same channels, those would be under the same “Network”. On the other hand, if you have a moveable dish, you could have several “Networks” associated with that dish. This will become more clear as we look at the configuration.

A “Mux”, when associated with free-to-air satellite, is the same thing as a transponder, which (if you’re not too nit-picky) is the same thing as a specific frequency allocation on a satellite. When a Mux is created and scanned, it should show all the active services (TV, radio, and data channels) available on the transponder, which will be on a specific frequency on the satellite. To use a specific example, as I write this, on AMC 21, Ku band, there is a transponder, or “Mux” in Tvheadend terminology, at 12180 V that contains several PBS channels. In that case, you can think of all the channels on the 12180 frequency as the “Mux”. When used in relation to terrestrial TV, a “Mux” is a single physical channel on a specific frequency, which may have several virtual channels. So whether on satellite or terrestrial TV, a “Mux” is a single frequency that may contain one or more TV and/or radio channels. In Europe things can get a bit more confusing, because they can duplicate transponders across multiple satellites, but we don’t see that here in North America.

I should also mention tuners. Generally speaking it is best to have one tuner input on your backend for each LNB output you have out on a dish. But if some satellites are infrequently viewed, it would be wasteful to dedicate a single tuner to the LNB associated with that satellite. Tvheadend does support the use of 4-input DiSEqC switches, at least with TBS tuner cards. As far as I can tell, even though Tvheadend supposedly supports them, either Tvheadend or the TBS cards, I’m not sure which, have some problem controlling 22kHz tone switches. I didn’t spend much time trying to make them work, since DiSEqC switches are relatively inexpensive.

If you have a card or cards with multiple tuners (for example, if you obtained a quad tuner card), then I would suggest using fixed rather than moveable dishes if your situation allows. While Tvheadend can in theory control a dish positioner motor, I’ve not yet seen it work in practice, and I’ve never personally attempted to do it. But feel free to try; if you can get it to work, please leave a comment and let us know what you had to do. The same goes for using any type of switch other than a standard 4-input DiSEqC switch. Remember that even if Tvheadend is capable of sending the correct signals to a switch, it is also up to the tuner card and its drivers to make sure the switching signal gets sent, so what works in one installation might not work in another if different tuner cards or drivers are used.

Note that you can buy LNB’s with dual (or, more rarely, quad) outputs. By hooking each output of a LNB to a separate tuner input (either directly or through a DiSEqC switch), you can watch or record shows from different transponders (or muxes, as Tvheadend calls them) on the same satellite at the same time. Note that you can watch or record as many simultaneous channels as you like from the same transponder (mux), because the LNB and tuner card can receive a full transponder stream, and Tvheadend breaks out the channels as necessary. It’s only when you want to watch or record from two different transponders (a.k.a. muxes, a.k.a. frequencies) on the same satellite that you’d need multiple LNB outputs connected to different tuner inputs.

The more dishes, LNB outputs, and tuner inputs you have available, the more likely it is that you’ll be able to avoid scheduling conflicts, where you want to watch or record a show, but no free tuner is available because all the tuners associated with that dish are already in use.


Once Tvheadend is installed, you access its configuration pages via a web browser. The address will be port 9981 at the backend’s IP address, so if for example the backend is at you’d use in your browser’s address bar to access Tvheadend’s web interface. If Tvheadend is running on the same machine you’re using, then you can use to access it.

You will see tabs across the top of the page, and the first place you will want to go is the Configuration tab. Click on that and it will expose a new row of tabs. You need to understand this about Tvheadend, it does not expose options until a previous selection indicates you need them. So if, right after installation, you were to try to discover where you configure a DiSEqC switch, you’ll never find it because you haven’t indicated to Tvheadend that you have a DiSEqC switch, therefore it will not show you that option.

In the second row of tabs, choose DVB Inputs. This will expose a third row, which is where most of the initial configuration will be done. First, choose the TV adapters tab. You should see a list of your available tuners. If you don’t, something is probably wrong – either your tuner card is not being detected by Linux, or you don’t have the correct drivers properly installed. You will need to resolve that before continuing on. Note that if you ever come here and the tuners have disappeared, it probably means you applied a Linux kernel update and forgot to rebuild the tuner card drivers. Just rebuild and reinstall the drivers, and all should be fine again (we hope).

Now go to the Networks tab. Create one network for each UNIQUE tuner input. In other words, if you have four satellite dishes and each has a single-output LNB and your are feeding all four LNB’s into discrete tuner inputs, then you will want to have four networks. If you have two satellite dishes and each has a dual-output LNB and you are feeding all four LNB outputs into discrete tuner inputs, you will only need two networks, because two of your tuners can receive duplicate programming. To possibly simplify this, if none of your satellite dishes are moveable (or if you always leave your moveable dishes parked on the same satellite) then you need to create one network for each satellite you can receive, and that’s probably a good rule to follow even if one or more of your dishes are moveable. Also, C and Ku band LNB’s should be on separate networks, and if you receive both the C and Ku bands from the same satellite, use different network names to reflect that (you could add “-C” or “-Ku” to the name).

To create a network, click the Add button, then in the window that appears select DVB-S Network in the dropdown (don’t worry if it’s DVB-S2, in this window DVB-S covers it).
Adding a DVB-S networkIn the next window that appears, give the network a name (again, I recommend you give it the name of the satellite, or the orbital position, whichever works for you, with the “-C or “-Ku” suffix if you receive both) and UNCHECK “Network Discovery”. Leave everything else at the default for now. Then click “Create”. Repeat as necessary for each unique tuner input/satellite you can receive.

Add a DVB-S networkYou may have noticed during the Network creation process that you could have selected a pre-defined mux. You could do that, but I don’t recommend it because pre-defined mux lists are often inaccurate, and sometimes don’t distinguish between C-band and Ku-band. So if you try to use those in North America, you will likely wind up with a list of outdated or inaccurate muxes and will wind up having to delete them manually. It’s your system; you can try the pre-defined mux setting if you like, but don’t say I didn’t warn you. You may also have noticed that you can select an orbital position, but you would only need to do that if you were going to try to control a moveable dish. For a fixed-position dish, it matters not whether you select anything there.

When you have configured your networks, go back to the TV adapters tab. This is where things get a little tricky. The first thing I will say is that you need to enable each tuner by checking the “Enabled” checkbox associated with each tuner as shown in the following screenshot, and also you need to click “Save” each time you make a configuration change (I can’t tell you how many times I have forgotten to click “Save”, and then wondered why something wasn’t working). Also, most configuration pages will have settings that don’t need to be changed, in which case leaving them at the defaults is fine.

At this point I’m going to quote from a previous article that covers this topic, but please note that the images are from a slightly older version of Tvheadend, so may not correspond exactly to what you’ll see. In some cases you’ll see additional options or settings, but this covers the ones you need to change:

There are a few things that North American users should be aware of. For one thing, Tvheadend assumes you’ll be using a Universal LNB, which is not something used all that often in this part of the world. Here, you are much more likely to be using a standard (Ku band) LNB, or even a C band LNB. But when you are setting up the TV adapters, you won’t find an option for those. The trick is that you need to select “Advanced” in the SatConfig dropdown, then save it, and then you will notice that in the left hand menu tree, additional options are exposed. This is how Tvheadend seems to work; it doesn’t show you options that are not applicable to your existing configuration, so as you make the configuration more complex, more options are exposed.

TV Adapters settingsSo once you have selected the Advanced setting and clicked Save, you can expand the tree view an additional level and click on Advanced, where you will select the number of orbital positions that each tuner has access to, which is 1 if you are connecting a tuner directly to an LNB. If you are connecting to a 4 port DiSEqC then it’s 4, as shown here:Orbital Postions settingAfter you save that, then you can configure settings for each of your orbital positions, including LNB type. In North America you will probably want to select either “C-band” or “Circular 10750”. You would use the latter for any standard Ku band LNB that has a LO Frequency of 10750 MHz, even if it’s not circularly polarized. Keep in mind that this type of software (or at least the satellite tuning portion) is much more widely used in Europe and other places outside North America, and they are much more likely to be using a circularly polarized LNB than we are here.

I’m going to interrupt my quoting here to note a few things. First, just to show how much some screens can change between versions, the above screenshot was from a 3.9 version of Tvheadend. By the time we got to version 4.0.9. that “Parameters” section on the right hand side had expanded to include many more options (mostly to support moveable dishes, or so it appears) but at this point you would likely still only need to set the number of orbital positions. After you get things working on a single satellite, then if you have a moveable dish you can come back and try to configure those settings: Baby steps, as the saying goes:

New Advanced ParametersAlso, when looking at the screenshot below, the setting for Ku in North America is now “Ku 10750” rather than “Circular 10750”. And, please note the “Name” and “Networks” dropdowns in the screenshot below. I find it easiest to use the satellite name in the Name field, and then select the network corresponding with the satellite that will be received by this tuner and switch combination. So in my configuration, which does not include any moveable dishes, the “Name” and “Networks” are always the same. However, if I were trying to control a moveable dish, I would likely select a “Name” associated with the dish (such as “C-Band moveable”) and then under “Networks” select all the networks (satellites) that dish is capable of receiving. Also for a moveable dish, I’d need to select a “Rotor Type”, which for most users would probably be “USALS”. Again, please bear in mind I have never tried to use a moveable dish with Tvheadend, so the parts about the moveable dish are just conjecture on my part. Continuing on with the quote…

Tvheadend Orbital Position Settings showing C-Band LNB and Generic switch type selectedIf you are using a standard DiSEqC and/or 22 kHz tone switch, then select “Generic” for the switch type. For a four port DiSEqC switch, you would use the “Committed” dropdown and select the port there. Tvheadend uses AA, AB, BA, BB port descriptors, which correspond to DiSEqC switch ports 1, 2, 3, and 4 respectively. I had no problem using a standard 4 port DiSEqC switch (well, except that it turned out that the brand new DiSEqC switch had a bad port 4, but that’s obviously not the fault of Tvheadend or the tuner). In the screenshot below, DiSEqC port 2 (AB) is selected. Settings for any types of switches you don’t have should just be left at the default settings.

Tvheadend Generic Switch Settings showing showing DiSEqC port 2 (AB) selectedOne other consideration for North America is that it is extremely rare for the free-to-air signals to include Electronic Program Guide data. Therefore, it would be a good idea to go to Configuration | Channel / EPG | EPG Grabber and in the Over-The-Air Grabbers section, uncheck all the grabber selections. None of those will work in North America anyway, so there’s no sense burning up CPU cycles checking for EPG data that will never appear. I will have a bit more to say about getting EPG data later in this article.

Disable the Over-The-Air GrabbersI have updated the above screenshot because in addition to disabling all the grabbers, you also want to make sure that the “Force initial EPG scan at startup” box is unchecked and that all the “Over-the-air Cron multi-line” entries are removed or commented out. It’s probably worth emphasizing that Tvheadend was designed primarily for use in other parts of the world, where commercial free-to-air services are available. We don’t have anything at all like that in North America, so there are many parts of the Tvheadend interface that simply aren’t applicable to us. An example is the “CAs” tab in the above screenshot; there is no reason to ever go into that tab here in North America.

After you get your tuner(s) configured and enabled, you will want to try creating a mux and scanning it. To do this, find a reference that shows available satellite channels, such as Sathint, or check in your favorite satellite forum. Let’s say you wanted to add the PBS channels on AMC-21. You could first go to Sathint’s North & South America page and select AMC-21. On that page you would find that the main PBS feeds are on 12180 V, that the symbol rate is 30000, that the FEC is 3/4 and if you mouse over the little arrow just to the right of “3/4” you will see that it is a DVB-S2, 8PSK signal.

Sathint exampleThis is the information you will need to create a mux. Note that both the frequency and the symbol rate in such listings are expressed in short form, in other words they should rightly read 12180000 and 30000000. Many receivers and software programs will accept the shorthand version, but Tvheadend does not.

So to create a mux, click the Muxes tab, then click the Add button. A window will pop up asking you to pick a network, in this case you’d pick AMC-21 or 125W, assuming you followed my advice to name the network after the satellite. After picking the network, you will then see the following window which should be filled in as shown here:
Sample MUX settingsYou want to check the “Enabled” box. Set the EPG Scan to “Disable” because North American channels do not contain EPG data, so why make all your hardware search continuously for something that will never be found? Set the Scan Status to PEND because you want it to scan the mux to find channels. Set the Delivery System to DVBS2 because it is a DVB-S2 mux. Set the Frequency to 12180000 and the Symbol Rate to 30000000; don’t forget the extra three zeroes at the end or it won’t work. The “Polarisation” (U.K./Canadian spelling there!) is Vertical, so pick V. The modulation is 8PSK, which Tvheadend presents as PSK/8 for some reason. The FEC is 3/4. The Rolloff can almost always be left set to AUTO. The other settings can be left at the defaults.

Try not to use AUTO for any setting other than Rolloff; Tvheadend is not very good at auto-detecting settings, particularly with 8PSK and higher signals. With QPSK signals it will often detect the FEC if you leave that set to AUTO, but if you know the FEC it’s always better to put it in. But, please be aware that data you find online isn’t always accurate; on a few occasions I’ve found channel listings containing incorrect FEC information.

Note: This guide was written using Tvheadend 4.0.9, but if you are setting up Tvheadend 4.2 or later there are some new checkboxes you need to know about, that you can only see if you are using the “Expert” view level.  The screenshot below shows an unconfigured mux, but does show the locations of the new checkboxes.  In North America you are probably going to need to check both of these.  If you don’t, some or all services on a mux may not scan in, or later on when you attempt to watch a channel on that mux, you may get “No input source available for subscription” errors or other errors.

UNCONFIGURED Add Mux screen showing new checkboxes in Tvheadend 4.2

When you click “Create” it should create the Mux and then if all goes well, a few seconds later it will start scanning the Mux to find channels. Watch the two columns labelled “Scan Status” and “Scan Result”, when the “Scan Status” returns to “IDLE” and the “Scan Result” is OK, that means it has successfully scanned the transponder. If it actually found any services (potential channels), the number found will be listed in the “# Services” column.

If, instead of OK, you see the word FAIL for the scan result, that means either the mux or the tuner were not configured properly, or the tuner didn’t detect any signal (or the signal strength was too low). Or it could be a timeout issue – if you are using a TBS card, see Tvheadend users, if your TBS card will not scan muxes to find channels, try this. Remember that satellite signals can come and go without any advance warning, and in particular remember that transponders that are active on weekdays sometimes are taken down on the weekends. If your first attempt to scan a mux is a failure, just try another. If you also have a satellite receiver, temporarily connect it to the dish and make sure the transponder you’re trying to receive is actually there.

Assuming the mux scanned correctly, go to the Services page and you should see the newly-scanned services. You might want to sort the list by Mux to find them easily, if other muxes have been previously scanned.
Example Services pageThere is one thing that is set by default that really should be changed in North America, but before I go into that I want to point out something in the above screenshot. Note at the lower right-hand corner of the screenshot there is a small button with two caret symbols (^) on it. If you click that, it will open a debugging window at the bottom of the screen that shows you what Tvheadend is doing in the background. For example, if you open that window before you scan a mux for channels, it will show you which tuner it’s using and other information that could possibly be useful in determining why a scan fails. If you open it while importing program guide data, it will show you statistics on what it’s imported and whether it encountered any problems. This can be quite useful when you are trying to diagnose a problem.

But getting back to the problem, in the Automatic Checking column in the above screenshot, note that it says “Auto Check Enabled”. What this means is that every so often, Tvheadend will check for the service presence, in other words, it will look to see if that service is still there. If it’s not found, this field will change to “Missing In PAT/SDT” and then you won’t be able to tune it in or watch it, because Tvheadend believes it no longer exists. The problem in North America is that services can disappear for a time, for any of several reasons. One is that some feed channels (channels that send feeds of smaller network or syndicated programs) often stop uplinking to their transponders on weekends, to save energy when nothing’s being transmitted. Another very common one, especially in Canada and the northern United States, is a huge snowstorm that dumps so much snow on the dish that reception is severely impeded. And, if you use a moveable dish, you will of course have no service from the satellites the dish isn’t pointed at. This type of check may make sense in sunny Spain, but not in North America. Fortunately this check can be disabled for any or all services, but unfortunately it’s a pain in the ass to do it because you have to do it for each individual service.

There are two ways to disable this check, and I will tell you about both of them because this is common to other parts of the Tvheadend interface. The first is to highlight a service and click Edit. A window will pop up and you can pick “Auto Check Disabled” from the dropdown. This is also how you can undo the “Missing in PAT/SDT” designation if it somehow gets set. Make the change and click Save, then repeat for each service that has Auto Check Enabled.
Setting Auto Check to DisabledThe second method is on the services page itself, you can click or double-click on the words “Auto Check Enabled” and a dropdown should appear right there, with the same options shown in the dropdown above. Select “Auto Check Disabled” and then (this is important) click SOMEWHERE ELSE in the window to make the dropdown disappear (this could be a double click on the next item you want to change). A small red triangle will appear next to the changed item; this means it is a pending change that has not yet been saved! You can work your way down the list of “Auto Check Enabled” services and change each to “Auto Check Disabled” but after the last item make sure you click somewhere else to make the dropdown go away and the small red triangle appear., Then, BEFORE YOU LEAVE THE PAGE, click the “Save” button (which is just above the “Play” column heading on the left hand side of the screen). The page should reload and all the red triangles should have disappeared. Only now are your changes saved! If you forget and leave the page before clicking Save, you get to make all the changes over again. I wish there were a way to make “Auto Check Disabled” the default, because I do not want Tvheadend making the decision that a service is no longer available and locking it out. In North America, that’s generally a really bad idea!

The two methods of making configuration changes that I have mentioned above work on several of the pages in Tvheadend, but you always have to remember to click Save before leaving or refreshing a window or page, otherwise your changes will be lost!

Once you have disabled all the Auto Checks, what you want to do next is map the valid services to Channels. You can always delete a channel you don’t want later, so if in doubt it doesn’t hurt to map it. Sometimes the Service ID numbers and/or the Service Names will give you some clue as to which are viewable channels, but if you like you can just try mapping all the services. Highlight the ones you want, in the same way you’d highlight files for copying in your computer’s file browser. When you have highlighted one or more services, the “Map All” button shown in the screenshot above will change to “Map Selected”. So when you have highlighted the ones you want, click on “Map Selected”, and you’ll then see a popup window that looks like this:

Map services optionsIn most cases you’ll simply click the Map button. Most of the other options would make more sense in other parts of the world, but will only cause problems if you use them in North America. The one exception to that is the “Include encrypted services” option. Once in a great while a satellite channel will be marked as encrypted when it really isn’t. If you see something that indicates you should be able to receive a channel, but it’s indicated as being Encrypted in the services list, you can try checking the “Include encrypted services” box to map the channel anyway.

To see the channels that have been successfully mapped, go to the Channel/EPG tab (in the second row of tabs) and select the Channels tab in the bottom row. You should see a list of all the channels that have been successfully mapped. You can highlight any channel and use the Delete button to delete any channel you don’t want (this does not delete the service in the services list, only the mapped channel) and you can use the Edit button to edit the data for channels. In most cases you will want to edit channels you plan to watch regularly. As was the case with changing the Auto Check settings in Services, there are two ways to do this, but probably the best way when you are first starting out is to highlight a channel and then press the Edit button. You will see a dialog box that looks something like this:

Edit channel windowBefore editing the channel, though, you may want to try actually viewing it using your frontend software. If you are using Kodi, you will need to enable and configure the Tvheadend PVR addon first. Go to this page and skip down to section 5, “Connecting Kodi to Tvheadend” and follow the instructions there. After you do that, go to the TV settings (System-Settings-TV) and in the General section make sure “Synchronise channel groups with backend(s)” and “Use channel order from backends” are selected (you will have to set the “Settings Level” to “Advanced” or “Expert” to check and, if necessary, change those options). If you have an older version of Kodi, you may have to go to the “Live TV” section and make sure it is enabled; but that no longer seems to be necessary in the latest versions of Kodi.

Once you have configured the PVR addon you can go to TV in Kodi’s main menu, and under Channels you should see your newly added channels. They may have strange names at this point, but you should try watching each, first to see if there is really a channel there, and second to try to determine which channel it is. Sometimes you will know from online listings which channels are which, but in other cases the only way to know is by watching for a while and looking for a channel identifier.

In the above image, we have shown the Edit channel dialog for PBS “HD01”, which you might determine is an eastern time zone feed for PBS. So for now, we can make the following edits to the channel. The most important at this point are the channel name and number.

The channel name should ideally be one that identifies the channel, in this case “PBS East” would be a good choice. The channel number should be any non-zero number; it will be used to order the channels in Kodi. The numbers do not have to be contiguous; it’s perfectly okay to group channels into blocks of numbers and leave some unused channel numbers in between, but you should try not to leave any enabled channel un-numbered or duplicate any channel numbers. Neither Tvheadend nor Kodi will complain if you do, but channels may not be in the order you expect if you do that.

The “EPG Source” field will be very important when you are setting up your program guide, but you probably aren’t ready to deal with that quite yet. You’ll most likely want to first get all your muxes and channels entered.

There is a field for a “User Icon”. There are two places you can store channel icons, one is in Tvheadend and the other is on the frontend systems where Kodi is being run. In my opinion it is better to store them on the frontend systems. I tried doing it in Tvheadend and had some weird issues as a result, such as Kodi freezing up when I attempted to exit the program. Such issues may or may not have been fixed in newer versions of Tvheadend and/or Kodi. In any case, you don’t need to add channel icons right now. When you are ready to do so, my suggestion is that you store them on the frontends running Kodi and then go to Kodi’s TV settings (System-Settings-TV) and in the Menu/OSD section, set the “Folder with channel icons” to the path where your channel icons are stored. But feel free to try doing it in Tvheadend if you like; if it works for you and doesn’t cause any problems then use that if you prefer.

In some places in Tvheadend you may see a reference to “picons” – these are small, generally low resolution channel icons that often appear blurry in Kodi. In Europe and other parts of the world people often download archives of picons that correspond to the channels available from their satellite provider. Kodi doesn’t care what size icon you use; if it is too small it will upscale it and it will look bad, whereas if it is too large Kodi will reduce it to fit and it will be very clear. Therefore, if you have a choice between a large icon or a small one, larger is often better (within reason – you don’t need one that fills half the screen on your computer’s display). Since we don’t have packages of “picons” corresponding to the channels available on North American C- and Ku-band satellite, and since I wouldn’t touch them if we did, I suggest you use your favorite search engine’s image search feature to find channel logos. You can also try LyngSat Logo, but be careful because some of their logos are too small to display clearly in parts of Kodi. Another thing to beware of is logos that don’t contrast well with Kodi’s dark background. If you have any experience with programs like Photoshop or The Gimp, you will probably find yourself wanting to modify a few logos slightly to make them look better in Kodi.

One additional point about storing the icons in Kodi is that they should be in PNG format, and should be named exactly the same as the channel name you gave the channel in the “Edit Channel” window. So for example, if you you have an icon for PBS East, it should be named PBS East.png. Yes, that means you will need to duplicate icons if you use the same icon for more than one channel (for example, even if you use the same icon for PBS East and PBS West, you’ll need two files, PBS East.png and PBS West.png). I would guess that icons in JPEG format (with a .jpg extension) might also work, but I have never tried it because I don’t care for JPEG artifacts.

Enough about icons. One other thing you may wish to do, which might help your frontend systems work a little easier, in in Tvheadend’s configuration select the Configuration tab on the top row of tabs, then the Stream tab on the second row, and the Stream Profiles tab on the third row. Then select the “pass” (MPEG-TS Pass-through) stream profile. Make sure all the checkboxes are checked next to these items:

  • Rewrite PMT:
  • Rewrite PAT:
  • Rewrite SDT:
  • Rewrite EIT:

The result should look something like this:

Pass-through stream profileThe reason for doing this is when you are streaming a channel to your frontend, with these boxes checked it will only send information about that specific channel, and not about all the channels in the MUX (if there is more than one). When information about multiple channels is sent, it might confuse your frontend, resulting in no video or audio. The only reason for not checking all these boxes would be if Tvheadend is running on a very underpowered system, which it probably isn’t if you followed my advice to use a desktop computer system when installing Tvheadend. It does take a little bit of CPU power to do these rewrites, but generally speaking, not enough that you’d ever notice.


Once you have configured Tvheadend, and have added all your muxes and channels, you will probably want to have the EPG populated so you can schedule programs to record. In North America, there is a company that offers paid schedule listings, and occasionally some of their proponents stoop to implying that it is somehow illegal or immoral to get program listings for free. It is neither, as long as you are using them for your own personal use (disclaimer: I am not an attorney, and I am not giving you legal advice). No one has ever gotten in trouble for using free listings in Tvheadend, and I would be shocked beyond belief if anyone ever does. Honestly, it pisses me off when a company or their supporters attempt to imply that you are a bad person for not purchasing their product, when you know their only reason for saying that is because they want to make money.

At this writing the easiest way to get free EPG listings for the USA and Canada is to use a program called zap2xml. That link takes you to a page of instructions for setup and use under Windows or Linux, and download links. You will probably want to run the Linux version on your backend system. Some time back I created an article containing additional hints and instructions, titled Some hints for getting free-to-air satellite channels into the Electronic Program Guide in Kodi (or another frontend). That article was not my best work; it’s been edited a few times and I may completely rewrite it some day, but if you are having problems figuring out how to use zap2xml or how to get Tvheadend to use the generated listings, that article may give you the clues you need to make it work.

Some other guides out there may mention a program called mc2xml. This program used Microsoft’s listing service, and several months ago Microsoft made some changes that rendered mc2xml inoperable. At that time, many users switched to zap2xml. The only problem some users have with zap2xml is that it is a Perl script, and therefore your system must have Perl installed. Ubuntu includes Perl in its operating system. However, if you ignored my advice above and decided to use a machine with an ARM-based processor, or if you are running one of the distributions ending in -Elec rather than Ubuntu, you may find that Perl isn’t installed and there’s no way to install it, or that there is no way to run a Perl script. Or, you may find that the tv-grab-file script used by Tvheadend won’t run because you don’t have the Bash shell installed, which is another thing that’s installed with Ubuntu. Or, you might discover you have no way to set up a cron job to get your schedule data automatically in the middle of the night. It’s usually possible to work around these issues one way or another, with considerable effort, but if you are not running Ubuntu you will likely find that setting up the EPG is a much more difficult process.


Occasionally you may want to tune in a channel that requires “special handling”. For example, one major U.S. provider uses six discrete audio channels to send 5.1 audio, and no standalone satellite receivers can decode it properly. But Tvheadend can, with a little coaxing. See the article, Fixing the audio on live TV from a certain network (which shall remain nameless) in Tvheadend for information.

Also, if you are using low-powered computers for your frontend systems, they may not be capable of playing back certain high-bitrate channels in real time. However, you can record shows from such channels, and play them back on equipment with more CPU power (such as your desktop computer), or you can convert the recording to a format that has lower CPU/GPU requirements for playback. Here’s an example of the latter approach: How to play video recorded from high-bitrate 4:2:2 sources on low-power systems


If you have a TV Antenna, I will just mention two ways you can add over the air channels to your backend. One is to use a tuner card that picks up ATSC Channels (be sure it receives ATSC, and not DVB-T or some other format that’s not used in most of North America) such as a TBS6704 ATSC/Clear QAM Quad Tuner PCIe Card. That card’s tuners should appear in your tuner list, just like any other tuner.

Another option is to use a HDHomeRun device, such as a HDHomeRun Dual (model HDHR3-US or possibly the newer model HDHR4-2US, also known as the HDHomeRun CONNECT). These have two independent ATSC tuners, which can be fed from the same antenna using a splitter, or from two different antennas, which may be useful as explained in the next paragraph. However, buying a HDHomeRun can be confusing because there are several models, and not all of them will work for this application. Also, Silicon Dust (the makers of the HDHomeRun) are now trying to push users toward their DVR product, so I don’t know if newer models will work as well with Tvheadend. The HDHomeRun Dual connects to your antenna(s) and also to your local network via an Ethernet jack. It can therefore be placed near where the antenna’s cable enters the house, as long as there’s an Internet connection and a power source there, and after a reboot Tvheadend will probably just find it on the network and show it in its tuner list, assuming you are using a recent version of Tvheadend.

Note that if you search on the Internet you will find several older guides that will tell you that you need to install extra software, such as drivers, to use a HDHomeRun device with Tvheadend. That may have been true at one time, but it no longer appears to be necessary to install any additional software if you are using Ubuntu 14.04 and Tvheadend 4.0.9 or newer.

You only need to set up one ATSC network for over-the-air channels, unless you have multiple antennas pointing in different directions, feeding different tuner inputs. For example, if you are in between two major cities and receive strong signals from both, you could put up two TV antennas, each pointed at a different city’s transmitters, and feed each antenna into a different tuner input. You would then create two ATSC networks in Tvheadend, so that Tvheadend could select which antenna to use for the best reception on any channel.


If you keep in mind that much of the information out there regarding Tvheadend is geared toward users in the Eastern hemisphere, and that settings that are useful in other parts of the world don’t apply to us in North America, then you may find reading the official documentation for Tvheadend helpful. It will tell you about some features of the program that I haven’t covered here. Probably the best place to start is the Tvheadend Wiki and the Tvheadend User Guide.


Please leave a comment if you spot any errors or omissions, or have anything useful to add!


A few Linux utilities that are useful for manipulating XMLTV schedule files

In my previous article, Some hints for getting free-to-air satellite channels into the Electronic Program Guide in Kodi or XBMC (or another frontend), I mentioned that schedule “grabber” programs save their files in XMLTV File format. So let’s say you have one or more XMLTV type files, but you want to do some additional manipulation on them before feeding them to your backend software.  Here are a few tools that run under Linux that I have found that may be useful, under certain circumstances.  These are in addition to zap2xml, which I mentioned in my previous article.

NOTE:  To find out if you have a particular program installed on your system, try entering the word which followed by a space and the program name at a Linux command prompt.  If the program is installed on your system, it should show you the path to the file.  Note that you will probably need to use the full path and filename if you are attempting to run the program from a shell script or a cron job!

  • tv_cat – Concatenate XMLTV listings files. The man page description says, “Read one or more XMLTV files and write a file to standard ouput whose programmes are the concatenation of the programmes in the input files, and whose channels are the union of the channels in the input files.”  Or in simple terms, it merges XMLTV format files together.  This program may already be on your backend system but if it’s not, you can typically install it on a Ubuntu/Debian-based system (and possibly in some other Linux distros) by installing the xmltv package.  tv_cat is a bit picky about the format of the files it will combine, so check the output carefully to make sure it is including all the channels.  I had some issues using tv_cat with TVHeadEnd, and wound up using a small quick-and-dirty Perl script to combine XMLTV listings files instead.
  • sed – Stream EDitor. This is a utility built into just about EVERY Unix/Linux system out there, and it’s probably available for Windows in some form also. sed is more or less a one-trick pony – it searches for text and replaces it with something else.  You can use it to resolve duplicate channel ID’s in two different XMLTV files by changing them in one of the files, using a command of the form sed -i ‘s/original text/replacement text/’ filename but note that there are some potential “gotchas”, so read the documentation first.  For example, if either the search or replace string contains a / character, it mush be “escaped” with a backward slash, so as not to be confused with the / delimiter character.  So if, for example, your search or replace string included the closing tag </display-name> you’d use <\/display-name> instead. (EDIT: You can also change the delimiter character to avoid this issue – see the first comment below).

    I will note that there are some “purists” out there that will say that you should never use sed to manipulate an XML file, even though it’s easy and (if you are careful to use unique strings that don’t appear anyplace that you don’t want to change) fairly foolproof, so I suppose I had better mention a tool that is specifically intended for manipulating XML files…

  • xmlstarlet – command line XML toolkit. According to the description, “XMLStarlet is a set of command line utilities (tools) which can be used to transform, query, validate, and edit XML documents and files using simple set of shell commands in similar way it is done for plain text files using UNIX grep, sed, awk, diff, patch, join, etc commands.” This is another one that you will likely find in your Linux distribution’s repository, at least if you are running a version of Ubuntu or Debian.  This one offers you a lot more flexibility in manipulating XML files, but at the expense of being somewhat more complicated to use.

Since xmlstarlet is a bit difficult for some users to wrap their heads around, I will give here some actual examples of how it could be used on an XMLTV format file, but please note that I am no expert with this so if you have a different proposed usage, please try to figure it out for yourself using the handy documentation, available as a web page or in PDF format.  No offense, but better you should spend a couple hours trying to figure out the correct syntax to achieve whatever results you want than me! 🙂

1. Remove all “Local Programming” entries from an XMLTV file named xmltv.xml and save to newfile.xml:
xmlstarlet ed --delete "//programme[title='Local Programming']" xmltv.xml >newfile.xml
2. Same as above but only for one specific channel:
xmlstarlet ed --delete "//programme[title='Local Programming'][@channel='']" xmltv.xml >newfile.xml
3. To change the value of @channel wherever it appears in the file:
xmlstarlet ed -u "//programme[@channel='']/@channel" -v '' xmltv.xml
4. To extract all entries for a specific channel to a separate file (non-destructive – does not change the original file):
xmlstarlet sel -t -m "//programme[@channel='']" -c . -n oldfile.xml >newfile.xml

Note that I am not saying that any of the above are the best example of how to do something.  As you can see, especially from the last example given, this program has some rather non-intuitive syntax for its command line arguments (to put it mildly).  If you have any additional – or better – examples of using xmlstarlet to manipulate XMLTV files, please leave them in a comment and I will consider adding them here.

That said, if you need to do an operation on an XMLTV file and don’t want to write a program or script to do it yourself, xmlstarlet could be your salvation – IF you can figure out how to use it!

Some hints for getting free-to-air satellite channels into the Electronic Program Guide in Kodi (or another frontend)

If you are running a satellite backend system such as Tvheadend or MediaPortal (or MythTV, if you are one of the lucky few that can actually get it to work), and you use Kodi or the MythTV frontend, then it is possible to populate the schedule grid with listings from many sources. Note I did not say that it is easy, just that it is possible. The key is to use an external program such as zap2xml (Zap2it TV listings to XMLTV or XTVD .xml). These are commonly referred to as “schedule grabbers”, or just “grabber” programs.

The real trick is figuring out how to use one of those programs. Typically they are used to grab listings for a single over-the-air market, not a hodgepodge of stations and services from various locations. Such programs will create a xml file that contains schedule listings (in Tvheadend it will typically be at /home/hts/.xmltv/tv_grab_file.xmltv, assuming that “hts” is the Tvheadend username on your system), and that file will have all the over-the-air channels in your area, or all the cable or satellite channels from your provider. If you want to use zap2xml and you’ve never set it up before, I’ll give you some setup hints later in this article. But for now, lets assume that you have it all set up and you know how to create an xml file (named /home/hts/.xmltv/tv_grab_file.xmltv) containing your local listings.

Once you have created the xml file, it can be imported into the Tvheadend, MediaPortal, or MythTV database. To import it into Tvheadend, you need to use a file called tv-grab-file, which must be downloaded and moved into the /usr/bin directory on the system running Tvheadend (be sure to make it executable, since it is a bash script). Also, you may need to edit the line in the script that starts with “cat” and contains the path to the tv_grab_file.xmltv file, to specify the correct path and file name of the file produced by your selected grabber program, if it isn’t being saved as /home/hts/.xmltv/tv_grab_file.xmltv. Note that if the tv_grab_file.xmltv file is not owned by the Tvheadend user, it must at least be made readable by Tvheadend – incorrect permissions and/or ownership on this file will make it inaccessible to Tvheadend.

Once you have done that, you tell Tvheadend to use the tv_grab_file script by going to Configuration | Channel / EPG | EPG Grabber page. First, if any grabbers are enabled in the “Over-the-air Grabbers” section, disable them by unchecking the boxes next to them. Then, in the “Internal Grabber” section, select “XMLTV: tv_grab_file …” in the dropdown (you may need to restart Tvheadend or reboot the system before it will appear – if it still doesn’t appear, check the ownership and permissions of the file, it should be the same as the other tv_grab_* files in the /usr/bin directory – owned by root, and executable by all users). This is how it looked in previous versions of Tvheadend:
Tvheadend Internal Grabber SettingsIn the newest versions of Tvheadend you can actually schedule the Internal Grabber to import the listings at a specific time each day. Here I have set it to run at 2:33 AM every day (after commenting out the default):

NEW Tvheadend Internal Grabber settings

Note that in the newest versions of Tvheadend (even more recent than what is shown in the above screenshots), the grabber settings have been broken up into three tabs, labelled “EPG Grabber Channels”, “EPG Grabber”, and “EPG Grabber Modules”, but you may not be be able to see all of the grabber settings until you do this: Click on the Configuration tab, then the General tab, then the Base tab, and then in the “User interface level” setting choose “Expert” from the dropdown. Then click “Save” (directly under the “Base” tab). Now you should be able to see all the EPG Grabber settings. In this new interface, you select the grabber in the “EPG Grabber Modules” tab, and all of the grabbers listed there should be disabled (orange dot at start of line) except for “Internal XMLTV: tv_grab_file is a simple grabber …”, which should have a green dot at the start of the line (click on any dots that are the wring color to change them, then don’t forget to click the “Save” button). And, you set the time you want the grabber to run in the “Over-the-air grabbers” section of the “EPG Grabber” tab. I will spare you my usual rant about developers making changes in the user interface that make things more confusing for users, but suffice it to say that it appears that every new version of Tvheadend changes the user interface in significant ways, so you may have to look around a bit to find these settings.

After you get the schedule grabber working, all you need to do set up a cron job or scheduled task to run your listings grabber (the zap2xml program, or whatever you use) once a day. Then if you have the newer version of Tvheadend as shown above, set it up to import the listings ten minutes after you have run the listings grabber (you could probably get by with a shorter interval, but why rush it – you want to make sure the listings grabber has completed its task before Tvheadend grabs the resulting file).

NOTE: There are some people that find that for whatever reason, they cannot run the tv_grab_file script. This most often happens on systems or devices where bash is not installed (to determine whether that is the case, enter which bash at a Linux command prompt and if bash is installed it will display the path, typically /bin/bash). In such a case it may be possible to use a modified tv_grab_file script. For example, in my Review of the TBS MOI+, I showed a variation of that script that runs under ash (as provided in BusyBox), since the original bash script won’t work in that environment. But if you can’t do it that way, there’s another method that involves using xmltv.sock, which is discussed in this thread on the Kodi forum. The advantage of doing it that way is that your new listings can be imported into Tvheadend immediately after you’ve obtained them, but the disadvantage is that most people find it harder to get that method to work, and the use of tv_grab_file is definitely easier to explain. If you do use xmltv.sock then you must go to the External Interfaces section of the page shown above, and check the box for the XMLTV module (not shown in the screenshots).

Note that after Tvheadend imports NEW channels, you MUST refresh the browser window before the new channels will appear in the EPG Source dropdowns under the Configuration | Channel / EPG | Channels tab. You may even need to close and re-open your browser. Failure to do this is probably the #1 reason people think Tvheadend has not imported the newly-added channels. You must select an EPG source for each channel before schedule data for that channel will be read into Tvheadend, which will happen on the next scheduled import of the TV schedule data.

NOTE: You can force an unscheduled read of TV schedule data in the newest versions of Tvheadend by clicking the “Re-run Internal EPG Grabbers” button under the Configuration | Channel / EPG | EPG Grabber tab. If you have an older version of Tvheadend that doesn’t have that button, you can accomplish the same thing by temporarily setting the Internal Grabber Module to “No grabber”, clicking the “Save Configuration” link, then changing the Internal Grabber Module back to “XMLTV: tv_grab_file …” and clicking the “Save Configuration” link again.

When you are setting up your listings sources (channels) on whatever TV listings service you plan to use, if you don’t know which providers or stations carry a specific channel, you can look it up on Wikipedia, which will often tell you which providers and/or local stations carry that channel.

There are some national services that I will not name here, but that aren’t listed in the channel listings because they aren’t intended for viewing by home viewers. You need to get creative with those. For example, if you just happen to find a feed of the QXZ network, and you are smart enough to not blab about it all over creation so that the signal gets scrambled, you may be able to get listing data for at least prime time by grabbing the listings for the network owned “flagship” station in your time zone, which might be WQXZ on the east coast or KQXZ on the west coast. Of course the QXZ network is totally fictitious, but hopefully you get the idea.

If you spend a little time studying the XMLTV File format, you can even write your own scripts or programs to create “fake” XMLTV data for certain stations – I suppose you could even do it manually if you are a very patient and precise person.

There is one pitfall to all this, which was actually more of a problem with a grabber program that’s no longer useful due to changes in the underlying service, but I’ll mention it anyway just in case you ever run across it. The various schedule sources sometimes change channel ID numbers without any advance warning, particularly when you are grabbing terrestrial (over-the-air) channels. If you find that the schedule data for a particular channel “runs out” after a certain day, it’s probably because the ID numbers have changed. In Tvheadend, go to the Configuration | Channel / EPG | Channels tab, find the affected channel(s), and change the EPG Source using the dropdown – you will probably see both the old and new ID’s, usually one underneath the other. Uncheck the old one and check the new one, and the next time Tvheadend updates its EPG information, it should be okay (don’t forget to click the “Save” button before you leave the page!). By the way, in case you hadn’t figured it out from the previous paragraphs, that’s the place where you select the channel data to associate with a channel in the first place, but I will again note that if the EPG sources aren’t appearing in the dropdowns after Tvheadend has imported your xml file, then you may need to refresh the page, or close and re-open your browser.

EDIT: For those that have never set up zap2xml before, here is the general procedure. These are basically their instructions, but with some added comments to help clarify what needs to be done.

EDIT (January 2018): Unfortunately, Zap2it has changed the format of their web interface. The latest releases of zap2xml (dated 2018-01-10 and later) do still work with both Zap2it and TV Guide, but you will need to download the latest version, and be sure to read the 2018 release notes. The instructions have been changed to reflect the changes in the setup procedure. When using either Zap2it or TV Guide as your listings source, you definitely should set your favorite channels, but if using Zap2it you will want to note the new -8 option in the zap2xml release notes, while if using TV Guide I have found that favorites may not “take” on your first attempt to set them – once you log out and back in, they just might be gone, and you’ll just need to set them again and then log out and back in to see if they were really saved. The following instructions are for setting up zap2xml to use Zap2it’s listings, which I believe are slightly more accurate than TV Guide’s for non-prime time listings on certain channels..

1. Register your free account

2. Click Change Provider to select a lineup (select country and input zipcode)

3. Optionally select your favorite channels (click the channel stars or click “Find Channels” link) to limit channel output

4. You may need to install the required supporting perl libraries (not needed with the Par-Packed Windows file) – COMMENT: I’d try step 5 first before you go adding any perl libraries, as they may already be present.

5. Run zap2xml with the userEmail and password parameters of your account – COMMENT: Watch the output and see it complains about missing Perl libraries. If so, see step 4. Here is how you might invoke it, assuming that you are running Tvheadend and that your Tvheadend user is “hts”:

./ -u -p yourpassword -o /home/hts/.xmltv/tv_grab_file.xmltv -c cache -8 -F -T -q

(Leave off the -q while testing, because it may suppress error messages that you’ll want to see, and leave off the -8 if you have not set any favorites, since the -8 option tells zap2xml to only output favorite channels, such as those you would see when clicking on the “Starred” button in Zap2it). This assumes that you have created a directory named “cache” (as a subdirectory off the directory where the script is saved) and that you have either already created a file /home/hts/.xmltv/tv_grab_file.xmltv (can be a zero byte dummy file to start) and made it world writeable, or else that you are always going to run the script as the Tvheadend user, in order to avoid file permissions issues. Of course, you must create the /home/hts/.xmltv directory if it doesn’t already exist. The point is that when you run the script and it tries to create the /home/hts/.xmltv/tv_grab_file.xmltv file, you don’t want it to fail due to file permissions or ownership issues. You can read about the options shown above, and others you may wish to use, on the zap2xml home page (in particular, you may want to use something like -d 12 to get 12 days of listings instead of the default 7). NOTE: Should you happen to be running OpenElec or LibreElec, which I most emphatically DO NOT RECOMMEND, will not work for you, in part because you may find it difficult or impossible to get to a command line, but also because Perl is not available. There is an alternative for OpenElec/LibreElec that is written in Python, but I have absolutely no experience with it.

5. Optionally set up a cron job/task scheduler task to run it every day – COMMENT: Keep in mind that when setting up a cron job, you must use full paths, and not any shortcuts such as “.” or “~” in the path. The cron job or task should be scheduled to run a few minutes BEFORE Tvheadend’s Internal Grabber is scheduled to run. So if Tvheadend’s grabber is set to run at 2:43 A.M., you may want to run your cron job that invokes zap2xml at 2:28 A.M., giving it 15 minutes to finish (which is, generally speaking, more than ample time for it to run to completion). Please set it to run at some odd random time (in other words, not right on an hour, half hour, or quarter hour mark, and don’t use the example times in the previous sentence) so that everyone isn’t clogging up the servers at once.

(End of edit.)

I am painfully aware that there is nothing at all that is easy about this process, and it probably makes you wish that we had European-style free-to-air services, where EIT guide data is embedded right in the program stream (lucky Europeans!1). But since we don’t, I just wanted you to be aware that you don’t need to have a blank EPG in your Kodi Live TV section. There is definitely a learning curve to getting it all working, but the more you work with it the more you will understand how all the pieces fit together. You may never be able to get schedule data for every channel you can receive, and you’ll obviously never find it for “wild feeds” that come and go, but I’ve been able to populate the EPG grid for quite a few of the stations I’m able to receive on my dishes.

(By the way, if you want icons for the channels, at least in Kodi you have to load those to the frontend system – as far as I can tell, there’s no good way to put them in the Tvheadend backend server and have Kodi get them from there. So just create a directory, dump your channel icons there, rename them to EXACTLY match the channel names except for the extension – for example, if you have a channel named “Big Fart Channel”2 then the icon file name should be “Big Fart Channel.png”, or whatever the correct extension is – then in Kodi go to System | Live TV | Menu/OSD and modify the “Folder with channel icons” setting to point to the directory containing the icons. And yes, I’m aware that you can supposedly enter a path to a “User Icon” for each channel in TVheadend’s Configuration | Channel / EPG | Channels tab, but those are really intended to be the paths to “picons” supplied by TV channels in some other parts of the world. I’ve found that if you attempt to use those, more than likely you are going to slow down Kodi or cause some other undesirable effect, such as Kodi hanging when you attempt to quit Kodi. You are better off to store your channel icons on each of your devices that run Kodi.)

If you know of any software tools that would make this easier, or pick up any hints or tips that I have not mentioned, please feel free to post a comment (but be aware that I will not approve spam comments that promote commercial services. Also, I don’t need any praise – if you like this article, don’t tell me, tell your friends that have satellite dishes and that could possibly benefit from this information!).

Here are some possibly useful links:

zap2xml software and documentation.
tv-grab-file, a file used with Tvheadend to import xmltv format data
Zap2xml for ATSC in OpenELEC (Kodi forum thread)
Installing zap2it grabber in OpenELEC (YouTube Video)
Setup instructions and files for Synology NAS users (Tvheadend forum thread)
NextPVR – EPG Setup – XML/XMLTV EPG – Zap2it & Zap2xml (NextPVR forum thread)
Home DVR Tvheadend OTA EPG Setup (Part 2) (YouTube Video)

Note regarding the video in the previous link: It shows the basic setup, but using an older version of Tvheadend, and using the free version of the mc2xml listings grabber which stopped working in July, 2015. So, don’t use mc2xml, use zap2xml instead. Carefully read and follow the instructions at the top of that page on how to set up your Zap2it account, and also consider utilizing the tricks I mentioned earlier in this article.

If you found this article useful, you may like my followup article, A few Linux utilities that are useful for manipulating XMLTV schedule files.

1 Sure, the lucky Europeans get EIT guide data with their free-to-air channels, but at least we don’t have to pay a “telly tax” on each TV set we own, so there’s that!
2 Someone REALLY should start the “Big Fart Channel” – that would be a real gas! And with that, this article has really bottomed out. What do you mean, my puns stink?