Installing and using MythTV

Robert Kulagowski, mailto:rkulagow@rocketmail.com

2008-03-10, v0.21.00
Initially, installation of MythTV seems like a huge task. There are lots of dependencies, and various distributions seem to do the same thing different ways. This document will attempt to give general installation instructions, as well as including distribution-specific instructions where necessary.

1. First things first.

2. Introduction.

3. Checking prerequisites.

4. System Configuration Requirements for Compiling MythTV.

5. Downloading and compiling.

6. MySQL.

7. Configuring Sound.

8. Setting up a remote control.

9. Configuring MythTV.

10. Configuring mythfrontend.

11. Using MythTV.

12. Scheduling Recordings.

13. MythPlugins.

14. MythWeb.

15. MythGallery.

16. MythGame.

17. MythMusic.

18. MythWeather.

19. MythVideo.

20. MythDVD.

21. MythNews.

22. Troubleshooting.

23. Miscellaneous.

24. Example Configurations.


1. First things first.

NOTE: Please note that I, Robert Kulagowski, am NOT the author/programmer of the MythTV application! I can not give you personalized installation support. If you are having issues installing MythTV you should examine the archives, or post your question to the MythTV-users mailing list. If you send me "Does MythTV work with 'X'"? messages - I will simply instruct you to ask your question on the mythtv-users mailing list.

1.1 What is MythTV?

MythTV is a GPL licensed suite of programs that allow you to build the mythical home media convergence box on your own using Open Source software and operating systems. MythTV is known to work on Linux and Mac OS X (PowerPC and Intel). It does not run on Windows.

MythTV has a number of capabilities. The television portion allows you to do the following:

Other modules in MythTV include:

1.2 QuickStart

Custom mini-distributions are available to make it easier to install MythTV. A mini-distribution removes many of the "general purpose" workstation / server software packages that may be installed by default if you use one of the big-name OS packages.

See http://mysettopbox.tv if you'd like to install a custom version of Knoppix optimized for MythTV.

See http://linpvr.org if you'd like to install MythTV onto a VIA Epia M machine.

See http://bit.blkbk.com if you'd like to install MythTV on a Xbox. NOTE: Site appears unmaintained.

See http://wilsonet.com/mythtv/ for instructions tailored to RedHat's Fedora Core distribution.

There is a MythTV wiki at http://wiki.mythtv.org.

If you are installing this version for Schedules Direct support, please see the Migrating from DataDirect Labs to Schedules Direct section for additional information.

1.3 Upgrading from previous versions

The upgrade from previous versions should be transparent. Any changes to the database structure should be applied automatically.

It is strongly recommended that you back up your database before installing a new version of MythTV.

See Saving or Restoring the database for instructions.

1.4 How to obtain this document / PDF versions of this document

This HOWTO document is maintained at the primary MythTV website: http://www.mythtv.org by Robert Kulagowski mailto:rkulagow@rocketmail.com.

This document is available as a single-page HTML document at http://www.mythtv.org/docs/mythtv-HOWTO-singlehtml.html or as a PDF at http://www.mythtv.org/docs/mythtv-HOWTO.pdf.

This HOWTO is for MythTV v0.21

Release notes for this version may be found in the MythTV Wiki at http://www.mythtv.org/wiki/index.php/Release_Notes_-_0.21

1.5 Books about MythTV

If you would like to purchase a book specifically about MythTV:

1.6 Document conventions

The following conventions are used throughout this document.
boldface - used for program names.
typewriter - used for program paths.
emphasis - Pay attention here.

Pay more attention.

Ignore at your own peril.

Feature that has been added to SVN (subversion, a revision control system) but is not available in the current release.

1.7 Mailing lists / getting help

It's recommended that you join the user list at http://www.mythtv.org/mailman/listinfo/mythtv-users. The developer list is at http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev. Please keep the developer list strictly for development-related issues.

Searchable archives for the lists are available at http://www.gossamer-threads.com/lists/mythtv/.

1.8 IRC

There are two IRC channels dedicated to MythTV which can be found on irc.freenode.net

The mythtv channel is where the developers discuss code. It is not a user-support channel. Please don't ask non-development related questions there.

Really. Even if there's no one in the mythtv-users IRC group or everyone seems to be ignoring you.

1.9 Bug database

If you feel you need to contribute to a bug database, use the MythTV bug ticketing system at http://svn.mythtv.org/trac.

Good entries will contain the following:

  1. Qt version
  2. Linux distribution
  3. gcc version
  4. the last entry in config.log to detail how you compiled
  5. MythTV version numbers (e.g.from mythfrontend --version)
  6. Hardware
  7. How you are able to reproduce the bug

See the instructions on how to debug in Section 22.

The bug database is not a chat room, so restrict your entries to what is relevant. It's also not a repository of feature requests; a feature request without an accompanying patch file to implement that feature will be quickly closed. There is a feature wishlist on the wiki at http://www.mythtv.org/wiki/index.php/Feature_Wishlist. There is no guarantee that anything on the wishlist will ever get code written to implement it.

If a developer closes out your bug, it's likely you didn't provide enough information. Don't re-open a bug without providing additional information.

1.10 Contributing to this document

Contributions to the HOWTO are welcome, especially if you find a grammatical or spelling error, or if the wording of something is just plain confusing.

If you'd like to make a new contribution, create a ticket at http://svn.mythtv.org/trac and click "New Ticket". The type should be set to "patch" and the owner set to "rkulagow" to ensure that I see your contribution.

Please send it as either SGML or as plain text. NO HTML. The source used to create the HOWTO is in SGML / Linuxdoc. Do not be afraid of SGML! A quick look at the source of this HOWTO will show that it is not difficult, because there aren't that many tags to worry about, so at least try to submit as SGML. See the Linuxdoc HOWTO at http://www.tldp.org/HOWTO/Howtos-with-LinuxDoc.html for information on the linuxdoc format itself, or look at the mythtv-HOWTO.sgml file as an example.

To create the actual patch, run diff -u origfilename newfile > doc.patch and attach your contribution to the trac ticket.

2. Introduction.

This HOWTO document will focus on manually building MythTV in a North American environment. If you have installation instructions for a different region or Linux distribution, please send them to the author so that it can be included in other versions of this document.

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:

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.

NOTE: You must use DMA for hard drive access to prevent choppy or jittery video. Not all distributions 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 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.

NOTE: You must not use ReiserFS v3 for your recordings. You will get corrupted recordings if you do.

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.

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.

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:

Here are some data points for decoding:

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:

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

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.

NOTE: Analog video capture cards are the only ones which require a soundcard for capturing audio. DVB, HDTV, and other hardware encoder cards all provide a combined audio / video stream.

NOTE: Plugging a Line-level device into the Mic input is not recommended. Line-level devices have higher voltages and can damage the sound card. In addition, even if it doesn't break your card, you will be getting Mono sound. See the Linux MP3 HOWTO at http://www.tldp.org/HOWTO/MP3-HOWTO.html 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 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:

  1. 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.
  2. 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:

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. The minimum MySQL version is 5.0.

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 / 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 thac@nyvalls.se.

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.

NOTE: Due to the requirement for Qt 3.3+, there are no packages for Debian woody/stable.

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

4. System Configuration Requirements for Compiling MythTV.

Before you compile MythTV from the current source tarball or from subversion, you may need to modify your system configuration in a few ways.

In general, if you install MythTV from pre-packaged binaries for your Linux distribution/version, you don't need to be too concerned about the issues in this section of the HOWTO - the install script for the packages should take care of them. However, this section is still recommended reading which may help if the packager skipped a step in their packaging.

4.1 Software requirements for compiling MythTV

General requirements

MythTV is written in C++ and requires a fairly complete, but standard, compilation environment, including a recent g++ compiler, make, and appropriate header files for shared libraries. Any standard Linux distribution should be able to install a suitable compilation environment from its packaging system. Section 3.2 of this HOWTO provides some details of how to install the required environment for many distributions.

Subsequent sections of this chapter address the few oddities that you may have to adjust by hand before you compile MythTV.

The reference compilation system for MythTV is Ubuntu.

4.2 Shared-Library requirements for MythTV

Modifying /etc/ld.so.conf

The runtime manager for shared libraries, /lib/ld.so, gets information about the locations and contents of shared libraries from /etc/ld.so.cache, a file created by ldconfig from information in /etc/ld.so.conf. Because MythTV installs some shared libraries in /usr/local/lib, that directory needs to be added to the list of directories for ld.so to search when doing runtime linking of programs, if it is not already there. You do this, as root, by editing /etc/ld.so.conf, then running ldconfig. There are many ways to do this; one that works is to enter this series of commands:

$ su -
# echo /usr/local/lib >> /etc/ld.so.conf
# /sbin/ldconfig
# exit
$

4.3 Environment variable requirements for MythTV

General requirements

QT libraries and binaries

The compiler needs to be able to locate QT binaries and libraries in order to compile MythTV. QTDIR needs to be set and the directory holding the QT binaries needs to be added to your PATH. Your distribution may already be making these changes as a part of the installation of the software prerequisites detailed earlier.

One way to do this is as follows:

Open a shell and execute the following:

$ echo $PATH
/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/games:/usr/lib/qt3/bin:/home/mythtv/bin:/usr/lib/qt3/bin
$ echo $QTDIR
/usr/lib/qt3
$ which qmake
/usr/lib/qt3/bin/qmake

For Mandriva, you should see a value like /usr/lib/qt3 for QTDIR and /usr/lib/qt3/bin should be in $PATH.

For Gentoo, you should see a value like /usr/qt/3 for QTDIR and /usr/qt/3/bin should be in $PATH.

If you don't, do not proceed past this step until you have resolved this error. You may need to manually specify the QTDIR and PATH at the shell prompt before compiling.

Also, check that there has been a link created in /usr/lib/qt3/mkspecs (/usr/share/qt3/mkspecs for Debian) called default. If not, you'll get errors during the compile. See the Troubleshooting Section for more information.

Distribution-Specific Notes

Mandriva

The following instructions work for Mandriva using bash as the shell, and may be applicable for a distribution which uses /etc/profile.d.

NOTE: Mandriva 10 installs a /etc/profile.d/qtdir3.sh file, but it doesn't include the addition of the PATH variable. If you're running Mandriva 10, don't create a mythtv.sh file as detailed below; edit the qtdir3.sh file and add the PATH statement within the if / fi block.
As root, create the following file in /etc/profile.d The example filename is "mythtv.sh". Use what you feel is appropriate.

Open a shell, and switch to superuser mode.

NOTE: ^D means press CTRL and d at the same time.
$ su
# cd /etc/profile.d
cat > mythtv.sh
export QTDIR=/usr/lib/qt3
export PATH=$PATH:/usr/lib/qt3/bin
^D

# chmod a+x mythtv.sh
# exit
$ exit
The last two commands are to exit out of the shell. This way, when you next open a shell your new commands will take effect.

Device Permissions

MythTV will need access to the video4linux devices on your system. By default, your distribution may restrict access to these devices to the logged-in user, so if you will be automatically starting mythbackend from a script rather than an interactive terminal session you will need to make some adjustments.

NOTE: The following instructions are accurate for Mandriva.

Check for a file called /etc/security/console.perms. Open the file in your favorite text editor and look for a line that has:

<console>  0600 <v4l>        0600 root.video
and replace it with
<console>  0666 <v4l>        0666 root.video

What we're doing is allowing read and write access to the files in the video4linux directory.

5. Downloading and compiling.

Get MythTV from the http://www.mythtv.org web site. There are two installation methods you may choose from. The first is to download the latest release in tarball format and compile. The tarball release of MythTV should work on a wide variety of systems and should be the preferred method for new users. If you wish to use the subversion copy of MythTV you may obtain it from http://svn.mythtv.org

NOTE: If you are going to use subversion to compile MythTV rather than using the distribution tarball, you must join the http://www.mythtv.org/mailman/listinfo/mythtv-commits/ and http://www.mythtv.org/mailman/listinfo/mythtv-dev/ mailing lists to keep up to date with the current status of the code. Code obtained from subversion has no guarantees regarding stability, etc.

If you are in North America you will use the Schedules Direct grabber which is built-in to MythTV. You do not need to install XMLTV (so you may skip XMLTV-related instructions), but you need wget version 1.9.1 or higher.

Get XMLTV from http://xmltv.sourceforge.net. Download the latest version (0.5.51).


NOTE for Mandriva users:  If you have added a "PLF" mirror, you may skip the
next step and type:

# urpmi libmp3lame0 libmp3lame0-devel

After downloading, be sure to install both:
# rpm -Uvh lame*

Get lame from http://lame.sourceforge.net/. Download the source code to v3.96.1 by following the links from "Using" through "Download...".

5.1 Building LAME

Open a shell and switch to the directory where you saved lame.

$ tar -xzf lame-3.96.1.tar.gz
$ cd lame-3.96.1
$ ./configure
$ make
$ make test
$ su
# make install
Check that it worked:
# ls -l /usr/local/lib
-rw-r--r--    1 root     root       381706 Nov  4 14:22 libmp3lame.a
-rwxr-xr-x    1 root     root          674 Nov  4 14:22 libmp3lame.la*
lrwxrwxrwx    1 root     root           19 Nov  4 14:22 libmp3lame.so ->
libmp3lame.so.0.0.0*
lrwxrwxrwx    1 root     root           19 Nov  4 14:22 libmp3lame.so.0 ->
libmp3lame.so.0.0.0*
-rwxr-xr-x    1 root     root       360197 Nov  4 14:22
libmp3lame.so.0.0.0*

# exit
$ 

5.2 XMLTV

Red Hat Linux and Fedora Core:

RPMs for XMLTV and all of its dependencies can be obtained from http://ATrpms.net/name/xmltv/. The web page has a list of all the dependent packages you must download and install.

# rpm -Uvh xmltv* perl*

If you install from this location you may skip to Manually building MythTV.

Mandriva

RPMs for XMLTV and all of its dependencies are located in Mandriva's "contrib". If you have added a contrib mirror, try installing XMLTV:

# urpmi xmltv xmltv-grabbers
If this does not work, it is possible that contrib for your Mandriva version does not have XMLTV, so you may install the XMLTV prerequisites by typing:
# urpmi perl-xml-twig perl-xml-writer perl-datemanip perl-libwww-perl

and skip straight to the XMLTV compilation step.

Manual installation

Untar the xmltv file:

$ tar -xjf xmltv-0.5.51.tar.bz2
Install the xmltv prerequisites. The following prerequisites are the minimum required; when you actually start running the xmltv setup program it may alert you to other modules that are required.:

$ su
# perl -MCPAN -e shell
cpan> install XML::Twig
cpan> install Date::Manip
Date::Manip is up to date.
cpan> install LWP
cpan> install XML::Writer
cpan> exit

Change to the XMLTV directory and compile it:

$ cd xmltv-0.5.51
$ perl Makefile.PL
You can answer "N" to the tv_check, tv_pick_cgi questions. Say "yes" to the grabber required for your location.

You may get errors about modules not being installed. You will need to resolve any missing dependencies at this point, or your grabber may not work correctly.

$ make
$ make test
$ su
# make install
# exit

5.3 Configuring the Schedules Direct service

As of 2007-09-01, Tribune Media Services will no longer offer free guide data. Schedules Direct is a non-profit organization which has licensed the data to make it available to users of Freeware and Open Source applications.

If you wish to use Schedules Direct, you'll need to establish a user account. Go to http://www.schedulesdirect.org and click on the "Membership" link.

Once you've read and agreed to the Subscriber Agreement, Terms of Use and Privacy Policy proceed to the lineup choices and configure your account for your particular location and the channels that you have. This configuration will be imported into MythTV when you first run the mythtv-setup program.

5.4 Manually building MythTV

If you are going to use subversion, execute the following instructions to obtain the latest version of MythTV:

$ mkdir mythtv
$ svn co http://svn.mythtv.org/svn/trunk/ mythtv
$ cd mythtv

To use a release version, you can execute:

$ mkdir mythtv-release-0.21
$ svn co http://svn.mythtv.org/svn/branches/release-0-21-fixes/ mythtv-release-0.21
$ cd mythtv-release-0.21

NOTE: Using a svn version of the code allows you to stay up-to-date with changes. So, if there's an update to the 0.21 release and you originally obtained it using svn, you could enter the mythtv-release-0.21 directory and type "svn up", which will update your copy with the fixed version from the website. You would then recompile and install the updated 0.21 code.

If you are using the tarball, then unpack it:

$ tar -xjf mythtv-0.21.tar.bz2
$ cd mythtv-0.21
$ ./configure

If you wish to change options, run ./configure --help to see what is available and to override and automatically detected options. See the config.log file after running configure to see previous runs.

To compile:

$ make -j 2

The MythTV compile can take advantage of multiple CPUs, SMP and Hyperthreading. If you want to build MythTV on a multi-CPU machine (or with distcc), specify "-j numjobs", where "numjobs" is greater than 2. In the above example, we had two concurrent jobs executing, which is recommended for a single CPU system. Do not set the number of jobs too high, or your compile will actually take longer to complete than it would if you did a "normal" build.

If you are using distcc, and you had two other host machines (red, blue) participating, you would do something like:

$ export DISTCC_HOSTS='localhost red blue'
$ make -j 6 CXX=distcc

The actual speed-up, if any, is dependant on a number of factors, such as number of CPUs / hosts, etc. The distcc documentation recommends using a -j value of twice the number of CPUs available to keep all of them busy.

Some timing information. The following should only be used for illustration; your actual results may vary. The test involves a complete make distclean to the final binary.

In the above example, we see that with a single CPU, a multi-stage make does not significantly decrease compile time.

Once the compile is done, switch to superuser:

$ su
# make install
# exit

NOTE: subsequent configuration steps assume that you are within the MythTV directory that you cd'd to above.

Enabling real-time scheduling of the display thread.

MythTV supports real-time scheduling of the video output thread. There are three ways to go about enabling this: You can use rlimits, you can use the realtime security module, or on older systems you can SUID the executable. Enabling real-time scheduling is optional, but can make the video display smoother, especially if you are decoding HDTV.

rlimits

The rlimits method is the preferred method and is included in Linux 2.6.12 and above. Unfortunately, you need PAM version 0.79 or above, which may not be supported by your distribution yet. Assuming anyone running mythfrontend is in the audio group and rlimits are supported, all you need to do is place this in your /etc/security/limits.conf

*               -       rtprio     0
*               -       nice       0
@audio          -       rtprio     50
@audio          -       nice       0

realtime module

The second option is to use the Linux realtime kernel module. This is will be phased out over time, but is currently supported by many distributions that do not yet support rlimits. If you are not using the distribution kernel you must configure your kernel with:

Security options : [*] Enable different security models
Security options : [M] Default Linux Capabilties
You may also need to install the realtime module, using your distribution's realtime package. Assuming the users who will be running mythfrontend will be in the audio group you can get the GUID of a named group like so:
$ grep audio /etc/group
If the number printed out from the grep was 18, you can now load this module as root before starting mythfrontend:
# modprobe realtime gid=18

run as root option (not safe)

The final and least preferred option is to set the sticky bit on the mythfrontend executable. This opens a security hole, but is the only option on systems that do not support either rlimits or the realtime module. This does not work on modern distributions either, and is not recommended on any system connected to the Internet. This may also make it impossible to debug MythTV without running gdb as root. If you would still like to do this, you just need to run this as root:

# chmod a+s /usr/local/bin/mythfrontend /usr/local/bin/mythtv

Frontend-only configuration

Since MythTV uses a client/server architecture, multiple frontend computers can simultaneously access content on a Myth system. Live TV, watching and scheduling recordings, etc. are all possible from multiple frontends.

To get a better picture of what is needed to run a frontend, note the following:

  • You do NOT need the MySQL server installed on your remote frontend
  • You do NOT need XMLTV installed on your remote frontend
  • You do NOT need to run the mythtv-setup program on your frontend machine
  • Other than the exclusion of the MySQL server and XMLTV, the MythTV compilation procedure is the same as when you're setting up both a backend and a frontend. However, you will need to install the database access libraries.

    Once MythTV is compiled and installed:

  • Run the mythtv-setup program on your Master backend. Under the "General" menu, change the IP address of the current machine (by default, "127.0.0.1") to the real external IP address - 127.0.0.1 is the loopback address and no external machine can access it. Change the Master Server IP setting to the same IP address as well.
  • Run the mythfrontend program on your frontend machine, and a "Database Configuration" screen should appear. Set the "Host name" field to point to your Master backend's IP address.
  • 5.5 Gentoo

    Installation of MythTV on Gentoo consists of simply emerging the desired ebuild because all of the packages are now part of the official Portage tree.

    $ su -
    # emerge --sync # make sure portage is up to date.
    # vi /etc/make.conf
    
    Add mysql to your USE variable. i.e. USE="mysql ...."
    # emerge mythtv
    

    6. MySQL.

    When you install MySQL 5.x you will also want to comment out "log-bin" in your my.cnf configuration file. This option will quickly fill your "/var" disk partition with many gigabytes of data, unless you are doing database replication and deleting these files regularly.

    6.1 Distribution-specific information

    Mandriva

    If this is the system maintaining the database, make sure that MySQL is running and started at boot. Click on Mandriva Control Center->System->Services, find MySQL and click the "On Boot" button and the "Start" button if the MySQL status shows that it isn't running yet.

    NOTE: There have been reports that MySQL isn't starting at boot. If this is happening to you, try running the following commands.
    $ su
    # chkconfig --level 35 mysql on
    # /etc/rc.d/init.d/mysql start
    # exit
    

    Red Hat Linux and Fedora Core

    If this is the system maintaining the database, make sure that MySQL is running and started at boot. Click on Redhat menu>Server Settings>Services and enter the root password when asked. Check "mysqld" and then click Start. Click Save, then close the window.

    This can be done from the command line by typing:

    # /sbin/chkconfig mysqld on
    # /sbin/service mysqld start
    

    Gentoo

    After installing MySQL you need to initialize the database by running mysql_install_db as root.

    6.2 Setting up the initial database

    This step is only required on the system maintaining the database, which may or may not be one of your MythTV boxes. If the database is on a non-MythTV machine you'll need to copy the database/mc.sql file to it.

    To setup the initial MySQL databases:

    $ cd database
    

    Mandriva and Red Hat Linux/Fedora Core

    $ mysql -u root < mc.sql
    

    Debian 3.0

    $ mysql < mc.sql
    

    Gentoo

    $ su
    # mysql < /usr/share/mythtv/database/mc.sql
    
    NOTE: It is good practice to set a root password for MySQL. Instructions for doing so can be found on MySQL's web site at http://www.mysql.com/doc/en/Security.html.

    Modifying access to the MySQL database for multiple systems

    If you're going to have multiple systems accessing a master database, you must grant access to the database from remote systems. By default, the mc.sql script is only granting access to the local host.

    To allow other hosts access to your master database, you can either set it up for no security at all, or with more granularity. Note that the "%" is the wildcard character in MySQL.

    NOTE: The "no security" option is very dangerous unless you're in a controlled environment.
    This example has no security at all, and allows access from any host.
    $ mysql -u root mythconverg
    mysql> grant all on mythconverg.* to mythtv@"%" identified by "mythtv";
    mysql> flush privileges;
    

    For a more secure setup, you can restrict which machines or subnets have access. If you have a complete DNS system operational, you could do the following:

    $ mysql -u root mythconverg
    mysql> grant all on mythconverg.* to mythtv@"%.mydomain.com" identified by "mythtv";
    mysql> flush privileges;
    

    Finally, if you just want to restrict by IP subnet (in this example, the 192.168.1. network):

    $ mysql -u root mythconverg
    mysql> grant all on mythconverg.* to mythtv@"192.168.1.%" identified by "mythtv";
    mysql> flush privileges;
    

    You'll also need to check that the "networking" feature of MySQL is turned on. Check that /etc/mysql/my.cnf does not contain skip-networking. If it does, remove it. Also verify that bind-address is set to your IP address instead of 127.0.0.1. If you change either of these items, restart MySQL.

    NOTE: Your distribution may have a customized MySQL configuration file; in Mandriva, check /etc/sysconfig/mysqld for additional configuration.

    7. Configuring Sound.

    If your video doesn't appear to be in-sync with your audio and you're using an analog video capture card and a soundcard to capture audio, it could be because you are listening to the real-time audio from your video card rather than after it's been processed and synchronized to the video by MythTV. Because MythTV is a personal video recorder, "Live TV" isn't really live - to let you pause live TV, MythTV is actually encoding the video, saving to disk, and then playing it back. This procedure puts your MythTV "live" TV about 2 seconds behind real-time, so it's important that you're not listening to the live audio. However, if you're having an issue where the audio and video aren't synchronized by small but varying amount, it's most likely because the sound driver that you're using doesn't have the DSP_CAP_REALTIME capability. This was the case with ALSA (0.5), but not with newer versions. See the Troubleshooting Audio section for more information if you're having issues with sound. Also, ensure that no other programs are grabbing the audio output, like arts or esd.

    What you need to do is to mute the "line-in" of your sound card and also set it as the recording source.

    There are two ways to do this. Graphically, and from the command line.

    7.1 Graphically setting up the mixer

    Mandriva and Red Hat Linux/Fedora Core

    Open Kmix by clicking K->Multimedia->Sound->Kmix for Mandriva, or

    RedHat Menu>Sound & Video>Volume Control
    
    on Red Hat/Fedora.

    Click on Settings->Configure Make sure that "Tick Marks" and "Show labels" have "X"'s in them. This will make it easier to find the correct audio source. Click OK.

    On the mixer page, look for Line-In on your sound card. You should see two LED's - a green one at the top, and a red one at the bottom. The green one at the top is for muting; you want to make sure that the green LED is a dark green, meaning that it's "off". You also want to click on the red LED so that it turns bright red, indicating that it's "ON"; this insures that the Line-in is used as the source. Click OK, and make sure that you save the settings so that this is your default.

    Using ALSA.

    To use ALSA, you'll need to correctly setup your asoundrc file. Configuring this file is beyond the scope of this HOWTO. Once ALSA is working correctly, change the output sound device in mythfrontend->setup->Audio from /dev/dsp to ALSA:default. This field may be edited to suit your ALSA requirements.

    7.2 Setting the mixer from the command line

    If you have installed the alsa-utils package, then the amixer program can be used to setup the mixer. The "Master" volume setting is only required on a frontend machine to ensure that the sound channels are unmuted and configured for outputting sound. The "Line" and "Capture" controls are required for your sound card to actually capture audio from the external Line-in if it's connected to an analog frame grabber. Not all sound cards have a "Capture" control, but if yours does and you don't set it then MythTV will not capture audio.


    Note the spelling in the following commands.
    

    $ amixer set Master,0 100%,100% unmute
    $ amixer set PCM,0 100%,100% unmute
    $ amixer set Line,0 75%,75% mute captur
    $ amixer set Capture,0 100%,100% captur
    $ su
    # alsactl store
    # exit
    $ 
    

    If you have multiple sound cards, then use the -c parameter to specify which card to adjust. Note that the first card will be "0", the second will be "1", etc.

    That takes care of setting the volume correctly, and the ALSA startup script will restore the volume after a reboot. If you find that your sound is distorted, it's possible that the levels in the above examples are too high for your particular hardware combination. Try reducing the percentages by 5-10% and checking again. Once you're satisfied, re-run the alsactl store command.

    You may also use the alsamixer program to set the volume. If you are using an ALSA version after 1.0.6, use alsamixer -V all First, start alsamixer from the command line. You should start out on the "Master" volume control slider. Use the up and down cursor to set the master volume to around 75%. Next, use the left and right cursor keys to move around on the screen until you find the "Line" slider. Press SPACE to set it as the capture source, set the level to around 50-75% and press "M" to mute it. You can now press ESC to exit out of the alsamixer program. You can also have MythTV manage all volume and mute settings, but this will only affect the "Master" or PCM volume, not the capture volume. See the mythfrontend setup page for options.

    Finally, if you've performed all of the above steps, and you still don't seem to have any sound, it's possible that your video capture device is muting the audio output.

    $ v4lctl -c /dev/video0 setattr mute off
    

    8. Setting up a remote control.

    MythTV does not have native remote control receiver and decoder software built-in. Instead, remote control functions are implemented by cooperating with lirc, the Linux Infrared Remote Control program. lirc handles the IR hardware and passes keystrokes to MythTV, which then acts as if the user had pressed the keys on the keyboard. The file keys.txt describes the keys used to control MythTV.

    NOTE: If you are running Mandriva, you may install lirc by executing: # urpmi lirc lirc-remotes and bypass the manual compilation steps described below by jumping to the Completing the lirc install section. See the contrib/mandrake91.etc.sysconfig.lircd file for an example of how to configure lircd.

    Some IR devices require a kernel recompile, and some don't. However, all at least require having the kernel source available as a resource for the lirc build process.

    8.1 Gentoo

    To install lirc on Gentoo, all you need to do is:

    # emerge lirc
    

    8.2 Obtaining and compiling lirc

    You're going to need to download and compile lircd. Go to http://www.lirc.org and download lirc; as of 2006-01-21, the version available is 0.8.0. Grab the remotes.tar.bz2 file as well.

    $ tar -xjf lirc-0.8.0.tar.bz2
    $ cd lirc-0.8.0
    $ ./setup.sh
    
    You're going to need to know what sort of receiver you have and where it's connected. In the case of the Pinnacle Studio TV card, with the IR receiver connected to COM1 (/dev/ttys0), once the configuration menu comes up, perform the configuration by going to Driver Configuration->Other Serial Port Devices->Pinnacle Systems Receiver->OK and on the next page select COM1->OK.

    Each remote is different; some remote receivers connect directly to your capture card and not to a serial port, so make sure that you've got the correct one.

    You then click "Save Configuration and run configure" to continue.

    Make sure you read the last text generated by the configure step. It will tell you if you require a kernel recompile, and what the name of your kernel module will be (if necessary). For instance a home-built receiver may require a kernel recompile, so you would be notified that you will have to load the lirc_serial module. If you did not get any such messages skip the kernel recompile steps below and go directly to making and installing the lirc driver.

    Once the configuration step is complete:

    $ make
    $ su
    # make install
    # chmod 666 /dev/lircd
    

    At this point, if you're using a serial receiver, check that there's a lirc device in /dev:

    $ ls -l /dev/li*
    lr-xr-xr-x    1 root     root            5 Jan 27 09:00 /dev/lirc -> ttyS0
    srw-rw-rw-    1 root     root            0 Jan 27 15:01 /dev/lircd=
    prw-r--r--    1 root     root            0 Jan 27 09:00 /dev/lircm|
    

    As you can see, there's a link from /dev/lirc to ttyS0, a.k.a. "COM1", which is appropriate for the Pinnacle Systems PCTV Pro. However, you may notice something like this:

    crw-------    1 root     root      61,   0 Dec 31  1969 lirc
    
    Some IR receivers (including some homebrew units) use a character device as their data interface as opposed to a link to a serial port. If the make install step has created a character device for you, don't replace it with a link to a COM port.

    So, if the link or character device was not created (but should have been), ensure that you ran the make install step as root. If it still doesn't work, then there are three options. The first option is to re-read the lirc documentation to determine whether your IR receiver is a character device or should be a link to a serial port and to create the link/character device manually. In this example, the IR device is connected to ttyS0. If it were connected to "COM2", then use ttyS1, etc.

    $ su
    # cd /dev
    # ln -sf ttyS0 lirc
    # exit
    $
    

    NOTE: The above example assumes that your receiver uses the standard serial driver. Some receivers do not, including receivers that plug into a TV capture card. Check the lirc documentation, but it may be necessary to replace the link created above with a character pipe:
    # mknod /dev/lirc c 61 0
    

    See the lirc documentation for additional information. The lirc installation should create this for you, so manually creating it indicates that your lirc installation may have other issues.

    The second option is to post your issue to the lirc list, not the mythtv-users list. The lirc programmers will be the ones that can assist you best.

    The third option is to dispense with lirc altogether by purchasing an IR keyboard (various options exist, although Chicony appears to work for some people) and a learning remote control. The IR keyboard receiver plugs into the PS/2 keyboard port on your PC and you would train your learning remote to emulate the various keystrokes from keys.txt of your IR keyboard. Using this method removes lirc entirely from the picture - your remote will be sending keypresses that your PC "sees" on the keyboard port.

    8.3 Completing the lirc install

    NOTE to Mandriva 9.1 users: skip to the manual start paragraph below.

    If the lirc configure program / compile did not mention anything about a kernel module, then you are finished. If it did mention a kernel module, you must edit the /etc/modules.conf file. Add this line as the first thing in the file. It must come first, or it may not work.

    alias char-major-61 XXX
    

    replace XXX with the name which you determined earlier, which in this example was "lirc_serial"

    $ su
    # modprobe lirc_serial
    # /sbin/ldconfig
    

    Next, we're going to manually start lircd the first time. Mandriva 9.1 users, type: # /etc/rc.d/init.d/lircd start instead of:

    # /usr/local/sbin/lircd
    

    NOTE: Read this next section if you're not familiar with how lirc works!

    There are two separate files used by lirc, and both are required for your remote control to do anything useful. First is the lircd.conf file. lircd.conf tells the lirc daemon how to interpret the IR pulses that it receives from a remote control and what name to assign to each sequence of pulses. Without getting too involved, a particular series of pulses may correlate to "Channel Up". The lircd.conf file will then contain a line that looks something like this:

              ChannelUp                0x0000000000001020
    

    The lircd.conf file can have multiple remote controls defined.

    The second file is lircrc, which takes the name of the button which was pressed ("ChannelUp") in the above example, and correlates that to an action to be performed by a program using the remote control. So in MythTV, ChannelUp means one thing, while in mplayer it means something different. lircrc gives you the flexibility of taking the name of the button and having it perform different actions depending on which program you're using at the time.

    NOTE: The definitions in lircd.conf come from the user community, and there is no standard for the common button names. One lircd.conf file may contain a definition for a button called "ChannelUp", while another may contain a definition for "Chan+". Your lircrc file must therefore be configured appropriately, or it won't work.

    If this fails, complaining of a missing lircd.conf file, then you must find or make one. First look for a pre-made configuration file at http://lirc.sourceforge.net/remotes/. Mandriva 9.1 users, look in /usr/share/lirc-remotes. If you find one your remotes either on the website or in /usr/share, download or copy the file, name it lircd.conf and put it in your /etc directory. If you couldn't find your remote, you must make your own lircd.conf file.

    To make your own lircd.conf file

    $ irrecord myremote
    

    Follow the on-screen directions to train your remote and define keys. If your remote ends up working well, you should consider submitting your lircd.conf file back to the lirc developers. Once finished:

    $ su
    # cp myremote /etc/lircd.conf
    

    now try to start lircd again:

    # /usr/local/sbin/lircd
    

    Now, we're going to add the commands necessary for lircd to run each time we boot. Mandriva 9.1 users, you can execute:

    $ su
    # chkconfig --level 35 lircd on
    # exit
    

    All other distributions:

    # cd /etc/rc.d
    # cat >> rc.local
    echo "Starting lircd"
    /usr/local/sbin/lircd
    ^D
    # exit
    $ 
    

    This takes care of the lircd portion, which "listens" for the IR signals. If everything went well, the install script for lircd put an appropriate configuration file for your remote into /etc/lircd.conf This file maps the buttons on the remote control to the IR pulses coming from the receiver.

    The next step is to convert those signals into something that can be used to control MythTV. MythTV now includes native support for lirc and can interact directly with

    $ cd ~/mythtv-0.21/contrib/configfiles
    $ cp lircrc.example ~/.lircrc
    
    or
    $ cp lircrc.example.pinnaclestudiopctv ~/.lircrc
    
    if you've got a Pinnacle Studio PCTV remote.
    $ irw
    
    Start pressing the keys on your remote; irw will print the name of the button as it is defined in your /etc/lircd.conf. If you don't see anything at this point, you need to troubleshoot further by going back to the lirc home page and investigating from there.

    If it is working, then press CTRL-C to abort the program. Once you know that your remote is working, you can either recompile MythTV with native lirc support by enabling it in configure or you need to run the irxevent program, which takes the key presses and sends them to MythTV. If you use native lirc support, you don't need to run irxevent. If you are going to use irxevent, then you need to run it like this:

    $ irxevent &
    
    If irxevent isn't running, then MythTV will not respond to your remote control unless you're using native lirc support.

    8.4 Additional information for lirc

    Take a look at the lircrc.example files in the contrib/configfiles/ directory. In my case, (Pinnacle Studio card) the channel up and down functions weren't working, due to the fact that the button names were different than the default lircrc.example file that came with MythTV.

    The lircrc.example file has this:

    begin
        prog = irxevent
        button = ChannelUp
        config = Key Up CurrentWindow
    end
    
    begin
        prog = irxevent
        button = ChannelDown
        config = Key Down CurrentWindow
    end
    
    but the /etc/lircd.conf that comes in the lircd package defines the buttons for the Pinnacle Studio PCTV as:
              channel+                 0x0000000000000017
              channel-                 0x000000000000001C
    
    rather than "ChannelUp" and "ChannelDown". I added the following to my /home/[yourusername]/.lircrc file:
    begin
        prog = irxevent
        button = channel+
        repeat = 3
        config = Key Up CurrentWindow
    end
    
    begin
        prog = irxevent
        button = channel-
        repeat = 3
        config = Key Down CurrentWindow
    end
    
    which took care of basic functionality. Because the PCTV Studio remote has additional buttons, look at the contrib/configfiles/lircrc.example.pinnaclestudiopctv for an example of how to define additional buttons, and how to debug potential button name conflicts between the lircrc.example file and how your remote defines the button names.

    By examining the button names defined in /etc/lircd.conf and using the irw program to make sure that your remote is working, you can create the appropriate mappings in .lircrc to get excellent remote functionality with MythTV.

    Note the repeat = parameter. This informs the irxevent program to pass through every third keypress. By default, lirc will only send one keypress to the application, even if you're holding down the key. The actual repeat = number will vary from system to system, so experiment and see which value works best for you.

    8.5 Configuring lirc for use with an IR blaster

    Lirc has support for various IR transmitters. A popular model is the Actisys IR-200L http://store.snapstreamstore.com/accessories.html. It was originally designed for IRDA communication, but can be used to transmit A/V remote control codes. By using the lirc SIR driver, this device can easily be integrated with MythTV. I have tested this device with an AT&T DCT2000 digital cable box but the instructions can be used to configure other IRDA devices and A/V remotes.

    Follow the steps in the previous section. When you run setup.sh, select option 1, driver configuration. From here select option 6, IrDA hardware. Select your appropriate device and the corresponding serial port, then Save configuration & run configure from the main menu. Once configure is done type:

    $ make
    

    Please note: unlike the Pinnacle receiver above you will be compiling lircd in addition to a kernel module for the SIR transmitter. Depending on whether you have your serial port driver configured as a kernel module you might see the following message during make:

    lirc_sir.c:56:2: warning: #warning
    "******************************************"
    
    lirc_sir.c:57:2: warning: #warning "Your serial port driver is compiled into "
    
    lirc_sir.c:58:2: warning: #warning "the kernel. You will have to release the "
    
    lirc_sir.c:59:2: warning: #warning "port you want to use for LIRC with:"
    
    lirc_sir.c:60:2: warning: #warning "setserial /dev/ttySx uart none"
    
    lirc_sir.c:61:2: warning: #warning
    "******************************************"
    

    If you do receive this statement make sure to run the setserial command before you load the lirc_sir module. Follow this with the install:

    $ su
    # make install
    

    You will notice that lirc installs the kernel module in /lib/modules/uname -a/misc.

    The configuration for starting lircd differs if you're going to be sending and receiving IR versus just receiving.

     
    # cd /etc/rc.d
    # cat >> rc.local
    echo "Starting lircd"
    setserial /dev/ttySx uart none        # (if required)
    modprobe lirc_sir
    /usr/local/sbin/lircd
    ^D
    # exit
    $ 
    

    At this point you have to populate the /etc/lircd.conf file with the proper codes for your A/V remote. You should be able to find your remote within the lirc remote tar file located at http://www.lirc.org/remotes.tar.bz2. In my case I extracted the file from remotes/motorola/DCT2000 (gi-motorola-dct2000)

    To test the lirc_sir module you can run irw to verify the codes are being received. If everything is configured correctly you should see something similar to the following:

    $ irw
    0000000000007ff0 00 1 gi-motorola-dct2000
    000000000000bff8 00 2 gi-motorola-dct2000
    000000000000f7f0 00 ENTER gi-motorola-dct2000
    

    Once you've verified lirc is working you can press CTRL-C to exit irw and configure the channel changing script.

    The path to the channel changing script will need to be entered on the mythtv-setup screen for Input Connections.

    This csh script will be called each time MythTV needs to change the channel. Below is a copy of the script followed by the corresponding perl script. Make sure both are in your path. Also make sure you leave the #!/bin/csh setting and not change it to Bourne or bash. This will create a frustrating symptom to diagnose where MythTV cannot open /dev/device. Unlike Bourne or bash, csh scripts automatically close parent file descriptors before they start.

    $ cd /usr/local/bin
    # su
    # cat > change_channel.csh
    #!/bin/csh
    echo "changing to $1"
    /usr/local/bin/channel.pl $1 &
    ^D
    # chmod a+x change_channel.csh
    # exit
    $ exit
    

    See contrib/channel.pl for the actual file. Copy it to /usr/local/bin/

    The last statement within the perl script is the lirc rc command. This is the command that transmits the code to your cable/DSS box. Make sure to have the IRDA device within a few feet of the box.

    9. Configuring MythTV.

    By this point, all of the compile-time prerequisites have been installed, mysql is running and has had its initial database setup. It's now time to configure MythTV.

    NOTE: If you're running Debian unstable and you have compiled MythTV from source, you will need to install an additional package before you will be able to run MythTV. Execute the following to install the MySQL driver for QT.
    $ su -
    # apt-get install libqt3c102-mt-mysql
    # exit
    

    9.1 Configuring the Master backend system

    Open a shell and decide where you will store your video files. This may be one directory or multiple directories on the same or different filesystems. There is no default directory used for new recordings, you must create at least one storage directory and configure Myth to use it by running mythtv-setup. If you do not do this, then MythTV will be unable to record anything. The following example is specific for /var/video, but the same instructions would apply for any directory name you choose to use. See the Advanced Partition Formatting section for hints on creating a partition for MythTV.

    $ su
    # mkdir /var/video
    # chmod a+rwx /var/video
    # exit
    

    NOTE: The last slash "/" is not required.

    TIP: Try not to have your video mount point on the same partition as your root partition, which could lead to the filling up of your root partition with video data if the mount fails. For example:

    If /var/video is created on your root partition and you then perform a mount of another drive to this directory there won't be any problems if everything is working the way it should. However, if the mount fails for some reason, /var/video still exists, so MythTV will find the directory and write files to it. If your / mount point is space limited, /var/video will also be space limited, and it won't take long to fill the partition. This will cause a number of side-effects, most of them bad. Instead, create subdirectories as the destination for the storage group.

    Your directory structure could then look something like this:

    /mnt/video/drive1/video
    /mnt/video/drive2/video
    

    Your /etc/fstab would look like this:

    /dev/hdb1 /mnt/video/drive1
    /dev/hdc1 /mnt/video/drive2
    

    Because the Storage Group path is /mnt/video/drive1/video, if the mythbackend can only find /mnt/video/drive1 it will not write files to that share.

    After you create the desired directory or directories for storing your video files, you will need to add them to the proper Storage Group using mythtv-setup. This procedure is described below in the Storage Groups section.

    The first thing to configure is the Master backend system. If you are running multiple backend systems, the Master backend will make all decisions about which programs will be recorded on which tuners. If you have only one backend, then it will be its own master.

    The Master backend will always choose the first available tuner in the same order as you add cards through "mythtv-setup". In other words, the second card you add will only be used when there are two overlapping recordings, the third when there are three, and so on. Therefore, you will want to have the greatest amount of disk space on the Master backend because its tuner will always be the first choice. You will then want to add your other backends in the order of your preference for recording.

    NOTE: It is possible to not have the cards on the Master backend be the first ones used. However, if you are new to MythTV it is easier to configure the Master backend first before moving on to the Slaves, at least until you become more familiar with the MythTV system. See Advanced Backend Configurations for information on configuring multiple backend systems in various ways.

    Because MythTV uses a database to store all configuration variables, part of the bootstrap of MythTV is to indicate the location of the MySQL database server. If the frontend, backend and MySQL database server are all going to be running on the same box, you can continue to the next step. If not, you'll need to change the Host Name in the "Database Configuration" screen of the mythfrontend program.

    NOTE: Users that have been running the frontend and the backend on different machines have stated that they have been having issues with remote access to the MySQL database. The following instructions may or may not work. Add the following to /etc/my.cnf on the backend machine and restart MySQL.
    skip-innodb
    set-variable=thread_stack=256k
    

    Run the setup program:

    $ mythtv-setup
    

    The backend setup program will start and offer you a number of choices. It is strongly recommended that you go through them in order.

    The first question will ask if you wish to clear out your existing configurations for your capture cards. Initially, you should say "YES" so that there are no surprises later.

    The next question will ask you if you wish to clear out your video source information. You should answer "YES" to this as well.

    Once the graphical setup starts, you'll see that there are six choices

    The Storage Directories feature is available only in the SVN version of MythTV.

    1. General
    2. Capture Cards
    3. Video Sources
    4. Input connections
    5. Channel Editor
    6. Storage Directories

    Use the arrow keys to move around, and press the space bar to select which option you wish to configure.

    General

    The first screen of the General configuration deals with IP addresses of the system that you're running mythtv-setup on and any master backend you may have. If you've only got one machine, then the default values are fine and you can move to the next page by pressing the space bar. If you need to move around the screen, use the arrow keys to move focus between settings, not the mouse.

    If you will be deploying multiple backends, or if your backend is on one system and you're running the frontend on another machine then do not use the "127.0.0.1" IP address.

    NOTE: If you modify the 127.0.0.1 address and use a "real" IP address, you must use real IP addresses in both fields, otherwise your frontend machines will generate "Unexpected response to MYTH_PROTO_VERSION" errors.

    Changing any of the port settings is very strongly discouraged. (If you do accidentally change them, the defaults are 6543 for the master/backend server, and 6544 for the HTTP requests)

    Once you're satisfied with the values, move the focus down to Next and hit the space bar.

    The next screen details the Host-specific Backend setup. This is where you will set the specific directory paths for this particular backend. Make sure that you've followed the steps at the beginning of this section and created a directory that exists and that MythTV will have write privileges to. When you're done, press Next to continue, taking you to the Global Backend Setup.

    On the Global Backend Setup configure your backend with the appropriate settings. Use the left and right arrow keys to iterate through the choices available on each setting, and the up and down keys to move between settings. Move to Finish when you're done and press the space bar, taking you back to the main configuration screen.

    Capture Cards

    You should have no capture cards defined, so the highlight will be on (New Capture Card). Press space to begin.

    Choose the appropriate settings for your particular tuner. Use the arrow keys to move around and to make your choices, and press RETURN when complete. Pressing RETURN will take you back to the Capture Cards screen; if you have additional capture cards in this machine, press the space bar when the highlight is on the (New Capture Card) row to define another card.

    If you have made a mistake, you can delete a card by highlighting it and pressing the 'D' key, or you can highlight it and press the RETURN or 'E' key to edit it.

    Once you have no additional cards to setup, press ESC.

    NOTE: If you have a dual digital/analog card, such as the pcHDTV cards and some DViCO cards, then you should not configure this as two separate cards. Configure the digital portion as a DVB card, then click on the "Analog Options" button within the DVB configuration panel for the card and configure the analog portion of the card there.

    Video Sources

    When you start, the highlight should be on (New Video Source). Press the space bar to begin. The first field asks for the name of the video source. You may choose something easy to remember, like "Antenna" or "Cable". Once you've chosen a name, press the down arrow to move to the next field.

    If you're in North America, change the grabber to "SchedulesDirect.org(Internal)", then continue pressing the down arrow to move to the next field. Fill in the username (lowercase only) and password that you have established with Schedules Direct, then move to the "Retrieve Listings" button and press the space bar.

    NOTE: You need wget version 1.9.1 or higher to use Schedules Direct.

    The mythtv-setup program will contact the Schedules Direct servers and get your account information. Once you're done, you may click the Finish button and skip the next few paragraphs in this document since they only apply to users that are using the external XMLTV script to get their guide data.

    If you wish to continue using the XMLTV grabber, then move to the Zip/postal code field and put in the appropriate value.

    If you're outside of North America, then some manual interaction will be required with XMLTV. You may need to switch from the MythTV setup program to the console it was run on to interact with XMLTV.

    Once you have chosen your provider, press RETURN to continue. XMLTV will now begin collecting the initial data for your location. The screen may blank for a few seconds to several minutes, depending on the load of the listings provider and the speed of your connection to the Internet. Be patient!

    You will then be returned to the Video Sources screen. If you have multiple video sources available, such as Antenna, Cable, etc, go ahead and define them all, even if they're not all going to be physically connected to the master backend server. Once you're done, press ESC to return to the main screen.

    Input Connections

    The final configuration item is Input Connections. On this screen, you will associate the various video sources you defined earlier with a physical input to a encoder card. It's entirely possible that you have multiple tuners, and each tuner has a different input, so on this screen you let MythTV know which device will connect to which input source.

    When you start this screen, you should see a listing of the various input connections available on each of the Capture cards you defined earlier. For example, you may have a capture card with a tuner, a SVideo and a Composite connection. If you wanted to associate the tuner (a.k.a., "Television") with an "Antenna" source you defined in Video Sources, you would move to the /dev/videodevice (Television) -> line and press the space bar. Using the left and right arrow keys will show you the various choices you have already created for video source. In our case, you would use the left/right cursor keys until "Antenna" was shown in the Video Source field. Press down to move to the next setting.

    On the connection pane there is a "Scan for channels" button, if you are configuring a digital source such as a DVB card, you need scan for channels and you must do this before pressing the "Fetch channels from listings source" button. You may scan for analog channels on an analog input, but this is not needed.

    The other button is called "Fetch channels from listings source". As long as you have a real listings source you should fetch channels from them for analog channels. You can do this for digital sources as well (unless the listing source is transmitted EIT data). If you are using XMLTV, you may need to switch from the MythTV setup program to the console it was run on to interact with XMLTV after pressing this button. It is possible to fetch the channels on the command line using mythfilldatabase. But if you need to do this, you will probably need to re-enter the MythTV setup program to configure the "Starting channel" setting for this source->input connection.

    NOTE: If you have a Hauppauge PVR-500, you must think of it has two PVR-150's on a single PCI card. For example, if you have a single PVR-500 card, it will appear as /dev/video0 and /dev/video1. Each /dev/video device will have a Tuner input.
    Once you're done, press RETURN to go back to the Input Connections screen. You would then finish associating the video sources to any other hardware devices you have available.

    NOTE: Don't add a video source to a hardware input if you don't actually have anything connected there. For example, adding "Cable" to the Tuner and to the Composite inputs without having something connected to Composite will lead to blank recordings.

    Press ESC to return to the main menu, and press ESC again if you have no further items to configure, thereby returning you to the command line.

    Channel Editor

    The channel editor is used to globally alter channel information, including items like hue, contrast, fine tuning and others. Users in North America shouldn't run the channel editor until you've completed the initial mythtv-setup and ran mythfilldatabase at least once to populate the database.

    Storage Groups

    New in MythTV 0.21

    Introduction.

    Storage Groups are lists of directories that are used to hold MythTV recording files giving you a flexible way to allow you to add capacity to your MythTV system without having to use exotic solutions such as LVM, filesystem expansion or RAID Online Capacity Expansion. You can also use Storage Groups to organize recordings and to put recordings of a certain type into one subdirectory.

    Storage Groups do not offer redundancy in case of hard drive failure, but unlike LVM, if you lose a hard drive, you only lose the recordings that were on that drive. With LVM, if you lose a hard drive, you will most likely lose everything.

    How to use Storage Groups.

    By default, there is only one Storage Group called "Default", and it is used for all recordings and Live TV.

    NOTE: You need to add at least one directory to the Default Storage Group or else you will not be able to record anything with MythTV.

    For example, if you have 5 hard drives in your system, your first hard drive could be your "boot" drive, and the remaining four could be dedicated to media storage. You could format the drives and mount them as /mnt/store/d2, /mnt/store/d3, /mnt/store/d4 and /mnt/store/d5.

    Within each mount point, it's strongly recommended that you use a sub-directory and make that the destination path for the Storage Group. See the Tip in the "Configuring the Master backend" section for additional information.

    You would then add the four subdirectories you created under the mount points (/mnt/store/d1/video, etc) into the "Default" Storage Group.

    At recording time, if there were four simultaneous recordings, MythTV would put one recording onto each drive.

    Or, say that you originally installed MythTV to a 80GB hard drive, and that hard drive is now filling up. You could simply add a new drive to your system, mount it and update the Storage Group to add additional space.

    You may create additional Storage Groups to store specific recordings in their own directories. Storage Groups are edited via the 'Storage Directories' section of mythtv-setup.

    You can also create multiple Storage Groups to group recordings together; recording schedules now have an option to specify which Storage Group to use.

    MythTV will balance concurrent recordings across the available directories in a Storage Group in order to spread out the file I/O load. MythTV will prefer filesystems that are local to the backend over filesystems that are remote until the local filesystem has 2 concurrent recordings active or other equivalent I/O, then the next recording will go to the remote filesystem. The balancing method is based purely on I/O, Myth does not try to balance out disk space unless a filesystem is too low on free disk space in which case it will not be used except