Step-by-step guide to building a MythTV System on Fedora Core 3 w/ATrpms
Compiled by Jarod C. Wilson <
jarod@wilsonet.com>
Made possible by information gathered from all over the Internet (Google is your friend)...
$Revision: 97 $
$Date: 2005-06-22 13:05:04 -0700 (Wed, 22 Jun 2005) $
TABLE OF CONTENTS:
- Introduction
- Hardware
- Initial System Setup
- Firstboot setup -- create MythTV user and enable ntp
- Get and install apt, update your OS packages
- Kernel choices
- Get and install video card drivers
- Audio setup
- Get and install MythTV
- Get and install capture card driver(s)
- Get and install lirc
- Set up MySQL
- Set up MythTV
- Configure automatic startup
- Configuring MythTV add-ons
- Upgrading your system
- Miscellanea
- Trouble-shooting
- Changelog
1. Introduction
MythTV is an open-source project, with its primary functionality being similar to that of a TiVo on steroids, with far more features, much greater flexibility and the ability to handle an extremely wide variety of content. The project's founder and leader is Isaac Richards. The official documentation can all be found on MythTV's official web site, at http://www.mythtv.org/. The project is supported by the contributed time and effort of the open-source community, with the primary lines of technical support being the documentation on the project web site, and the project's mailing lists. It is highly recommended that if you are intending to install MythTV, join at least the mythtv-users mailing list, which you can subscribe to here: http://www.mythtv.org/mailman/listinfo/mythtv-users/, and read through the official docs.
While the official documentation attempts to be as distribution-agnostic as possible, this document is geared specifically toward building a MythTV system on the Fedora Core 3 Linux distribution put out by Red Hat, with all components installed from binary packages using automatic dependency resoltion tools (i.e., you won't need to compile anything or manually deal with any twisted dependency issues). Note that for various reasons, things aren't entirely smooth if you're using an x86_64 system yet (apt doesn't support multi-arch systems, so you need to use yum or smart instead). I finally just got a new Athlon 64 system myself, so look for more x86_64-specific instructions in the future. Quite a few people following this particular body of documentation have successfully created their own MythTV systems, and many of them frequent the MythTV Users mailing list. Someone on the list can generally help you if you have a problem. I also frequent the mailing lists, and will help out in any way I can, though my spare time is in very short supply these days. However, please search the mailing list archive, found here: http://www.gossamer-threads.com/lists/mythtv/, before you mail the list, because there is a good chance you'll find your answer there. If you are unable to find the answer there, then read this document: http://catb.org/~esr/faqs/smart-questions.html, after which you may address your question to the mailing list. ;-)
The old Fedora Core 1 version of this doc is still available for those that need/want it. It is NOT being maintained anymore though and hasn't been for some time, so if you find any inaccuracies, refer to this version of the document for possible information to help you around them. I'm doing the same with the last revision of the Fedora Core 2 version and Fedora Core 3 version of this doc, though 2 and 3 are still fairly similar to the Fedora Core 3 version, much more so than FC1 is.
It was suggested to me by a number of folks that I provide PayPal account information for those wishing to contribute. Recent donations helped me acquire some AMD64 hardware. Hopefully, I can now better sort through multi-arch problems people are running into... Donations also help persuade my wife that I'm doing more than just wasting my time! Certainly don't feel obligated, but go ahead and click on the little PayPay button if you feel inclined. =)
Anyhow, I try to answer any email I get, but of late, there's no way I can keep up (I'm at least a month and a half behind on replies as I write this). I often get some of them the same questions/problems over and over, so chances are, someone on the list can answer your question, even if you don't find what you needed in the mailing list archive, and you'll likely have a solution faster than I can respond. I used to be very active on the mailing list myself, but just plain haven't had the time lately, mostly due to a new job and another kid due shortly. However, if you think you've found a problem with something in this document, or have a suggestion for an improvement, please don't hesitate to contact me directly via email, and I'll try to get to it when I have the time. I try to keep this document as up to date and accurate as my time permits -- time just isn't permitting much these days...
Thank you, and enjoy!
--
Jarod Wilson
jarod@wilsonet.com
2. Hardware
I suggest you start here for information on hardware:
An excellent place many folks get their Myth box hardware from is NewEgg.com.
And those looking at building the quietest Myth box possible should probably check out SilentPCReview.com for advice.
Just about any computer that runs Linux and has enough processing power can be used as a MythTV box. For example, I had zero problems playing back full-resolution PVR-250 recordings on an Athlon 800 with a GeForce 4 MX. I've recently shuffled around a ton of hardware at home, so the systems listed below are merely examples of setups that I'm familiar with and know to be functional.
-
Dedicated Master Backend System (not used at all for viewing):
- Case: Antec Full Tower
- PSU: Antec TruePower 480W
- Motherboard: Asus P2B-DS
- CPUs: Dual Pentium III 600MHz
- RAM: 4x 256MB PC133 DIMMs (1GB of RAM is excessive, but use it if ya got it)
- Hard Drives: 7200rpm ATA/100 60GB Maxtor (for OS and live TV buffer), 7200rpm ATA/100 250GB Western Digital Caviar SE, 2x 7200rpm ATA/100 200GB Western Digital Caviar (WD drives LVM grouped for video)
- Optical Drive: Generic CD-ROM
- Video Card: nVidia TNT2
- Sound Card: none
- NIC: 3Com GbE
- Video Capture Card: Hauppauge WinTV PVR-250
-
High-Definition TV Capture and Playback System:
- Case: Antec Sonata
- PSU: Included Antec TruePower 380W
- Motherboard: Chaintech Summit 7NJL6 (full ATX nForce2 Ultra board)
- CPU: AMD Athlon XP 3200+ w/400FSB (overkill for most systems, but not for HDTV)
- RAM: 2x 256MB DDR-400 (PC-3200) for 512MB of RAM running in dual-channel DDR mode
- Hard Drives: 2x 7200rpm SATA 160GB Samsung SpinPoint (highly recommended by Silent PC Review)
- Optical: Black bezel 16x Sony DVD-ROM
- Video Card: 128MB 8x AGP Chaintech GeForce FX 5200 (fanless low-profile card)
- Sound Card: SoundBlaster Audigy OEM, feeding digital coax to a Yamaha amp
- NIC: Onboard Realtek
- Video Capture Card: pcHDTV HD-2000
- Display: 47" Panasonic HDTV, connected via an Audio Authority 9A60 VGA to component video transcoder
-
Standard Definition Slave Backend and Playback System:
- Case: CoolerMaster ATC-620C-BX1 (black desktop micro-ATX)
- PSU: Enermax Whisper Series EG365P-VE 350W (adjustable fan speed for low noise operation)
- Motherboard: Chaintech Summit 7NIF2 (nForce2-based micro-ATX)
- CPU: AMD Athlon XP 1800+
- RAM: 1x 512MB DDR-333 (PC-2700)
- Hard Drive(s): 5400rpm ATA/100 40GB Western Digital Caviar
- Optical Drive: Black bezel Sony CD-RW
- Video Card: Onboard GeForce 4 MX (64MB shared system memory)
- Sound Card: Onboard
- NIC: Onboard nForce2
- Display: 27" Analog Television
-
Standard-Definition Remote Playback-only System:
- Case: Travla C137 (the black one)
- PSU: external supply included w/case
- Motherboard: VIA EPIA M10000
- CPU: VIA C3 @ 1.0GHz
- RAM: 256MB DDR-266 (PC-2100)
- Hard Drive(s): 2.5" 4200rpm ATA/33 10GB Toshiba (laptop HD, requires adapter, but very quiet and low-noise)
- Optical: Samsung slimline (laptop-style) CD-RW/DVD-ROM combo drive
- Video Card: Onboard Unichrome/CLE266
- Sound Card: Onboard
- NIC: Onboard VIA Rhine-II LAN
- Display: 19" Monitor
-
All-in-one Standard-Definition System:
A good place to look at other examples of what people are using for their MythTV boxes, and how they rate their systems, is Mark Cooper's PVR Hardware database, browseable here:
Pundit users might also find Matt Marsh's "Pundit MythTV Device" site of use:
Also note: the WinTV PVR series and AVerMedia M179 cards may have issues running correctly on some motherboards based on VIA chipsets. Check the ivtv FAQ to see if your chipset is on the list of known offenders:
3. Initial System Setup
This guide is geared toward using Red Hat's Fedora Core 3 Linux distribution. For the most part, this document should still be applicable to Fedora Core 2 and 3 as well. You can download the iso CD images for Fedora Core from one of the many Red Hat mirrors out there, the official list of which can be found here:
The 2.6 kernel series includes several journaling file systems, some of which are better-suited for use with large files -- like Myth recordings -- than Red Hat's default file system, ext3. However, Red Hat doesn't let you use anything else at system install time, unless you type in "linux <otherfs>" at the boot: prompt when firing up the installer CD, where <otherfs> is something along the lines of reiserfs, jfs or xfs. I'd *highly* recommend a custom partitioning scheme rather than auto-partitioning, with a dedicated /video (or similar) partition for storage of all your recordings. Previously, XFS was my personal recommendation for the file system to use for such a purpose, but some additional stability issues with using XFS on Fedora Core's stock kernels have been brought to my attention. In the case where you're stacking software RAID, LVM and XFS all together, stack overflows tend to crop up. I'm still running XFS myself, and have for ages without a problem, but I'd have to lean toward suggesting JFS right now, so boot the installer with "linux jfs", then choose JFS for your /video partition. ReiserFS is also an option, though I believe JFS performs a bit better (XFS is even better still, at least, when its stable...). An example partitioning setup can be found below.
At the Installation Type screen, you want to choose a Custom installation (rather than Personal Desktop, Workstation or Server), because none of the defaults give us everything we need and/or add junk we don't need.
On the Disk Partitioning Setup screen, choose to Manually partition with Disk Druid. A suitable custom partitioning setup is as follows (assuming a single IDE hard drive):
| Partition |
Mount Point |
Size |
Format |
| /dev/hda1 | /boot | 50-100MB | ext3 |
| /dev/hda2 | swap | same as RAM (ex: 512MB) | swap |
| /dev/hda3 | / | 8-12GB | ext3 |
| /dev/hda5 | /video | Everything else | jfs |
Be sure to choose JFS (or XFS or ReiserFS) as the partition format type for the /video partition, as the selection will default to ext3. Note that there's really no point in using anything but ext3 on / and /boot. Red Hat tests ext3 heavily, its the only one that is pretty well guaranteed to be problem-free for / and /boot. Those expecting to add additional hard drives to their system for more video storage might want to set the partition type for hda5 to LVM, then create a logical volume over the top of it, formatted JFS. That'll allow you to increase the size of your /video partition transparently across multiple drives (which is exactly what I'm doing w/three 200+ GB drives in my master backend). Details on how to do that can be found in the official MythTV docs, at http://mythtv.org/docs/mythtv-HOWTO-23.html#ss23.3.
On the Network Configuration screen, I highly recommend setting a static IP address (could either be truly static, or a staticly mapped DHCP address). It really isn't a huge deal if you only have one Myth box (though you probably don't want MythWeb to be a moving target), but it could cause major headaches once you have more than one machine, since non-primary systems wouldn't know where the master backend was anymore if the address changed.
On the Firewall Configuration page, life will be much easier if you simply disable both the firewall and SELinux. Again, the firewall being enabled probably won't cause a problem if you only have one Myth box (though I'd allow at least ssh and http traffic), but if not properly tweaked, would prevent any secondary systems from being able to contact the master backend. As for SELinux, there are a number of things that just plain won't work right if you have it enabled. ResierFS doesn't work well with SELinux (known bug in Red Hat's bugzilla) and MythWeb (or more specifically, the web server, apache) can't communicate with MySQL without some work. I don't know enough about SELinux yet to know what changes are needed, or care enough to want it on a Myth box, so I just assume make life easier and disable it.
On the package selection screen, select (at least) these package groups:
- X Window System
- KDE Desktop Environment
- MySQL Database (be sure mysql-server is selected under the "Details" section)
- Web Server (if you want to use MythWeb)
Some other packages that might be of interest, but are not required:
- Graphical Internet
- Gaim
- Firefox (very handy for following this very guide -- think copy and paste)
- Sound and Video
- Windows File Server
- Network Servers
- Development Tools (if you want/need to compile anything)
As suggested on the MythTV site, we're going to use KDE as our X environment for running MythTV. If you happen to be running another window manager, you can fire up a terminal session, and issue the command:
$ switchdesk KDE
Note that there seems to be a bug in the FC3 installer, where if one only installs KDE, your user desktop will default to twm instead of KDE, so you may need to run the above command the first time you login to your box, then logout and log back in, and all should be well.
Or, you can try your luck with another window manager. Others will work, but this doc is geared toward using KDE. As an aside, I've used MythTV under Gnome 2.2 through 2.8, all without issue, as well as under XFCE4, which is now included as an install-time option in FC3 (but I didn't care for, since I couldn't get a shell to overlay video -- bad for debugging). It should be noted that full-featured desktop like KDE or Gnome does add some memory and cpu overhead that may be undesireable for lower-end systems. If you're short on cpu power, you should probably take a look at something like WindowMaker, twm, Black Box or Rat Poison. Jim Chandler has already gone down the WindowMaker path, and contributed these notes, and Greg Hawley has compiled some notes on setting up Myth on a low-end system, which include notes on using twm. Users on the MythTV mailing lists have written assorted information to the list about using Black Box and Rat Poison. I've actually successfully used Jim's WindowMaker setup on my EPIA now, and damn! The desktop loads a helluva lot faster than KDE. However, I can't alt-tab and get a console window to overlay Myth, which I do often for debugging purposes, so I'm back to KDE for the moment.
4. Firstboot setup -- create MythTV user and enable ntp
At the first boot setup screen, create a user called mythtv, with a password of your choosing. All further documentation assumes you are logged in as the user mythtv. Lines with $ as the prompt are executed as user mythtv, lines with # as the prompt are executed as root. You should NEVER log in to your machine directly as root. Log in with the normal user account, then assume root privs with 'su' wherever a command needs to be run as root.
For the beginners out there, type 'su' (without the quotes) then hit return, and you'll get prompted for the root password. After entering that, you'll have a root prompt. Do what you need to do as root, then type 'exit' (again, without the quotes) to get back to your normal user prompt.
In that same first boot setup area, there is an option to enable ntp. This is highly recommended. You want your shows to start (and stop) recording at the right times, don't you? ;-) Check the box to enable ntp, and either enter an ntp server you know of near you (I happen to know time-nw.nist.gov is just up the road from me in Redmond, WA, on the Microsoft campus) or leave it with the pre-populated values, which are from the ntp.org pool (pool.ntp.org aliases to a bunch of time servers around the globe). I actually have one system on my network that slaves off time-nw.nist.gov (and a few others for redundancy) then serves as the ntp server for the rest of my home network.
5. Get and install apt, update your OS packages
Well, only get and install apt if you're not using a multiarch 64-bit system (i.e., an Athlon 64 or EMT64 P4, where you're running both 64-bit and 32-bit libraries, which is what you get on FC, unless you're very crafty). If you're on a 64-bit system, you're much better off using yum instead. I still prefer apt when I can use it, but yum doesn't have the multiarch limitations that apt has, and is getting better all the time. To get started with yum, go to http://atrpms.net/install.html and follow the instructions for yum. After doing a "yum upgrade" (yum's equivalent of "apt-get update && apt-get dist-upgrade"), basically any "apt-get install some-package" command in this doc can be replaced with a "yum install some-package". It'll work for both 64-bit and 32-bit systems.
Those on 32-bit systems, you can simply install Axel Thimm's ATrpms-kickstart from http://atrpms.net/dist/fc3/atrpms-kickstart/. This provides you with apt and a pre-configured set of apt repositories, which include everything we'll need.
# rpm -Uvh http://atrpms.net/dist/fc3/atrpms-kickstart/atrpms-kickstart-25-1.rhfc3.at.i386.rpm
NOTE: the version number for the atrpms-kickstart package may be different when you read this, so double-check Axel's site if you get a file not found error and adapt accordingly.
Now we'll run a command that fetches all the latest metadata for apt to process, so it knows what is out there and available to install:
# apt-get update
Now go ahead and kick off an upgrade of all your installed rpms. This will take a while, lots of packages to download, roughly 265MB the last time I did it and paid attention, and this number tends to increase a bit with the age of the distribution, as more and more base packages are superceded by updates.
# apt-get dist-upgrade
WARNING: Do NOT attempt any other rpm activity while the upgrade is in progress. Performing multiple exclusive rpm operations at the same time can lead to very bad things happening (rpm database inconsistencies, race conditions, etc). After the big upgrade, you MAY get an error about being unable to open the rpm database (this used to happen to me w/RHL9, but hasn't ever with FC). If you do encounter this error, try the following:
# rm -f /var/lib/rpm/__db*
# rpmdb -vv --rebuilddb
Note that the rebuilddb will take quite a while to complete. After it completes, you'll see an error message, but you can safely ignore it and move on to see if the rebuilddb cleared the problem. If not, good luck... Note that the presence of those __db* files doesn't indicate a problem, they're supposed to be there, they just get corrupted every once in a while.
Anyhow, with recent changes on ATrpms, you should be primed for a successful installation without any further changes to your apt setup. In the past, we had to account for issues with kde-redhat, but not anymore. Now you get a bare-bones sources.list that contains only the essential repositories.
However, you might also want to install Synaptic, a graphical frontend to apt, which you can use in place of the command line if you prefer. As it is still under fairly heavy development and not guaranteed stable, its in the at-testing repository (note than I've never had a single stability issue with it though). Its easy enough to simply install it like so:
# apt-get install http://download.atrpms.net/testing/packages/fedora-3-i386/atrpms/synaptic-0.55.3-21.rhfc3.at.i386.rpm
The adventurous people out there might want to enable at-testing and install medley-package-config to get the old default sources.list that has a myriad of repositories pre-configured. The less-adventurous can skip on down to the next section. If you want to take the plunge, then edit /etc/apt/sources.list, replacing at-stable with at-testing. After that, run these commands:
# apt-get update
# apt-get install medley-package-config
# mv /etc/apt/sources.list.rpmnew /etc/apt/sources.list
# apt-get update
That should outfit you with access to a ton of different repositories. Personally, I run a modified full-blown config, with only os/core, updates, atrpms, freshrpms, dag and kde-redhat enabled. I generally don't need anything from any of the other repos, but I use quite a bit out of those ones.
On a related note, here's the apt-get line you need to use if you have kde-redhat enabled to get their packages to install cleanly:
# apt-get install kdebase qt arts kdelibs gtk+ gtk2 redhat-artwork
# apt-get dist-upgrade
As hinted previously, note that Axel maintains a few different channels of rpms, with varying stability labels on them. This entire installation can now be done using nothing but packages classified as "stable", but even "testing" is generally pretty stable. The only channel to *really* watch out for is the "bleeding" channel. If you enable it, you've been warned; things may break. You're on your own to fix 'em, so be prepared (Axel appreciates bug reports though -- http://bugzilla.atrpms.net/). The primary classifications are as follows (from Axel's web site):
- stable packages imply minimal upgrading risk. They are considered very well tested. You will usually find slight modifications to Red Hat's own packages here.
- testing packages are provided on a "works for me" basis.
- bleeding packages means asking for trouble!
For those that are attempting this installation using apt, but without installing the atrpms-kickstart package, note that you'll have to do some editing of your apt repositories. At a minimum, you need to be set up to use the ATrpms at-stable repository and the core and updates repositories (provided by FreshRPMs, among others). Generally, any problems encountered with ATrpms and ATrpms packages should be addressed on the atrpms-users mailing list before being taken to the MythTV list. You can subscribe to the ATrpms lists here:
As with any other mailing list, please search the archives first (you can find a link to them at the same location as above).
6. Kernel choices
Many of the features one used to only find in Axel's custom kernels for Fedora Core 1 and earlier Red Hat releases were full of back-ports from the 2.6 kernel. That means that pretty much everything we need is already in the latest Fedora Core 3 kernels provided by Red Hat, which are based on then kernel.org 2.6.11 release. Generally speaking, you should always install the latest errata kernel, shortly after the release of which Axel should have all the needed kernel modules available. Kernel modules are NOT maintained for older kernels, because of two things. First, a new kernel from Red Hat usually fixes some flaw in earlier kernels (security hole or bug fix), so its good practice not to use the flawed kernel and second, building kernel modules for every kernel would take forever and a day and cause assorted other headaches for Axel. To make providing kernel modules feasible, only the very latest one or two kernels are supported. As of this writing, kernel 2.6.11-1.34_FC3 is the latest released kernel.
If you happen to have a working yum install and aren't certain what the latest kernel is, yum handles kernels a bit differently than apt. This is actually one of the few things where I think yum is worlds better than apt -- you can simply issue the command 'yum install kernel' and the latest kernel will get installed (or 'yum install kernel-smp' for HT-P4 and SMP boxes). If you don't have a functional yum install or simply want to stick with apt, then for single-processor (except HyperThreading P4) systems:
# apt-get install kernel=2.6.11-1.34_FC3
For multiprocessor or HyperThreading Pentium 4 systems:
# apt-get install kernel-smp=2.6.11-1.34_FC3
We're going to set up a custom environment variable that will make life easier when installing kernel modules. To make this variable get set automatically on boot, we'll drop a file in /etc/profile.d, created like so:
# echo "export KVER=\`uname -r\`" >> /etc/profile.d/kver.sh
(those are back-ticks, not single-quotes)
Now edit /boot/grub/grub.conf and set default=0 if it isn't already, (which should correspond to the first listed entry, for the just-installed kernel), save your changes and reboot to start using the new kernel.
# vi /boot/grub/grub.conf
# reboot
Following all subsequent reboots, you should have the KVER variable set. On with the show...
7. Get and install video card drivers
While Fedora Core includes video drivers for most video cards, they aren't always the best ones for the needs of a MythTV user. For example, many video cards require experimental 3rd-party or proprietary drivers to enable TV-Out. Without nVidia's own proprietary video drivers, the performance of cards based on their chipsets will suffer greatly, even if you aren't using TV-Out. Instructions for installing accelerated drivers for nVidia and SiS cards can be found below. You're on your own for other cards. Click to expand the appropriate section for your video output device...
-
For users of the PVR-350's TV-Out:
Initially, you'll need another video output device hooked to a display in order to configure the PVR-350's TV-Out, unless you're extremely comfortable at the command line, in which case you can simply ssh into your PVR-350-equipped box (well, okay, you can also ssh in from another machine running an X server and run X-based apps over ssh's X forwarding, but...). I actually did all the setup of mine while the computer was connected to my TV via TV-Out on my GeForce 4 MX, in run-level 5. That way, I had a shell window and a browser window open, so I could easily cut and paste. Further instructions for configuring the PVR-350 can be found further down the page...
-
For users of nVidia Video Cards:
I strongly suggest everyone with an nVidia graphics card use the latest driver from nVidia as of this writing, version 7667. It appears to have fixed a number of problems folks had with 6629 and 7167, and provides improved video playback performance to boot (especially for HDTV).
Anyhow, to make life easier, Axel has prebuilt kernel modules. Install for your active kernel like so:
# apt-get install nvidia-graphics7667-kmdl-$KVER
# apt-get install nvidia-graphics7667
(answer Y if prompted)
Simply replace the 7667 with another version number, and you can install the older version instead. Note that you can actually have multiple versions installed, and switching between them is as easy as:
# init 3
# nvidia-graphics-switch 7667 (or 6106, or whatever else)
# init 5
(you can *probably* get away with simply reloading X at this point, but reboot if you run into problems)
Axel's nvidia rpms insert a necessary line into modprobe.conf and generate an xorg.conf file for use with the nvidia driver, based on your initial xorg.conf file. This new file is saved as /etc/X11/xorg.conf.nvidia, and after peeking through it to make sure it looks appropriate, drop it into place. I suggest backing up the original file, and keeping a copy of the initial nvidia version, just for good measure.
# mv /etc/X11/xorg.conf /etc/X11/xorg.conf.orig
# cp /etc/X11/xorg.conf.nvidia /etc/X11/xorg.conf
Add Load "v4l" in the "Module" section near the top of your xorg.conf file, to enable optimal v4l to X video transfer and v4l picture controls.
If you're in X right now, simply log out to relaunch X with the new configuration. If you're at the command line, either switch to run-level 5 ("init 5") or run "startx". Once you've verified this configuration is working, you'll likely want to look into the additional options below, to enable TV-Out, accelerated rendering, etc.
Here's an example Device setup section for a GeForce 4 MX video card using the 1.0-7667 nvidia driver to output to an NTSC television via S-Video (this should work equally for any GF4 or FX series card, as well as GF2/3):
Section "Device"
Identifier "Videocard0"
Driver "nvidia"
VendorName "Chaintech"
BoardName "nVidia GeForce 4 MX 440"
#Option "RenderAccel" "1"
# TV Out Setup
Option "TVStandard" "NTSC-M"
Option "TVOutFormat" "SVIDEO"
EndSection
Those with particularly cantankerous displays and/or people who want to pass their signal through an A/V switchbox may have problems with their card/drivers not auto-detecting the attached display type, in which case, you can add an Option line to the above Device section to force the display type, such as this one:
Option "ConnectedMonitor" "TV"
As for overscan, nvidia driver versions prior to 6106 used a fixed value option in the above Device section, which required a restart of X when adjusting. The latest driver versions rely on the nvidia-settings utility to set your overscan with a slider, and you can do so without restarting X. You can also adjust gamma, contrast, color balance, etc., with the nvidia-settings utility. All the settings are saved on a per-user basis, and according to nVidia's docs, should be reactivated at login if you do the following:
$ echo "nvidia-settings --load-config-only &" >> ~/.xinitrc
$ echo ". /etc/X11/xinit/xinitrc" >> ~/.xinitrc
This isn't actually working for me right now, along with audio levels not being properly restored, so I did something else, which you can find down in the Configure Automatic Startup section.
Another excellent feature you can activate in nvidia-settings is the flicker filter. It helps to greatly reduce the effects of interlace jitter. With the filter enabled, I no longer bother enabling software deinterlacing in Myth for playback. Note that the flicker filter can only be enabled on TV-Out (SVideo or Composite), not over VGA or DVI.
Note: overscan is possible with some older nVidia cards, as well as some 3Dfx cards, by using nvtv, which but you can find here:
My secondary MythTV system had a GF2MX in it for a while, with which I was using nvtv to blow the picture up a bit. It did a fine job. Its been so long since I used it though, I can't remember anything about it that would be of use. Really, given the price, I just recommend upgrading to a GF4MX or GF MX 4000.
There are a few settings not explicitly specified in the above configuration, as most of them can be auto-detected. However, it is possible you'll have to force some settings if auto-detection doesn't work. All these options are well-documented on nVidia's web site in the documentation files available in the Linux driver download area (http://www.nvidia.com/view.asp?IO=linux).
Not sure exactly what has changed in the nvidia driver, but most folks no longer seem to be able to use the RenderAccel line without having problems. However, I'm not sure what added benefit it provides anymore, since contrary to my earlier belief, it isn't necessary for me to use XvMC... With 6629, I didn't have any problems with it on any of my motherboards with VIA chipset or nVidia's own nForce2 chipset, none of which play nice with RenderAccel enabled anymore, but it doesn't seem to make any difference, I can still play back even HDTV video just fine without it.
For reference, and because many people have asked, I'm posting full copies of the xorg.conf files from both my HDTV-connected and SDTV-connected systems. My HDTV system uses a custom 960x540p mode for the MythTV GUI and standard-definition recordings and a custom 1920x1080i mode for HDTV content to output to a High-Definition TV through an Audio Authority 9A60 VGA to Component Video converter. I used to feed this set via S-Video, and while the picture was good, it can't touch the signals I'm now feeding the HDTV w/the Audio Authority adapter. My secondary system outputs via S-Video to a plain old 27" analog TV.
-
For users of SiS cards (and Pundit-S):
The original Asus Pundit's onboard video controller is made by Silicon Integrated Systems (the later Pundit-R has an onboard ATI Radeon). Accelerated video is not supported by Fedora Core's native video driver. You'll want to obtain the binary SiS driver, or MythTV performance will suffer greatly (and TV-out won't work right).
Use wget to get the binary SiS video driver
$ cd ~/sources
$ mkdir sis_drv
$ cd sis_drv
$ wget http://www.winischhofer.net/sis/sis_drv.o_xorg_6.8.1_gcc3_current.tar.gz
$ tar -xzvf sis_drv.o_xorg_6.8.1_gcc3_current.tar.gz
$ su
# mv /usr/X11R6/lib/modules/drivers/sis_drv.o /usr/X11R6/lib/modules/drivers/sis_drv.o.orig
# cp sis_drv.o /usr/X11R6/lib/modules/drivers/sis_drv.o
# exit
Note: http://www.winischhofer.net/linuxsisvga.shtml also lists a SiS Display Control Panel, which might be of use, especially for folks that need to tweak their display settings a bit and don't want to deal with command-line text-file hacking. I've used it myself, and it certainly is a handy tool. You can adjust overscan and underscan, flicker reduction, display mirroring, etc., all on the fly without restarting X.
Now run the system-config-display utility to change the video driver.
# system-config-display
Choose the 'Advanced' tab, then press the 'Configure' button for the video card type.
Choose the 'SiS 650' card. This will set the driver to 'sis'. Also click on 'Custom memory size' to the value you have set in the BIOS (8 to 64M).
Press the 'Ok' button, then press the 'Ok' button again.
Log out of your X session (if you had one active) and log back in for the settings to take effect.
Here is an example /etc/X11/xorg.conf 'Device' section for the ASUS Pundit:
Section "Device"
Identifier "Videocard0"
Driver "sis"
Option "XvOnCRT2" "true"
Option "ForceCRT2Type" "SVIDEO"
#Option "ForceCRT2Type" "TV"
#Option "CHTVOverscan" "false"
Option "CHTVOverscan" "true"
VendorName "Silicon Integrated Systems"
BoardName "SiS 315/650"
VideoRam 65536
EndSection
And finally add Load "v4l" in the "Module" section near the top of your xorg.conf file, for optimal v4l to X video transfer and v4l picture control.
UPDATE: Just got a copy of Chris's xorg.conf file for the Pundit, which you're welcome to:
-
For users of Via EPIA onboard Unichrome graphics:
I'm now running my EPIA M10000 system as my secondary viewing system, using the onboard Unichrome graphics chip, outputting to a 27" analog TV via S-Video. The quality is quite good, and the Unichrome driver is coming along quite well. Current CVS Myth supports use of the Unichrome driver's XvMC support to enable hardware decoding of mpeg2 content (like PVR-x50 recordings) with very minimal cpu usage. I'm using the Unichrome packages provided by Terry Barnaby with my EPIA, which is still running FC2. Visual quality might not be quite as good as the PVR-350's output for TV, but this is a much better output for general-purpose use, and still very good (it passes the CNN ticker test). I have zero problems playing back any of my xvid/divx/ffmpeg dvd rips using the Unichrome for output, while with the 350, only some types of rips worked smoothly. I have yet to try transcoding a MythTV mpeg2 capture to mpeg4 to see how it does...
For reference, here is my xorg.conf:
More to come, as the Unichrome driver begins to stabilize, and we figure out how to include binary unichrome-enabled Myth packages on ATrpms...
8. Audio setup
For starters, let me say that aRts (the KDE sound server) does NOT work well with MythTV in many cases, though work has been done recently to remedy that (I have no problems with it enabled on my systems anymore). It is still highly recommended that you disable aRts from starting up if you encounter audio problems. To do so, while logged in as your mythtv user, choose "Control Center" off the Fedora (Red Hat) menu. Navigate through "Sound & Multimedia" to "Sound System" and deselect "Start aRts soundserver on KDE startup" ("Enable the sound system" on KDE 3.3 or later) and then click "Apply". On subsequent logins, aRts will not launch.
Note: I'd previously recommended gnome-alsamixer for configuring audio settings in a slightly more user-friendly way than the cli alsamixer. For whatever reason, gnome-alsamixer isn't being packaged on freshrpms.net anymore, but my prior aversion to kmix has largely disappeared, as it has improved greatly, and now works just about as well with ALSA-powered sound cards as gnome-alsamixer did (necessitated by the fact ALSA became the default sound system in FC2). Anyhow, the rest of this step is not essential, you can just set your volumes with the mixer program of your choice and move on to the next step if you like. ALSA is the default sound system in the 2.6 kernel, so you've already got it, and the card should have been auto-configured. If you have some flashy new card, there's a chance you might need a newer ALSA version, which ATrpms does provide (I generally run the latest ATrpms packages). Those wanting to install the latest ALSA packages from ATrpms should do so with these commands:
# apt-get install alsa-kmdl-$KVER
# apt-get install alsa-driver
If you have multiple sound cards you want to use, you may have to edit your /etc/modprobe.conf file for your specific card. Details for supported cards can be found here:
I'm including a copy of my /etc/modprobe.conf ALSA configuration excerpt, which is for a SoundBlaster Audigy sound card. This should be valid for SB Live! and Audigy2 cards as well. If your card isn't one of those, check out the ALSA site's sound card matrix to find information for your card. The differences are very minor for most cards, and usually only the driver name has to be changed. For example, to configure ALSA for use with the onboard audio of an nForce2 board, it should be a simple matter of replacing all instances of "emu10k1" in the following modprobe.conf and .asoundrc with "intel8x0".
# Example modprobe.conf entries for my Audigy
alias snd-card-0 snd-emu10k1
install snd-emu10k1 /sbin/modprobe --ignore-install snd-emu10k1 && /usr/sbin/alsactl restore >/dev/null 2>&1 || :
remove snd-emu10k1 { /usr/sbin/alsactl store >/dev/null 2>&1 || : ; }; /sbin/modprobe -r --ignore-remove snd-emu10k1
For those folks out there unfortunate enough to need dual sound cards, I'm including a theoretical modprobe.conf ALSA snippet for a SoundBlaster Audigy and nForce2 onboard (i810) audio.
#Example modprobe.conf entries for Audigy and nForce2 onboard (i810) audio
alias snd-card-0 snd-emu10k1
options snd-card-0 index=0
install snd-emu10k1 /sbin/modprobe --ignore-install snd-emu10k1 && /usr/sbin/alsactl restore >/dev/null 2>&1 || :
remove snd-emu10k1 { /usr/sbin/alsactl store >/dev/null 2>&1 || : ; }; /sbin/modprobe -r --ignore-remove snd-emu10k1
alias snd-card-1 snd-intel8x0
options snd-card-1 index=1
install snd-intel8x0 /sbin/modprobe --ignore-install snd-intel8x0 && /usr/sbin/alsactl restore >/dev/null 2>&1 || :
remove snd-intel8x0 { /usr/sbin/alsactl store >/dev/null 2>&1 || : ; }; /sbin/modprobe -r --ignore-remove snd-intel8x0
Next, create a .asoundrc file for your mythtv user (full path of /home/mythtv/.asoundrc). Technically, this isn't necessary, but it can help out quite a bit in some cases (especially if you're outputting via an S/PDIF connection), and can't hurt. Anyhow, just make a new text file called .asoundrc like so, adjusting for your specific card, substituting for "emu10k1" where necessary:
$ cat > ~/.asoundrc
pcm.emu10k1 {
type hw
card 0
}
ctl.emu10k1 {
type hw
card 0
}
(Now hit Control-D to end cat input)
This is a *very* basic .asoundrc file, which worked for me just fine for some time, but I'm currently forging forward with native ALSA digital output in Myth, which requires a bit more complex setup. Mike Dean did an excellent writeup on the matter of digital sound, with details on a fully fleshed out .asoundrc, which you can find at:
I put together my own tweaked-out .asoundrc for my Audigy based on the long version for the nForce2 sound card found at the above link. It basically amounted to four changes. You can grab my full .asoundrc here:
Note that it is set up with output via S/PDIF and hardware decoding (by my external amp) as the default output method, so adjust accordingly. I'm actually not certain everything in here is correct, but audio on my box does everything it should, so I've left well enough alone.
Anyhow, now fire up the audio controller of your choice (aumix, alsamixer, kmix or gnome-alsamixer) and adjust the volumes, inputs and outputs to your liking. While enabling S/PDIF out for my Audigy was a matter of a checking a box in gnome-alsamixer, some folks have reported having to set a particular slider (IEC958 something-or-other?) to zero to enable the S/PDIF output on their sound cards. Go figure.
A simple way to test whether or not you've got sound is to use ALSA's aplay utility, like so:
$ /usr/bin/aplay /usr/share/sounds/KDE_Startup.wav
For whatever reason, my FC3 box doesn't like to restore all my audio levels, despite my having stored them with an 'alsactl store'... To get around this, along with my nvidia-settings not loading, I used a short shell script you can check out in the Configure automatic startup section below.
9. Get and install MythTV
Now, here's why we REALLY like apt... MythTV has numerous required dependencies to function correctly, which apt automatically takes care of installing with one simple command:
# apt-get install mythtv-suite
The last time I looked, that one-liner installed 94 different packages, totalling about 85MB. Just a wee bit easier than hunting down all the rpms by hand, let alone compiling everything from source... :)
If you get some error about failed dependencies, package conflicts, etc., with gtk2, gtk+, redhat-artwork, or something like that, please refer to the part about kde-redhat in the apt installation section...
10. Get and install capture card driver(s)
MythTV supports a myriad of different video capture cards, and as of version 0.17, firewire input from certain cable boxes as well. See the official MythTV docs at http://mythtv.org/docs/mythtv-HOWTO-3.html#ss3.1 for details on exactly what are and are not supported. Below you'll find details on setting up a number of popular capture devices under Fedora Core.
Click on the links by the + signs to expand and/or collapse the sections you need. Enable or disable display of PVR-350 Output information right here.
Show PVR-350 Output info
|
Hide PVR-350 Output info
*** Current setting:
Hiding PVR-350 Output info
-
For ivtv-based cards (PVR-250/350, M179, MPG600, etc):
Disclaimer! The ivtv driver for these capture cards is still considered beta, though it does work quite well. Driver development isn't entirely stable just yet, and moves quite rapidly, thus parts of this section may become obsolete over time, because I just can't always keep up. But on with the show!
As of this writing, the Hauppauge PVR-250, Hauppauge PVR-250MCE, Hauppauge PVR-350, AVerMedia M179, Yuan MPG160 and Yuan MPG600 are all supported by the 0.2.x series ivtv driver, which is what'll get installed from the ATrpms stable repository. There are patches to support a number of other cards primarily found in the Asian marketplace that can be found over at http://www.paken.org/ and the latest 0.3.x ivtv development series, which can be found in the ATrpms testing repository, now supports the Hauppauge PVR-150 and PVR-500 series cards fairly well, and seems to finally be mostly stable for most folks. I have a PVR-150 in production use now, and a PVR-500 to follow shortly. More to come on the 150 and 500...
So go ahead and install the ivtv driver components, like so:
# apt-get install ivtv-firmware
# apt-get install ivtv-kmdl-$KVER
# apt-get install ivtv
(answer Y if prompted)
For PVR-350 output on FC3, you'll need to install the ivtvdev package. This is done simply enough:
# apt-get install ivtvdev
Now, edit /etc/modprobe.conf to add ivtv-specific configuration info. For the PVR-250 and PVR-250 MCE, as well as PVR-350 users that aren't using its TV-Out, for NTSC, this should do the trick (note the extra tveeprom and msp3400 params that seem to be necessary as of this writing):
# ivtv modules setup
alias char-major-81 videodev
alias char-major-81-0 ivtv
alias tveeprom tveeprom-ivtv
alias msp3400 msp3400-ivtv
PAL and SECAM users may need an additional parameter, if video only comes in black and white (reportedly needed for some newer cards):
options ivtv tda9887=0
And other PAL users may need even more, for some newer cards that may not get everything auto-detected properly:
options ivtv ivtv_std=2 tda9887=0
NOTE: Dutch users are encouraged to check out the forum at http://mythtv.nl/ for more information.
As for users of the M179 (and probably Yuan MPG600), tuner detection (and possibly msp detection) doesn't work on these cards just yet, so you may have to manually specify them, like so:
# ivtv modules setup
alias char-major-81 videodev
alias char-major-81-0 ivtv
alias tveeprom tveeprom-ivtv
options ivtv tuner=2
options msp3400 once=0 simpler=1 simple=0
Users of the PVR-350 will need an additional line if they want to enable TV-Out, so their modprobe.conf additions should look like this:
# ivtv modules setup
alias char-major-81 videodev
alias char-major-81-0 ivtv
alias tveeprom tveeprom-ivtv
install ivtv /sbin/modprobe --ignore-install ivtv; /sbin/modprobe ivtv-fb
NOTE: Most of the PVR-350 TV-Out information contained here is derived from the TvOutHowto on the ivtv wiki site, with slight modifications to be Fedora/Red Hat specific (and subsequent changes for 2.6 kernels).
We're going to make little modification to the kernel boot line in your grub.conf file that should force the ivtv frame buffer to load on /dev/fb1, as well as allow the ivtv-fb module to be loaded and unloaded. Without doing this, unloading the ivtv-fb module would probably crash your system. To the end of all 'kernel /vmlinuz...' lines in /boot/grub/grub.conf, append 'vga=791', then reboot your system. This tells the kernel to load a frame buffer for your video card at 1024x768, 16-bit color. I use this all the time myself, simply so I can see more when I'm not in X. I'd always done this on my 350-equipped box without even thinking about it, which could explain some of why I've not run into some of the problems other folks have...
Now try loading up the ivtv driver:
# /sbin/depmod -a
# /sbin/modprobe ivtv
If you run into problems along the lines of a message saying memory can't be allocated when trying to either modprobe ivtv or use the card (like cat'ing video from /dev/video0), many folks seem to need to use the following command:
echo 16384 > /proc/sys/vm/min_free_kbytes
Not sure why this is necessary for some folks and not for others (I don't seem to need it). But if that helps, make it permanent with an entry in /etc/sysctl.conf:
# echo "# Fix ivtv memory allocation problems" >> /etc/sysctl.conf
# echo "vm.min_free_kbytes=16384" >> /etc/sysctl.conf
Again, the version of ivtv from the ATrpms stable repository should include support for all the latest tuners, but lots of new ones seem to be popping up lately. If you do indeed come up with an unknown tuner type, you should post a message to the ivtv-devel mailing list, with the entire contents of /var/log/messages from between
ivtv: ==================== START INIT IVTV ====================
and
ivtv: ==================== END INIT IVTV ====================
and the good folks over there can help set you back on course (I'm on that list too). An easy way to get the required info out of your log file is to run this shell script:
#!/bin/sh
tac /var/log/messages |
sed -n '/=\ \ END INIT IVTV\ \ =/,/= START INIT IVTV =/p;
/= START INIT IVTV =/q' |
tac
You can subscribe to the ivtv-devel mailing list here:
With the ivtv-fb line in your modprobe.conf, your system will automatically load up the ivtv-fb module. If you have that line commented out, you can load the ivtv-fb module up manually, with this command:
# /sbin/modprobe ivtv-fb
Check that your card is being properly recognized:
# /sbin/lspci -v
The lspci output should return something like this for a PVR-250 within the output (rev2, iTVC16, thus "Unknown device 0016"):
01:08.0 Multimedia video controller: Internext Compression Inc: Unknown device 0016 (rev 01)
Subsystem: Hauppauge computer works Inc.: Unknown device 4009
Flags: bus master, medium devsel, latency 32, IRQ 12
Memory at dc000000 (32-bit, prefetchable) [size=64M]
Capabilities: [44] Power Management version 2
Or like this for an M179:
01:07.0 Multimedia video controller: Internext Compression Inc iTVC15 MPEG-2 Encoder (rev 01)
Subsystem: Avermedia Technologies Inc: Unknown device a3cf
Flags: bus master, medium devsel, latency 32, IRQ 5
Memory at d8000000 (32-bit, prefetchable) [size=64M]
Capabilities: [44] Power Management version 2
And finally, like this for a PVR-350:
00:07.0 Multimedia video controller: Internext Compression Inc iTVC15 MPEG-2 Encoder (rev 01)
Subsystem: Hauppauge computer works Inc.: Unknown device 4000
Flags: bus master, medium devsel, latency 32, IRQ 10
Memory at e0000000 (32-bit, prefetchable) [size=64M]
Capabilities: [44] Power Management version 2
Those intending to run X on their PVR-350's output(s) will want to make note of their PCI bus ID, which is the very first part of that lspci output (the 00:07.0 part in the above example), because it'll have to be specified in your xorg.conf file.
Also check that your video device(s) exist:
$ ll /dev/video?
1 root root 6 Feb 13 18:23 /dev/video -> video0
lrwxrwxrwx 1 root root 6 Feb 06 2005 /dev/video -> video0
crw------- 1 mythtv root 81, 0 Feb 06 2005 /dev/video0
crw------- 1 mythtv root 81, 24 Feb 06 2005 /dev/video24
crw------- 1 mythtv root 81, 32 Feb 06 2005 /dev/video32
Make a note of what your video device has been set up as (device /dev/video0 in this case), as you will need to inform MythTV of this fact later on. You can determine exactly what device ivtv is configured on by looking in /var/log/dmesg just after loading the module. For example, you should see something like this:
# /bin/dmesg |grep Initialized
ivtv: Initialized WinTV PVR 250, card #0
I believe M179 users may see failure messages regarding i2c. I think the primary use of i2c on the PVR-x50 is for the IR interface, which the M179 does not have. I'm not certain on that one though... And if you've got multiple cards, you'll see multiple lines in dmesg, like so (from my system):
# /bin/dmesg |grep Initialized
ivtv: Initialized WinTV PVR 250, card #0
ivtv: Initialized WinTV PVR 350, card #1
ivtv: Initialized AVerMedia M179, card #2
If it isn't already obvious, card #0 corresponds to /dev/video0, card #1 to /dev/video1, etc.
You'll also need to take note of the frame-buffer device that ivtv-fb grabs. You can find that out with this command (followed by example output):
# cat /var/log/messages |grep "iTVC15 TV out"
Feb 7 21:17:39 htpc kernel: fb1: iTVC15 TV out frame buffer device
In this case, the PVR-350's TV-Out grabbed /dev/fb1. Most likely, you'll either get fb0 or fb1. You'll need to know that for your xorg.conf file later on.
The next step is to test the functionality of the TV-Out connection. First, remove the saa7127 module, so we can subsequently reload it with a test pattern. If you only have one input to your TV at your disposal, and you're already using it with your video card's TVOut, it is perfectly safe to unplug that connection and substitute the 350 for it. Simply switch the connections back when you've seen the 350 test pattern:
# /sbin/rmmod saa7127
# /sbin/modprobe saa7127 test_image=1
If everything looks good at this point, unload the saa7127 module and reload it without the test pattern:
# /sbin/rmmod saa7127
# /sbin/modprobe saa7127
I've heard at least one report that the test_image parameter doesn't seem to be working these days. I haven't actually used the output on my 350 in ages, so I can't easily confirm or deny that with the lack of spare time I've got these days. You might try forging ahead at this point, even if the test_image test doesn't work. Another test you might have more success with is this, which will attempt to play video off the card right back out to your TV:
# /usr/bin/ivtvfbctl /dev/fb0 -noglobalalpha -localalpha
# dd if=/dev/video0 of=/dev/video16 bs=64k
(control-c to stop)
# /usr/bin/ivtvfbctl /dev/fb0 -globalalpha -nolocalalpha
Now you need to set some aspects of the capture card for test capturing. In this case, we're going to make sure the card is set up for tuner input, using the NTSC (US) video standard, and full NTSC resolution (720x480). The next four lines 1) set NTSC as the video standard, 2) select the tuner for input, and 3) set the full NTSC resolution of 720x480 (you can set a lower rez if you really want, but I say use the best! But then I have an HDTV...). NOTE: The ivtv docs say that './ivtvctl -p 0' should set the tuner for input, but yours may vary (mine did, it is '-p 4'). Keep trying with different -p values (I think at least 0-8 are valid for some cards), doing a test capture after each change until you get the right one.
# /usr/bin/ivtvctl -u 0x3000
# /usr/bin/ivtvctl -p 4
# /usr/bin/ivtvctl -f width=720,height=480
NOTE: If you have multiple cards, understand that the ivtvctl utility assumes you're operating on /dev/video0 if no device is specified. On any ivtvctl command lines, tack on a "-d /dev/videoX" to operate on any other card (i.e. add -d /dev/video1 to work on your second card).
And by popular demand, here is the PAL version:
# /usr/bin/ivtvctl -u 0xff
# /usr/bin/ivtvctl -p 4
# /usr/bin/ivtvctl -f width=720,height=576
And finally, the SECAM version:
# /usr/bin/ivtvctl -u 0x7f0000
# /usr/bin/ivtvctl -p 4
# /usr/bin/ivtvctl -f width=720,height=576
MythTV now controls some (all?) of these functions internally, so be sure to set similar values when we get to the MythTV setup portion. Now hook up your cable or antenna to the WinTV PVR-250's tuner input if you haven't already done so (or some other video source to the S-Video or composite input), and we'll try to capture some video... Press Ctrl-C to stop the video capture.
# cat /dev/video0 > /tmp/test_capture.mpg
(ctrl-c to stop capture)
Use that copy of mplayer you installed a bit ago (as part of the mythtv-suite install) to view the capture:
# mplayer -vo xv /tmp/test_capture.mpg
If you're using the PVR-350's output, you won't be able to use -vo xv, as the ivtvfb driver doesn't have any Xvideo support. Instead, substitute -vo x11, like so:
# mplayer -vo x11 /tmp/test_capture.mpg
If you get something that looks and sounds intelligible, then congrats, your card is good to go! If not, and you're using the tuner input, it may be that you aren't tuned to a channel you actually have a signal on. Try this combo, which will let you watch the mpeg2 stream off the card while changing channels:
# /usr/lib/ivtv/ptune-ui.pl &
# mplayer -vo xv /dev/video0
Use the ptune UI to change channels, frequency tables, TV standard, etc., as necessary, until you find a working channel. If you still get nothing, you probably should talk to the ivtv list.
NOTE: the latest mplayer builds from ATrpms try xvidix output before xv output. However, xvidix can only be used when running with root priveleges, and for whatever reason, some systems aren't properly falling back to xv when mplayer isn't run as root, mplayer either hangs, or even segfaults. The extra '-vo xv' tells mplayer to use X-video output, which is the same output method Myth (typically) uses.
To hear audio with this video capture when played back using mplayer and the 350's output, audio output is going to be through your sound card, not the PVR-350's audio outputs. Personally, I piped the 350's audio outputs back into the line in port on my sound card, and then the sound card feeds my speakers, because system, MythMusic and mplayer audio (currently) can only be output through a sound card (but work is underway to change that).
If you get the following error:
cat: /dev/video0: Input/output error
Run the following commands to reload the driver (this won't work for PVR-350 users if the ivtv-fb module is loaded -- see above):
# /sbin/rmmod ivtv
# /sbin/modprobe ivtv
Now try the capture again.
If you don't have any sound, it is possible that the correct msp3400 module didn't get loaded for one reason or another. To remedy that situation, follow these steps:
# /sbin/rmmod ivtv
# cd /lib/modules/$KVER/kernel/drivers/media/video
# mv msp3400.ko msp3400.ko.orig
Then reload the driver yet again, and try the video capture one more time:
# /sbin/depmod -a
# /sbin/modprobe ivtv
# cat /dev/video0 > /tmp/test_capture.mpg
# mplayer /tmp/test_capture.mpg
Now that you have video capture working, we'll try to play some video through the PVR-350's output(s). First, we'll tweak some of the cards settings, then read video in and immediately pipe it out:
# /usr/bin/ivtvfbctl /dev/fb0 -noglobalalpha -localalpha
# dd if=/dev/video0 of=/dev/video16 bs=64k
(control-c to stop)
At this point, you need to connect the PVR-350's video output to something you can actually see its output on. For those with a single TV input, once again, you can type the commands in, then move your cables around. Note that sound for this test will be fed out the 350's audio outputs. If you see and hear what you'd expect from television, you're ready to keep moving on, so reset the alpha settings on the card (which MythTV handles internally, so you shouldn't have to do this again):
# /usr/bin/ivtvfbctl /dev/fb0 -globalalpha -nolocalalpha
If you got video, but there were like 20 to 50 evenly spaced horizontal lines overlaying it, try tweaking the ivtv-fb driver with this command:
/usr/bin/ivtvfbctl /dev/fb1 -alpha -on -globalalpha -nolocalalpha
Then run the dd test again, and with luck, the picture will look like it should. If not, rinse and repeat from the beginning...
Some people have run into issues with their cards generating a slight inverse ghosted image off to the right of the main picture, myself included. The recommended fix, which appears to be working for me, is to set the DNR mode to 0 (mine was initially set to 3), like this:
# /usr/bin/ivtvctl -c dnr_mode=0
Also make sure that the values for DNR temporal and spatial filters are set to 0, for best results:
# /usr/bin/ivtvctl -c dnr_temporal=0
# /usr/bin/ivtvctl -c dnr_spatial=0
You can verify all the settings for your card, see possible inputs, video standards, etc., with this command:
# /usr/bin/ivtvctl -a
NOTE: MythTV controls the capture resolution and bit rate internally, so scripts adjusting bit rate are no longer necessary (and will be overridden by MythTV's internal mechanisms).
Running X on the PVR-350's TV-Out-
For starters, recall the PCI bus ID of your PVR-350. Mine was 00:07.0 from the example output above. I'm honestly not certain what the "best" way to do this is anymore. What seems to work reliably is to take the output of lspci, convert it to decimal and throw a "PCI:" in front of it, so you'll end up having a line in xorg.conf that reads 'BusID "PCI:0:7:0"'. If your bus ID was something like 01:0f.0, you'd use 'BusID "PCI:1:15:0"'. See http://svn.wilsonet.com/projects/mythtvology/ticket/11 for more coverage on the matter.
You can simply download my (ntsc) xorg.conf file for the PVR-350, edit the PCI bus ID and frame-buffer device lines to match your system, and you *should* be good to go. PAL users will have to check out the ivtv wiki TvOutPal HOWTO for PAL-specific info. You can grab my PVR-350 xorg.conf file here:
To be on the safe side, I highly recommend making a backup of your current xorg.conf file before putting your tailored xorg.conf file into place:
# cp /etc/X11/xorg.conf /etc/X11/xorg.conf.pre350
# mv /path/to/customized/xorg.conf-PVR350.txt /etc/X11/xorg.conf
Assuming you're still in run-level 5 at this time, connected to your display with your video card's TV-Out, move your cabling and/or switch inputs on your TV over to the PVR-350 and hit ctrl-alt-backspace to kill off X and restart it on the PVR-350. You ought to be greeted by a login screen. If you are, you're in business. If not, you probably did something wrong, so retrace your steps from the beginning of this section. =)
NOTE: there is more X/TV-Out related info at the start of the ivtv-fb.c file in ivtv/driver if you download the ivtv source code.
Once you actually have MythTV up and running, you'll need to make some changes within the frontend specific to using the PVR-350's output, which are covered in section 13, Set Up MythTV.
The final touch is to rebuild your system's initial ram disk to include the drivers for the 350's output, so that you can have the driver load early enough in the boot process that rhgb will work over it. First up, you'll need to make some changes to /sbin/mkinitrd. A patch that adds an extra flag "--ivtvdev" can be found right here. This patch hasn't yet been heavily tested, but should do the job, if I haven't lost my marbles (again) -- feedback welcomed. Download the patch, make a backup copy of mkinitrd and apply the patch:
# wget https://svn.wilsonet.com/svn/mythtvology/trunk/mkinitrd-ivtv.patch
# cp /sbin/mkinitrd /sbin/mkinitrd-ivtv
# patch /sbin/mkinitrd-ivtv < mkinitrd-ivtv.patch
Now build your initial ramdisk:
# mkinitrd-ivtv -f --ivtvdev /boot/initrd-`uname -r`.img `uname -r`
After the ramdisk has been built, subsequent restarts should load the ivtv frame buffer a short bit into the system load process, much earlier than without the initrd changes, and soon enough that you should see the rhgb boot screen.
With the addition of the ivtvdev driver, I have no qualms about recommending the use of the PVR-350's output to anybody that either 1) doesn't ever want to play games on their system (no OpenGL acceleration) or 2) doesn't have an addiction to goom (one of the MythMusic visualizations). The video quality is second to none, for standard-def programming. Of course, it isn't all that easy to set up sometimes...
Oh yeah, and with the ivtvdev X driver, the measly 1GHz Via C3 in my EPIA (runs like a PIII-600) can decode and play back high-resolution xvid and ffmpeg4 encoded DVD rips without a problem.
-
For bttv-based cards (older WinTV-Go, AVerMedia AVerTV Studio, many others):
A wide variety of TV capture cards utilize the Brooktree bt848, bt878 and other variants. The particular card I have is an AVerMedia AVerTV Studio, which has a chipset labeled Conexant Fusion 878A (Conexant bought out Brooktree some time ago). Note that there aren't many bttv cards availble new anymore, as Conexant has replaced the 8x8 chipset with the cx2388x chipset. Many cards branded the same could be either 8x8-based, or could be cx2388x-based. The newer cards require the much-less-stable cx88 driver to function. Anyhow, the lspci -v output for my AVer card looks like so:
# /sbin/lspci -v
[snipped to relevant section only]
03:07.0 Multimedia video controller: Brooktree Corporation Bt878 Video Capture (rev 11)
Subsystem: Avermedia Technologies Inc: Unknown device 0003
Flags: bus master, medium devsel, latency 64, IRQ 19
Memory at d0500000 (32-bit, prefetchable) [size=4K]
Capabilities: [44] Vital Product Data
Capabilities: [4c] Power Management version 2
03:07.1 Multimedia controller: Brooktree Corporation Bt878 Audio Capture (rev 11)
Subsystem: Avermedia Technologies Inc: Unknown device 0003
Flags: bus master, medium devsel, latency 64, IRQ 19
Memory at d0501000 (32-bit, prefetchable) [size=4K]
Capabilities: [44] Vital Product Data
Capabilities: [4c] Power Management version 2
The card was automatically recognized by kudzu (Fedora Core's hardware detection utility) at system boot time after I put the card in the machine, and a basic /etc/modprobe.conf entry was written for me, and the stock bttv module (v0.9.x) was loaded at startup. Everything worked fine in xawtv (once it was configured with the right parameters, i.e. ntsc, us-cable, tv input), and I was able to use it in MythTV.
While my card works with the single line, "alias char-major-81 bttv", and everything is correctly auto-detected, some more advanced features may not be enabled and some cards may not be properly detected. A script that appears to be of some use is ftvco, or Find TV Card Options, which you can find here: http://www.mind.lu/~yg/ftvco/. It'll ask you a few questions, then try a number of combinations, which you can preview in xawtv. Chances are, one of those combinations will work for your card, and then a file is written out with the necessary contents to be placed into /etc/modprobe.conf.
Unlike the PVR-x50s, which mux audio in with the video stream into mpeg2 files, I needed an audio jumper cable from the sound out on the TV card to the line in on my sound card. This is all well and good for xawtv, but you need to make a few quick tweaks for use with MythTV. Open up your sound mixer (Fedora/Red Hat menu → Sound & Video → Volume Control) and mark the check boxes for Mute and Record for the Line In on your sound card. Now when you try xawtv, you'll get no sound, but when you fire up MythTV, everything will be gravy. Trust me. Note that ALSA in the 2.6 kernels has a snd-bt8x8 modules (or something like that) which works with *some* bttv cards to get audio into your system without need for an audio jumper cable, but I haven't tried it.
-
ivtv and bttv cards in the same system:
Only some minor tweaks are required to get both the PVR-x50 and a bttv-based card running in the same system. You *might* have to spec a specific tuner type for either bttv or ivtv if they aren't auto-detected, but the latest versions of each should do that for you just fine (unless you have an M179 or MPG600, see above). Here is the pertinent section of my modprobe.conf file:
# ivtv modules setup
alias char-major-81 videodev
alias char-major-81-0 ivtv
# bttv
alias char-major-81-1 bttv
Note that I had only set up the PVR-250's remote in this dual tuner configuration. The PVR-250 was configured for /dev/video0, the AVerTV for /dev/video1, both tuner types were auto-detected.
-
Multiple ivtv cards in the same system:
At one time, I had one PVR-250 and one M179 in my master backend system. The module configuration only differs from what you'd need for dual PVR-250s in that I have to tell the tuner module what type of tuner the M179 has. Here is the pertinent section of my modprobe.conf file:
# ivtv modules setup
alias char-major-81 videodev
alias char-major-81-0 ivtv
alias char-major-81-1 ivtv
options ivtv tuner=-1,2
The tuner= part of the options ivtv line simply says the tuner on /dev/video0 should be auto-detected (type=-1) and the tuner on /dev/video1 is type 2. If you have a pair of PVR-x50s, the options line is not needed. The alias char-major-81-X lines are alias definitions for /dev/videoX. These can be expanded for more cards as necessary, just add more lines (and more tuner types, if necessary).
-
pcHDTV capture cards (HD-2000 and HD-3000):
I was using my pcHDTV HD-2000 very successfully for some time in my production Myth environment, following David George's instructions. I've since moved on to using the DVB drivers mentioned below, as the DVB drivers seem to be the future route most development in Myth will focus on (since it can be unified with the work done to support the various other DVB standards).
Note that there are now updated tarballs available from pcHDTV's web site that can now be built external to the kernel, so patching and recompiling isn't necessary to use the v4l drivers anymore, they'll build against the stock FC3 kernels. A quick overview of how to do that can be found in the pcHDTV forums: http://www.pchdtv.com/forum/viewtopic.php?t=475.
Anyhow, my HD playback is perfectly smooth on all channels these days, with HD content outputting within a 1080i mode, raw AC3 audio passed to my amp, and CPU usage hangs around 70% for 1080i material (w/kernel deint filter enabled) and 50% for 720p material, on an Athlon XP 3200+. No stutter or anything on OSD fades either. Kick ass. More to come, eventually...
-
DVB capture cards (Nova-T, Fusion DVB-T, Air2PC, pcHDTV):
I highly recommend you check out Jani Talikka's pages at http://www.users.on.net/~jani/dvico-mythtv.html. They're specific to DVICO Fusion HDTV DVB-T cards, but should provide more help with configuring any DVB card than I can provide.
Note that there are also DVB drivers for the pcHDTV cards (in addition to the v4l-based drivers pcHDTV provides) and the Air2PC ATSC PCI card, all of which provide HDTV reception for the US market, as well as a bit of support for cable HDTV with the HD-3000 and Air2PC (from what I understand, only the HD-3000 completely works with cable HDTV at the moment, the current Air2PC cards only partially work, but their next hardware revision should work fully). Angel Li has done a write-up for what it took to get his Air2PC card working on FC3, which you can find at http://www.rsmas.miami.edu/personal/angel/mythtv/air2pc-howto.html. Note that I'm now running both an Air2PC and HD-2000 card in a box using a stock FC3 kernel and the ATrpms linuxtv-dvb-kmdl packages, pulling over-the-air HDTV, so there's no need to compile anything if you don't want to. Still working out the kinks in my setup, more to come when I have the time...
-
Hauppauge PVR-150 and PVR-500 capture cards:
First up, you need to be aware these cards don't work flawlessly yet, and some may not work at all (there seem to be quite a few variants). There is no hardware scaling at the time of this writing, so you have to set your MythTV recording profiles to use full-resolution (720x480 for NTSC, 720x576 for PAL/SECAM -- defaults are 480 horizontal instead of 720), or the right third of your picture will be missing. You will also be running a very bleeding-edge driver that is under heavy development, so there's a chance you'll get a lemon driver (I've had very good success with all recent versions, other folks... Not so much). To get started, you'll need to enable the ATrpms testing repository and install the 0.3.x ivtv driver. Edit /etc/apt/sources.list and change at-stable to at-testing, then:
# apt-get update
# apt-get install ivtv-firmware-audio
# apt-get install ivtv-kmdl-$KVER
# apt-get install ivtv
Now you'll need to set up a few things in /etc/modprobe.conf. The needed parameters vary between NTSC, PAL and SECAM, I've only got NTSC and my disposal, so at the moment, you'll have to check the ivtv list for what works elsewhere. For my PVR-150MCE, the modprobe.conf additions consist of:
# ivtv (PVR-150MCE)
alias char-major-81 videodev
alias char-major-81-0 ivtv
alias tveeprom tveeprom-ivtv
alias tuner tuner-ivtv
alias msp3400 msp3400-ivtv
Everything else is getting auto-detected just fine now (I wrote some of the supporting code to make that happen :-). My PVR-500 isn't much different, it actually appears to the system and ivtv as a pair of PVR-150 cards:
# ivtv (PVR-500MCE)
alias char-major-81 videodev
alias char-major-81-0 ivtv
alias char-major-81-1 ivtv
alias tveeprom tveeprom-ivtv
alias tuner tuner-ivtv
alias msp3400 msp3400-ivtv
Now you should be able to run a depmod and load up the ivtv module:
# /sbin/depmod -ae
# /sbin/modprobe ivtv
As with other ivtv cards, if yours doesn't work properly, get together log output and send it to the ivtv mailing list, per the instructions in the PVR-250/350 section above. The ivtvctl commands and testing methods detailed in that same section should apply equally to these cards, save the difference of the tuner input being '-p 6' instead of 0 or 4.
-
FireWire capture from a supported cable box:
As stated before, MythTV 0.17 debuted FireWire capture support, which when used with a supported cable box (Motorola DCT-6200/6400 and Scientific Atlanta 3250), allows for capturing High-Definition video via FireWire. I'm personally recording HDTV programming off my own DCT-6200 now. Setup is really quite trivial, and reliability is fairly good. My cable box seems to have restarted one day (I assume my provider sent down a firmware update that required a restart) and wound up on a different FireWire node address, which threw Myth for a loop, and every once in a while, when video is requested, it just doesn't come off the box, but the next attempt usually works. Not too shabby for brand new support, and getting better in current cvs (should be pretty close to rock-solid in 0.18, I'd wager). You'll obviously need a FireWire card in the box you want to hook your cable box to, but note that not all FireWire cards are created equal (or at least not all work equally well under Linux). The on-board FireWire on an Asus board I have didn't work worth a damn, but the FireWire port on my SoundBlaster Audigy works great, as does a Western Digital-branded PCI FireWire card (NEC OrangeLink chipset), which is what I'm using in production now.
Anyhow, if you're running the very latest MythTV builds from ATrpms, you've got almost all the necessary tidbits installed, as we added FireWire support and all the needed libraries to ATrpms some time back. If you're upgrading, simply upgrading your Myth packages should pull in the required libiec61883 and libraw1394 packages. You'll need to manually install the libiec61883-utils package:
# apt-get update
# apt-get install libiec61883-utils
And then set up a device node, as the current raw1394 module doesn't work properly with udev without these steps, and load the raw1394 module:
# mknod /dev/raw1394 c 171 0
# mknod /etc/udev/devices/raw1394 c 171 0
# modprobe raw1394
You should already have a line in /etc/modprobe.conf for your FireWire controller (something like 'alias ieee1394-controller ohci1394'), but I added one more line to make sure the raw1394 module loaded on startup:
install ohci1394 /sbin/modprobe --ignore-install ohci1394; /sbin/modprobe raw1394
Now, connect the cable box to your FireWire input, then power it up. You should see some output in /var/log/messages similar to:
ieee1394: Host added: ID:BUS[0-00:1023] GUID[0090a94000003380]
ieee1394: Node added: ID:BUS[0-01:1023] GUID[000f9ffffea323c6]
ieee1394: raw1394: /dev/raw1394 device initialized
Now run the plugreport utility (part of libiec61883-utils) to see what your system sees where on the FireWire bus:
# plugreport
Host Adapter 0
==============
Node 0 GUID 0x0090a94000003380
------------------------------
libiec61883 error: error reading oMPR
libiec61883 error: error reading iMPR
Node 1 GUID 0x000f9ffffea323c6
------------------------------
oMPR n_plugs=1, data_rate=2, bcast_channel=63
oPCR[0] online=1, bcast_connection=0, n_p2p_connections=1
channel=0, data_rate=2, overhead_id=0, payload=376
iMPR n_plugs=0, data_rate=2
Make note of the port and node where plugreport says it sees a device. The port (aka Host Adapter) is almost always 0, the node varies. In the above example, the port is 0, the node is 1. Note that these match up with the inforamtion in the log output, they're just easier to read in plugreport's output. Anyhow, you'll need that info to configure the capture device for Myth. You'll also pass the node number on to the next utility to do a test capture. First, I suggest setting the cable box to a known-working HDTV channel (manually, using the remote or buttons on the box), preferrably to one of the major networks, which ought to be free of any encryption. With that done, try a test capture, where the number after the '-r' switch is the node plugreport says it sees your box at:
$ test-mpeg2 -r 1 > testcap.ts
libiec61883 warning: Overlayed connection on channel 0.
You may need to manually set the channel on the receiving node.
Starting to receive
(hit ctrl-C)
done.
You should be able to play the file back using mplayer:
$ mplayer -vo xv testcap.ts
At the moment, you'll have to figure out manually what channels do and don't work. I created a custom lineup with Zap2it containing only the channels I found I could get off the FireWire port on my box. You'll also need a way for Myth to change the channels on your cable box. If you're using a DCT-6200 series cable box, MythTV 0.18.1 debuts internal channel-change support over FireWire, so no external channel-change app required, which definitely simplifies setup. If you've got one of the SA 3250 boxes, I believe you'll have to use something like an IRBlaster, directions for which can be found in the lirc section below. Once you've figured all that out, you're ready to set up the capture device for Myth to use.
Fire up mythtvsetup, and navigate into section 2 to set up a new capture device. Set the card type to "FireWire Input", FireWire port to 0 (unless you got something different from plugreport), FireWire Node to whatever plugreport said, FireWire speed to "100Mbps" (more than sufficient, this option may go away in the future) and leave Default Input as "MPEG2TS" (the only current option). Assign the custom lineup to your FireWire input, an external channel change command if you're not using a DCT-6200 series box, a known-good starting channel, and that's about it. Works for me, anyhow. :-)
11. Get and install lirc
The final version of lirc 0.7.0 was released just a bit ago. There are lirc rpms available from ATrpms, installable via apt and everything. However, it should be noted that they don't work with every single remote out there. Axel has attempted to roll in as much support for the most popular remotes as possible, and quite a few do now work. It is also possible to obtain the source packages, and rebuild for your specific remote, if the prebuilt packages don't work for you.
The earlier "apt-get install mythtv-suite" command installed part of LIRC for us already (lirc-lib). To finish the install, we need the appropriate kernel module as well. Simply install the remaining bits like so:
# apt-get install lirc-kmdl-$KVER
# apt-get install lirc
Expand the appropriate section below for your IR receiver interface.
-
Using the IR port on a PVR-x50:
There are now three different remotes floating around that come with PVR-x50 cards. There's an old black one, and two different grey and black ones. The older grey and black remote has the four colored buttons around the channel and volume controls, pictured here. The newer one has the four colored buttons at the bottom of the remote, pictured here. Config files for the two older remotes are provided in the ivtv packages, but the newest one you'll have to pull off the web.
For the new grey and black remote, you can grab a copy of the config file off my web server. Say yes if prompted about overwriting an existing file.
For the older grey and black remote:
# cp /usr/share/doc/ivtv-*/lircd-g.conf /etc/lircd.conf
Users with the black remote, you'll need to go this route:
# cp /usr/share/doc/ivtv-*/lircd.conf /etc/lircd.conf
Alternatively, you can also use certain universal remotes with you Hauppauge IR receiver. I'm now using a RadioShack 15-2116 remote to control two of my MythTV boxes. I've done a little write-up on what was required to make it work, complete with config files, which you can find here:
Now we add a bit to ivtv's setup in /etc/modprobe.conf to load the lirc modules. Add this line to the bottom of modprobe.conf, which should ensure ivtv is loaded before lirc_i2c, so we can access the i2c bus on the ivtv card:
install lirc_i2c /sbin/modprobe ivtv; /sbin/modprobe --ignore-install lirc_i2c
Then add one line near the top of /etc/modprobe.conf, that reads:
alias char-major-61 lirc_i2c
Now try loading up the lirc module...
# /sbin/depmod -a
# /sbin/modprobe lirc_i2c
If everything is still going like it should, let's set up lircd (the lirc receiver daemon) to start at boot time:
# /sbin/chkconfig lircd on
Then go ahead and fire it up right now...
# /sbin/service lircd start
If you get one or two [OK]'s, then proceed to testing the remote (one is for lircd, one is for lircmd; you only really need lircd). If not, check /var/log/messages to see if you can figure out what went wrong. To begin testing, fire up the irw tool:
$ /usr/bin/irw
You should get some output corresponding to the buttons you pressed. Hit ctrl-C to stop irw.
The next step is to set up a file to map those remote button presses onto key combinations that MythTV understands, so your remote actually does something useful once we have MythTV working. I've got one already prepared and ready for download for the older grey and black remote. You can view it here:
Getting it onto your MythTV box is a simple matter of:
$ wget http://wilsonet.com/mythtv/lircrc-haupgrey.txt
$ mkdir ~/.mythtv
$ mv lircrc-haupgrey.txt ~/.mythtv/lircrc
Please be aware that this lircrc file is somewhat customized toward my own needs (though I actually use a universal remote now). For example, the VOL+/- buttons don't alter volume at all, because I use an external amp. However, the MUTE button does mute. Other notables are the YELLOW button, which seeks to the previous commercial cut point, the BLUE button, which seeks to the next commercial cut point, and the FULL button, which toggles the aspect ratio (very useful with my HDTV). Adjusting the buttons to suit your own needs is a simple matter of editing the lircrc file.
More likely than not, you'll also want to use your remote with whatever video player gets launced to view your video library via MythVideo. The above lircrc file includes settings in it for both xine and mplayer, but they both look for an lirc settings file in ~/.lircrc, which we can remedy simply by symlinking to ~/.mythtv/lircrc, like so:
$ ln -s ~/.mythtv/lircrc ~/.lircrc
Courtesy of Brad Templeton, here's an lircrc file for the newer grey and black Hauppauge remote:
Follow the same steps as detailed for the other grey remote to get everything playing nice.
-
Using the IR port on your bttv card:
There are quite a few different possible remote control interfaces used across the wide array of bttv cards. Many of them SHOULD work with the latest lirc kernel module available from ATrpms, but maybe not all. You'll have to do some investigation of your own to figure out which lirc interface type your card uses, but the types that should work are (from the lirc driver types in the rpm spec file):
lpt1, sir_com3, it87, flyvideo, avermedia, tekram_bt829, udp, avermedia98, com1, hauppauge
My AVerTV Studio card uses the avermedia98 lirc driver, and works quite nicely with this rpm. The actual kernel module used is lirc_gpio, so I add this line to my /etc/modprobe.conf file:
alias char-major-61 lirc_gpio
Next, I dropped the appropriate lircd.conf file for my remote in place. Config files can be found in /usr/share/doc/lirc-0.7.0/remotes/<your type>. I simply did this:
# cp /usr/share/doc/lirc-0.7.0/remotes/avermedia/lircd.conf.avermedia98 /etc/lircd.conf
-
Using a serial IR receiver:
Most serial IR receivers should work with the lirc_serial module, but will need some extra parameters, such as port, irq, and possibly receiver type passed to them. All of them will require the following in /etc/modprobe.conf:
alias char-major-61 lirc_serial
If your receiver is hooked to the first serial port, aka COM1, you'll need these extra settings in /etc/modprobe.conf:
options lirc_serial irq=4 io=0x3f8
install lirc_serial /bin/setserial /dev/ttyS0 uart none ;\
/sbin/modprobe --ignore-install lirc_serial
If your receiver is hooked to the second serial port, aka COM2, you'll need these settings:
options lirc_serial irq=3 io=0x2f8
install lirc_serial /bin/setserial /dev/ttyS1 uart none ;\
/sbin/modprobe --ignore-install lirc_serial
The one other thing to look out for are serial receivers that are "Igor-style", which use a slightly different chipset, requiring an extra item "type=4" tacked onto the end of the appropriate "options ..." line above.
UPDATE: I think I finally have a completely viable, universal fix to get both ivtv and lirc modules (no matter which lirc module you're using, as long as its in modprobe.conf) loading very early in the boot process. I simply made a few changes to rc.sysinit, which you can add to your system via a patch I've generated. You'll still need to remove the first line from /etc/udev/rules.d/lirc.rules, leaving only 'KERNEL="lirc0", SYMLINK="lirc"' in there (easy way to do so included below), then download and apply a patch:
# tail -1 /etc/udev/rules.d/lirc.rules > /etc/udev/rules.d/lirc.rules.tmp
# mv /etc/udev/rules.d/lirc.rules.tmp /etc/udev/rules.d/lirc.rules
# wget https://svn.wilsonet.com/svn/mythtvology/trunk/rc.sysinit-mm.diff
# patch /etc/rc.d/rc.sysinit < rc.sysinit-mm.diff
With these changes, everything finally initializes correctly at boot time on my boxes. I never really looked into this one much earlier, since my boxes never reboot. ;-)
Anyhow, at this point, you should be able to start up lircd:
# /sbin/service lircd start
The start command should return an OK or two (look in /var/log/messages if you don't get an okay for some possible insight as to what went wrong). Now fire up irw to verify that lircd is receiving signals from your remote:
$ /usr/bin/irw
You should see some output when you press buttons on your remote that correspond with each button press. Hit ctrl-C to stop irw.
At this time, you're on your own to create a lircrc file for your remote. I have mostly implemented one for my AVerTV Studio remote, mostly just to verify that it work and until I get something better (quite frankly, it is utter junk, especially for use with MythTV).
Hopefully, this section will be of some aid to those using a different remote interface also...
Other routes to consider for an IR receiver if you either don't like the one that comes with your capture card or have a remote frontend without a capture card are serial port and USB receivers. I'm a huge fan of the USB receiver from Windows XP Media Center Ed., because they have a nice long cord to get them optimally placed (versus the very short cord on the PVR-x50's receiver) and have much better range and multi-directionality than any other one I've used. I've also got a serial one on the way shortly.
You can get a USB XP MCE receiver from NewEgg.com, but its a touch spendy, since you don't have the option to buy it without the MCE remote:
Another popular USB combo is the ATI Remote Wonder, which isn't actually IR, but RF. RF doesn't have nearly as many directionality or range issues as IR, but I don't believe you can control anything but your Myth box with a Remote Wonder, and the receiver is only good for the Remote Wonder. These ship with some ATI TV tuner cards, and you can also find them as a stand-alone at NewEgg.com:
Those using an ATI Remote Wonder probably want to check out Tim Litwiller's doc on how he set up his:
You can easily build your own serial IR receiver, per the diagrams on the LIRC web site, or you can just pick one up online for a few bucks. One popular source for pre-build serial IR receivers is Zapway.de, which while in Germany, does ship globally.
12. Set up MySQL
We'll need to enable MySQL to load at startup, set some passwords, and create the MythTV database, which we'll populate shortly. Starting with MythTV 0.12, the population of this database is handled by mythtvsetup, in the next step, and all MythTV add-on module database additions must be done AFTER running mythtvsetup.
# /sbin/chkconfig mysqld on
# /sbin/service mysqld start
Set the mysql root password, replacing ROOT_PWD with your chosen administrator password:
# mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('ROOT_PWD') WHERE user='root';
mysql> FLUSH PRIVILEGES;
mysql> quit
Now we create the mythtv database (called mythconverg) to get us started:
$ mysql -u root -p < /usr/share/doc/mythtv-0.18.1/database/mc.sql
(enter the password you just set above when prompted)
Again, all subsequent database population for MythTV's add-on modules must now be done AFTER running mythtvsetup for the first time. And if you get an error that look like this:
ERROR 1064 at line 4: You have an error in your SQL syntax near 'TEMPORARY TABLES ON mythconverg.* TO mythtv@localhost IDENTIFIED BY "mythtv"' at line 1
You can safely ignore it. Everything got created just fine, that line is for people using MySQL 4.x, which does not ship with many distros yet, because of licensing issues. It isn't necessary to upgrade, Myth will work fine with what you've got, but feel free to if you like. I'm actually running MySQL 4.1.9 out of the Fedora development tree on my master backend right now. No real discernable difference from 3.x though, until I started tweaking the config. It is worth customizing some parameters in /etc/my.cnf for optimal performance with Myth. I know next to nothing about the topic, but from experimentation and listening to people who do know what they're doing (I think), these adjustments to my.cnf under the [mysqld] section improve performance with Myth and MythWeb:
key_buffer = 16M
table_cache = 128
sort_buffer_size = 2M
myisam_sort_buffer_size = 8M
query_cache_size = 16M
UPDATE: Here are the MySQL 3.x versions of the same:
set-variable = key_buffer = 16M
set-variable = table_cache = 128
set-variable = sort_buffer = 2M
set-variable = myisam_sort_buffer_size = 8M
13. Set up MythTV
There are a number of things you might want to figure out in advance to successfully complete your setup. First, recall that your video device was set up as /dev/video0. Note that the actual device number is NOT what determines what order MythTV will use your cards in. What matters is the order that you enter them in mythtvsetup, so your best card doesn't have to be /dev/video0. Set up /dev/video8 first, and it'll be the first card used for recordings.
You will also need your zip code (please tell me you know this...), and it would help to know the right listing from http://www.zap2it.com/ (for US users, other countries use different listings sources) that matches your service provider, so xmltv gets the right program listings (I screwed up the first time, because I was guessing, and most of the programming info was askew). US folks will also have to fill out some paperwork to use zap2it's new xml data feed listings (the only way to go now). See this page in the MythTV docs for details:
Before you dive into the setup, you may want to make one little change so that you can actually see all the text you're supposed to see. There's a bug in Fedora Core 3's urw-fonts package that causes fonts to display MUCH larger than they should. Details on how to fix this can be found here:
Now on to launching the MythTV setup utility. For this part, you need to have an X session started up, as the setup utility is an X application. Fire it up like so:
$ mythtvsetup
I'm told that non-US folks may have issues correctly getting through the tv_grab_xx/xmltv part of the setup if "focus follows mouse" is already set (in KDE's Control Center), so keep that in mind. Just set "focus follows mouse" when everything else is already configured.
Recent changes in the mythtvsetup and database population methodology broke the default path settings for the MythTV rpms, which should be /var/lib/mythtv/ for storage of recorded shows, and /var/cache/mythtv/ for live TV buffer. These directories are automatically created at install time, but you'll have to manually enter them in section 1 of mythtvsetup.
Those using a dedicated /video partition, per my example, should obviously set /video/recordings/ for storage of recorded shows and /video/buffer/ for their live TV buffer. However, you can do pretty much whatever you like here, such as recording to an NFS or samba mount, a software RAID array, or even to an LVM group so you can expand your /video partition sometime down the road. Just make sure your mythtv user has permission to read and write to whatever location you choose.
It is highly recommended that you go through the setup steps in order. Follow the on-screen instruction, with aid from the MythTV website's documentation on this page:
NOTE: your system may appear to hang at step 3; give it time, it isn't locked up, that part just takes a while!
Once you've gone through the setup, you have to populate the MythTV database with some program info. I spent a good long time tweaking my channel lineup on zap2it's site to remove all the junk channels I didn't really care to have show up. Once you have your listings to your liking, you're ready to fill your database with programming info. A change in MythTV 0.17 requires that you start up the backend first. We'll daemonize it a bit later, but for now, just start it up like so:
$ mythbackend &
Assuming all goes well and the process doesn't exit on you (if it does, check out the troubleshooting section below), lets get some guide data:
$ mythfilldatabase
If you're using a guide data source other than zap2it (i.e., anyone outside the US and Canada), I'm told that you may well need to add a "--manual" flag to the end of that command to get it to work. Look at the output of "mythfilldatabase --help" for more clues if you have problems.
Also, BE PATIENT! This step can take a fairly long time, depending on your internet connection speed and how many channels your service provides... It is also recommended to run mythfilldatabase every night from cron, to keep your show information up to date. To help mitigate possible flooding of our listings provider's servers, we'll set mythfilldatabase to run at some random time after 2:30am, as suggested by David Rees on the mythtv-users mailing list. We'll simply add an entry to the mythtv user's crontab, like so:
$ crontab -e
----Insert the following text into your mythtv user crontab----
### Run mythfilldatabase every night at some random time after 3:01am
01 3 * * * sleep $(expr $RANDOM \% 14400) && mythfilldatabase > /var/log/mythtv/mythfilldatabase.log 2>&1
----Cut above here (don't include this line)----
Myth also has built-in support for scheduling when mythfilldatabase should be run. You can find it somewhere in the frontend's setup. The randomization wasn't as good as the above the last time I looked (its been a while), but probably sufficient. I still use the cron job myself, actually running sometime mid-day, to help easy zap2it's traffic load (most people hit them in the dead of night).
Now start up the MythTV front-end (I recommend doing this in a separate shell window, so you can distinctly see the different output for the backend and frontend processes)...
$ mythfrontend
There are various options within mythfrontend that you can tweak... In the past, I've recommended enabling "De-interlace Playback", even if you're using an interlaced display (like a TV). However, I've found with the latest nvidia driver and its flicker filter, this is no longer necessary for TV output (note that the flicker filter can only be used on SVideo or composite TV-Out, it isn't an option for DVI or VGA). You're on your own for the rest of the settings. Just be sure to go through every section, and get to the point where you click a "Finish" button, otherwise some values seem to not get initialized (most notably, you may get crashes that say something about not being able to open the dsp). Another setting I'd recommend enabling, especially if you're using an nVidia video card (not sure about others) is OpenGL VSync, which recently became a toggleable option. It isn't stable for everybody, but works very well for me on several systems (and I find it to be a must for optimal HDTV playback). If everything appears to be working, once you've gone through all the configuration steps, you can set your system up to automatically load everything at startup. And congrats, you've done the bulk of the work. You can stop here if you want, but if you're like me, you'll want everything to load automatically when the system boots.
PVR-350 output users need to enable use of the 350's decoder. Go into Settings → TV Settings → Playback and go to the "Use PVR-350 Output" screen. Check the box, and make sure it reads /dev/video16. Click through to the "Finish" button of that section, and now you should be good to go for MythTV to take full advantage of the PVR-350's decoder and TV Output.
14. Configure automatic startup
The necessary init script for the MythTV backend to automatically start at system boot is already in place for you, just simply turn it on:
# /sbin/chkconfig mythbackend on
If the backend isn't already running, save yourself a reboot and issue this command:
# /sbin/service mythbackend start
Now, because I have a few things that don't seem to want to play nice anymore (i.e., nvidia-settings don't load like they should, alsa volume levels aren't restored), I decided to create a quick little shell script in ~/.kde/Autostart/myth-load.sh to handle loading up all the extra goodies I need/want to auto-start, as well as force stubborn things to work. This script loads my nvidia settings, restores alsa volumes, launches irexec for my little power button script (on the Tips 'n' Tricks page), then launches mythfrontend, all in one fell swoop. Just copy and past all this into ~/.kde/Autostart/myth-load.sh (adjust accordingly for different desktop environments):
#!/bin/bash
# Only do this stuff if we're on the main display
# (i.e., don't do this in a vnc session)
if [ `echo $DISPLAY | grep -c ":0"` -ge 1 ]
then
# Load nVidia driver custom settings
nvidia-settings --load-config-only &
# Restore audio settings
/usr/sbin/alsactl restore
# Launch irexec for myth power button stop/start
irexec &
# Launch myth frontend
mythfrontend &
# Disable dynamic power management (screen blanking)
/usr/X11R6/bin/xset -dpms
# Disable screen saver
/usr/X11R6/bin/xset s off
fi
exit
Don't forget to make it executable:
$ chmod +x ~/.kde/Autostart/myth-load.sh
While logged in to an X session, you'll also have to run gdmsetup, to set autologin for your mythtv user