Ubuntu Hoary Installation

From MythTV

Jump to: navigation, search

This section describes, in detail, the procedures involved with building a machine for use with MythTV on the Ubuntu Hoary (5.04) distribution.

See Ubuntu Installation Guides for installing on other Ubuntu versions.

Contents

TODO List

  • Rewrite the page so it doesn't require compiling nearly as much from source. I'm sure you'll find packaged versions of everything if you look hard enough. For starters, Matt Zimmerman of Canonical has Debian Unstable/Ubuntu packages of MythTV at http://dijkstra.csh.rit.edu/~mdz/debian/dists/unstable/mythtv/, which seem newer than the multiverse ones. (Note as of 23rd May 2006 these appear to no longer being maintained.)
  • Use kernel headers instead of kernel source - for IVTV example, see http://www.willmer.com/kb/2005/02/installing-ivtv-driver-for-pvr-350-card/.
  • Fix the hardware requirements list - I picked hardware pretty much at random. Someone made a great suggestion about having several different configurations, depending on need. (newbie, starter, advanced) etc.
  • I don't like the sections with a lot of "Type .." stuff. Other documents usually put keyboard input into a box or something. (I've made some changes - looks like a list/code bug in this version of Moin. Lets not worry until we convert to MW -- David Greaves)
  • 2006-4-21: This document should probably start being updated to reflect Dapper Drake, and how to compile MythTV 0.19, since Dapper Drake will only have MythTV 0.18.1 in the repositories.

Introduction

This section describes, in detail, the procedures involved with building a machine for use with MythTV on the Ubuntu Hoary (5.04) distribution.

Requirements

This section describes the hardware and software requirements for building a base machine.

Minimum Hardware Requirements

  • Ubuntu is very flexible in terms of hardware requirements!

For PCs: The following hardware items can be purchased or found around the house and assembled into a single unit. Remember that these are minimum hardware requirements - faster CPU, more memory, and more disk space the better. At the moment, this is simply a suggested configuration.

  • Intel Pentium 4 1.8 GHz or AMD 1200+
  • 256 MB RAM
  • PCI or onboard sound card
  • Onboard video or standard video card (This includes AGP and PCI-E 16x cards with ATI or nVidia chipsets)
  • Ethernet capability or compatible dial-up modem

Please note that Ubuntu WILL run fairly smoothly on hardware inferior but close to this configuration. With certain alternative Ubuntu-compatible software it could smoothly run on a system with specifications such as this:

  • Intel 333MHz CPU or AMD equivilant
  • 64 MB RAM
  • Onboard video or standard video card
  • Ethernet capability or compatible dial-up modem
  • Alternative to the above: Many burnable CD-ROMs and an extra computer that is already running Ubuntu or one that has access to its repositories.

On hardware inferior to this, Ubuntu will likely run slowly, lagging in places, especially when using the GNOME window management software. It can theoretically run on anything with a 32bit CPU, theoretically, but many things would require a great deal of tweaking.

Software Requirements

This section describes the core software that is to be installed and configured. Full procedures for obtaining, installing, and configuring the various pieces of software, will be covered in the upcoming sections.

Installing and Configuring the Operating System

This section describes the procedures involved in configuring and installing the operating system.

Obtaining Ubuntu

  1. Open a web browser and navigate to http://www.ubuntulinux.org
  2. Download the newest ISO file from one of the available sites, and burn it to CD. This document reflects Ubuntu 5.0.4 "Hoary Hedgehog".

Installing Ubuntu

Now that you have a Ubuntu installation CD, you are now ready to begin with the operating system installation.

  1. Boot the computer using the Ubuntu CD. You may need to set your computer to boot from CD-ROM if this is not already the case.
  2. Press ENTER when the Ubuntu splash screen appears
  3. Select your language (Probably English) and press ENTER.
  4. Select your location (Probably Canada or United States) and press ENTER
  5. Select your keymap (Probably American English) and press ENTER
  6. Wait while the installer detects some of your hardware and configures network settings.
  7. Enter a hostname for your computer. This is essentially a name for your computer on the network. You may want to pick something like 'mythbox'. This isn't too important.
  8. Select "Erase entire disk..." for "Partitioning Method", or set aside an XFS partition to store captured video for its ability to delete large files quickly.
  9. "Write these changes to disk?"... select "Yes'
  10. Wait while the Ubuntu base system is installed.
  11. "First stage of installation complete"... remove the Ubuntu CD from the CDROM and select "Continue"
  12. Your computer will now reboot and enter the basic Ubuntu configuration.
  13. "Welcome to your new Ubuntu system!".. select "OK"
  14. Select your timezone and press ENTER
  15. Enter your full name (Firstname Lastname) and press ENTER
  16. Select a username - Ubuntu gives you a suggestion. You can keep the suggestion or pick your own name.
  17. Enter a password for this new account. You will be required to verifiy your password.
  18. "Download software from the Internet?".. select "Yes'
  19. Wait while your the Ubuntu installer downloads some packages from the Internet.. At times, your system may appear to pause or be frozen. Be patient.
  20. If your computer pauses at "99% [Waiting for headers]" for quite some time, press CTRL-C.
  21. "Select the video modes...." ... make sure that the only resolution selected is 800x600 (Use the spacebar to toggle selection). This is a safe resolution to go with.
  22. "Thank you for choosing Ubuntu!" ... Press ENTER
  23. The Ubuntu installation is now complete.

Upgrading

  1. Open a terminal window
  2. Type "sudo pico /etc/apt/sources.list"
  3. Make the following change:
    From: # deb http://archive.ubuntu.com/ubuntu hoary universe
    To: deb http://archive.ubuntu.com/ubuntu hoary universe
  4. Add the line "deb http://archive.ubuntu.com/ubuntu hoary multiverse" to the end of the file
  5. Save and close the files.
  6. Type "sudo apt-get update"
  7. Type "sudo apt-get upgrade" to see if there are any updates available. I always get an error on kdelibs-data being in conflict withknetworkconf. The solution is to
$ sudo apt-get remove knetworkconf
$ sudo apt-get upgrade
$ sudo apt-get knetworkconf

Worked for me.

Installing Video Capture Card

PVR-250

1. Login to your Ubuntu system using the user account created in Section 3.2

2. Open a terminal window

3. install the necessary packages:
 sudo apt-get install gcc g++ linux-headers-2.6.10-5-386
 wget http://205.209.168.201/~ckennedy/ivtv/ivtv-0.2.0-rc/ivtv-0.2.0-rc3a.tgz
 tar -xzf ivtv-0.2.0-rc3a.tgz
 cd ivtv-0.2.0-rc3a/utils
 wget http://hauppauge.lightpath.net/software/pvr250/pvr250_18a_inf.zip
 sudo ./ivtvfwextract.pl pvr250_18a_inf.zip
 cd ../driver
 sudo rm /lib/modules/2.6.10-5-386/kernel/drivers/media/video/msp3400.ko
 sudo make
 sudo make install
 cd ../utils
 sudo make
 sudo make install
 sudo mknod /dev/video0 c 81 0
 
4. Add the following lines to the file /etc/modutils/ivtv, and then save and close.
       sudo pico /etc/modutils/ivtv
       alias char-major-81 videodev
       alias char-major-81-0 ivtv
5. The modules are placed in the wrong directory, you'll need to move them to the correct directory and make the system aware of them.
sudo mv /lib/modules/`uname -r | sed 's/-.*//'`/ivtv /lib/modules/`uname -r`/
sudo update-modules
sudo depmod -a
sudo modprobe ivtv

6. Add ivtv to /etc/modules, so it'll be loaded at startup

  echo ivtv |sudo tee -a /etc/modules

(The next few instructions seem like a very round-about way to do what we just did in 6 and can probably be skipped... but just in case somebody knows something that I don't...) {

6'. Add the following line to the file, and then save and close.
         sudo pico /etc/init.d/ivtv
         modprobe ivtv
7'. Type
sudo chmod +x /etc/init.d/ivtv
sudo update-rc.d ivtv defaults 50

}

LIRC

Installing from source

While it may be possible to install lirc using the ubuntu packages, installing from source allows you to use the lirc-0.7.1, which includes support for the PVR-150 (as well as the PVR-250/350 and many others). These directions were taken from a posting in ubuntuforums.org by Comp Engr (http://ubuntuforums.org/showthread.php?p=152456#post152456).

1. Download the kernel source:

$ uname -r
2.6.10-5-386
(Use your own kernel version here)
$ sudo apt-get install linux-source-2.6.10

This places linux-source-2.6.10.tar.bz2 in /usr/src.

2. Download the gcc compiler (if you installed ivtv in step 4 then you already did this):
$sudo apt-get install build-essential
3. Change to the directory /usr/src:
$ cd /usr/src
4. Uncompress the kernel source:
$ sudo tar xvjf linux-source-2.6.10.tar.bz2
5. Make a link called linux from the new source directory:
$ sudo ln -s /usr/src/linux-source-2.6.10 /usr/src/linux
6. We need the source directory to contain certain files (`version.h`, configuration files) for lirc to compile so:
$ cd linux
$ sudo make oldconfig --This should make the config file
$ sudo make include/linux/version.h --This creates the version.h file
$ sudo make modules -- WARNING: This may take a very long time to complete.
Now we need the lirc package. 7. Download lirc:
$ cd /usr/src
$ sudo wget http://lirc.sourceforge.net/softwar...7.1.tar.bz2
8. Uncompress lirc
$ sudo tar xvjf lirc-0.7.1.tar.bz2
Now you should have a directory called lirc-0.7.1 in /usr/src. 9. Creates a file that allows lirc to understand that you do indeed have a working source directory.
$ sudo touch /usr/src/linux/Rules.make
10. Now go to the lirc directory:
$ cd /usr/src/lirc-0.7.1
11. Install dialog and run the setup:
$ sudo apt-get install dialog
$ ./setup.sh
 i. Choose your remote receiver. If you have a PVR-150/250/350 you should choose Haupauge TV card.
 ii. Select Option 3 "Save configuration & run configure"
If you have problems here, it can be caused by the kernel source directory. (Solutions vary.) iii. Take note of the module it mentions it is going to compile and install. It usually looks like "lirc_serial" or "lirc_i2c", you get the idea. You'll need this info for later when try to load the module.
12. Make lirc:
$ sudo make
13. If it made without errors:
$sudo make install
This installs in the modules into `/lib/modules/2.6.10-3-386/misc/`. 14. You need to add lirc to modutil. If you did did the PVR-250 step above, you can just use the ivtv file, other make a new file.
$ sudo pico /etc/modutil/ivtv
Add the following, above ivtv lirc_dev lirc_i2c, to the file and save it

alias char-major-61 lirc_i2c

You should change lirc_i2c to whatever you're using, of course. 15. Update the modules file, dependency file, and try to modprobe them in...
$ sudo update-modules
$ sudo depmod -ae
$ sudo modprobe lirc_i2c (Substitute the module you made above here instead of lirc_i2c)
With any luck, it worked! 16. Change the permissions on `/dev/lircd` to enable non-root users to use LIRC.
$ sudo chmod 666 /dev/lircd
17. I checked the make install text and noticed that it installed an appropriate remote control file for me (`/etc/lircd.conf`) with Hauppauge codes in it. (Now that's service!!!!) So next, start the daemon and the lirc test program:
$sudo lircd
$irw
You should now be looking at a blank line... Point your remote at your sensor and push a button... (Praying at this point is not unheard of) If everything worked right, you should see something like this:

00000000000017e1 00 Ch- hauppauge_pvr 00000000000017e1 01 Ch- hauppauge_pvr

If it does, then congratulations, the hard part is done! If not, then you'll probably need to review the LIRC website to figure out what went wrong. Is your remote and receiver supported? 18. Assuming lirc installed the appropriate lircd.conf file for you in /etc, you'll just need to add a lircrc file in `~/.mythtv`. If you have a PVR-250/350 with the older black or grey remote you can use this lircrc file from Jarod Wilson: http://wilsonet.com/mythtv/lircrc-haupgrey.txt
$ wget http://wilsonet.com/mythtv/lircrc-haupgrey.txt
$ mkdir ~/.mythtv
$ mv lircrc-haupgrey.txt ~/.mythtv/lircrc
If you have a PVR-150/250/350 with the newer grey remote (with the colored buttons at the bottom), you can use this lircrc from Brad Templeton and Jarod Wilson: http://wilsonet.com/mythtv/lircrc-haupgrey-g3.txt

$ wget http://wilsonet.com/mythtv/lircrc-haupgrey-g3.txt $ mkdir ~/.mythtv $ mv lircrc-haupgrey-g3.txt ~/.mythtv/lircrc

19. To get lirc_i2c to load at boot if you have a PVR-150/250/350, I suggest changing /etc/init.d/ivtv to 'modprobe lirc_i2c' instead of 'modprobe ivtv'. lirc_i2c relies on ivtv and will insert ivtv before inserting itself.

20. On reboot, my machine replaced /dev/lirc with /dev/lirc0. We need to start lircd at boot and also tell it to use /dev/lirc0. I used the following script in /etc/init.d/lircd. It's not pretty and I obviously mangled it from another script, but it does work for me. It would probably be nice if someone more knowledgable could replace this with a better script.
First we need to create the file
$sudo pico /etc/init.d/lircd
Then put the following script in the file and save:
#!/bin/sh

case "$1" in 'start') /usr/local/sbin/lircd --device=/dev/lirc0 RETVAL=$? ;; 'stop') killall lircd RETVAL=$? ;; esac exit $RETVAL

21. Type
sudo chmod +x /etc/init.d/lircd
sudo update-rc.d lircd defaults 99
lirc should now start properly at boot.

MythTV

Installation from Packages

Install MythTV Base

  1. Open a terminal window
  2. Type "sudo apt-get install lame mythtv"
  3. "Remove all databases...", select "No"
  4. "What is the password...", press ENTER
  5. Press ENTER again to complete the MythTV installation
  6. Type "sudo passwd mythtv"
  7. Enter "mythtv" as the new password. You will be required to verify this password.
  8. Type "sudo chgrp mythtv /dev/video*"
  9. Type "sudo chmod g+rw /dev/video*"

Configuration

  1. Logoff from the user account by clicking on "Computer", then "Logout", and then clicking on "OK"
  2. Login as the mythtv user
  3. Open a terminal window.
  4. Type "/usr/bin/mythtv-setup"
  5. "Would you like to clear all capture card settings...".. press ENTER
  6. "Would you like to clear all program ... " .. press ENTER
Capture Cards
  1. Select "Capture cards" from the setup menu
  2. Select "(New Capture card)" and press ENTER
  3. Select "MPEG-2 Encoder (PVR-250,PVR-350)" under "Card type:"
  4. Select "Finish" and press ENTER
  5. Press ESC to exit the "Capture cards" menu


Video Sources
Cable
  1. Select "Video sources" from the setup menu
  2. Select "(New video source)" and press ENTER
  3. Type "Cable" in the "Video source name:" field
  4. Enter your Zap2it username and password
  5. Select "Retrieve lineups" and press ENTER
  6. Select "Finish" and press ENTER
  7. Press ESC to exit the "Video sources" menu
Input Connections (Needs verifying)
  1. Select "Input connections" from the setup menu
  2. Select the "Tuner" option
  3. Make an association between the Tuner input connection and the Cable video source
  4. Select "Finish" and press ENTER
  5. Press ESC to exit the "Input connections" menu

Installation from Source

This is to assist a source installation. The official documentation at mythtv.org provides more information and should be reviewed as well for additional options. Installing from CVS is identical, except for the source of the source. See the official mythtv.org documentation on getting the CVS source.

Install Mythtv Base

1. Edit the apt source list:
$ sudo pico /etc/apt/source.list
Add the follow to the end of the list:(Note as of 23rd May 2006 these appear to no longer being maintained.)

deb-src http://dijkstra.csh.rit.edu/~mdz/debian hoary mythtv

Save the file. 2. Install the mythtv dependencies via apt-get:
$ sudo apt-get update
$ sudo apt-get build-dep mythtv
3. Add /usr/local/lib to ld.so.conf
$ sudo -s
# echo /usr/local/lib >> /etc/ld.so.conf
# /sbin/ldconfig
# exit
4. Download the mythtv source from www.mythtv.org, untar and compile. You can adjust the ./configure options to suit your install. Use `./configure --help` for option.
$ tar xjf mythtv-0.18.tar.bz2
$ cd mythtv-0.18
$ ./configure
$ qmake mythtv.pro
$ make
$ sudo make install
5. In order to connect to the database we need to add the MySQL driver for Qt:
$ sudo apt-get install libqt3c102-mt-mysql

Base installation complete!

MythTV Plugin Install from Source

This section will provide the dependencies required to install each plugin from source. Please see the official mythtv.org documentation on compiling each plugin.

MythGallery
1. Opengl should already be installed if you would like to use the opengl transitions (assuming your videocard supports it). Another TIFF library will have be added, however
$ sudo apt-get install libtiff4-dev

2. If anyone knows what packages need to be added to support EXIF, please update the docs.

3. To enable EXIF support, install the following.
$ sudo apt-get install libexif12 libexif-dev
MythVideo
1. You need to install mplayer
$ sudo apt-get install mplayer-nogui

Optionally, you can also use xine of course and make the appropriate changes in the video settings.

2. In order to pull data from imdb you need to add the following packages

$ sudo apt-get install libxml-simple-perl libwww-perl
MythWeather

No additional packages are required to support MythWeather.

MythMusic
1. Install the following packages:
    $ sudo apt-get install libmad0-dev libid3tag0 libid3tag0-dev libflac++-dev libflac-dev libcdaudio0 libcdaudio0-dev libcdparanoia0-dev

2. The following packages are optional.

  • For FFTW, install:
   $ sudo apt-get install fftw2 fftw-dev
  • For SDL, install:
   $ sudo apt-get install libsdl1.2debian-all libsdl1.2-dev

Everything needed for OpenGL should already be installed. If anyone knows what packages are required to support `--enable-aac`, please update the docs.

3. For --enable-aac, install the following.
$ sudo apt-get install libfaad2-0 libfaad2-dev
MythDVD
1. You'll have to edit `/etc/apt/sources.list` and add the following repository:
deb ftp://ftp.nerim.net/debian-marillat testing main
2. Then update
$ sudo apt-get update
3. To enable transcode and VCD, you'll need all of the following packages installed
$ sudo apt-get install libdvdread3-dev liba52-0.7.4 liba52-0.7.4-dev libxvidcore4-dev libfame-0.9 libfame-dev
$ sudo apt-get install transcode libdvdcss libdvdcss-dev

Starting MythTV Frontend

  1. Login as the mythtv user
  2. Open a terminal window
  3. Type $ /usr/bin/mythfrontend

Common Options

Installing Nvidia Binary Drivers

Taken from http://ubuntulinux.org/wiki/Binary Driver Howto

$ sudo apt-get install nvidia-glx
$ sudo apt-get install nvidia-glx-dev
$ sudo nvidia-glx-config enable

Note (optional): the nvidia-settings package provides a control panel to configure graphics card options such as gamma correction.

Personal tools