Tvheadend versus MythTV
Recently, I took advantage of an unforeseen hardware problem to experiment with replacing one of the longest-running services on my home network: the MythTV service that records local broadcast television. The replacement I explored was Tvheadend (TVH), which provides a recording back-end and electronic program guide (EPG) but no dedicated playback front-end. For a number of reasons, TVH is easier to work with, although—for the time being—it does not boast quite as many features at MythTV.
To provide some background, the tuner hardware I use with MythTV is a pair of networked HDHomeRun devices. Each one is connected only to an antenna and they pick up only a handful of channels; there is no cable or satellite service in the mix. This puts my recording needs staunchly on the low end of the spectrum compared to other MythTV users, but such modest requirements do not make MythTV more cooperative to configure, use, or troubleshoot. When one of the HDHomeRun tuners started exhibiting flaky performance, I bought a replacement and decided to put the new device to the test with TVH—at least temporarily—just to gauge the difference.
MythTV has been around since 2002; it predates the digital-television transition and, thus, has a fair amount of technical debt to manage—stemming from the need to support analog tuners and encoders and due to the age of the codebase itself. TVH is much newer; it is focused specifically on supporting DVB and IP television (IPTV) services. Here in the United States, DVB is generally only found on free-to-air (FTA) satellite systems (DVB-S), while broadcast signals are sent in ATSC. Luckily, the HDHomeRun product line is the exception to TVH's DVB-centric focus (probably because the devices themselves are plug-and-play and the video formats are virtually identical MPEG-2 streams), so the devices let one record ATSC broadcasts.
Head on
I tested TVH version 4.0.8 running on an Ubuntu 14.04 machine—the same one running the MythTV backend. That older distribution choice is an artifact of using MythTV; MythTV updates have a nasty habit of breaking in subtle ways—to the point where users are usually advised to only run the service on long-term-support (LTS) releases. For deployment on a fresh system, TVH supports plenty of more recent distributions, as well as FreeBSD and Android.
The TVH installation process is simple enough; the installer prompts the user to create a username/password combination for use inside the application itself. Other users can be created after the fact, to separate configuration from recording privileges. The program runs as a single process (as the hts user) that exposes a web interface on http://localhost:9981 . There are also access control list (ACL) and key-based options available to further restrict access, although they are not enabled by default.
![Adding a network to Tvheadend [Tvheadend network
configuration]](https://static.lwn.net/images/2016/03-tvh-networks-sm.png)
System configuration is done entirely in the web interface. Notably, TVH uses a somewhat different nomenclature to describe the relationship between the available signals, program streams, and "channels" that one needs to enumerate. A "network" refers to a broadcast medium (e.g., over-the-air antenna, satellite provider, IPTV source, etc.); a "mux" refers to a tunable frequency that might carry one or more "services" (which constitute what most people call "channels" in the vernacular lingo). But TVH does automatically discover most of the available tuning hardware and, when told what "network" to associate with a tuner, it will automatically scan to pick up whatever "muxes" and "services" it can find. The intent of this complex model is to allow TVH to combine multiple signal sources (terrestrial, satellite, and broadcast) into a single channel map, glossing over a number of potential differences in how the components are labeled. Consulting the user guide is helpful, though, particularly for making sense out of all of the configuration minutiae.
![EPG display in Tvheadend [Tvheadend EPG]](https://static.lwn.net/images/2016/03-tvh-guide-sm.png)
After configuring program reception, the next most critical setup task is getting EPG information. In my test, this was TVH's weakest point by far. Although the program supports an array of EPG sources, none of them worked for over-the-air broadcast in the US. Worse, the relevant chapter in the manual is filled with empty sections and the forums are filled with frustrated users asking the same questions and getting no solutions. Eventually, I tracked down an external blog post that pointed toward a solution; sadly, the solution is an ugly workaround for what is (apparently) TVH's broken support for the XMLTV guide-data grabber. It seems, however, that users in DVB regions of the globe have a much easier time with this step.
With EPG data in place, one can schedule single or recurring recordings from within the web interface. The UI for doing so is not sophisticated; there is a long list of programs in a spreadsheet-style list (XMLTV grabs two weeks' worth of EPG data at a time) and one can search or filter it on a number of fields (episode titles, service, content tags, etc.). The giant list of programs is less user-friendly than the classic "TV Guide" grid, but at least the search and filter functions are easy to use—which cannot be said for MythTV, where searching and filtering features are split into several sections placed rather far apart from each other in the configuration-screen hierarchy.
![Scheduling a recording in Tvheadend [Scheduling Tvheadend recordings]](https://static.lwn.net/images/2016/03-tvh-record-sm.png)
As for recordings themselves, TVH does little to nothing with them after they are saved to disk; the intent is that users will access their content through another front-end like Kodi. On the plus side, this makes managing content easier in some respects: normal filesystem tools are all that one needs to track and delete files, or one can simply rely on the tools built into the front-end. In contrast, MythTV relies on a background process that schedules deletions using a lengthy list of overlapping criteria. TVH also allows complete freedom in where individual recordings are stored and how the files are named; MythTV provides neither feature.
The late night wars
Setup and configuration is the hardest part of using MythTV. For starters, MythTV's back-end process (which handles EPG and scheduling recordings) can only be configured through a GUI application, making it a poor fit for headless systems. More importantly, though, that configuration tool uses a mix of keyboard-only commands that are hard to discover and onscreen elements that can only be accessed with a mouse. Many of the settings must be altered by stepping sequentially through a lengthy series of screens (at times, ten or more).
And the interface itself is not the only awkward factor: tweaking MythTV's behavior is difficult. To give one brief example, the decision of which tuner should be used to record a particular program (e.g., to cope with one antenna receiving a signal stronger than another) involves at least six settings: the "priority" of the tuner/channel mapping, an "preferred input" setting attached to the recording rule, the "priority" setting of the recording rule, separate "priority" points assigned for HDTV and wide-screen broadcasts, and the order in which the tuners were initially configured during setup. How exactly they interact is one of the project's enduring mysteries.
On that type of issue, TVH is far ahead of the competition. The desired documentation is clearly missing in places, but setup is certainly simpler and better organized than MythTV's. That said, it is also possible that TVH's design seems friendlier to those who have experience with Unix systems, because it relies on several system services. The EPG grabber, for example, adds crontab entries to schedule updates, whereas MythTV runs a separate background daemon to fetch and update guide data. Which approach is "better" may be an opinion question, but crontab is far better documented.
The other vital factor to keep in mind if one is debating a move from MythTV to TVH is that TVH is still limited primarily to DVB recording hardware. In contrast, a great many MythTV users record programs from cable or satellite set-top boxes using external encoders like the Hauppauge HD-PVR. As near as I can tell, TVH does not support this hardware use case at all, though there are some potential workarounds if one is willing to write external scripts. And, to be fair, MythTV's support for these devices relies on its share of external workaround scripts, too—they simply ship with the code.
Stay tuned
As I alluded to in September, I have been trying to streamline and simplify the various services running throughout the house, and reports were that TVH would be less convoluted to use than MythTV. Based on a few days of testing, this appears to be the case when it comes to managing hardware and scheduling recordings, although TVH still falls short on EPG support for the region I live in.
According to the project, the upcoming 4.2 release will improve
support for the North American ATSC broadcast format—among
other things, adding the ability to extract embedded EPG information directly
from the broadcast stream. So it is a release that I plan to watch for.
Those users living in DVB regions of the world will probably have an
easier time getting TVH up and running; for those users, the program
offers substantial improvements over MythTV.
Posted Mar 3, 2016 13:14 UTC (Thu)
by gerdesj (subscriber, #5446)
[Link] (1 responses)
(backend) #export DISPLAY= *sigh*
Actually ssh and sshd take care of the DISPLAY bit but it still seems weird to run a remote X client these days. VNC could do the job but I don't want all the other X stuff on the backend, its bad enough as it is. It would be nice if mythweb could sprout a config frontend to mythtvsetup but I suspect that is quite a large job.
Posted Mar 3, 2016 15:17 UTC (Thu)
by n8willis (subscriber, #43041)
[Link]
Nate
Posted Mar 5, 2016 20:14 UTC (Sat)
by yodermk (subscriber, #3803)
[Link]
First, it seems like Linux's support for OTA tuners is .... poor. I don't know if I was doing something wrong, but with the same rooftop antenna, I'm able to get all the main local channels just fine on an old Panasonic DVD box and the Roamio, but with Linux and a Hauppauge WinTV 2255 (internal PCI card, the replacement for the 2250) and a 950 (USB stick) I could at most get a couple of the main channels, and the signal broke up after a few minutes. It was the same on my laptop with the 950.
And MythTV itself confused the heck out of me. I'm obviously a pretty decent Linux user, having used it almost exclusively since 1998, but there were numerous parts of MythTV where I was lost, and the Arch Linux wiki (normally awesome) seemed quite out of date.
Maybe someday ...
Posted Mar 10, 2016 23:50 UTC (Thu)
by ras (subscriber, #33059)
[Link] (1 responses)
Since then at least in Australia other alternatives have emerged. We have BeyonWiz. The first version would have been a difficult choice, but for the 2nd version they rewrote it in Python, run it on OpenWrt, made the entire thing open source with a copy left licence, hosted it on github, and regularly accepted patches from people with itches. The security setup sucks as everybody has root access, but since you have root you can fix it - or do anything else you want with the box.
The hardware is proprietary of course, as selling it is where they make their money. But it's cheaper than setting up your own white box do only that job and of course infinitely easier - except for the securing it bit. But most importantly, it has a UI the whole family can use without help from me.
Given all the gloom and doom I regularly hear about how companies hate copy left licences and how hard it is to enforce compliance, this is a stellar example of the reverse - a company adopting a copyleft licence by choice, and it working out well for them.
Posted Mar 11, 2016 19:26 UTC (Fri)
by Klavs (guest, #10563)
[Link]
Tvheadend versus MythTV
(laptop on wifi) #xhost + *sigh*
(backend) #mythtvsetup *press keys carefully and slowly*
Tvheadend versus MythTV
Tvheadend versus MythTV
Tvheadend versus MythTV
Tvheadend versus MythTV