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 a good MythTV experience, you must understand that MythTV exercises your hardware more than a typical desktop. Encoder cards generate DMA across the PCI bus. The CPU is busy encoding / decoding video. Hard drives are constantly reading and writing data. Building a MythTV system on older / "spare" hardware may be an exercise in frustration and can waste many hours of valuable time.
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/lists/mythtv/ 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 if you are doing software-based encoding, less if you are using a hardware-based encoder.
Here are a few data points:
- A PIII/733MHz system can encode one video stream using the MPEG-4 codec using 480x480 capture resolution. This does not allow for live TV watching, but does allow for encoding video and then watching it later.
- A developer states that his AMD1800+ system can almost encode two MPEG-4 video streams and watch one program simultaneously.
- A PIII/800MHz system with 512MB RAM can encode one video stream using the RTjpeg codec with 480x480 capture resolution and play it back simultaneously, thereby allowing live TV watching.
- A dual Celeron/450MHz is able to view a 480x480 MPEG-4/3300kbps file created on a different system with 30% CPU usage.
- A P4 2.4GHz machine can encode two 3300Kbps 480x480 MPEG-4 files and simultaneously serve content to a remote frontend.
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-150/250/350/500. 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.
The price differential between a frame grabber and a card that implements hardware MPEG-2 encoding, such as the Hauppauge PVR-x50 series, is now less than $30 US. Primary development in MythTV has transitioned to supporting MPEG-2 capture devices and HDTV, so if given the option, go with the hardware MPEG-2 encoder.
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 for MPEG-4, 2 GB/hour for MPEG-2 and RTjpeg and 7 GB/hour for ATSC HDTV.
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 4GB. You must use a 64 or 128 bit filesystem. These will allow you to create large files. Filesystems known to have problems with large files are FAT (all versions), and ReiserFS (versions 3 and 4).
Because MythTV creates very large files, a filesystem that does well at deleting large files is important. Numerous benchmarks show that XFS and JFS do very well at this task. You are strongly encouraged to consider one of these for your MythTV filesystem. JFS is the absolute best at deletion, so you may want to try it if XFS gives you problems. MythTV .21 incorporates a "slow delete" feature, which progressively shrinks the file rather than attempting to delete it all at once, so if you're more comfortable with a filesystem such as ext3 (whose delete performance for large files isn't that good) you may use it rather than one of the known-good high-performance file systems. There are other ramifications to using XFS and JFS - neither offer the opportunity to shrink a filesystem; they may only be expanded.
Because of the size of the MythTV files, it may be useful to plan for future expansion right from the beginning. If your case and power supply have the capacity for additional hard drives, read through the LVM and Advanced Partition Formatting sections for some pointers.
Video Capture Device
In order to capture video, MythTV will need one or more video capture devices with Linux drivers. There are a number of classes of hardware available for capturing video.
Frame Grabbers.
This class of card is the simplest and is usually the cheapest. There is no on-board encoding of the analog video; hardware known as a Digital-Analog Converter (DAC) takes the video and presents it to the computer in an essentially raw digital form.
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, Bt878 or CX2388x series of video capture chips; 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.
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.
Hardware MPEG-2 encoders.
While inexpensive video-capture cards simply capture raw frames, leaving encoding to software, some higher-end cards incorporate hardware-based encoding. Using either a G200 MJPEG encoder card, or a MPEG-2 encoder card supported by the IvyTV project http://ivtvdriver.org such as the Hauppauge PVR-150/250/350/500, Avermedia M179, Hauppauge "Freestyle" or Yuan M600 cards will allow you to use dedicated hardware encoders rather than your CPU. (The PVR-350 can simultaneously be used as an output device.) Using the on-board MPEG-2 encoder greatly reduces the CPU requirements for encoding.
The ivtv driver was incorporated into the Linux kernel starting at v2.6.22.
There is a Beta driver for the HVR-1600 card at http://www.ivtvdriver.org/index.php/Cx18
NOTE: Motherboards with the Via chipset are notoriously bad with DMA and have caused numerous issues with ivtv, including hard locks. See the ivtv website http://ivtvdriver.org for the latest information on what works and what doesn't.
Here are some data points for encoding:
- A Celeron 450 uses 2% CPU for encoding a 480x480 16Mbps MPEG-2 stream.
Here are some data points for decoding:
- An Athlon 1800XP can decode a 720x480 8Mbps MPEG-2 file using 10% CPU
- An Athlon 1GHz can decode a 720x480 16Mbps MPEG-2 file using 30-50% CPU, can decode a 480x480 16Mbps MPEG-2 using 30% CPU and approximately 30% for Live TV at 416x480.
- A P3-550 can decode a 480x480 16Mbps MPEG-2 file with 55% CPU.
- A Celeron 450 (no SSE) can decode a 480x480 16Mbps MPEG-2 file with 80% CPU.
DVB capture cards.
DVB is a video standard primarily found in Europe (where it comes in DVB-C, DVB-T and DVB-S varieties for Cable, Terrestrial and Satellite) and is also used as the programming interface for HDTV capture cards in Linux. To see if your DVB card is supported, see the list of cards in the "Supported Hardware" section of the DVB Wiki at http://www.linuxtv.org/wiki/index.php/Main_Page for more information.
In the United States, you may use a card such as the TwinHan to obtain unencrypted Free-To-Air satellite channels. See http://www.lyngsat.com/ for the types of content which is available.
HDTV.
There are a number of HDTV cards with Linux drivers which are known to operate in the United States; a complete list of cards with DVB drivers can be found at http://www.linuxtv.org/wiki/index.php/ATSC_Devices Some cards support capture of unencrypted digital cable TV (utilizing QAM256), others will only work with Over The Air (aka "OTA") signals captured with an antenna (with 8VSB).
Cards that have been reported to work include:
- pcHDTV HD-2000, Air2PC PCI rev 1-3 (8VSB only)
- SiliconDust HDHomeRun (8VSB, QAM256)
- pcHDTV HD-3000/5500 (8VSB, QAM256)
- Air2PC HD-5000 (8VSB, QAM256)
- DViCO Fusion HDTV Lite/Gold 5 (8VSB, QAM256)
NOTE: There are no known consumer-level capture devices which will allow you to capture the HDTV output (DVI, HDMI, VGA, YPbPr / Component) from a set-top box commonly found with digital cable systems or satellite systems. None of the capture devices listed above perform any encoding; they merely allow your computer to save a copy of a HDTV stream which has already been converted to MPEG-2 at the broadcast facility.
NOTE:: All of the cards listed above (except for the HD-2000 and HDHomeRun) should be configured as DVB cards. The HD-2000 can be configured as a pcHDTV card if you use the V4L drivers from http://www.pchdtv.com and use Linux kernel 2.6.9 or earlier. With kernel 2.6.10 and higher it must be configured as a DVB card, but you lose access to the second antenna input in ATSC mode. The HDHomeRun should be configured as two HDHomeRun cards, one for each tuner.
To playback HDTV content, plan on a powerful CPU. "How powerful?" depends on a number of factors, such as the capture resolution, whether the video is progressive or interlaced, and whether your display card has hardware-assist support for Linux.
The Simple Answer: Once you are in the 3.2 Ghz P4-class of CPU you should have no issues with viewing HDTV.
The Complicated Answer:
For 720p content (1280x720), a 2.4GHz P4 should be sufficient.
For 1920x1080i->1920x1080p with the better deinterlacing methods done in real time a 2.4GHz CPU is taxed, but should work if you use "Bob and Weave" deinterlacing, or if you have an NVIDIA card with MPEG-2 hardware acceleration. If you enable the hardware acceleration, you may be able to use a 1.8GHz processor.
Firewire.
You may use the Firewire output of the Motorola DCT6200 or the SA3250. If your provider uses 5C encryption on a particular channel, you won't be able to get any content.
DBoxII or other devices running Neutrino
You may use the Ethernet port of an DBoxII or a similar device to capture MPEG2. Your set top box has to be running the Neutrino GUI.
USB Capture Devices.
The Plextor ConvertX PVR devices are supported through Linux drivers available from http://www.plextor.com/english/support/LinuxSDK.htm. MythTV uses the Plextor to capture hardware encoded MPEG-4, so the host CPU requirements are low.
Hauppauge WinTV-PVR-USB2 (driver available at http://www.isely.net/pvrusb2/) emulates a PVR-x50 card.
IP Recorder (RTSP, RTS, UDP)
MPEG-2, MPEG-4 and H.264 internet TS stream recording is supported using the IPTV recorder in MythTV. This recorder expects the channels to be supplied as a m3u playlist. If your DSL/Fiber provider supplies television service, but does not provide a m3u playlist for the channels, you can construct one for your own use. You do not need to download it from the same server as the streams themselves, and can also read it from a file if this is more convenient.
NOTE: Some DSL providers only allow you to use one recorder at a time, so you may need to limit yourself to one recorder in MythTV and turn off any set top box the cable provider sold or rented to you with your service. This limitation is independent of the bandwidth you have purchased.
Hardware known NOT to work and other issues
- Hauppauge WinTV-D or -HD (no driver)
- Hauppauge WinTV-USB series
- Hauppauge WinTV-PVR-usb (model 602), or WinTV-PVR-PCI (model 880) cards (no driver - this is not the PVR-250/350 series of cards supported by the IvyTV driver)
- ATI All-in-Wonder series
Sound card
The system needs a sound card or an on-board 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 on-board 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.
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 X 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), the 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/lists/mythtv/ using the card name in your search string.
ATI
ATI makes many cards with TV-out capability, but only offers Linux drivers for Radeon 8500 and above cards. See the Drivers and Software section of http://www.ati.com for the driver and additional information.
The enhanced ati.2 X driver created by the GATOS http://gatos.sourceforge.net project offers some support for TV-out on other ATI cards, 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.
NVIDIA
Some NVIDIA cards with TV-out can be run using the standard nv driver in X, 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/object/unix.html for more information.
NOTE: It's strongly recommended that you use the proprietary NVIDIA drivers; they have excellent support for XvMC and ship with a good configuration utility. XvMC provides MPEG-2 hardware acceleration, which is important if you want to display HDTV.
Hauppauge PVR-350
MythTV supports the TV-out and MPEG-2 decoder functions in the IvyTV driver.
The PVR-350 is unique amongst the Hauppauge PVR-x50 cards in that it also supports audio output, but you need to connect that audio output to something. There are two courses of action you may take:
- Take the audio output from the PVR-350 and plug it into an input on a sound card on your machine. You may then use MythTV's internal audio controls.
- Take the audio output from the PVR-350 and connect it directly to your television / audio system. You must indicate that you are using external audio control on the PVR-350 setup page.
Other Options
Some devices with on-board 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:
- AITech Web Cable Plus, powered by external transformer or takes power from PS/2 keyboard connector, support resolutions up to 1024x768, outputs composite and SVideo, provides position adjustment.
- Averkey lite, powered by a USB port, has Composite, SVideo, YPbPr outputs; pan, brightness, overscan/underscan controls; supports up to 1024x768 outputs; and supports PAL and NTSC.
- ADS TV Elite XGA
- AverKey iMicro (comments are generally favorable)
- AITech Web Cable (comments are generally unfavorable, different than the "Plus" version above)
- TVIEW Gold (mentioned once, favorably)
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.
Pre-compiled packages
A number of people have created pre-compiled packages for MythTV that may make your installation easier.
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 / Fedora Core
The definitive documentation on installing MythTV on Red Hat Linux / Fedora Core can be found in Jarod Wilson's ( mailto:jcw@wilsonet.com) HOWTO at http://wilsonet.com/mythtv/ Just like 3rd-party packages, any 3rd-party documentation problems should be brought up with the 3rd-parties (maintainer, lists, bugzillas etc.). The installation instructions which follow should be used as a guide only; refer to Jarod's guide.
Red Hat Linux and Fedora Core packages for MythTV and all of its add-on modules and some themes have been packaged by mailto:Axel.Thimm@ATrpms.net and are available at http://ATrpms.net/topic/multimedia/. All of the prerequisites for MythTV (such as XMLTV) are available as RPM packages. If you have problems with the RPMs, please contact the ATrpms lists at http://lists.ATrpms.net/ or file a bug against http://bugzilla.ATrpms.net/.
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.net/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 from http://ATrpms.net/name/atrpms-kickstart/. Install the package with:
# rpm -Uvh atrpms-kickstart*
Then run:
# apt-get update
# apt-get dist-upgrade
# 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 kernel modules, etc., nor do
they set up your MythTV database. Check
http://ATrpms.net/topic/multimedia/ for the drivers you
need.
Mandriva
Thac has created RPMs for MythTV for Mandriva which may be obtained from http://rpm.nyvalls.se/ If you have problems with the RPMs, please send him email directly at [email protected].
Debian
Debian packages for MythTV and most of its add-on modules are maintained by Christian Marillat mailto:marillat@free.fr and are available at http://www.debian-multimedia.org/. 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.
If you have followed the instructions on the above page you should have added
deb-src http://www.debian-multimedia.org sid main
to your /etc/apt/sources.list
file. Running apt-get update and then
executing apt-get build-dep mythtv should install all the
pre-requisites required to compile MythTV.
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. This list includes mysql, gcc, freetype2-devel, xorg-xserver-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.3 or higher is required. NOTE: MythTV DOES NOT WORK with Qt4. 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. If you're having trouble compiling, ensure that you've installed the -devel version of a prerequisite.
Command-line installation
This section details the various methods for installing prerequisites from the command line.
Mandriva
NOTE: The following instructions should be considered out of date as of 2006-09-10. If updated instructions are not submitted by the release of v0.21 of MythTV they will be removed.
urpmi is the simplest tool for installation of packages from the
command line, but properly configuring it can be difficult. The
following website
http://easyurpmi.zarb.org/ 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.
Open a shell, and execute the following. 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 libMesaGLU1-devel
NOTE for Mandriva 9.1+ users: execute the following command. # urpmi libqt3-mysql
However, you might get this when you execute the commands above:
everything already installed
In that case, you're ready to move to the next section. Once you have completed installing the pre-requisites, exit out of the shell and start a new one to ensure that any environment variables setup by the installation have a chance to take effect.
Gentoo.
NOTE: MythTV does not run on Qt4.
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.
Debian.
Build-dependencies for MythTV can be satisfied by adding the following to
your /etc/apt/sources.list
# Christian Marillat's packages (mplayer, lame)
deb http://www.debian-multimedia.org sid main
deb-src http://www.debian-multimedia.org sid main
and executing:
# apt-get build-dep mythtv
# apt-get source mythtv --compile
Next Previous Contents