MythTV Walkthrough

From ArchWiki
Revision as of 20:01, 31 March 2007 by Paulr (talk | contribs) (New page: =About this document= ==What is MythTV== MythTV is a Linux based Personal Video Recorder. It acts as an intelligent combined television and video recorder. There are many plugins for it w...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

About this document

What is MythTV

MythTV is a Linux based Personal Video Recorder. It acts as an intelligent combined television and video recorder. There are many plugins for it which expand its basic functionality.

Why two entries in the Wiki

There already exists a wiki entry for installing mythtv. However, it does lack detail for the less experienced user. I wanted to write a "from beginning to end" installation guide for mythtv ; to do that would require editing the original MythTV HOWTO pretty drastically. I would recommend reading both guides.

The downside to my approach is that the instructions are 'specific' for my hardware and my location.

Localisation and Hardware variations

MythTV can cope with a wide variety of hardware. There are two main things that change from system to system which require significant setting up.

Firstly, the video capture card. There are many of these and they are often subtly different. MythTV does a pretty good job of detecting and configuring hardware.

Secondly, the location. MythTV has an Electronic Program Guide (EPG) built in, so that programmes can be recorder and viewed easily. There is a common way of setting this up using a program called XMLTV, which extracts data from web sites or other data providers. Some devices (for example DVB-T cards) also require transmitter information.

Some digital systems can use the EPG which is part of the signal. This is currently in development.

My personal information

This guide is written 'as I do it'. However, this is for my hardware in my location, and you are almost certainly different. I will offer suggestions for alternatives where appropriate. It is always worth reading installation guides for other machines ; the process of installation does not vary significantly. If you have a common video capture card, you can find help in most cases ..... somewhere. The MythTV website is a good place to start.

My Hardware

I'm running Arch Linux 0.8 (Voodoo) with an Nvidia card. The "important" piece of hardware though is my DVB-T capture card. DVB-T is known in the UK as "Freeview" ; it is digital television transmitted down the 'standard' aerial.

Other alternatives are the old analogue system, DVB-S (satellite) and DVB-C (cable),

The capture card I am using is a Hauppauge WinTV "NOVA" model, which fits internally in one of the PCI expansion slots. It is highly recommended for DVB-T reception and it is pretty cheap.

My Location

I live in Norfolk in England, and my nearest transmitter is in Tacolneston. Fortunately this is about 5 miles away which means I can "get away with" an indoor aerial, normally DVB=T requires an outdoor aerial. It is rather like FM radio ; you either get a good signal or none at all.

Setting up the hardware

Fortunately my hardware is autodetected by the Arch 0.8 Kernel, or almost completely. It does not install the cx88_dvb module which is required for my system.

Checking it exists

if you do either




it will list all the devices connected to the PCI bus or the USB bus respectively. You should see something which roughly describes your hardware. In my case, lspci produces

02:01.0 Multimedia video controller: Conexant CX23880/1/2/3 PCI Video and Audio Decoder (rev 05)
02:01.2 Multimedia controller: Conexant CX23880/1/2/3 PCI Video and Audio Decoder [MPEG Port] (rev 05)
02:01.4 Multimedia controller: Conexant CX23880/1/2/3 PCI Video and Audio Decoder [IR Port] (rev 05)

you can also look at the boot log by typing

dmesg | less

this shows what the system is doing as it 'boots up' ; somewhere you will hopefully see text which describes your card. In my case, a part of the log is

Linux video capture interface: v2.00
cx2388x cx88-mpeg Driver Manager version 0.0.6 loaded
CORE cx88[0]: subsystem: 0070:9002, board: Hauppauge Nova-T DVB-T [card=18,autodetected]
TV tuner 4 at 0x1fe, Radio tuner -1 at 0x1fe

there is a great deal more descriptive information, but this is very hardware specific.

Putting in the module

To force the Kernel to load the cx88_dvb module I changed my rc.conf file so the "MODULES" line reads as follows

MODULES=(r8169 cx88_dvb)

This will force the kernel to load the module at start up. The r8169 module is my network card and is likely to be different on your system.

You can reboot it ; if you don't want to, load it yourself, just this once, with

modprobe cx88_dvb

Checking it works

The simplest way to check it works initially, and that the system has recognised it is to check for the existence of the video device(s) in linux.

ls /dev/v4l

checks for analogue devices and

ls /dev/dvb

checks for digital devices. In both cases you should see a list of device links (like a directory listing). If these are present then linux has probably recognised the card, and it might work.

The next stage is to try and see if it is picking up any signal.

Getting the first digital signal

This part is very specific to DVB-T. For a standard analogue card, you have to do very little ; for DVB-C and DVB-S I do not know.

The first thing to do is to install linux-dvb-apps.

pacman -S linuxtv-dvb-apps

What transmitter do I use ?

Each transmitter transmits DVB-T signals on a different frequency. You need to find a file which describes your local transmitter frequencies.

The simplest way in the UK is to use the WolfBane website at If you click on "UK digital TV reception predictor" you can enter your postal code (what we call the "zip code") and it will tell you what tranmitters are available.

The next stage is to find the "ukxxxx" file.

What is the ukXXXX file ?

The ukxxxx file is the file that describes how your transmitter transmits DVB-T data. For my transmitter, Tacolneston, it looks like this :-

# UK Tacolneston
# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
T 730166670 8MHz 3/4 NONE QAM16 2k 1/32 NONE

I have no idea what it means either, if it's any consolation. Not that it matters much, as long as it works.

How do I find it ?

Unfortunately there is no central repository of these - as far as I know anyway (!). If you have installed linuxtv-dvb-apps (i.e. you're following the instructions) you should find a listing of these in the /usr/share/dvb-utils/scan/dvb-t directory.

There's about 30 listed here from various countries (including Australia, the UK and the Netherlands). If your transmitter is not listed here, as uk-Tacolneston wasn't, then you have to hunt on the web ; I googled for things like "DVB-T Transmitter MythTV Tacolneston" and the like, and found a gentleman called Adam Bower had already done the work for me ; thanks, Adam.

What is channels.conf ?

Having acquired your transmitter information (in my case, in the file uk-Tacolneston, you now query your local transmitter to see what channels it has to offer. These contain things like channel details and the tuning frequencies, go in a file commonly called "channels.conf". Once you have this, it should be easy to get your system watching television using mplayer.

Generating the channels.conf ?

You may be able to find a channels.conf for your transmitter already. If you can't, to create our channels.conf we use a program called 'scan' (part of the linux-dvb-apps we installed earlier)

scan uk-Tacolneston >channels.conf

This should print out reams of gobbledegook, hopefully without error messages. If there are error messages, check your signal strength (do you need a better aerial ?) and your frequencies, which may be wrong.

If you open channels.conf in an editor it should look something like this (lines truncated slightly here !)

Five:730166670:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_1_2 (etc)
Five Life:730166670:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC (etc)
Five US:730166670:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_1 (etc)

except there will be more of it (one line for each channel). The first things on each line should be recognisable as the channels available on your local service. The names are often truncated.

Getting the first picture

This part is again only applicable to DVB-T transmissions. The next part is to check the card is working by - watching some television.

Install and run Mplayer

My preferred viewer is mplayer (though you can do this with xine as well - the process is identical). To view the television in mplayer, firstly install it once and run it.

pacman -S mplayer

It is run once to create the .mplayer subdirectory in your home directory, which will contain your channels.conf file.

Making Mplayer work with DVB-T

To make mplayer work with DVB you have to tell it about the channels it can read. The simplest way of doing this is to copy the channels.conf file into your .mplayer directory

cp /aux/arch/channels.conf /home/paulr/.mplayer

(Your command may vary depending on your login name and the directory you put the channels.conf file)

You should now be able to watch TV. Look at one of the channels in your channels.conf. I shall choose the TV channel BBC1. The line from channels.conf looks like this.


to watch BBC1, you use the name of the channel - the line as far as the first colon. In this case

mplayer dvb://"BBC ONE"

Replace BBC ONE with the channel you wish to watch. With a bit of luck, if everything has worked, that should open a window and start playing the channel in glorious LinuxColour ; in this case , BBC1.

If not ... search the internet checking error messages :) If the previous stage worked (getting the uk-xxxxx and channels.conf) it's a bit puzzling that it doesn't work.

If you've got this far you can be pretty sure you will get MythTV to work properly - eventually. There's a bit more setting up to be done yet. It is not that difficult to get MythTV working, recording, display video, and so on. The hard bit - in my experience anyway - is getting the EPG working.

But it *is* worth it. MythTV watching is a whole new way of looking at television ; it's a whole new way of thinking about television. Without DRM.

"I think this is getting needlessly messianic." (Fook, Hitch Hikers Guide to the Galaxy)

Installing XMLTV=

What does XMLTV actually *do* ?

Why XMLTV is so problematical

What about the DVB-T EPG ?

What about the AUR

Download and first compile

The incremental fix and compile approach

Checking XMLTV actually works

You can have it all, but you don't want to

Installing MythTV

Installing MySQL

Installing MythTV

Creating the Database

Linking XMLTV and MythTV

The shotgun wedding

What you are trying to do, technically

Using MythTV

Using XMLTVDruid

Doing it by MySQL Script or similar

Checking that it's worked

Setting up MythTV

the various setups

Running MythTV