SuSE Linux 9.2 + Linux 2.6.10 + MythTV-0.17

A definitive guide to installing Myth on SuSE 9.2 using the new 2.6.10 kernel

5.24 - I've been a bit busy with finals, moving out, taking a quick break - On top of that, I've been dealing with "dependency hell" :( Working on fixes with the RPM developer. Will keep you posted.
4.19 - I have SuSE 9.3 - I'm in the process of re-installing with SuSE 9.3
This guide will be pretty much obsolete, as the new kernel and the RPM-install will make all of this easier. Give me a few days and the new guide will be here. Old guide will moved here

Table of Contents

Introduction
Hardware Used in My MythBox
Step 1 - Install SuSE 9.2
Step 2 - Update your video4linux files or roll the new 2.6.10 kernel
Step 3 - Install and Configure your Nvidia Card
Step 4 - Install LAME and MPlayer
Step 5 - Install ivtv
Step 6 - Install LIRC
Step 7 - Download and Install MythTV
Step 8 - Start MySQL and setup the intial database
Step 9 - Setup MythTV
Step 10 - Installing Myth Modules
Notes on MythTV-0.17
Conclusion

Introduction

When I first heard of MythTV and home-brew PVRs, I was a n00b to Linux; I was barely able to get a copy of Fedora working on my Dell laptop. I read about a few different projects on Slashdot, and I wanted to (someday) build my own Tivo....

About six months later, right in time for Christmas, I got my MythBox off the ground. I spent about a week getting the parts together (researching, ordering, and awaiting arrival) and a few hours with assembly. Ive used SuSE since my early debacle with my laptop and the then-recently released Fedora Project. However, I read Jarrod Wilson´s excellent Fedora/Myth tutorial, and seeing the ease at which to install Fedora and MythTV (with apt-get) I thought it might be a good idea to give Fedora another chance.

It didn´t work out as I thought it would. I had plenty hardware issues - Fedora didn´t like any of the hardware I threw at it, and I was too used to Yast and SuSE. I went back to SuSE, opting for SuSE 9.2 Professional. It was a good move, as (almost) all of my hardware was instantly recognized, and I was able to hit the ground running on my MythBox

Today, a soon-to-be Novell Linux Certified Engineer, I am happy with my resulting MythBox. But the road to the finished project did not come without much work, and I have documented the whole effort to get this MythBox working. I endured many, many late nights, a few RTFMs, a whole new kernel, (some) frustration, and success. I hope this guide will help others expedite the process in getting their box going. I compiled this from many different sources; I thought it best to have one central location for all of this information, and if you feel I didn´t credit you properly or you´d like to offer technical/grammar/other suggestions, email me and I will rectify the situation.

I should note a couple of caveats, though. This HOW-TO does make a few assumptions -

1.) You´re building a MythBox using a PVR-350 (although most of this will work for any PVR-x50 series

2.) You´re using a MythBox with a Nvidia card using the Nvidia tv-out

You can do this with an ATI card, although I don´t necessarily recommend it. Anyone with an ATI card who has tried to get it to work under Linux knows of the complexities of getting the drivers loaded and 3D support enabled. Nvidia´s installer and the process was much easier and even with the new 2.6.10 kernel, it was not hard to get everything working.

I plan to do a write up on how to use the PVR-350´s tv out later on.

3.) You are in the United States

I apologize to my international vistors, but I haven´t had to configure other screengrabbers, as I am in the desert of Arizona. However, I am working on a fix to this, and I should be done with other options for those not in the United States shortly.

4.) You´re using pico.

Someone once complained about my use of pico, and began to extol the virtues of vim until my ears bled. Personally, I prefer the simpleness of pico. I´ve always seen this debate rage on emacs vs. vim, but no one ever mentions pico. I bet both programs are plenty useful (although I swear I had a hell of a time editing a file with vim once - I tried to edit a line and nothing happened) , but I´ve always used pico. Quite simply -

$ pico rocks

End of discussion. If you think you can change my mind, by all means, email me as noted above

-Chris Robbins
Computer Science Sophomore
University of Arizona

Hardware Used In My MythBox

Hardware

Name

Processor

AMD Athlon64 3000+

Motherboard

Gigabyte GA-K8VM800M MicroATX

Video Card

Nvidia GeForce FX 5500

Memory

512mb (generic - from local computer store)

Hard Drive

Western Digital WD2000JB 200gb (7200rpm, 8mb buffer)

Network Card

D-Link DWL-G520 (AirXtreme - 108mbps, 802.11 b/g)

Case

AthenaTech MicroATX case (front-mounted LED w/temperature readout)

Optical Drive

Sony 16x Dual Layer DVD+/-RW Drive (DW-D22A-B2)

TV Tuner Card

Hauppauge PVR-350

Step 1 - Install Operating System

With SuSE 9.2, this is pretty straightforward. Insert DVD, reboot, and let the installer take over. Be sure to select installation from the boot menu though, because the first option is to boot from hard disk. You can adjust settings (partitions, hardware, etc) as necessary, but ensure that you take a look at "Installed Packages" before you proceed. We want to be sure that a few packages are pre-installed, because they are prerequisites for MythTV. Click on "Installed Packages" and adjust the search parameters so "Search" is enabled. From here, search for the following packages -

Qt3
Qt3-devel
MySQL
freetype2
Perl-Tk

I would also advise getting rid of LIRC (infrared support for remote controls), as you will need to install and configure from source. From here, proceed and let the install cook. Take a nap, get a drink, do something while it completes. When you're done, it a few prompts will come up for the root password, network configuration, user setup, and hardware. When all of this is complete, you'll be booted into SuSE 9.2 Professional. From this point on, we will assume a KDE-based install (as Myth seems to work best in KDE, YMMV.)

Step 2 - Update your video4linux modules or roll the new 2.6.10 kernel.

NOTE: Installing the new kernel is NOT required for all users. If you are a user of the newer (recently manufactured) Hauppauge PVR series of tv tuner cards (i.e. - PVR-250/350), a new type of tuner has been used in production. Some, but not all of these tuner cards (especially within the US) use the newer tuner 47 and 50. The kernel needs new definitions to communicate properly with the newer tuners. There are two ways to fix this. You can patch the video4linux modules in the kernel OR roll the new 2.6.10 kernel. The new 2.6.10 has all the proper definitions for the new tuners from Hauppauge. The video4linux snapshots support tuners up to type 57. It is easiest to update via video4linux snapshots, but I´ll leave the kernel upgrade guide up for those feeling particularly daring ;)

If you plan on updating via a newer video4linux snapshot, head over to bytesex.org. Most of the instructions there are pretty straightforward. Look under the Downloads for snapshots, download and update. To test to see if you need to update your video4linux files -

This guide is extremely generic - You could install any 2.6.x kernel using these instructions. At the original time of writing, I used 2.6.10. I believe the current version is 2.6.11-6. To upgrade to the newer kernel...

First off, go get the kernel sources at kernel.org (Click to download) There is a more in-depth guide at Kwan Lowe's site. I'm not going to be very thorough; Kwan Lowe's site does best in explaining everything, but for this site, I'll be brief.

From the command, untar the kernel sources where you feel comfortable working (i.e. - /home/user, etc). You can do this as a normal user, and is recommended. So -

$ tar xfvj linux-2.6.10.tar.bz2

Change directory to the source

$ cd linux-2.6.10

Issue the command to clear the source directory and get rid of previous configs

$ make mrproper

Run 'oldconfig'. While xconfig has many different options to configure hardware/filetypes/network options, oldconfig preserves the configuration options from the installed kernel and (thus) makes it less likely to screw up. Furthermore, any other options for installable modules will be brought to your attention, with options and recommendations. From here-

$ make oldconfig

The config will run, prompting you for some options. Answer options and wait for the config to complete. From here, issue the following commands -

$ make clean
$ make bzImage
$ make modules

Simply put, make clean gets rid of any remaining junk left during in the config, while make bzImage creates the boot image for the new kernel. Make modules makes the kernel modules. The first step is quick, but making the boot image and making the modules takes time, depending on the hardware you're using. It won't take all day, but it's nothing like the initial install. The next step needs to be executed as root to install the modules. Run -

$ su
# make modules_install

This is the easiest part of the kernel install. If you've made it this far, you're practically home free as the install is complete. The make modules_install places all of the new kernel modules in /lib/modules/2.6.10/. First off, let's move the bzImage to the /boot folder, so there's a 2.6.10 kernel to boot. As user, run-

$ cp arch/i386/boot/bzImage /boot/vmlinux-2.6.10
$ cp System.map /boot/System.map-2.6.10
$ ln -s /boot/System.map-2.6.10 /boot/System.map

The three commands, in order, move the boot image to a file in the /boot folder and uses the SuSE-naming convention for the boot image. The System.map file is copied and then linked to the System.map. We need to make an initial ramdisk to provide drivers for the computer to access the filesystem. From here, run the mkinitrd utility.

$ mkinitrd -k vmlinux-2.6.10 -i initrd-2.6.10

Our final step is to link the the bootloader with the new 2.6.10 kernel. By default, Grub is the bootloader for SuSE, so these instructions apply to Grub. If you do not use Grub, go to the kernel howto at the link above. Edit the file at /boot/grub/menu.lst

$ cd /boot/grub/
$ pico menu.lst

Add the following lines to the file -

### Kernel 2.6.10 boot instructions ###
title SuSE Linux 9.2 - 2.6.10
kernel (hd0,1)/boot/vmlinux-2.6.10
initrd (hd0,1)/boot/initrd-2.6.10

Finally, move the source directory to where it should go, and make sure you link /usr/src/linux to the new kernel sources -

# mv /path/to/linux-2.6.10 /usr/src/
# ln -s /usr/src/linux /usr/src/linux-2.6.10

The installation of the 2.6.10 kernel is complete. One of the hardest parts is complete, and the rest of the installation of MythTV and its prerequesites will get exponentially easier.

Step 3 - Install and configure your Nvidia Card

Most people who´ve built a MythBox or dealt with video cards and linux know that by far, Nvidia does linux drivers quite well as far as usability and configuration. I opted for a Nvidia card, and it seems easiest to use one for tv-out. Download the most recent nvidia drivers (1.0-66629 at time of writing) There is conflict with the new 2.6.10 kernel that has since been resolved with patches (both files hosted here and here). For our SuSE install, we must switch to runlevel 3.

$ init 3
$ su

As root, run the following commands-

# sh NVIDIA-Linux-x86-1.0-6629-pkg0.run --extract-only
# cd NVIDIA-Linux-x86-1.0-6629-pkg0
# patch -p0 < /path/to/NVIDIA_kernel-1.0-6629-1165235.diff.txt
# patch -p0 < /path/to/NVIDIA_kernel-1.0-6629-1171869.diff.txt
# ./nvidia-installer

Once complete, configure with sax2.

# sax2

Step 4 - Install LAME and MPlayer

Get LAME and MPlayer for MythTV. LAME is an mp3 encoder and MPlayer is a full-fledged media player for Linux. From here on out, Ill assume you can do a ./configure, make, and make install on your own, but I will guide some of the other sections as needed. The installs for Mplayer and LAME are fairly easy, as noted above, run ./configure, make, su, make installl after you´ve untar-ed the files.

Step 5 - Install ivtv

Obtain a copy of Chris Kennedys IVTV drivers. He builds more often than the actual ivtv project, and all the drivers I have used are much developed than those at the ivtv project site. Go to here and obtain the sources. I used ivtv-0.2.0-rc3c for my box. The 0.3 versions are all still in development and may not be stable at time of writing.

Download and untar this file to your home directory. cd into this directory-

$ cd ivtv-0.2.0-rc3c
$ cd utils

Go get the latest firmware for your PVR-350. Become root....

$ su

Extract the firmware

# ./ivtvfwextract.pl /path/to/pvr250_22_inf.zip
# exit
$ cp videodev2.h /ivtv-0.2.0-rc3c/driver

From here, cd into the driver and utils and perform a make and a make install

From here, we can test to make sure all of this now works. First off though, we must get the Perl modules to deal with ivtv to use the Perl utility ptune-ui.pl to adjust channels and settings. This module is packaged with the IVTV driver. The perl prerequisites for ptune-ui are-

Video::Frequencies
Video::ivtv
Config::inifiles

Filling these in is relatively easy. Google is your friend in this case, as most of these are easy to find. After you've downloaded these files, untar them. Change directories for each one, and issue the command-

perl Makefile.PL

for each one you install. A few messages should be displayed, usually stating that things ¨look good¨. From here, run a make and a make install.Before testing, load the ivtv module. Execute -

$ su
# modprobe ivtv

If all goes well, this should return nothing. If something goes wrong, it will be noted here or in the system log. Change directories to your utils directory and as user, run-

$ ./ptune-ui.pl

This should bring up a small menu with many different numbers and settings. Select a channel that you know will come in relatively clear. From here, run the following command to test your pvr-350.

cat /dev/video0 > /tmp/test.mpg

Let this run for a time, and kill it with CTRL+C Open the test file with Mplayer. If it works with picture and audio, you´ve conquered another hard part of the MythBox install. Ifyou get static/fuzz with no sound, try changing the channel or starting again from the beginning. This setup usually works on the first try.

We need to edit a startup script so most of this loads for us automatically. If we don´t, we´ll have to modprobe every time we restart the computer. Find modprobe.conf.localunder /etc, and edit in these lines.

alias char-major-81 videodev
alias char-major-81-0 ivtv

The third line is for remote control support, which we will discuss in the next step, Step 6 - LIRC Support

Step 6 - Install LIRC

I moved this up because it is important to get this taken care of before setup of Myth. Doing so will prevent you from having to recompile MythTV.

While everything ran smoothly with the MythTV install, the one sticking point I had for the longest time was the trouble with my remote control. Remote control support was tough for me to figure out, but I finally did figure it out. First off, from my own experience, linux kernel 2.6.10 and above require the latest CVS version of LIRC (lirc-0.7.1pre1.tar.gz), which took a while to determine. I have a newer PVR-350, but all of the Hauppauge remotes are supported. Untar the package, and run -

$ ./configure

This will run you through the menu setup. Follow all the prompts, selecting 1 to edit the driver type, 5 for tv card, f for a Hauppauge card, and 3 to save and run configuration. From here, we will run a make and a make install to finalize LIRC setup.

But all is not done from here. LIRC will build the configuration for the remote for you, but it must know the inputs for the keypresses and which keyboard buttons are associated with these keypresses. For MythTV, you can stick this file under the directory /home/user/.mythtv/lircrc. You´re also going to want to place the same file in /home/user/.lircrc. This is easily achieved through a link like this -

$ ln -s ~/.mythtv/lircrc ~/.lircrc

The config files are easy enough to figure out on your own, but I will be hosting my lircrc file for your own use as a template or to use permanently.

Within the tools directory of the untar-ed LIRC file, there should be an executable titled irw. To test the inputs of the remote and make sure that at least your remote is communicating properly with your MythBox, run -

$ ./irw

If the buttons you press match the buttons displayed in the console window, you´ve got part of it working. From here, you must get the LIRC daemon to start up when you restart your computer, and make sure that both the lirc_i2c and the lirc_dev modules are started as well. You could write a bash script to run at startup, or you could edit the boot.local (located at /etc/rc.d/boot.local)to have these lines shown -

modprobe lirc_dev
modprobe lirc_i2c
/usr/local/sbin/lircd

Editing boot.local was easiest for me. This worked well, although initially, it didn´t work until I recompiled mythtv from scratch. This means doing a $ make distclean in the mythtv-0.17 directory, and then repeating the install directions as noted above.

Step 7 - Download and Install MythTV

You´ve reached Step 7, and by now, you´re nearing the end of the project. MythTV, version 0.17 can be found here. Untar the file, and cd into the mythtv-0.16 directory. First off, if you plan on using LIRC for infrared/remote control support, you´re going to have to compile into the source. Fire up a console, and edit the file settings.pro. You´re going to be looking for something like this:

# Native lirc support
#CONFIG += using_lirc
#LIRC_LIBS =-llirc_client

Uncomment out these lines (take off the # signs in front of the second and third lines.) Save this file, and from here-

$ ./configure
$ qmake mythtv.pro
$ make
$ su
# make install

Step 8 - Start MySQL and setup the initial database

MythTV needs to have MySQL started in order for it to work. This can be done from the command line, but this is easier to see if we do it from Yast. Go into Yast, enter the root password when requested, and go to the System tab and look for the icon called Runlevel Editor.

Enter the Runlevel Editor. When you first enter, under Simple Mode there should be a list of programs and services that can be started. Find mysql, highlight it, and click on Enable Service. This will start MySQL.

But this task is not yet complete. We must create the initial database for MySQL. From here, change directories into your database directory (under /path/to/mythtv-0.16) and enter this command in the command prompt -

$ mysql -u root < mc.sql

Assuming no errors come back from this command, all is well, and we can move on to installing the rest of the modules for MythTV.

Step 9 - Setup MythTV

The final steps include setup and starting MythTV, as well as the add-ons for Myth. All of the modules and their setup fall under Step 7, but I will add a modifier to the step to note what module is being installed. For example, the first module to be detailed, MythWeather, will be under 7.1 - MythWeather

We must setup MythTV first, though. Assuming you are in the mythtv-0.16 directory, change directories to setup and enter -

$ ./setup

The console should show a few things, and then we should be shown a screen that includes five different options. From here, we start with the first option, and move across. Most of it is self-explanatory. Setup the tuner card, and set other options. Most of the IP setup should be left alone. The Channel Editor shouldn´t show any channels - this is fine. When you execute mythfilldatabase> later, this will fill up.

One thing to note is that (if you are in the United States/Canada) you will need a DataDirect account to grab listings for your cable provider. Go to the Zap2it labs, and sign up for an account. They will prompt for a password/registration code. Use ZIYN-DQZO-SBUT for this code. The service is free, although they will ask for re-registration about once every three months. Notices are sent via email when the time comes around.

Once setup is complete, execute -

$ mythfilldatabase

This will fill the MySQL database with all of the channel information and tv listings. Once this runs, we can run -

$ mythbackend && mythfrontend

As a personal preference, I run both of these in two different console windows. It´s easier to figure out what went wrong and where it went wrong when I have two windows open. If the frontend crashes, I still know what the backend is doing, and so on.

Everything should load up, and you should see a Watch TV icon and a Setup icon. You can edit options to your heart´s content (including the skin used for MythTV, as well as other options related to recording, etc.) or watch tv.

Step 10 - Installing Myth Modules

The power of MythTV lies not only in the ability to watch and record tv, but that there are modules that make your MythBox do almost anything. For this part of the install, I will add a modifier to the step to note what module is being installed. For example, the first module to be detailed, MythNews,will be under 10.1 - MythNews

The MythTV modules can be found here under the Add-on Modules link.

10.1 - MythNews

MythNews is an RSS reader that shows headlines/news stories from various RSS feeds. No prerequesites to install. Download the file, unpack it, and

$ qmake mythnews.pro
$ make
$ su
# make install

Once MythNews is installed, go into Setup in the frontend, and select which RSS feeds you´d like to subscribe to. A new icon, News will show up when you start the frontend.

10.2 - MythWeather

MythWeather is a weather module that pulls weather information (including 3 day forecasts and Doppler radar maps) from MSN. No prerequesites required. Unpack and -

$ qmake mythweather.pro
$ make
$ su
# make install

After the installation, you can control how often the module updates weather information and your location from setup. A Weather icon should appear in the frontend.

10.3 - MythVideo

MythVideo is a video player module that can pull down information about your movies from the Internet Movie Database (IMDB). Parental controls are also a part of this module. Nothing is needed to install MythVideo. Unpack, change directories to the unpacked mythvideo, and -

$ qmake mythvideo.pro
$ make
$ su
# make install

10.4 - MythMusic

MythMusic is a full-fledged music player/ripper for MythTV. From MythMusic, you can play mp3/ogg/cd/flac, as well as rip CDs into these formats. There are quite a few prerequesites that are required for MythMusic. Before you install MythMusic, make sure that these requirements are fufilled. This is easy to do with the Yast package manager.

mad
mad-devel
libid3tag
libid3tag-devel
libvorbis-devel
FLAC
CDParanoia

The only requirement not found with Yast is libcdaudio, which can be downloaded from from SourceForge. Once all of these are installed, download the MythMusic package and untar the package. From the /path/to/MythMusic -

$ ./configure $ qmake mythmusic.pro
$ make
$ su
# make install

This completes the install of MythMusic. From here, you can setup the module to the path of your music files and where to store your ripped files in the Music icon under Setup. A new icon for Music will be displayed in the frontend.

10.5 - MythDVD

MythDVD is a DVD ripper/player for MythTV. MythDVD is similar to MythMusic in that there are plenty of prequesites. Further complicating the problem is the conflicts in documentation. The documentation that is noted on MythTVs website (offical, written by Robert Kugalowski) and the documentation that comes with MythDVD (official, author unknown) both conflict as to what prerequesites are required. Upon my first dealings with MythDVD, I realized that there were not only less prerequesites to fufill using the MythDVD documentation, but they were easier to find. To fill the requirements for MythDVD you will need to install (per each requirement´s documentation) -

libdvdread (Download Here)
nasm (Download Here)
mjpegtools (Download Here)
xvid (Download Here)
liba52 (Download Here)
libfame (Download Here)
transcode (Download Here)
libdvdcss (Download Here)

Once all of the prerequesites have been installed, the rest of the install is straightforward. There are a few options for compiling MythDVD. When executing the configure command, we can add these command line options:

--enable-transcode (enables transcoding for ripping)
--disable-transcode (disables transcoding)
--enable-vcd (enables vcd playback)

All of these options can be used on one command. So, if you wanted to enable vcd and transcoding, youd run -

$ ./configure --enable-transcode --enable-vcd

Once your options are set, run the configure and then execute -

$ ./configure $ qmake mythdvd.pro
$ make
$ su
# make install

Depending on personal preference, you can use three different players for DVDs. You can use Ogle, or Xine, which is needed for XVCD playback. You can also use MPlayer, which was installed earlier. Command line options for these programs as well as MythDVD can be found under Setup. If you plan on ripping DVDs, you will need to make sure that the Transcoding daemon is started. In a command shell, you can run mtd when you wish to rip, or add a line in your startup files that will start it up everytime you reboot.

10.6 - MythGallery

MythGallery is a picture slideshow/viewing module for MythTV. There are prequesites, but we can fill these with Yast with relative ease. Go into the Install and Remove Software icon under Yast, and search for the following packages.

libtiff
libtiff-devel

Once these are installed, we unpack the file, change directories, and install.

$ ./configure --enable-opengl
$ qmake mythgallery.pro
$ make
$ su
# make install

I should note that if you have trouble with the --enable-opengl line, you can do away with it. I had trouble with it, and I (thus far) have noticed little problems with the lack of OpenGL support. The Setup icon in MythTV will show the path to your pictures as well as show a few options to edit. Look for the Gallery icon in the frontend after all is done.

10.7 - MythGame

MythGame is a module for the frontend that allows you to catalog video game roms and run them from the frontend. The prequesites for MythGame are as follows-

stella (Atari emulator)
xmame (MAME emulator)
FCE Ultra (NES emulator)
snes9x (Super Nintendo emulator)

From what I can tell, there is support for the Odyssey2 emulator (which I couldn´t find) and for PC games. As far as PC games go however, I think it best to leave them out, as mainstream linux games (with the exceptions of Doom3 and Half-Life 2, as well as others) are still lacking.

Install the emulators and give MythGame an installation. Untar the package, and install like this -

$ qmake mythgallery.pro
$ make
$ su
# make install

From here, run the Game Settings under Setup, and set directories and command line settings for the various emulators. Once this is done, all should be complete, and you should be able to start playing old arcade games on your MythBox.

10.8 - MythBrowser

MythBrowser is a small web browser that uses tabs and bookmarks that can be used within MythTV. Simple to use and easy to install. Be sure that the KDE development tools are installed (easy to do in Yast). Unpack the package, and run -

$ qmake mythbrowser.pro
$ make
$ su
# make install

The documentation for MythBrowser lays out all of the keyboard shortcuts and more information on configuration. Setup is done in under the Browser Settings icon in Setup.

Updates for Myth-0.17

There's nothing really to update for Myth-0.17. If you're using RPMS, this should be easy enough to do. If you followed the guide, there's plenty to download and recompile. Among fixes for myth-0.17 include greater integration of MythPhone and a few other bugfixes and new features. I think the interface looks a lot better than before, although it is somewhat different from the original menu setup. Beware of the menu changes, but the upgrade is not that much unlike that of installing MythTV from scratch again.

Conclusion

MythTV is a slick program, and the modules only enhance the experience. While it did take quite some time to install, you will have a fast box that can do anything to entertain. Furthermore, the system is incredibly reliable, and if you leave it on, you can expect runtimes that last for years, with little to no mantainence to be done aside from updates. I hope this document helped you in your quest for a MythBox.


Valid HTML 4.0!


eXTReMe Tracker