facebook rss twitter

Run your own home-entertainment server with Linux and MythTV: we show you how.

by Jo Shields on 4 October 2007, 14:52

Tags: HEXUS, Linux

Quick Link: HEXUS.net/qajyv

Add to My Vault: x

A habit cannot be tossed out the Window

Firstly, let's see some proof that MythTV is awake. Load up a web browser anywhere on your network, and visit http://linuxservername/mythweb/ - you should get MythTV's web GUI appear. Click "Listings" to see all available channels, click any program to configure recording options. Wasn't that easy? We'll come back to MythWeb a little later. Now to get a frontend working - this could be a Linux desktop, or the same server we've been configuring so far. You want to install packages called "mythtv-frontend" and "mythtv-themes" now, so use Synaptic to put them on. If you're using the server machine, then you don't need any extra configuration here - simply pick MythTV Frontend from the Applications, Sound and Video menu. That's it! If you installed onto a different computer (such as a smaller, more living-room-friendly machine) then you will be asked for details of your MySQL server - give it the username "mythtv", the hostname of your server, the database name "mythconverg", and the password you wrote down earlier. All these details are on the server, in a file called "mysql.txt" in /etc/mythtv

MythTV!

So, what next? First, have an explore of MythTV - try tweaking some settings, watching some TV, or scheduling a recording. Within live TV, try hitting P to pause, or the left arrow to rewind. Want some extra functionality? Quit the front-end, load Synaptic back up, and take a look at some of the other "myth" packages. "mytharchive" is for burning recordings to a regular DVD. "mythflix" is for managing a Netflix rental account. "mythvideo" is for watching random video files from disk. Install any of these you want to - one note, however, is about "mythdvd". Commercial DVD playback on Linux requires a library which is not included for patent licensing reasons. To enable it (make sure this is legal in your country first!) run "gksu /usr/share/doc/libdvdread3/install-css.sh". If you have a MythTV frontend in the living room, you might want to install the "ubuntu-mythtv-frontend" package - this will cause a user to be automatically logged in and the frontend loaded, on bootup. For a dedicated machine, this is a good option.

Now to integrate your system with the Windows world. First, what's the best way to access recordings? Well, there are three major options - accessing the recording files directly from the shared folder, using software which access the backend "properly", or using software which accesses the UPnP server built into Myth. MythTV recording files are in a format which isn't supported by Windows out of the box, so we need to install a couple of codecs first - we need to add support for the MPEG-TS container format, and MPEG2 video and MP2 audio formats (all of these are used for digital TV in the UK, requirements may vary elsewhere). For this, we will use the Haali Media Splitter to add MPEG-TS support, and FFDShow (tryouts version) for MPEG2 and MP2 support. During installation, ensure the appropriate boxes have been ticked. Your Windows Media Player is now ready to play files - try double-clicking on a .mpg file from your recordings directory. Notice the unpleasant filename? We can rename this with a little tweaking on the server - on the server, navigate to /usr/share/doc/mythtv-backend/contrib/ and double-click on "mythrename.pl.gz". Extract it somewhere like your desktop, right-click on it, and click Properties. In the Permissions tab, ensure "execute" is ticked, and hit close. You can now run the script by double-clicking, which will rename all your recordings to something human-readable, for easy access via file sharing. What about UPnP? Well, make sure you install the codecs mentioned above, and fire up Windows Media Player. Ensure you have media share viewing enabled, go to your video library, and recording access should simply work! The final option is a real MythTV client - in this case, MythTV Player. When you run it, simply give it the name of your Linux machine, and that's it - you have access to all your recordings.

MythTV Player for Windows

How about non-recording videos? Well the easiest option is accessing your files directly via the network share. However, if you install the "mythvideo" package onto your server, then you will gain access to all your video files via the web, along with any posters and information you assign to them. Technically this is also available via UPnP, but Windows Media Player's implementation is buggy, and you cannot access your videos using it (another UPnP client should work).

Access your video files from MythWeb

And scheduling? Well, you could use MythWeb from any web-enabled device... even a WAP browser on a mobile phone!

Finally, how to access music? Well, Windows Media Player should work fine, via UPnP. Or there's MythWeb again (once "mythmusic" is installed on your server). Or there's simply accessing files from your file share. But how about iTunes? Well, iTunes uses its own system instead of UPnP, so we need to install an extra server to manage this. Install the "mt-daapd" package on your server, and open its configuration file with "gksu gedit /etc/mt-daapd.conf". Change the "mp3_dir" line to indicate the real location of your music, save, then run "gksu invoke-rc.d mt-daapd restart". You should now see your music fine from within iTunes, once share access is enabled.

Music access in iTunes