UPDATE, December 2010: In June, I bought a new 1.5 TB external hard drive in order to back everything up and do a fresh install. After backup, I installed Ubuntu 10.04. This is long-term support release, so I was hoping it would help with the stability of my MythTV box. All went well. 10.04 fixed the only major problem I had previously been having (as detailed below): the remote. Previously, every update or security fix to the kernel screwed the remote and meant I had to reinstall the firmware. It got to the point where firmware re-installs made no difference and the remote wasn’t working at all. 10.04 has solved this completely by including the firmware for this TV card (and hence the remote) in the distro as a proprietary driver, in the same way as the Nvidia drivers etc. On the whole, MythTV version 0.23 should have been a big improvement. Where it not for a major new bug: the frontend crashes every time a DVD is inserted. This means I have to use Totem or similar to watch DVDs, which is a pain. The bug was first reported in March, and an upstream patch was available in April. Why has Ubuntu still not fixed such a major bug in what is supposed to be an LTS release? Ridiculous. And yes, I know Ubuntu 10.10 is available now, but the whole point was to stick this box on a stable LTS release. This is a big negative point against Ubuntu as far as I’m concerned. (One last thing: I had to install an updated version of the frontend on the MacBook so that it matched the new version of MythTV on the backend in 10.04 (0.23-fixes).)
I built my own digital video recorder (DVR) using normal PC parts, a hi-fi style case (also known as home theatre PC — HTPC), the free GNU/Linux operating system and the MythTV system. I built the machine in April of 2009 and about a month later, I had the whole thing working. This sounds like a lot, but there was also a two-week holiday involved there. Still, there was probably a couple of weeks of weekends and evenings’ work involved. Don’t let that put you off though: as long as you’ve built your own PC before, you’ll find MythTV pretty straightforward. Some basic Linux knowledge would help, but it’s not essential.
I have built up this document gradually over the last five months (publishing September 2009). I mainly wrote it for my own benefit to record how I did everything so I could do the whole thing again from scratch should I need to. I have tried to make it as accessible as possible though. All questions and constructive criticisms welcome in the comments section at the end of this page.
MythTV is a sophisticated free and open source software project that lets you use any PC running any GNU/Linux operating system as a DVR and general media hub. A DVR allows you to record and play back TV programmes directly onto hard drive without messing with DVDs or tapes. This guide assumes a little basic Linux knowledge (if you don’t have any, the Ubuntu docs seem good for beginners). There are already many good guides to MythTV out there, so instead of reinventing the wheel, I won’t repeat what is in those: instead I will link to the ones I used, adding updated information where necessary.
When I first heard about the MythTV project several years ago, I thought it was a great idea. The list of features is very impressive. Also, at home we’ve recently been downloading a lot of programmes over the internet, so I wanted an easy-to-use machine with all our video files in one place, and without having the bother of connecting a laptop to the TV every time we want to watch one, and that can be controlled from the comfort of the sofa with a normal remote control instead of a bulky keyboard and fiddly mouse.
Originally, several things held me back from building a MythTV machine. The price of new hardware powerful enough to run it was one factor. Also, MythTV sounded a but complex to install.
More recently though, the price of PC components went down enough that it started to seem more realistic. Also, when I read Gary Parker’s excellent and acessible guide to building a MythTV box with Ubuntu Linux, it seemed that MythTV has now reached the stage in its development that — as long as you are buying mostly new parts, specifically chosen for compatibility with Linux — it should be fairly straightforward to install and configure.
The third and final problem I had to overcome was — bearing in mind the many possibilities of the excellent client/server architecture of MythTV (more of which later) — which configuration would I choose? A sever in the spare room and thin clients around the flat? Ultimately I decided to keep things simple and go for a combined backend-frontend solution. I could then expand in the future using thin clients as further frontends as required.
With all that in mind, I decided to take the plunge and build a MythTV machine from scratch. I set out my general requirements for the machine, before looking at the parts:
- Records Freeview TV (Freeview is the free-to-air digital standard (DVB) you can watch in the UK via a regular aerial without subscription)
- Plays films and TV downloaded from the internet. Also: has a flash-enabled web browser to watch BBC iPlayer.
- Plays DVDs
- Play my collection of MP3/OGG music file (and CDs — natch)
- Fairly silent (at least quieter than my rather noisy XBox 360)
- Fairly powerful, but also fairly cheap
- Other more geeky stuff later (streaming recorded TV over the internet? Schedule recordings from a web interface over the internet while out of the house (e.g. on a 3G mobile phone)? — MythTV is theoretically capable of both of these things)
On the software side, MythTV does all these things, but the trick is to make sure that the parts you’re buying for your new machine have good support for Linux before you buy them.
Documentation and guides
The main reference I used was Gary Parker’s guide to building a MythTV box with Ubuntu, which I highly recommend (it’s also about UK TV, so that’s good for me too. Plus he has a guide to making it work with Freesat, should I ever go down that route). Rather than repeat everything in Gary’s guide, I will assume you have read it for the rest of this article. There is one caveat: it was written a few years ago, so some of it is a little out of date. Gary himself is a very friendly guy and replies promptly to (sensible) questions posted on his site (although the comments section seems to be down at the moment).
Other useful (optional) background reading:
- Ars Technica’s “Ultimate Home Theater PC Guide”
- Phoronix, which is the top source for reviews of the latest hardware, tested on GNU/Linux
- bit-tech.net’s Home Theatre PC Buyer’s Guide.
This is the final list of components. Prices as of April 2009. I bought them from Scan.co.uk and eBuyer.com:
- Antec NSK 2480 HTPC case (includes 380W PSU) (£84.99)
- ASUS M3N78-VM motherboard (includes on-board gigabit ethernet, sound and GeForce 8200 graphics) (£52.50) [see also this thread on Ubuntu Forums]
- AMD Athlon 64 5200+ dual core CPU (£50.00)
- 1TB Samsung Spinpoint F1 SATA hard drive (£71.29) (But you’ll be shocked how quickly even 1TB starts filling up!)
- 2GB (2x1GB) Corsair DDR2 800 MHz RAM (£28.34)
- Hauppauge WinTV Nova-TD 500 Dual DVB-T TV tuner card (£48.09)
- Pioneer DVR-216DBK SATA DVD writer (£17.83)
- Logitech EX110 Cordless keyboard and mouse set (£20.92)
- 2.0m Scan HDMI Cable (£5.69)
In addition, I added the following, which I was lucky enough to have lying around in my parts box:
- Netgear WG311T PCI wireless card (802.11g) (free)
The grand total was £390.56. Not bad really. I was aiming to keep it around £350, so I failed in that, but at least I kept it under £400. No doubt prices will go down pretty quickly, and/or you will be able to get better stuff for the same price soon enough.
For the OS, I chose the latest release of of Ubuntu GNU/Linux — which was 9.04 aka Jaunty Jackalope (as I publish this 9.04 is still the current version of Ubuntu but the next version — 9.10 aka Karmic Koala — is a month away from release). I’ve been a Debian guy up until now, but the general level of community support around Ubuntu has been growing for so long, I thought I would give it a try, especially as it seems to be maturing as a Linux distribution now. (1)
The other reason for choosing Ubuntu is that it makes it easier to add access to restricted and non-free (as in freedom) multimedia formats — which unfortunately will be necessary for a machine intended to run every audio and visual format under the sun. As much as I support and respect the Free Software ideal, and admire the democratic governance of the Debian system, I’m also want my DVDs to play and that.
I used the current stable version of MythTV (0.21) rather than the development branch (in other words, I just installed the standard packages — 0.22 is due to be out in time for Ubuntu 9.10). I can add backports of any particular features I really need (such as VDPAU) later. I might upgrade to future versions of Ubuntu if there are compelling reasons to do so (and only then with extreme care, keeping a disc-image of the pre-upgrade install). The general rule with MythTV seems to be “once it works, don’t touch it”.
Building the machine
So computer parts have changed a lot since I last built a PC in 2004 — for the better. The Antec NSK 2480 case, especially made for home theatre PCs (HTPCs) is great. It doesn’t look out of place in the living room, is easy to open and a snip to install everything in. Recommended. SATA is brilliant: so much cleaner and easier to install than those ugly old IDE ribbons. Oh yea, and personally I LOVE the modern trend of having loads of stuff integrated into the motherboard (although I remember being skeptical about it 10 years ago when I first noticed it). It just makes things a lot easier and saves PCI slots.
Plus, would you prefer this:
… or this:
Well?? Personally, I got a lot of geek satisfaction when I realised this tiny little chip was the sound card. The ASUS M3n78 is a highly recommended motherboard and comes with loads of ports.
A word about this aspect is important, not for geek reasons, but just because you don’t want your HTPC to be so loud that you can still notice it when watching movies and stuff. The two fans that come with the Antec NSK 2480 case are really really silent (as long as you run them on the lowest setting, as I do with no problems). The stock Athlon fan is a bit louder — loud enough to notice in an otherwise silent room. But it is still quiet enough not to notice over the sound of a TV. Much quieter than my noisy Xbox 360. I might replace the Athlon fan in the future when I have a spare £30 or so.
Installing Ubuntu Linux
First impressions of Ubuntu are excellent. With Ubuntu 9.04, GNU/Linux is now officially easier to install than Windows Vista. Almost everything worked out of the box, even the wireless card (which had not worked in Windows Vista when I tried to install it out of curiosity — ha!). It took some fiddling to get sound working, but this turned out to be an issue with the way my TV was configured, not an Ubuntu problem (it was sending the sound to the TV channel that displays the VGA cable input, while I was looking at the soundless picture on the HDMI channel — simple enough to fix but easy to forget until you realise).
Generally speaking, I just followed Gary’s guide to installing Ubuntu for the purposes of MythTV. It’s pretty easy. In the end I went with the combined front-end/back-end approach so that both MythTV server and MythTV front-end run on this PC which is directly connected to our TV.
I also used this guide to install various extras:
sudo apt-get install ubuntu-restricted-extras
I also followed Gary’s advice on the following: turning off the screen saver, setting monitor blanking in the power saving settings to “never”, setting MythTV to start automatically on boot, setting GDM to login to the MythTV user account automatically, and setting the sound volume in both the Ubuntu desktop and MythTV to maximum (so volume can be controlled by the TV remote). I made separate user accounts for my wife and myself to use for work, web surfing etc, but mythtv is the account used most often for watching recordings, viewing photos etc.
Most things just work in Ubuntu. However, you will still need to fiddle with some stuff for your MythTV set up. The main two hold ups for me were LCD TV resolution/overscan and the Hauppauge remote control. Hopefully, both of these will be fixed and work “out of the box” in the next version of Ubuntu (9.10) due out soon (especially if MythTV 0.22 is ready in time).
Overscan: I don’t totally understand why, but LCD TVs seem to work differently from monitors, and the default display on my LCD TV (at least after I had installed the proprietary NVIDA graphics drivers) cut off the top and bottom of the screen. It would be good if this could be sorted out in Ubuntu by default, as it was the main headache I had to overcome. It mainly seems to be NVIDA’s fault: in the Windows drivers, there is a simple utility that sorts this out perfectly and easily: you can adjust the resolution pixel by pixel. The Linux drivers don’t have this yet, which means I had to manually fiddle with the xorg.conf file to get the correct resolution settings. The full guide is in this post on the Ubuntu forums. If you have to use this method, my advice is: stick with it, it works in the end. It’s incredibly fiddly to do and once or twice I almost gave up in frustration, but I endured and ultimately it worked.
(As it happened, the only widescreen resolutions my TV supported were around 1280×720 and 1920×1080. The latter renders most text too small to read, but the former leaves little room on the screen for multiple windows. Thankfully, this is not a problem for MythTV and when watching movies, it just means the TV is not the optimal place to surf the web. Note to self when buying next TV set: make sure it can handle a good range of resolutions.)
Remote: The last big obstacle was getting the remote that came with the Hauppauge TV tuner card working, which involved compiling and installing the latest version of the drivers (much easier than it sounds, although it took me a long time and several red herrings to realise it was this simple). This also means you have to be careful in the future when installing kernel security fixes: the remote will stop working after you reboot. This just means you’ll have to install the updated drivers again and reboot once more. Easy, but simple to forget and panic about the remote! (so keep a local copy of the drivers that worked, just in case future versions of the drivers break on your system)
I also had to set MythTV to actually use the remote, which I did by installing Mythbuntu Control Centre and selecting Hauppauge Nova T-500 from the remotes list. There were still some buttons that did not work in MythTV. This turned out to be because the lircrc file auto generated my Mythbuntu Control Centre strangely omits the entries for certain buttons (hopefully this will be fixed in Ubuntu 9.10). So I had to edit this manually. The file has now been split up and is now located in separate files for each program in ~/.lirc/ (e.g. the config for MythTV is in ~/.lirc/mythtv). I used examples from Gary’s lircrc file but had to update the syntax of the file a bit. My finalconfig file is here.
Update April 2011: Note to self: if after a system update several remote buttons (i.e. Enter, Skip Fwd/Back & Back/Exit) are not working, then it means Lirc is broken (some of the remote buttons work via the kernel drivers now). To solve this do
sudo apt-get --purge remove lirc then install it again.
The final set up
Once everything was working, I also installed the Mac OS X version of the MythTV Frontend on my wife’s new MacBook. This is absolutely brilliant. It means that we can watch recorded TV programmes on the laptop, anywhere within WiFi range. Not only that, but it has full access to everything on the main MythTV box: music and video archives, and even the TV tuners: yes we can now watch live TV on our laptop over WiFi with no extra laptop hardware! It seems very smooth so far (there is a little bit of latency when I move the laptop to the outer reaches of the signal of my old WiFi router, which is pretty weak — I need to replace that). Next I’ll set up the Remote app on my wife’s iPhone so we can use that as a remote control for the MacBook.
As long as you already have a decent WiFi router in place, this strikes me as a cheap and easy way (yes easy: the Mac version of the MythTV frontend took me all of 10 minutes to install and it just worked) of extending your TV signal all around the house without bothering with aerial extension wires, or those crappy wireless TV signal kits you can buy from QVC or Maplins (they always have bad signal in my experience). Just use MythTV and WiFi instead. Easy.
My components in hindsight
- Hauppauge WinTV Nova-TD 500 Dual DVB-T TV tuner card: This has pretty much worked perfectly “out of the box” in Ubunutu 9.04 (apart from the remote issues detailed above). This still seems to be the dual DVB card of choice for MythTV in the UK (the dual part means I can record more than one TV channel at the same time — once you start scheduling recordings you’ll be surprised at how even two tuners does not seem enough. Luckily there are lots of repeats and some time-shift channels (like E4+1) on Freeview. We still use the Freeview tuner that is built-in to our TV, since it is not rare for the MythTV box to be recording two programmes at the same time (and hence limited to those two channels for the length of the recordings) while we want to watch a third). You’ll read some reports out there on the internet that one version of this card sold in the UK was using a (not working) different chip-set, and marked “Diversity” with a sticker. However, this seems to have been limited to a few cards and is now no longer sold. My box mentioned “Diversity” features (no sticker though), yet my card has two aeriels connectors and the the (working) VIA chipset on the card. It worked out of the box first time in Ubuntu 9.04 (apart from the remote issues detailed above).
- Antec NSK 2480 case: Top marks. Buy one. It looks like a real piece of audio-visual equipment, not like a nasty old PC at all. It’s also very very quiet.
- Pioneer DVRW-216D: The main plus with this is that it’s pretty easy to alter the firmware and re-flash it the drive to region free (RPC1) so I can watch DVDs from around the world. That’s a big factor in its favour. I have now been able to retire my stand-alone DVD player! However, the drive is not exactly quiet when discs are spinning — at least compared to the super-quiet case. It was cheap though, so can’t complain too much. And it’s not so loud you really notice.
- RAM: In retrospect, I would definitely go for 4GB if you are planning a similar box. 2GB is plenty for normal MythTV use, but if you want to keep more than one user account signed in, it could start thrashing the swap.
Possible future upgrades
- Scythe Mini Ninja HS/F. Upgrade on the stock Athlon fan. Not essential but may be nice.
- RAM. Believe it or not, 2GB is not enough if you want to stay logged into multiple accounts at once!
- Hard drive. You will not believe how fast high resolution video uses up a 1TB hard drive. Five months later and my drive is 80% full! (to be fair, I haven’t been deleting old shows that I could archive to DVD — anyone have any tips on how to transcode MythTV progs to Xvid using the MythTV interface? Still can’t figure that. Half-hour shows are talking up about 800MB each!)
- Multi-format flash card reader. Should slot in nicely to the second 5.25″ bay (below the DVD writer). Again, not essential.
- A wireless card running at N speeds. For the longest time, I looked at buying a draft-N PCI wireless card. However, it seems that the Linux kernel (rather shockingly for an OS that has such a good history when it comes to networking) does not yet support many draft-N cards. In fact I had a hard time finding any PCI card that would run in Linux at draft-N speeds. To be sure, this is a wider problem related to wireless companies being coy about opening their specifications to free software programmers. Still — something should be done about that. No doubt it will before the 802.11N standard is (at last) finalised. Until then, I found this thread that suggests that 802.11g speeds are OK for streaming standard-resolution video. So far my experience streaming hi-res MythTV video from the backend to a frontend on a laptop is very good. It plays very smoothly within WiFi range.
- Freesat card? This could make the dream of a fully High Definition DVR a reality. It does open up a whole can of performance-related HD worms though. This would be no minor upgrade, but rather an optional long term project. Still: I have tried to make the components of this box as “HD ready” as possible,
- Blu-Ray player? This is contentious — Blu-Ray seems like it’s an even more restricted format than DVD. DVD is hi-res enough for me to be honest.
- Backup external/network hard drive. Backup of everything. Centralising all files on this server is a bit risky. It makes backups all the more vital. Therefore: a 1.5TB external hard drive for backups will be required. This is not so optional really. Buy ASAP.
MythTV is brilliant. It’s just so slick and powerful once it’s working. Seriously: someone could make a mint by setting up a company to sell pre-installed MythTV DVRs. It’s definitely changed the way we watch TV for the better.
It does seem to be obligatory in MythTV guides such as this one to mention the significant investment in time MythTV requires to really get it working exactly how you want. In my opinion, this factor is much less true than is used to be, especially now there are excellent MythTV packages in all the big distributions — there are also specialised MythTV Linux distributions like Mythbuntu. However, I still wouldn’t say MythTV is exactly mainstream yet. It will definitely eat into your weekends and evenings. If you have a non-geek partner, he or she will love it as it’s intuitive and very easy to use: however, he or she will not love the amount of time you will spend tweaking it!
The configuration options are so numerous it’s practically infinite. If you’re the kind of person who would enjoy getting their teeth into such a project, then go for it, but if not, beware.
- Extremely flexible
- After setup, it has a very user-friendly interface that non-techies don’t have much of a problem with
- Centralised, all-in-one media centre
- Price (to compare: basic 1TB DVRs go for about £200 — although they are nowhere near as flexible as a MythTV system).
- Time investment to set up and install (although this could be a Pro if like me you enjoy these kinds of projects).
- Commercial-skipping seems a bit unreliable. It seems to work on US shows better than UK shows (easy enough to switch off skipping though). Thanks for the tips in the comments section that helped me resolve this.
In short, MythTV a good combination of geek’s dream and user friendly.
(1) The fact that Ubuntu is basically a more user-friendly Debian also helps. I’m sorry to offend any Red Hat fans, but the first Linux distro I tried back in 1999 was Red Hat based, and after struggling for ages with dependency-hell I crossed over to Debian’s amazing APT system and never looked back. Return.
I intend to upgrade this MythTV box to a new version of Ubuntu, mainly because of the new release of MythTV 0.22 (also hoping it could magically fix current remote woes). Might try an in place upgrade before a fresh install. I was thinking about upgrading to the new 9.10. However, I might wait till 10.4 comes out in April now since it’s going to be a LTS release.
Things to do when installing fresh Ubuntu
- Backup /home /var and mythTV DB
- Parititions: / (about 20GB, but check current usage), /home (everything else)
This article is copyright, Asa Winstanley 2009. Licensed under a Creative Commons licence:
“How I built my own DVR using MythTV and Linux” by Asa Winstanley is licensed under a Creative Commons Attribution-Non-Commercial-Share Alike 2.0 UK: England & Wales License.