Installing MythTV on Debian Etch
This is a Tutorial to install MythTV on a Debian GNU/Linux 4.0 ('etch') machine.
Contents
Debian GNU/Linux 4.0 ('Etch') Base System Installation
Download the netinst disk for your favorite platform from http://www.debian.org/CD/netinst/ or one of the mirrors.
- Boot the target PC from the Debian CD
- At the Debian Boot Screen, hit enter
- Choose your preferred language, Country or Region, and Keyboard Layout
- Choose a servername and domain
- Accept automatic partition changes
- Install GRUB to the MBR
- Reboot
- Debian starts its post install configuration routine
- Choose your Time Zone
- IMPORTANT: do not use the username "mythtv". The user "mythtv" is reserved for use by mythtv
- Enter your new root password and the information for your new user account
- Add ftp.debian.org
- Make sure that only Base or Standard System is checked
- The Debian Netinst installer should now leave you with a login screen
MythTV Installation and Configuration
MySQL
become root
su -
now at first we need the mysql server:
apt-get install mysql-server
now set the mysql root user password
mysqladmin -u root password yourpasswordhere
Sound
For sound, I ran
apt-get install alsa-base alsa-utils
After the installation completes, configure everything with the following command
alsaconf
IvTV driver packages
If you need ivtv for your TV Tuner, then run (NOTE: The following command is one line long. The `uname -r` part is placing your specific linux kernel version, so you may run into trouble if you have compiled your own kernel, in which case you should run 'apt-cache search ivtv' and find the correct modules for your system. You will also need to keep an eye on the 'linux-source-2.6.18' package, and be sure that you are getting the correct version.)
apt-get install ivtv-utils ivtv-modules-`uname -r` linux-source-2.6.18 linux-headers-`uname -r` module-assistant
Note: If ivtv-utils is not found in apt, you may need to add the contrib packages to your sources.list file (and then apt-get update)
deb http://ftp.debian.org/debian etch contrib deb-src http://ftp.debian.org/debian etch contrib
If you are using a Hauppauge PVR-150 TV Tuner, then get latest pvr-150 firmware from http://dl.ivtvdriver.org/ivtv/firmware/ and put the *.fw files (except the usb-related files, indicated by their filenames) in /lib/firmware, then run
modprobe ivtv
Please note: Debian GNU/Linux 4.0 comes with IVTV version 0.8.2. If for some odd reason you need newer IVTV drivers, then the two options are:
1) Grab the latest greatest out-of-the-box packages from 'sid'.
2) Build the IVTV drivers from source as described on the IVTV wiki page
Both are not explained in detail over here.
Linux Infra Red Remote Control lirc
Please see LIRC_on_Debian_Etch.
Graphical User Interface (GUI): X.org
In order to run X, I ran (The last entry, fluxbox, is the window manager. It is up to you to decide which window manager you want to run.)
apt-get install xfonts-base xbase-clients xserver-xorg xfonts-75dpi fluxbox
After installing X, you will need to modify your /etc/X11/xorg.conf file.
Getting MythTV
Out-of-the-box packages
Add the MythTV sources to /etc/apt/sources.list accordingly (please use a nearby mirror):
Architecture : alpha | amd64 | hppa | i386 | ia64 | powerpc | sparc
Australia
deb http://deb.samad.com.au/multimedia/ stable main deb-src http://deb.samad.com.au/multimedia/ stable main
Belarus
deb http://ftp.mgts.by/debian-multimedia/ stable main deb-src http://ftp.mgts.by/debian-multimedia/ stable main
deb ftp://ftp.mgts.by/debian-multimedia/ stable main deb-src ftp://ftp.mgts.by/debian-multimedia/ stable main
Belgium
deb ftp://mirrors.powersource.cx/pub/debian-multimedia/ stable main deb-src ftp://mirrors.powersource.cx/pub/debian-multimedia/ stable main
Brasil
deb http://www.las.ic.unicamp.br/pub/debian-multimedia stable main deb-src http://www.las.ic.unicamp.br/pub/debian-multimedia stable main
deb http://linorg.usp.br/debian-marillat/ stable main deb-src http://linorg.usp.br/debian-marillat/ stable main
deb ftp://linorg.usp.br/debian-marillat/ stable main deb-src ftp://linorg.usp.br/debian-marillat/ stable main
Canada
deb http://debian.dc-uoit.net/debian-multimedia/ stable main
deb http://gulus.usherbrooke.ca/pub/distro/debian/debian-multimedia/ stable main deb-src http://gulus.usherbrooke.ca/pub/distro/debian/debian-multimedia/ stable main
deb ftp://gulus.usherbrooke.ca/debian-multimedia/ stable main deb-src ftp://gulus.usherbrooke.ca/debian-multimedia/ stable main
Denmark
deb http://debian.three-dimensional.net/debian-multimedia stable main deb-src http://debian.three-dimensional.net/debian-multimedia stable main
El salvador
deb http://debian.ues.edu.sv/debian-multimedia/ stable main deb-src http://debian.ues.edu.sv/debian-multimedia/ stable main
France
deb http://mirror.home-dn.net/debian-multimedia stable main deb-src http://mirror.home-dn.net/debian-multimedia stable main
deb http://debian-multimedia.gnali.org stable main deb-src http://debian-multimedia.gnali.org stable main
deb http://debian-multimedia.yolker.be stable main deb-src http://debian-multimedia.yolker.be stable main
Germany
deb http://debian-multimedia.dfoell.org/ stable main deb-src http://debian-multimedia.dfoell.org/ stable main
deb http://debian-multimedia.informatik.uni-erlangen.de/ stable main
deb http://mirrors.ecology.uni-kiel.de/debian/debian-multimedia stable main deb-src http://mirrors.ecology.uni-kiel.de/debian/debian-multimedia stable main
deb http://debian-mirrors.sdinet.de/debian-multimedia stable main
deb http://debian.netcologne.de/debian-multimedia.org stable main deb-src http://debian.netcologne.de/debian-multimedia.org stable main
deb ftp://debian.netcologne.de/debian-multimedia.org stable main deb-src ftp://debian.netcologne.de/debian-multimedia.org stable main
deb http://honk.physik.uni-konstanz.de/mirror/www.debian-multimedia.org stable main deb-src http://honk.physik.uni-konstanz.de/mirror/www.debian-multimedia.org stable main
deb http://debian.ids-services.de/debian-multimedia/ stable main deb-src http://debian.ids-services.de/debian-multimedia/ stable main
deb http://ftp.uni-kl.de/debian-multimedia/ stable main deb-src http://ftp.uni-kl.de/debian-multimedia/ stable main
deb ftp://ftp.uni-kl.de/debian-multimedia/ stable main deb-src ftp://ftp.uni-kl.de/debian-multimedia/ stable main
Great Britain
deb http://debian-multimedia.fx-services.com/ stable main deb-src http://debian-multimedia.fx-services.com/ stable main
Greece
deb ftp://ftp.hol.gr/pub/mirror/debian-multimedia.org stable main deb-src ftp://ftp.hol.gr/pub/mirror/debian-multimedia.org stable main
deb http://ftp.hol.gr/pub/mirror/debian-multimedia.org stable main deb-src http://ftp.hol.gr/pub/mirror/debian-multimedia.org stable main
deb http://ftp.duth.gr/debian-multimedia/ stable main deb-src http://ftp.duth.gr/debian-multimedia/ stable main
deb ftp://ftp.duth.gr/debian-multimedia/ stable main deb-src ftp://ftp.duth.gr/debian-multimedia/ stable main
Ireland
deb http://floating3.ucd.ie/debian stable main deb-src http://floating3.ucd.ie/debian stable main
deb http://ftp.heanet.ie/mirrors/debian-multimedia/ stable main deb-src http://ftp.heanet.ie/mirrors/debian-multimedia/ stable main
Italia
deb http://mi.mirror.garr.it/mirrors/debian-multimedia stable main deb-src http://mi.mirror.garr.it/mirrors/debian-multimedia stable main
deb ftp://mi.mirror.garr.it/mirrors/debian-multimedia stable main deb-src ftp://mi.mirror.garr.it/mirrors/debian-multimedia stable main
Portugal
deb http://ftp.eq.uc.pt/software/unix/Linux/debian-multimedia/ stable main deb-src http://ftp.eq.uc.pt/software/unix/Linux/debian-multimedia/ stable main
deb ftp://ftp.eq.uc.pt/software/unix/Linux/debian-multimedia/ stable main deb-src ftp://ftp.eq.uc.pt/software/unix/Linux/debian-multimedia/ stable main
deb http://neacm.fe.up.pt/debian-multimedia/ stable main deb-src http://neacm.fe.up.pt/debian-multimedia/ stable main
deb ftp://neacm.fe.up.pt/debian-multimedia/ stable main deb-src ftp://neacm.fe.up.pt/debian-multimedia/ stable main
Russia
deb http://debian.nsu.ru/debian-marillat/ stable main
Slovakia
deb http://ftp.tuke.sk/debian-multimedia/ stable main deb-src http://ftp.tuke.sk/debian-multimedia/ stable main
deb ftp://ftp.tuke.sk/debian-multimedia/ stable main deb-src ftp://ftp.tuke.sk/debian-multimedia/ stable main
Sweden
deb http://ftp.sunet.se/pub/os/Linux/distributions/debian-multimedia stable main deb-src http://ftp.sunet.se/pub/os/Linux/distributions/debian-multimedia stable main
deb ftp://ftp.sunet.se/pub/os/Linux/distributions/debian-multimedia stable main deb-src ftp://ftp.sunet.se/pub/os/Linux/distributions/debian-multimedia stable main
deb http://ftp.acc.umu.se/mirror/debian-multimedia stable main deb-src http://ftp.acc.umu.se/mirror/debian-multimedia stable main
Taiwan
deb http://ftp.tw.debian.org/debian-multimedia/ stable main deb-src http://ftp.tw.debian.org/debian-multimedia/ stable main
Architecture : i386 only France
deb http://www.dedale.eu.org/mirror/debian-multimedia/ stable main deb-src http://www.dedale.eu.org/mirror/debian-multimedia/ stable main
Switzerland
deb http://debian.mxchange.org/debian stable main
Ukraine
deb ftp://ftp.linux.kiev.ua/pub/mirrors/www.debian-multimedia.org/ stable main deb-src ftp://ftp.linux.kiev.ua/pub/mirrors/www.debian-multimedia.org/ stable main
Main Repository
deb http://www.debian-multimedia.org etch main deb-src http://www.debian-multimedia.org etch main
Before we can use apt, we must import the gpg keys for the site by installing the debian-multimedia-keyring package. The "apt-get update" command will give a warning about missing GPG key. Type 'yes' if prompted to install "untrusted" package for the "apt-get install" command:
apt-get update apt-get install debian-multimedia-keyring
Now we can get the rest of the needed package to build myth via:
apt-get build-dep mythtv
Now you can get mythtv:
apt-get install mythtv
and if you want extras you can search for them with
apt-cache search mythtv
Building from source
If you really insist building yourself:
add your user to the staff group so you get write permission to usr/local now after logging in as a user (DON'T USE ROOT) do this:
svn co http://cvs.mythtv.org/svn/trunk/mythtv
This creates a folder called mythtv where the actual sources are in.
cd mythtv
and compile it with something like:
./configure --prefix=/usr/local --arch=athlon-xp --enable-dvb --enable-dvb-eit make make install
The configure line above is only an example. In this example, the installation is configured to be under /usr/local. If you want to put it somewhere else, you can alter the --prefix argument. Run ./configure --help to see what options are available and necessary for you.
You will probably want to be root to run the "make install" part, though, because that target invokes ldconfig to set up shared library paths, and usually nobody but root can do this.
Starting MythTV
Set the mythtv user's password:
passwd mythtv
Log in as the mythtv user, then start an X session:
startx
Open up XTerm and run the MythTV Setup program:
mythtv-setup
After configuring MythTV, you can start the MythTV Backend:
sudo /etc/init.d/mythtv-backend start
You will then need to pull your channel information:
mythfilldatabase
Additional (and Optional) MythTV System Configuration
Auto Login
If you would like the mythtv user to automatically log in, but don't want to use gdm, then follow these simple instructions. First you will need to install rungetty which will allow you to enable the automatic login of the mythtv user.
apt-get install rungetty
Then, you will set the first screen to automatically log the mythtv user in, instead of displaying a login prompt and waiting for user input. To do this you will edit the /etc/inittab file to change the line:
1:2345:respawn:/sbin/getty 38400 tty1
to read
1:2345:respawn:/sbin/rungetty tty1 --autologin mythtv
You will then need to set up the mythtv user account to automatically start X, and also automatically restart X in the event of any type of exit. To do this you will modify the file /home/mythtv/.profile to read:
if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty1 ]; then while [ 1 == 1 ] do startx sleep 10 done fi
At this point, X will start, but it will just sit there waiting for user input. In order to automatically start mythfrontend when X starts, you will need to edit /home/mythtv/.xinitrc to something like:
exec irexec & exec xset s off & exec fluxbox & wmpid=$! exec mythfrontend 2>> /home/mythtv/MYTHERRORS & wait $wmpid
A few notes on the above suggestion:
- The irexec line is starting the IR interpreter program. This is useful if you have edited your lirc configuration files to allow button presses on your remote to operate things outside of MythTV. This line is optional according to whether or not you use irexec.
- The xset line is disabling your screen saver and/or screen blanking. This is completely optional.
- The fluxbox line is starting the chosen window manager (Fluxbox, in this case), and noting its pid. The window manager that you choose is optional, however the 'wmpid=$!' is not optional without reworking this file.
- The mythfrontend line is starting mythfrontend, and appending the MYTHERRORS file with any errors that would normally be lost in the console. This might be helpful for debugging, but please note that it appends to this file, meaning it will continue to grow and should be watched over. The '2>> /home/mythtv/MYTHERRORS' part is optional (the & is NOT optional).
- The wmpid line is waiting for Fluxbox to close. This line is not optional without reworking this file.
IMDB Fetch Problems?
The original source of this section is (this is more or less a word-for-word copy): http://fauxzen.com/2007/04/03/mythtv-020-02ubuntu2-imdb-fetch-problems/
If you have trouble with the getting all of a movie's information pulled from IMDB (plot, director, ratings, etc), then follow these steps to correct the issue.
First create a backup of the original script
sudo cp /usr/share/mythtv/mythvideo/scripts/imdb.pl /usr/share/mythtv/mythvideo/scripts/imdb.pl-orig
Download the SVN Copy
wget http://svn.mythtv.org/trac/browser/trunk/mythplugins/mythvideo/mythvideo/scripts/imdb.pl?format=raw
Rename the script
mv imdb.pl\?format\=raw imdb.pl
Replace the old script with the new one
sudo cp imdb.pl /usr/share/mythtv/mythvideo/scripts/imdb.pl