In the past few weeks, I’ve been playing around with home networking and media centers and decided to set up a MythTV home entertainment system. It was pretty confusing at times, but definitely really educational, and I ended up learning a decent amount about AV stuff (which used to be totally foreign to me), Linux (of which I’m still getting a grasp), and networking/routing (around which I’ll never, ever wrap my mind).

I’m not pretending to be an expert, but I thought there should be a more consolidated guide on how to get MythTV up and running for those who aren’t as Linux and AV-savvy (like me), those who aren’t fully aware of all that MythTV has to offer, or those who don’t want to sift through the massive amount of information on the MythTV wiki. MythTV is a really fantastic tool, but the number of features and options can definitely be overwhelming at times, and although there are many good tutorials scattered around the wiki and on various blogs, I’ve always preferred consulting a single complete walkthrough. This post covers what MythTV is capable of, why you should use it instead of the alternatives, and how you can set up your own MythTV box.

Here is a diagram of my ideal MythTV/house setup. I haven’t completed some of the parts (like the security cameras), but it should give you a basic idea of what you can do with MythTV.

I welcome comments (and criticism) from experienced users and questions from newbies. Andrew.Manugian@gmail.com

If you like, you can download a PDF of this walkthrough.

—

Navigation

—

—

What MythTV is:

MythTV is a really awesome tool: it’s basically Tivo, Slingbox, and a media/information center packaged into one free, open-source program and it’s a great way to run a robust home media network without a lot of complicated setup and ugly hardware. It allows its users to record TV and then makes it and all your other media accessible to a limitless number of computers/TVs/media devices in your house (and is even accessible over the internet).

Why you should use MythTV :

It’s Free: MythTV is totally free. And since it’s open-source software supported and developed by an entire community (complete with an extremely detailed wiki, you have all the support you’ll ever need if something goes wrong).

It’s capable: MythTV is capable of everything Tivo and other DVR hardware can do (pausing, rewinding, conflict-avoiding scheduling, etc.). It even has some pretty advanced commercial-detecting and skipping options (which I don’t use and should be the topic of an entirely different post), that aren’t available on most DVRs. Depending on how many capture cards you install, MythTV can record several feeds at the same time, so you can watch one feed while you record another one (or two, or three).

It’s clean: MythTV eliminates a lot of the local boxes and ugly cords that many people have on every TV and computer in their house. You could have your noisy, ugly, and bulky computer loaded with MythTV software located anywhere in your house (perhaps in the attic or basement) so you don’t have to bother with a bunch of wires and boxes (DVR, DVD, satellite receivers, external hard drives) around every TV or computer. It just makes for a much cleaner and quieter setup. You can access your formidable music collection without lugging around a bunch of external hard drives.

It’s Comprehensive: MythTV is definitely an example convergence culture. From a single TV, you can access the internet, record and watch TV, play music, stream videocasts, view photos, DVDs, and media clips, check the weather, Skype friends, and check movie times…and that’s just for starters. With all the available plug-ins and thanks to its open-source nature, the number of MythTV features seems only limited by the imaginations of its community members. Like classic videogames? Why not install a Super Nintendo or Arcade emulator? If enough people in the MythTV community express a need to have a feature, they will collaborate to incorporate it into the next release.

An ideal setup would include some sort of social networking like StumbleUpon or Digg in which individuals with similar tastes could recommend or even schedule recordings for you and you could post on or discuss specific episodes inside that episode’s schedule listings.

It’s Mobile: With a little knowledge about routing, you can schedule recordings and access all your media from a browser (or even your iPhone) anywhere in the world. Don’t like the tunes at a friend’s party? Log into your Mythweb account and play your own music. Stuck in traffic on your drive home? Pull out your iPhone and tell your MythTV box to record your favorite show. Can’t decide on what to watch at a friend’s house? Access your movies and recordings on his laptop and plug it into his TV.



How MythTV is different:

From my description, MythTV seems to sound like it’s imitating a lot of different products, but I’m of the opinion that it combines the best parts of many different hardware and software options. This section outlines the differences between MythTV and the products it resembles.

Like Tivo, MythTV schedules recordings, resolves programming conflicts, and lets you pause and rewind live TV. Unlike Tivo, you don’t have to switch rooms if you happen to have recorded a particular desired program on the downstairs unit because one MythTV box set up in your attic or basement can take care of all of your recordings and distribute them to various TVs as you see fit. Also unlike Tivo, it comes with no monthly fee.

Like a Slingbox (which is basically hardware that lets you remotely view and watch your TV on a computer anywhere), you can remotely access your TV from anywhere over the internet. Unlike Slingbox, it doesn’t have to monopolize your video source, because it can distribute to any number of computers. And since you can store the information on a hard drive (instead of only streaming it), you can direct download your recorded shows over the internet (if your connection is dodgy and your stream is constantly buffering). Also unlike Slingbox (and Tivo), it comes with no monthly fee.

Like Windows Media Center, MythTV provides a 10-foot interface in which users can access and view all their pictures, music, and video on a large TV screen from the comfort of their couch. Unlike Windows Media Center, you don’t need to purchase Premium or Ultimate Windows Vista as well as Windows-certified hardware and remotes for every TV… and your media formats are not limited to only Microsoft-approved ones.

What MythTV can do:

Like I said, besides the normal DVR function, MythTV has a variety of plug-ins that offer a lot of features DVRs do not. This section outlines a few of the ones I use.

MythTV: Watch a TV stream from any computer or TV in your house. Pause, rewind, and skip TV. Schedule, manage, and view recordings. Flag and skip or delete commercials.

MythWeb: Access and control your MythTV backend remotely from anywhere in the world. Schedule and manage recordings, watch TV, and listen to any of your MP3s (you can make playlists and stream them). Mythweb is the reason I use MythTV: with a 40 GB netbook and an internet connection, I can be in Thailand and still record and watch United States TV as well as access terabytes of information while it remains safe in my climate-controlled house in Memphis. You can even use Mythweb on your iPhone.

MythGallery: Bore your friends with vacation pictures! MythGallery lets you view your entire digital photo collection on your TV. Now, everyone can see those thousands of pictures that you’ll never get printed.

MythMusic: Listen to your digital music from any computer or TV in the house. Play your favorite mp3s while you choose what to record (or as you sort through your vacation pictures). Watch a visualizer with your friends.

MythVideo: Watch all those .avis and ripped DVDs that have been sitting on your hard drive on a big TV.

MythTube: Search for and watch streams from Youtube and get your favorite RSS feeds.

MythGame: Emulate classic console and arcade games. Play Super Mario World, Street Fighter 2, Metal Slug, and other classics from any TV in your house.

MythZoneMinder: Access your ethernet surveillance cameras to keep track of your kids and property. Great for home security or just for fun.

How MythTV works:

I’m not going to go into too much detail (mainly because I don’t think I really know that much myself), but MythTV runs on what they call a backend (which is your computer that runs the serverside software) and is accessed from frontends (client software).

Backend servers do all the work: recording, commercial flagging, transcoding, storing all of your media, and streaming all this content to any frontend you may have set up. You can set up a massive backend server near your cable or satellite feed while keeping laptops or netbooks on every TV or speaker setup. Frontends access any recordings or media you have as well as have the ability to schedule recordings or access a variety of information (weather, IMDB, movietimes, etc). Frontends can be a computer, xbox, or Big-screen TV with a laptop attached.

A backend will have a video feed and hard drives with whatever media you see fit. No more searching through empty DVD cases and struggling with scratched DVDs…if you upload all of your media to a hard drive on a backend server, you can access it from basically anywhere. The number of possible simultaneous recordings is based on the number of capture cards you have on your backend server.

Since I’m a digital packrat, and with hard drives cheaper than ever, I could see myself running several backend servers with multiple capture cards recording all the TV I possibly can for posterity. With two new 750GB hard drives, I just seriously upped my amount of available storage.

—

-BUILD YOUR OWN MYTHTV SETUP-

I’ll walk through exactly what I did to make my MythTV setup. Obviously, depending on what you want to get out of your system, you might change some things, so I’ll try and cover a few alternatives.

Step 1: Hardware

Having a capable machine is obviously an important first step, but after doing a little research, it became apparent that MythTV isn’t the most hardware-intensive (or wallet-intensive) software, so long as you make some good buying decisions. I was able to create a MythTV backend by harvesting parts off of my last two computers (one of which was 9 years old) and adding about $450 of new parts in order to create a Frankenstein.

Obviously, you don’t have to build a new computer…you could use an old one or buy a pre-made one. However, building your own computer is not only an educational exercise—it’s also extremely cost-effective, and you can ensure every component is exactly what you need. By each important part, I also list what are considered to be minimum requirements for MythTV.

Motherboard: I bought an Asus P5KPL-CM G31 for $60 because I fried my old one. Just make sure your motherboard has the right slots for what you need and can fit your CPU. This one has a PCI express slot for my graphics card and two PCI slots if I wanted to get another capture card. It also has onboard sound and SATA inputs for my hard drives.

Processor: Your CPU does all the transcoding, fastforwarding etc, and commercial flagging, but you don’t have to invest in an awesome CPU if your Capture card has its own encoder. I have an Intel Core2 Duo E7400 that I purchased for $110. I’ve read 800Mhz PIII systems and above are capable of capturing and watching live TV.

RAM: I put an old 2GB DDR2 stick in this computer and it has a slot for another. Although I’ve read MythTV boxes run adequately on 500 MB of RAM or less , I’m under the impression that you can always use more RAM.

Storage: I bought a 750GB SATA hard drive for $109. Encoded TV can take up to 2GB an hour , and if you want to put music and DVDs on your hard drive, you’ll definitely need a lot of space. Fortunately, I already had two big external drives already full of media.

Power Supply: I used an old 650 Watt power supply, which is more than enough for this box’s needs.

Graphics Card: I bought a GeForce 7200 for only $44 dollars (I have no idea why it was cheaper than the 6k series). It’s a pretty powerful PCI express videocard with TV out. If you’re planning on hooking a TV directly into your backend/frontend, you’ll need a nice graphics card that’s supported by MythTV. Otherwise, don’t worry about it.

Capture Card: A capture card is what captures (and sometimes transcodes) your TV stream. If your capture card has hardware dedicated to doing the encoding, it takes considerable strain off your CPU. Once again, make sure MythTV supports your card before you buy. The Hauppauge PVR-500, which I got for $65 on ebay, has two tuner inputs (so you can watch and record two coax feeds simultaneously) as well as a S-video input (for my DirectTV box) and serves my needs quite well. It fits into the PCI slot of my computer, and a simple coax cable runs from a cable wall-jack to the card.

Cables: coaxial cable from a wall jack into Tuner1 on the capture card, and the Satellite feed comes into the receiver from a coaxial cable and out of the receiver into the capture card with S-video and composite dual-channel audio cables (red and white) . Additionally, if you want to control your satellite receiver from the computer, you’ll need either an infrared blaster cable or a usb-to-serial cable that’s approved by whatever set top box (STB) you have. My local cable feed comes in on a basicfrom a wall jack into Tuner1 on the capture card, and the Satellite feed comes into the receiver from aand out of the receiver into the capture card with. Additionally, if you want to control your satellite receiver from the computer, you’ll need either an infrared blaster cable or athat’s approved by whatever set top box (STB) you have. Cooldvr has a lot of information on the matter, and the webmaster is very helpful and informative.



Step 2: Install Mythbuntu





Mythbuntu is basically for people who don’t know enough Linux to make their own MythTV setup from the ground up (for example, me). It is the software that makes all this possible. Here’s how to install Mythbuntu.

Download Mythbuntu 9.04 from Mythbuntu’s download page. I got the 64 Bit version, as its recommended for more intensive actions, but either will probably do.

Burn CD /Create Bootdisk CD – The file comes in .iso format, so use whatever preferred mounting/burning software you have to burn it to a cd. DVD Decrypter works just fine. Insert a blank disc, select the .iso from wherever you downloaded it, and burn it to disc. You now have a Mythbuntu install CD that can create a backend or frontend out of any computer.

BOOTDISK – Thanks to Paul for mentioning I should include this much easier method. Using the program Unetbootin for Windows and following these steps , you can install the .iso without having to burn a CD (plus, knowing how to use liveboot thumbdrives can be extremely handy in salvaging a harddrive).



Install CD on new computer. (Note that depending on what release you selected, some of these steps are out of order or nonexistent. Just be reasonable during the installation and everything will go fine…you can change most of these settings later anyway).

Click the default install option and go through the menus for preferred language, time zone, and keyboard setup. When they ask about partitions, click “Guided – use entire disk” to make the entire PC a Mythbuntu PC. Next, set up your username and password. I used a complex password to make it more difficult to access Mythweb. I did not set up any IR devices. When they ask about drivers, load the proprietary drivers for your graphics card, and if you plan on using a TV out, select the correct resolution for your TV. When they ask what system you want to set up, click “Primary Backend w/ Frontend” so that you’ll be able to access whatever media you record on the same box. I didn’t do any backend configuration here because you can do it later, so skip that option. For additional services, plug-ins, or themes, I selected all of them. Finally, check over the installation summary to make sure you’re happy with all your settings. Click next… and Mythbuntu’s installed!



Step 3: Configure MythTV Backend and Control Center

CONFIGURE MYTHTV BACKEND:

The option to configure the backend is available during installation, but I doubt you’ll get everything right the first try. If you right-click your desktop, it’s an option under Applications->System->“Configure MythTV Backend.” You should now be looking at a screen a lot like this:

General: You don’t really need to change many things in here unless you’re planning on running frontends on different machines. If that’s the case, you’ll need to set your Pin to 0000 and your IP address for MythTV and your backend to anything other than a IP provided.

Capture Cards: Configure your capture cards here. Select “New Card” for each new option. Hopefully, MythTV identifies the hardware, so all you have to do is name it and select what type it is. My cable feed’s name is cable, it’s encoder type is IVTV MPEG-2, it recognizes the card as a PVR-500, its location is /dev/video0, and its input is tuner1. My DirectTV is the same IVTV MPEG-2 encoder type, but location /dev/video1, its name is satellite, and its input is S-video 1.

Video Sources: In video sources, you basically assign a name and source to the inputs you just set up on your card. Select“new video source” and name it whatever is appropriate (I named one “cable” and the other “satellite”). Then assign the source to the corrosponding card and input. You should probably keep frequencies the default unless you still use a broadcast frequency or you see your specific frequency on the list.

Input Connections: Input connections lets you scan for channels as well as manually set channels. It’s a good tool to see whether you connected your box to the source correctly, but the mc2xml setup (explained later in this tutorial), does the channel import for you.

CONFIGURE MYTHTV CONTROL CENTER:

The MythTv Control Center is an easy-to-use GUI for a few more settings, most of which were offered in the original Mythbuntu installation. Access it by right-clicking your desktop and going to Applications->System->“MythTV Control Center”

System Role: Change your system role (from dedicated backend to backend/frontend, etc).

Applications and Plug-ins: Select what plug-ins you want to appear on your frontend and set your Mythweb un/pw. I selected most of the plug-ins.

Remote Control: Although I haven’t, you can set up a IR remote control to work with your system.

Proprietary Codecs/Proprietary Drivers: Although MythTV can’t officially support or condone this, you can install all the codecs you need to view different file types. Simply click the option to enable the unofficial package and your installation will be underway.

STORING OTHER MEDIA:

I use MythTV’s default directories to store my other media. If you place the files in the correct folder, the MythTV frontend will automatically populate its Media Library.



Place music in /var/lib/mythtv/music

in /var/lib/mythtv/music Place videos in /var/lib/mythtv/videos

in /var/lib/mythtv/videos Place pictures in /var/lib/mythtv/pictures

Step 4: Configure TV listings

This one took me a little while to figure out, but it makes a lot of sense. The backendneeds to be getting your TV listings data from some service in .xml format (which is basically a spreadsheet with a week’s worth of TV listings in it). You could pay $20/year (with a 7-day free trial) at schedulesdirect or use mc2xml, which is a command line that downloads TV listings from Windows Media Center and TitanTV servers and puts them into a .xml file for free.

HOW TO SETUP MC2XML:

First, if you run 64-bit Mythbuntu, you have to get some 386 libraries. In the terminal ( right click->Open Terminal Here ) , type:

sudo apt-get install libc6-i386 (it will ask for your password, which you type and hit enter, even if you see nothing on the screen)



sudo apt-get install lib32nss-mdns

Download mc2xml for linux: link

Open the terminal and make a directory called mc2ml and move the file you downloaded there:

mkdir ~/mc2xml

cd ~/mc2xml

mv ~/downloads/mc2xml . (the period is important)



Make mc2xml executable and run it from the directory in order to configure it.

chmod 755 mc2xml

./mc2xml -c us -g yourzipcode

Answer questions about your TV provider (I selected Comcast Cable). Then update your mythfilldatabase.



mythfilldatabase –refresh-all –file 1 ./xmltv.xml (the way the –file command works is –file <source id> <xml file>, so if you have different files for the different sources you created in the backend setup, pick the ride modifier after –file. If you only have one source, 1 should be the default).



Finally, set up a cron job that can update mythfilldatabase with your mc2xml file daily. First, open thunar as root (be careful as you can harm your system if you play with stuff you shouldn’t). Type sudo thunar in the terminal (and enter your password if it asks). Then, in the /etc folder of your filesystem, open the file “crontab” and fill this information in on a new line. Change “user” to your username. 27 3 * * * user /home/user/mc2xml/update.sh This is code that makes your computer run a particular program daily at 3:27 am. Finally, make a new file ( right click->Create from Template->Empty File ) in the mc2xml folder called update.sh and type this in it. This is the file that the cronjob is accessing. #!/bin/sh

cd ~/mc2xml

if ~/mc2xml/mc2xml ; then

mythfilldatabase –refresh-all –file 1 ./xmltv.xml

fi

that can update mythfilldatabase with your mc2xml file daily.

TO SETUP LISTINGS FROM DIFFERENT FEEDS:

Setting up multiple listings in the same .xml isn’t particularly difficult, and you’ll want to do it if you have both cable and satellite feeds or any other combination of two sources. To set up multiple listings, you use mc2xml’s commands to add a created channel list to a new one and then write a new file:

-D =sets .dat filename -C =sets .chl file

-I = Insert -o = sets output

mc2xml -D sat.dat -C sat.chl –o sat.xml for the satellite .dat, .chl, and .xml outputs

mc2xml -D cable.dat -C cable.chl -I sat.xml -o cable_satellite.xml creates a combination .xml file after inserting the satellite output from above



Now, download mc2xml for linux

http://mc2xml.110mb.com/#download

then, open the terminal and make a directory called mc2ml and move the file you downloaded there:

mkdir ~/mc2xml

cd ~/mc2xml

mv ~/downloads/mc2xml .

Make mc2xml executable and run it from the directory in order to configure it. Then update your mythfilldatabase.

chmod 755 mc2xml

./mc2xml -c us -g 10000

mythfilldatabase –refresh-all –file 1 ./xmltv.xml

Finally, set up a cron job that can update mythfilldatabase with your mc2xml file daily.

First, open thunar as root (be careful as you can harm your system if you play with stuff you shouldn’t):

Terminal

Sudo Thunar

Then, in the /etc folder, open the file “crontab” and fill this information in on a new line. This is code that makes your computer run a particular program daily at 3:27 am.

Step 5: Configure and use MythTV frontends

If you would like an additional frontend, you can just follow the steps from your Mythbuntu installation CD as you install it on a new computer.

HOSTNAME: You’ll have to enter your backend’s internal IP (eg. 192.168.1.104), which you can discover by right-clicking your internet connectivity icon on your toolbar and clicking “Connection Information.”

DATABASE: default is mythconverg

USER: mythttv is default

PASSWORD: find this on your backend in /etc/mythtv/mysql.txt

Access your Frontend on your Frontend/Backend setup (right click desktop->Applications->Multimedia->MythTV Frontend). This is where you’ll watch TV and recordings, and access all your media. There are also a lot of settings you can play with inside the frontend. Accessing your frontend interface on any dedicated frontend machine is as easy as turning it on.



From the frontend, you can watch live TV, recordings, and any other media as well as schedule future recordings.

Watch TV is self-explanatory–provided your feeds are set up correctly, you can watch TV. Here are some of the buttons I use, but if you choose not to program a remote, here’s a full list of keybindings.

P = Pause R = Record

S = Guide O = Options

[ = Volume Down ] = Volume Up

Y = Switch between video feeds

Numpad = Channel number input

Arrow keys = Skip left and right, channels up and down

The Media Library is where you access your recordings, videos, music, streams, pictures, and games.

The Information Center has a bunch of useful information, based on what plug-ins you chose to install.

Frontend configuration inside Setup/Utilities is extremely straightforward and mostly deals with aesthetics. The few exceptions are setting your zip code for weather/movie times, preferred news feeds in the Info Center Setup, and emulators in Media Setup->Games Setup.



Step 6: Configure Mythweb and Router Settings

This is the really cool bit. From Mythweb, you can schedule and access recordings and any other media you happen to put on your backend. There are several ways to allow outside access to your computer, and it’s important to properly password protect.

You can compensate for a router that issues dynamic local ips for your computers several ways, but No-IP is a really easy and free service that creates a static hostname for your dynamic IP. It also offers a service in case your router or cable provider prevents port 80 forwarding.

PORT FORWARDING:



Port forwarding sends any outside http requests to your Mythbox’s local IP.

Right-click the connections icon on the taskbar on Mythbuntu and click “Connection Information”…your computer’s local IP should be listed. Since I use a linksys router, my MythTV box’s IP is 192.168.1. 107 .

. To access my router settings, I have to type 192.168.1.1 into a browser (it varies depending on what router you own, so get out those hardware manuals). Under Applications and Gaming->UpnP Forwarding , you can make port 80, which handles http requests, always route to your MythTV box (address 192.168.1. 107 ).

, you can make port 80, which handles http requests, always route to your MythTV box (address 192.168.1. ). What this does is automatically send any outside http request to the MythTV box. Therefore, if you type in your home’s IP address from outside the house (get your address here), it should access your Mythweb, barring your router or internet provider blocking port 80.

I would definitely recommend password protecting both your Mythweb access and your router access with strong passwords. While your box is still password protected, this isn’t necessarily the safest way to do this, so I avoid it.

SECURE SSH TUNNEL:



SSH is a secure protocol used for sending information between two networked computers and the way I remotely access my Mythweb. I couldn’t write a better FAQ than this one: MythWeb ssh tunnel howto.

Linux usually has ssh installed, but if you’re connecting from a Windows PC, you can download PuTTY, which is an .exe which makes this whole remote connection process pretty easy.

Step 7: Optional Stuff

SDLMAME:

Mame is a multi-platform game emulator that MythGame is capable of running. Installation is quite easy.

Download a SDLMAME installer from here. I got the 64-bit Ubuntu 9.04 version. Double click the .deb file to install. Download whatever ROMS you feel like playing from ROM-World’s MAME section (or wherever else you can find your favorite games). Place the still-zipped games in “/usr/local/share/games/sdlmame/roms.” Recommended: Marvel Vs. Capcom, Street Fighter Alpha 3, Metal Slug Series

Inside MythTV’s Frontend ( Rightclick desktop->Applications->Multimedia->MythTV Frontend->Utilities/Setup->Setup->Media Settings->Game Settings ), create a new player entitled “Mame” with type “mame,” command “mame,” and ROM path “/usr/local/share/games/sdlmame/roms”. Enjoy! Access your games by selecting Media Library , then Games in the main MythTV frontend.

DIRECTTV THROUGH SERIAL:

Because I’d like to watch my Satellite feed after it’s been decrypted by a set top box, my MythTV box must have some way to communicate with the box in order to change channels. Luckily, this isn’t particularly difficult. I have a D12-100 DirectTV box, which is quite current, and I got a USB to Serial Cable from CoolDVR.



Download the Directv.pl control script from here and place it in “ Under “Input Connections” in the backend setup, select the satellite connection and then add the script’s location to the channel change parameter. Mine was in /usr/local/bin/directv.pl

Make sure your satellite box is activated and plugged in correctly, then connect the usb port to your computer’s serial port.

Whew…that was pretty exhausting to write. If you have any (simple), questions, I’ll try and answer them. And if you’re knowledgeable, please ridicule my more glaring mistakes.

Thanks for reading my guide,

Andrew Manugian

Andrew.Manugian@gmail.com

—

—

Here are a few shots of the collection of my (not really that) old action figures.

and my brand-new USB Missle Launcher…