Next Previous Contents

3. Checking prerequisites.

You must ensure that any firewalls (either hardware, or a software firewall installed by your distribution) will not block access to the ports that will be used by the MythTV clients and servers on the "inside" LAN. The ports for MySQL (TCP port 3306) and mythbackend (TCP ports 6543 and 6544) must be open. It is strongly recommended that you do not expose the MythTV and MySQL ports to the Internet or your "Outside" LAN.

3.1 Hardware.

Hardware selection is a complex topic, one this HOWTO will only discuss briefly and in general terms. The following subsections offer some general guidance but stop short of offering specific recommendations.

For more detail about actual configurations that others have used, Mark Cooper has setup a hardware database at http://pvrhw.goldfish.org/. The website will let you browse what other users have reported as their hardware configuration, and how happy they are with the results.

If you have specific questions about the suitability of specific hardware choices, you can consult the archives of the mythtv-users mailing list at http://www.gossamer-threads.com/archive/MythTV_C2/Users_F11/ or post a question to the list.

CPU Type and Speed

Selection of CPU type and speed is one of the trickiest elements of hardware selection, mainly because there are so many tradeoffs which can be made. For example, if you have plenty of CPU, you can use higher bitrates or capture sizes, etc.

MythTV has two modes of operation. First, it can function as a software video encoder, which means that it uses a fairly generic "dumb" video capture card to get frames of video, encodes them using the CPU on your motherboard and writes them to disk. High-end video capture cards and devices like the Tivo and ReplayTV have dedicated encoder chips which use specialized hardware to convert the video stream to the MPEG-2 format without using the motherboard CPU. The main CPU has the responsibility of running the Operating System and reading and writing the encoded frames to the disk. These tasks have fairly low CPU requirements compared to encoding video, which is why a device like a Series 1 Tivo can run with only 16MB of RAM and a 54MHz CPU.

There are many variables that go into the question: "How fast a CPU do I need to run MythTV"? Obviously, the faster your CPU, the better your experience will be with MythTV. If you are using the software MPEG-4 encoder and performing the "Watch TV" function, where the CPU is both encoding and decoding video simultaneously to allow Pause, Fast Forward and Rewind functions for live TV requires more CPU then just encoding or decoding. MythTV also supports multiple encoder cards in a single PC, thereby increasing the CPU requirements if you plan on simultaneously encoding multiple programs. As a general guideline, plan on 1GHz per encoder.

Here are a few data points:

The second mode of operation is where MythTV is paired with a hardware-based video encoder, such as a Matrox G200 or a Hauppauge WinTV-PVR-250/350. In this mode, because the video encoding is being done by a dedicated video processor, the host CPU requirements are quite low. See the Video Capture Device section for details.

If you have a Via M10000 series or a Hauppauge PVR-350, MythTV can use the hardware-based video decoder for playback, which further reduces CPU requirements.

Memory

A MythTV host that is both a backend and a frontend and using software encoding with a single capture card should run adequately in 256MB of RAM. Additional RAM above 256MB will not necessarily increase performance, but may be useful if you are running multiple encoders.

Hard Disk(s)

Encoded video takes up a lot of hard disk space. The exact amount depends on the encoding scheme, the size of the raw images, and the frames per second, but typical values for MythTV range from 700 megabytes/hour to 2 gigabyte/hour for MPEG-4 and larger for MPEG-2 and RTJPEG.

NOTE: You must use DMA for hard drive access to prevent choppy or jittery video. Red Hat Linux 8.0 apparently does not enable DMA at boot time. See the Troubleshooting Section for instructions on how to do this.

Writing video to disk is sensitive to timing issues; RTJPEG requires less CPU with the tradeoff being larger files and needing to write to the disk faster. MPEG-4 requires more CPU, but the files are smaller. At the default resolution, MPEG-2 creates the largest files of all with almost no CPU impact.

See the Troubleshooting section for more information.

Filesystems

MythTV creates large files, many in excess of 2GB. You must use a filesystem that will allow you to create large files. Filesystems known to have problems with large files are FAT and FAT32.

Because of the size of these files, it may be useful to plan for future expansion right from the beginning. If your case and power supply have the capability for additional hard drives, read through the LVM and Advanced Partition Formatting sections for some pointers.

Video Capture Device

In order to watch live TV, MythTV will need one or more video capture devices with Linux drivers. For a list of video capture cards known to work with Linux, please see /usr/src/linux/Documentation/video4linux/bttv for a partial listing; even if your specific card is not listed, it may be that the vendor is actually using a standard reference design and placing their own name on it. See the video4linux mailing list ( https://listman.redhat.com/mailman/listinfo/video4linux-list) for more information and for specific hardware questions.

The most common inexpensive cards available use the Bt848 or Bt878 video capture chip; examples are the "Hauppauge WinTV Go" card and the "AverTV Desktop PVR" card, both of which use the bttv kernel module.


NOTE:  The ATI TV Wonder series and the ATI All-in-Wonder series of cards
are not the same.  The All-in-Wonder cards will not work with MythTV.

Newer cards may use the CX23881 series of chips; a driver is available at http://bytesex.org/cx88/.

After you have installed a suitable capture device, you can check that the kernel sees it with lspci. Look for an entry labeled "Multimedia video controller". To get more detailed information about the card, use lspci -v or lspci -vv. Ensure that your system is loading the bttv modules by typing:

# lsmod |grep bttv

You want to see the bttv module listed.

While inexpensive video-capture cards just capture raw frames, leaving encoding to software, some higher-end cards incorporate hardware-level encoding. Using either a G200 MJPEG encoder card, or a MPEG-2 encoder card supported by the IvyTV project http://ivtv.sourceforge.net/ such as the Hauppauge PVR-250, PVR-350, Avermedia M179, Hauppauge "Freestyle" or Yuan M600 cards will allow you to use dedicated hardware encoders rather than your CPU. Release 0.13 of MythTV is able to use these MPEG-2 encoders as an input device for live TV and for scheduled recordings. (The PVR-350 can simultaneously be used as an output device.) Using the onboard MPEG-2 encoder drastically reduces the CPU requirements for encoding.

Here are some data points for encoding:

Here are some data points for decoding:

See the Hauppauge PVR-250/350 hardware MPEG-2 encoder. section for information on installing a PVR-250 on Mandrake 9.1. The information contained in the section will also apply to other MPEG-2 encoder cards supported by the IVTV driver.

NOTE: The ATI All-in-Wonder cards (which are not the same as the ATI TV Wonder, TV Wonder VE or TV Wonder Pro) will not work as a MythTV capture device because the GATOS http://gatos.sourceforge.net drivers that are available provide only a limited subset of the V4L API. The TV Wonder series of cards are supported by the Bt8x8 Video4Linux driver.

Sound card

The system needs a sound card or an onboard equivalent on the motherboard to play back and in most cases, to record sound. Any sound card that can be operated by the ALSA (Advanced Linux Sound Architecture) kernel modules will work with MythTV. However, some cards and drivers will provide better quality or compatibility than others. In particular, many audio devices included on motherboards can be problematic.

The usual practice for capturing the audio associated with the video is to run a cable from an audio output on the video capture card to the Line input on a sound card. However, some video capture cards provide onboard audio capabilities that work with the kernel btaudio module instead, thereby eliminating the need for a cable. This is useful if you will be using multiple capture cards in a single chassis, since each capture card will not need its own sound card. Note that a separate sound card is still required for playback when using btaudio, and that often the audio recorded in this way will be mono only. See the btaudio section for more information.

NOTE: The MPEG-2 cards supported by the IVTV driver do not require a sound card for audio capture.

NOTE: Plugging a Line-level device into the Mic input is not recommended. Line-level devices have higher volatages and can damage the soundcard. In addition, even if it doesn't break your card, you will be getting Mono sound. See the Linux MP3 HOWTO at http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/MP3-HOWTO.html#toc8 for additional information.

Video Display Card

MythTV will work with just about any video card. However, it is highly recommended that you use a card which supports XVideo (XV) extensions. If your card does not support XV, color conversion and scaling will be performed by your CPU rather than the video card. This is very CPU and memory intensive and will often result in dropped frames and a corresponding degradation of quality. Check the XFree86 documentation for details if you are uncertain about your preferred card. You may also run xvinfo; look for your video card to be listed as one of the adapters.

If you want to use MythTV with a standard television, you will need a physical connection from your video card to your TV set, which can either be a TV-out port on the card itself or an external adapter that converts the VGA signal to an appropriate video signal. "Appropriate" depends on a number of factors, such as video standard (NTSC vs PAL) type of input connection (Composite vs SVideo), etc.

Note that with some video cards and X drivers, Xvideo extensions are only supported on the VGA output, and not on the TV output.

Cards with TV out

The next section deals with a number of cards that are known to have TV-out ports. The list is unlikely to be complete, so if you know of others, please post a message to the mythtv-users mailing list so the information can be included in future versions of the HOWTO. The list is organized by manufacturer.

Reports here are based on what users of the cards have posted on the mythtv-users mailing list, so if you need configuration details, please search the archives at http://www.gossamer-threads.com/archive/MythTV_C2/Users_F11/ using the card name in your search string.

ATI

ATI makes many cards with TV-out capability, but ATI offers no official support for their use with Linux. The standard XFree86 ati driver does not support TV-out.

The enhanced ati.2 X driver created by the GATOS http://gatos.sourceforge.net project offers some support for TV-out, but only in its "experimental" version, available through CVS. There have been reports from people who say they have made this driver work with one or another ATI card. For example, Bruce Markey mailto:bjm@lvcm.com writes (on the mythtv-users mailing list): "I got this to work. You can quote me on that. I've used TV-out on several models of ATI cards both All-In-Wonder and regular cards with TV-out." See the "Adventurous Setup" section of http://gatos.sourceforge.net/watching_tv.php for details. Also see http://www.retinalburn.net/linux/tvout.html for more information.

Specific cards:

Matrox

The standard Matrox driver included with XFree86 does not support TV-out.

Older Matrox cards can be used with a proprietary X driver provided by Matrox, and it does simultaneously support TV out and XVideo on some cards. See http://www.matrox.com/mga/support/drivers/files/lnx_21.cfm for details.

Newer Matrox cards can be run with a set of kernel patches (for kernel 2.4.19) and a customized X driver, but this arrangement does not support XVideo on TV-out. See http://www.bglug.ca/matrox_tvout/g450_tvout_howto.html for details.

Specific cards:

nVidia

Some nVidia cards with TV-out can be run using the standard nv driver in XFree86, combined with the userspace application nvtv to control the TV-out port. See http://sourceforge.net/projects/nv-tv-out/ for details. Recent versions of the nVidia driver have better support for overscan and other features useful with TV-Out, so the nvtv application may not be required.

Some nVidia cards can be run with a proprietary nVidia X driver made available by nVidia. See http://www.nvidia.com/view.asp?IO=linux for more information.

Specific cards:

Savage

The standard savage X driver supports TV out on some Savage cards. Unfortunately, XVideo support for the Savage 2000 card (a very common and inexpensive Savage card with TV out) is broken. See http://www.probo.com/timr/savage40.html for details.

Specific cards:

Hauppauge PVR-350

MythTV supports the TV-out and MPEG-2 decoder functions in the IvyTV driver.

Other Options

Some devices with onboard TV-out capability, such as XBoxes converted to Linux and some laptops, can be used as MythTV frontends to display on a television screen. Please consult the mythtv-users mailing list for messages that report the details of these special arrangements.

External Adapters

External adapters convert standard VGA output to a form suitable for display on a television. The output format varies by region, since different countries have different TV standards. People on the mythtv-users list have mentioned these adapters:

3.2 Software.

There are a few ways of installing programs on Linux systems; you can either use a pre-compiled package, or install from a tarball after satisfying any prerequisites.

NOTE: you must have the MySQL database software installed on a system to store the master database. This does not necessarily mean that MySQL must run on one of the MythTV boxes.

NOTE: The following distributions have issues which may prevent a successful MythTV installation:

Pre-compiled packages.

A number of people have created pre-compiled packages for MythTV that may make your installation easier.

BIG FAT WARNING: This HOWTO assumes that you have not installed MythTV from a package. All example command lines and file locations are based on the MythTV tarball defaults. Some packagers have modified the filenames, binaries and file locations to match what is commonly found in that distribution. Any issues with MythTV installed via a pre-compiled package MUST be raised with the packager.

If you use any of the pre-compiled packages you may not need to perform any additional configuration steps in this HOWTO. The next logical step is configuring MySQL, which you may or may not have to perform. See your package documentation.

Red Hat Linux

Red Hat Linux 9 packages for MythTV and most of its add-on modules and some themes have been packaged by mailto:Axel.Thimm@physik.fu-berlin.de and are available at http://atrpms.physik.fu-berlin.de/topic/multimedia/. All of the prerequisites for MythTV (such as XMLTV) are available as RPM packages. If you have problems with the RPMs, please send him email directly.

Given the large number of dependent RPMs you are advised to use tools like apt or yum for automatic retrieval and installation of the required RPMs. ( http://atrpms.physik.fu-berlin.de/install.html) In this case a special meta-package called mythtv-suite will allow you to install all of MythTV and its add-ons, plus all dependencies.

If you don't have apt or yum on your machine, download and install the atrpms-kickstart package. Install the package with:

# rpm -Uvh atrpms-kickstart*
Then update your apt package listings:
# apt-get update
And finally:
# apt-get install mythtv-suite
These steps however, do NOT perform the installation of any drivers required for ALSA, capture cards, lirc, etc., nor do they set up your MythTV database. Check ATrpms for the drivers you need.

Further documentation on using ATrpms packages can be found in Jarod Wilson's mailto:jcw@wilsonet.com "HOWTO Build a MythTV System on Red Hat Linux 9 w/ATrpms" document, http://pvrhw.goldfish.org/tiki-page.php?pageName=rh9pvr250. Just like 3rd-party packages, any 3rd-party documentation problems should be brought up with the maintainer.

Mandrake

Thac has created RPMs for MythTV for Mandrake 9.0 and 9.1 which may be obtained from http://rpm.nyvalls.se/ If you have problems with the RPMs, please send him email directly at thac@nyvalls.se.

Debian

Debian packages for MythTV and most of its add-on modules are maintained by Matt Zimmerman mailto:mdz@debian.org and are available at http://dijkstra.csh.rit.edu/~mdz/debian/dists/woody/mythtv/ (for Debian 3.0/woody) and http://dijkstra.csh.rit.edu/~mdz/debian/dists/unstable/mythtv/ (for unstable). Be sure to use the appropriate packages for your system; the woody packages cannot be installed on unstable, nor vice versa. Installation instructions can be found on those pages as well. All of the prerequisites for MythTV are available as Debian packages, most of them from the official Debian archive.

NOTE: As of 2003-11-03, the .debs are still for MythTV 0.11. New .debs will be created some time in December 2003.

If you are running woody, be sure to follow the instructions on the above page to ensure that the MySQL server starts up immediately after it is installed. If you are running unstable, this is the default behavior.

The Debian packages are configured such that MythTV programs should be run as the mythtv user, which is automatically created during installation. This user has access to write new recordings to disk in the default directory, read and write the database, access the audio and video devices, and everything else that MythTV needs to do.

See /usr/share/doc/packagename/README.Debian for more information, including copies of the MythTV documentation. The mythtv-doc package contains a copy of this HOWTO in /usr/share/doc/mythtv-doc.

Manual installation

You may use the graphical tools that come with your distribution, or you can use command-line utilities. Either system will get the job done, and it all depends on your comfort level with Linux.

In order to compile MythTV, we need to make sure that the software it needs is installed. As of 2003-03-15, this list includes mysql, gcc, freetype2-devel, XFree86-devel, qt-devel and lame. If you're going to use a remote control with MythTV, you're going to need the cdialog package in order to compile lircd if your distribution doesn't have a pre-packaged lirc. If you are using XMLTV as a grabber, you will need perl.


NOTE:  Qt v3.1 is required.

NOTE:  If you are going to be using RPMs to install various
components, you should be aware that not all packages include the necessary
headers for compiling packages.  If you're having trouble compiling, ensure
that you've installed the -devel version of a prerequisite.

NOTE:  Other than where noted, Mandrake 9.1 users may follow the
Mandrake 9.0 instructions.

There appears to be issues with ALSA and simultaneously recording and playing sound, which is a core requirement for MythTV. If you are not running ALSA 0.9.0rc6 or higher and experience lock-ups of your system when trying to use MythTV, then please check the main ALSA website and upgrade to the latest version, or see if your distribution has already packaged the latest ALSA drivers.

Graphical installation tools.

Mandrake 9.0

On systems running KDE, a tool which will allow you to see what packages are available and if they're installed on your system can be accessed by clicking K->Configuration->Packaging->KPackage

While the graphical tools are nice, the command line tool is actually easier to use. It's strongly recommended that you use the command line tool.

There are many inter-related modules, so make sure that you've got the main package for each one, and not a sub package for an unrelated item. For example, there are many modules that have "perl" in them; some are a part of the apache web server, others are a part of the perl distribution. In each case, we're looking to make sure that the primary module is getting installed.

Click the magnifying glass or press CTRL-F and enter "perl" as your search term. You should find it under the "Perl" folder. You need at least the perl 5.80 base package installed. If not, click on the "Mark" button.

If you are going to be installing mysql on this system, search for mysql - it should be under "Databases". Make sure that mysql and mysql-clients are installed. If not, click on "Mark".

Search for gcc. You're going to need gcc and gcc-c++ installed.

Search for freetype2. Make sure that you've got freetype2 and freetype2-devel installed.

Search for XFree86-devel.

Finally, check for qt. You'll need libqt3-devel (under folder "KDE and Qt") and libqt3 ("Libraries").


NOTE for Mandrake 9.1 users:  Mandrake 9.1 has removed the MySQL modules
from the default installation.  Ensure that you install libqt3-mysql.

Make sure that cdialog is installed if you want to use MythTV with a remote control if you need to compile lirc from source.

alsa-utils is needed for setting the volume. MythTV now has native volume support, but you may have a special configuration that necessitates an external program to adjust your volume settings. If this is the case, then you can disable native volume support.

If you marked anything to install, click on Install Marked. Click "Yes" or OK if you get a message about satisfying dependencies.

Red Hat Linux 8.0

Red Hat Linux 8.0 does not have the same graphical package manager used by other distributions, so you will need to use Red Hat's package manager. This is the same utility you saw upon installation from the Red Hat Linux 8.0 installation CD, and it allows you to select packages at installation time, or once the system is up and running. You can access this program by selecting

RedHatMenu>System Settings>Packages

If you did a typical Desktop install of Red Hat Linux 8.0 make sure you have selected:

Click Install to continue.

You can not install qt-MySQL, a necessary prerequisite, graphically. To install this package using the command line do

$ up2date --solvedeps qt-MySQL

NOTE: ensure that the correct symlinks have been created for the XFree-86 development libraries:

# ln -s /usr/X11R6/lib/libXext.so.6 /usr/X11R6/lib/libXext.so
# ln -s /usr/X11R6/lib/libX11.so.6 /usr/X11R6/lib/libX11.so

Command-line installation.

This section details the various methods for installing prerequisites from the command line.

Mandrake

urpmi is the simplest tool for installation of packages from the command line, but properly configuring it can be difficult. The following website http://plf.zarb.org/~nanardon/urpmiweb.php will allow you to choose a mirror site and then present the command-line configuration text for that mirror. You will most likely need to add a "Contrib" mirror to your setup. If you add a site from the "Penguin Liberation Front", you will be able to load the lame library without compiling from source.

Special instructions for Mandrake 8.2

NOTE: These instructions will be removed on 2004-01-15. Contact the HOWTO maintainer if you wish to create up-to-date docs for Mandrake 8.2.

Mandrake 8.2 does not have a pre-packaged libqt3-devel, so you must compile and install this manually. The following command will install the prerequisites for qt3, so don't skip this step. The simplest tool for installing packages from the command line is urpmi.

Open a shell, and execute the following. You may get asked a number of questions regarding dependencies. It's best to answer "YES".

$ urpmi mesa-common-devel libmng1-devel mysql-devel libunixodbc2-devel
$ urpmi postgresql-devel xfree86-static-libs
Once all of the prerequisites have been installed, the next step is to obtain and compile the source RPM.

Go to http://www.rpmfind.net and search for qt3. There will be a number of different versions available. As of 2002-12-02, the latest version for Mandrake is called qt3-3.0.5-7mdk.src.rpm. Unless you are running Mandrake Cooker (the beta version of the next release of Mandrake), make sure to download the standard "Mandrake" release. Download the .src.rpm file to a directory that you can find.

$ su
# cp qt3-3.0.5-7mdk.src.rpm /usr/src/RPMS/SRPMS
# cd /usr/src/RPMS/SRPMS
# rpm --rebuild qt3-3.0.5-7mdk.src.rpm
# cd ../RPMS
# ls -l
The "ls -l" command will show you a directory listing. There should be two files, one will be named "qt3" and the other will be "qt3-devel". The full filenames will vary, so one you know the filename, you can install them with
# rpm -Uvh [filename1]
# rpm -Uvh [filename2]
Once this has completed (it can take a while, so please be patient), continue by following the Mandrake 9.0 instructions.

Mandrake 8.2 and 9.0

The simplest tool for installing packages from the command line is urpmi.

Open a shell, and execute the following, all on the same line. You may get asked a number of questions regarding dependencies. It's best to answer "YES".

$ su
# urpmi mysql gcc gcc-c++ freetype2-devel cdialog alsa-utils
# urpmi XFree86-devel perl
# urpmi libqt3-devel


NOTE for Mandrake 9.1 users: execute the following command.

# urpmi libqt3-mysql

However, you might get this when you execute the command above:
[root@pvr root]# urpmi mysql gcc gcc-c++ freetype2-devel libqt3-devel alsa-utils XFree86-devel perl
everything already installed

In that case, you're ready to move to the next section.

Gentoo.

If Qt has not been installed on your system: Edit /etc/make.conf and locate the "USE" variable. If the line is commented out, remove the comment. The line should have at least:

USE="mysql alsa"
Next you need to build Qt. If you don't plan on using the ebuilds as described in the Gentoo section then you also need to install lame.
# emerge lame mysql qt

If you have already installed Qt: you will need to rebuild because the default installation doesn't include mysql support, a requirement for MythTV. To enable SQL support, add "mysql" to your USE variable in /etc/make.conf and rebuild Qt by running

# emerge qt

All the necessary files will be downloaded and built. Even on a fast machine this may take a lot of time if you need to do a full Qt build.


Next Previous Contents