Ubuntu:MythTV
From Linux 101, The beginner's guide to all things Linux.
Here's my tutorial for installing MythTV 0.19 on Ubuntu Breezy (5.10).
Contents |
[edit] Getting Started
First you'll need to get a computer and install Ubuntu on it. I am using Clemson Ubuntu because this will make MythTV installation a little simpler. This is mostly just because it adds some extra repositories which include packages MythTV needs, along with helpful clemson- metapackages that depend on many of the required libraries and utilities.
[edit] Hardware
For my setup I am using a 2.2 GHz Northwood Intel Pentium 4 in a barebones Asus machine. It has a Hauppauge PVR-250 TV capture card, and an 80 GB hard disk.
[edit] Operating System
Installing Ubuntu was pretty straightforward. The only abnormal steps I took were done during the partitioning step. I set up my machine so that some areas of the filesystem had a fixed size by putting /var and /home their own partitions.
MythTV records into /var/lib/mythtv/ and since its recordings are rather large, this can fill up the disk quickly if you're not careful. So, setting /var up on its own partition ensures that if that partition gets full, it will not prevent the rest of the computer from working normally (because / will not be full). Here's how I partitioned my 80 GB drive:
- / : 10 GB
- /home : 19 GB
- swap : 1 GB
- /var : 45 GB
- /boot : 256 MB
I used Logical Volume Management to set up my partitions. This ensures that I can resize any of the partitions later, or if I add a new disk, I can use some of its space to extend the other partitions.
[edit] Prerequisite Software
MythTV has a number of software requirements that must be met before it will run properly. We'll satisfy most of the requirements by installing Ubuntu packages.
[edit] Install Packages
First, since we're using Clemson Ubuntu, we already have the package clemson-base. This not only adds other packages to your system for install, it adds other repositories that have software not usually available to users after a new install of Ubuntu. Most importantly, the clemson-multimedia package contains some audio and video libraries and codecs that are crucial to MythTV's operation.
Here's a list of packages you'll need to install. They can be installed, of course, through Synaptic (System -> Administration -> Synaptic Package Manager).
- clemson-multimedia for codecs and multimedia libraries. Depends on:
- totem-xine
- beep-media-player
- libdvdcss2
- libmad0
- w32codecs
- gstreamer0.8-lame
- gstreamer0.8-plugins
- clemson-devel for compilers, build tools, kernel headers, manpages, etc. Depends on:
- linux-headers-386
- linux-headers-686
- build-essential
- manpages-dev
- manpages-posix-dev
- gcc-3.4
- kdelibs4-dev
- liblame-dev
- libxxf86vm-dev
- libttf2 for TrueType font support
- libqt3-mt for QT
- libqt3-mt-mysql for MySQL support in QT
- linux-source-2.6.12 for the Linux sources. If you are not using 2.6.12 get a different version. Search in Synaptic for "linux-source".
- mysql-client for MySQL client (database administration)
- mysql-common parts of MySQL
- mysql-server for MySQL server
- xlibs-dev
- xmltv for downloading TV listings
Install all of these packages and each of their dependencies.
|
Note: Don't install the mythtv and mythtv-database packages - they're for version 0.18.1, not 0.19. |
|
Note: If you don't have Clemson Ubuntu and you're wondering about clemson-devel and clemson-multimedia, these are just metapackages that pull in a lot of other stuff. Just install the dependencies listed below those two packages instead of them. |
|
Note: One of MySQL's dependencies is Postfix (a mail server). When you install it a dialog will pop up asking you how you'd like it configured. Select Local only (unless you have some other mail server config setup in mind - but you're on your own for that). Next it will ask for a "mail name", the default localhost.localdomain is fine. |
[edit] IVTV - Drivers for TV card
My Hauppauge card works well in Linux using drivers called IVTV. These drivers are not yet part of the Linux kernel so we must download them and compile them ourselves. In the previous step we installed the Linux kernel headers which are needed by IVTV. Now we must set up the kernel build environment so that the IVTV build scripts can use them.
[edit] Setup Build Environment
|
Note: I am still assuming that you're using kernel 2.6.12 like me, if you're not, change the instructions below to fit your system. |
- Change to the system source directory.
cd /usr/src
- Unpack the kernel source.
sudo tar jxvf linux-source-2.6.12.tar.bz2
- Create two symbolic links, these are important because the IVTV driver is built using these.
sudo ln -s /usr/src/linux-source-2.6.12 /usr/src/linux sudo ln -s /usr/src/linux /lib/modules/`uname -r`/build
- Now copy over the config for the kernel, and build it.
sudo cp /boot/config-`uname -r` /usr/src/linux/.config cd linux sudo make oldconfig
[edit] Compiling IVTV
- Download IVTV. I'm using the latest stable version 0.4.3 which was just released yesterday. You should download whatever is the latest version on the IVTV web site (http://ivtvdriver.org/). I like to put things in a downloads directory in my home, you can put them wherever you like. I will use ~/downloads as a point of reference.
cd mkdir ~/downloads cd ~/downloads wget http://dl.ivtvdriver.org/ivtv/archive/0.4.x/ivtv-0.4.3.tar.gz
- Unpack it.
tar zxvf ivtv-0.4.3.tar.gz
- Enter the new directory.
cd ivtv-0.4.3
- Compile the driver.
make
- Install it.
sudo make install
Now, the IVTV driver is installed. Before it can be loaded, however, one must get the firmware for the card.
[edit] Getting the Firmware
This is explained in detail on the IVTV wiki here: http://ivtvdriver.org/index.php/Firmware
Basically, the firmware for the Hauppauge cards is not stored on the card itself, but loaded by the driver. So, we must extract the firmware from the Windows drivers, and install it in the right place on our system. I've listed the commands on how to install on Ubuntu, for a better explanation see the link to the IVTV wiki.
- Return to the downloads directory, get the firmware and unpack it.
cd ~/downloads mkdir pvr-firmware cd pvr-firmware wget ftp://ftp.shspvr.com/download/wintv-pvr_150-500/inf/pvr_2.0.24.23035.zip unzip pvr_2.0.24.23035.zip
- Install the firmware in the appropriate place.
sudo cp HcwMakoA.ROM /usr/lib/hotplug/firmware/v4l-cx25840.fw sudo cp HcwFalcn.rom /usr/lib/hotplug/firmware/v4l-cx2341x-enc.fw
- Get the encoder and decoder firmware and install it using a utility that comes with IVTV.
wget ftp://ftp.shspvr.com/download/wintv-pvr_250-350/inf/pvr_1.18.21.22254_inf.zip sudo ../ivtv-0.4.3/utils/ivtvfwextract.pl pvr_1.18.21.22254_inf.zip
- Remove the redundant encoder and move the decoder firmware to the appropriate place.
sudo rm /lib/modules/ivtv-fw-enc.bin sudo mv /lib/modules/ivtv-fw-dec.bin /usr/lib/hotplug/firmware/v4l-cx2341x-dec.fw
- Install the mpeg firmware that comes with IVTV to the appropriate place.
cd ../ivtv-0.4.3 sudo cp v4l-cx2341x-init.mpg /usr/lib/hotplug/firmware
Now we need to load the driver and see if it worked.
[edit] Loading the driver
- Get the system to find the new module.
sudo depmod -a
- Load the ivtv module.
sudo modprobe ivtv
- Check the kernel logs to see how things went.
dmesg | grep ivtv
- If you see errors in this, consult the IVTV Troubleshooting page and other IVTV documentation on the wiki.
| Navigation: Ubuntu Index |

