Page Description
This page will describe how to install MythTV onto your Ubuntu linux computer. MythTV is a 'Tivo' like system; it allows you to watch, pause, and record televsion. These instructions were created using Ubuntu 5.10 (Breezy Badger). They are written for the basic Linux user, however a knowledge of Linux commands will be helpful when installing myth.
Upgrade Ubuntu for Installing MythTV
Access Terminal by Selecting Applications->Accessories->Terminal
Set the 'root' password
%sudo passwd root
- Optionally, can put 'sudo' before every command Now, a root account exists
Enable 'Universe' and 'Multiverse' Select Settings->Repositories Press the 'Add' button Check the 'Community-Material (Universe)' checkbox Check the 'Non-Free (Multiverse)' checkbox Select the 'Oks' and let the packages download Press the 'Close' button and exit out of the 'Add Applications' window
Switch to root user %su Enter the password created earlier with sudo command
Update and upgrade Ubuntu %apt-get update %apt-get dist-upgrade %apt-get upgrade
Download required packages used to install Myth %apt-get install build-essential
Myth also requires gcc-3.4 %apt-get install gcc-3.4
- Alternativey, could make symbolic link that's named gcc-3.4 but links to gcc compiler version installed with Ubuntu
Install Apache and Mysql
%apt-get install apache2 %apt-get install mysql-server
- Choose 'setup internet site' I used default values. If you're smarter than me, change as needed.
%apt-get install phpmyadmin Open Firefox web-browser enter 'localhost' into the website address Click on phpmyadmin Enter 'root' into the user name field box Leave the password field empty and press ok. Click on change password Enter in your new password in both field boxes and press ok. Press 'logout' now, enter root as the username and nothing in the password box. If what you did worked, you just got denied. Now enter 'root' as the username and the password you chose in the password field box. Press enter. If you get logged in, then everything worked well. Logout again.
Download and Install Myth To do this we will use synaptic manager Select System->Administration->Synaptic Package Manager Right click anything with Myth in front of it and mark for installation
- Mythgame and Mythphone have problems. We'll get to this later. Click 'Apply'. Click 'Apply' again. Watch the packages download.
Also use synaptic package manager to download lynx and ncftp
Installing Hauppauge pvr-350 Visit http://ivtvdriver.org and download the latest stable release of the driver I downloaded ivtv_0.4.0.tar.gz. Unzip the file. I do this by double clicking on it, and using the Ubuntu unzip utility to extract it to my desktop. Just push extract when the button appears. You no longer need the *.tar.gz file. Feel free to delete it.
Open up a terminal. In your home directory, create a directory called Software. %mkdir Software Move into that directory %cd Software Make a directory for all of your television software %mkdir tv Move into that directory %cd tv Move the Driver directory into the current directory %mv ../../Desktop/ivtv-0.4.0 ./ Move into the driver directory %cd ivtv-0.4.0
Download soemthing that makes 'make' work
%apt-get install linux-headers-$(uname -r) Now make the driver %make Now install the driver %make install The output of make install lists some conflicting files. It suggests several move commands to 'HIDE' these files. Follow these commands by copying and pasting them into the command line and pressing enter. (Press enter for each command individually) Then install it again %make install Hopefully the install went well for you. On my machine, it installs into the wrong directory. So we need to copy it. We first need to find where it went. Type in the following %find / -name ivtv This command should reveal the location of the ivtv driver. Now we need to copy it to where it should go. %cp -r <result_of_find_command> /lib/modules/<your_kernel_number>/kernel/drivers/media/video
- If you don't know your kernel number, type the following %uname -r
Copy it to another location as well (this really shows you how little I know about what I'm doing. I got it working, so that part's good.) %cp -r <result_of_find_command> /lib/moudles/<your_kernel_number>/ Now we need to generate the modules.dep and map files. Do this by typing the following: %depmod And now we need to add those modules to the linux kernel Do this by typing the following: %modprobe ivtv Edit a file %gedit /etc/init.d/ivtv Add the following line to the file (it might be the only line in the file) 'modprobe ivtv' Make ivtv executable %chmod +x /etc/init.d/ivtv Update the modules that start on boot up %update-rc.d ivtv defaults 50 Check to see if the driver is working As root, issue the following command %dd if=/dev/video0 of=/dev/video16 After a few seconds, push 'Control-C' You should get an output that looks like this:
- 30696+49 records in 30720+0 records out
If you got this, then the drivers are workign well.
- Note: /dev/video16 is the hardware decoder that comes with the Hauppauge pvr-350 If you don't have the 350, then you may not get any records out.
How are you feeling so far? Feeling good? Things are going well. Only a bit further.
Let's look at the output of the modprobe command. %dmesg | less
- Note: if you don't know how to use less, type '%man less' before issuing the above command
If you scroll to the bottom of the ivtv section, you can see that several errors occurred. This is because we have yet to isntall the firmware for our capture card (the Hauppauge pvr-350). We will do that now. Open up Firefox web browser Again visit http://ivtvdriver.org Click on the 'firmware' link Here you get some really cryptic messages for what you want to do with the Hauppauge pvr-350. I'll tell you what I did. If you find a better way, please let me know ndwork@hotmail.com
The first thing we see is that the hotplug mechanism will be used starting with driver ivtv-0.4.1. That means if you use a release later than 0.4.0, this document is out of date. I welcome you to figure it out and let everyone else know how to do it by improving this document. If you're still using ivtv-0.4.0, then download the following files: pvr_2.0.24.*.zip and pvr_1.18.21.22254_inf.zip and save them to your desktop.
In your tv directory (within your Software directory) make a pvr_firmware directory %mkdir /home/<your_user_name>/Software/tv/pvr_firmware Move into that directory %cd /home/<your_user_name>/Software/tv/pvr_firmware Move the zip files into the current directory %mv /home/<your_user_name>/Desktop/*.zip ./ Now run a perl utitilty that came with the ivtv driver %../ivtv-0.4.0/utils/ivtvfwextract.pl pvr_1.18.21.*_inf.zip.
- Make sure
Note: we have not yet used the pvr_2.*.zip file. This will be used later for the hardware decoder.
Now we have to get some additional modules. At this point, let me say my two cents. Thank you to all the developers who have created Myth, ivtv, and linux in general. Open source is an amazing solution to software development. Ubuntu, in general, rocks. This would all be so much harder if it were not for this new, beautiful, distribution of linux. If I might make a suggestion, it would be the following. It would be great if installation of the driver were done just by installing the capture card into the computer. I understand that there are plans to get ivtv included into the linux kernel, and I'm looking forward to those days. I've spent about a week trying to figure all of this out, and I'm still going.
Ok, back to the additional modules.
Visit http://www.pcxperience.org/james/ivtv Download the Video::Frequencies and Video::ivtv modules For each module, do the following: Unzip the file and extract the internal directory to the desktop (as done before) Move the dirctories into your pvr_firmware directory %mv /home/<your_user_name>/Desktop/Video* /home/<your_user_name>/Software/tv/pvr_firmware Navigate to the firmware directory %cd /home/<your_user_name>/Software/tv/pvr_firmware Navigate into the Video Directory %cd Video-Freq* Use perl utility to create makefile %perl Makefile.PL Make %make %make install Repeat for the Video::ivtv module Use CPAN to install IniFiles %cpan -i Config::IniFiles
- It takes a while to go through all the options. I selected default for most of them. You'll be fine.
Navigate back to the ivtv driver directory %cd /home/<your_user_name>/Software/tv/ivtv-0.4.0 Make and make install %make %make install Restart your computer by selecting the following
System->Logout->Restart
Open a terminal and become root user %su %depmod %modprobe ivtv Now check the output of modprobe %dmesg | less The ivtv portion should have no errors Restart your computer Switch to root user Navigate to the ivtv directory %cd /home/<your_user_name>/Software/tv/ivtv-0.4.0 Navigate to the directory with ptune in it. %cd ./utils/perl Test the capture card with ptune.pl. Type '%perl ptune.pl' to see how to use it. %perl ptune.pl -c 8
- The above command assumes you have channel 8.
If the output is something like: 'Ch.8: 181250 2900' then the card is working.
- Note, again, we still haven't got the decoder working. If you have a Hauppauge pvr-250 instead of a Hauppauge pvr-350 then you don't have a decoder and life is good for you.
If it worked, edit an aliases file. Perform the following: %cp /etc/modprobe.d/aliases /etc/modprobe.d/aliases.orig %gedit /etc/modprobe.d/aliases Now find the following line:
- 'alias char-major-81 videodev'
After that line, add the following line
- 'alias char-major-81-0 ivtv'
An additional card could be added as 81-1
Create a username and password for mythtv in the sql database if you're not the mythtv user, switch to it %su Then enter the following set of commands %mysql -u root -p mysql mysql> UPDATE user SET password=PASSWORD('mythtv') WHERE user="mythtv"; mysql> FLUSH PRIVILEGES; mysql> quit
- Enter a different password if you would like. Just remember the one you enter.
Finally, on to MythTV! Navigate to your home directory %cd /home/<your_user_uname> Make a password for the mythtv user %passwd mythtv Enter in a password (I suggest making it the same password used for the sql database). Now need to disable a security feature; remember to enable it again later. %xhost + Change to the mythtv user %su mythtv Enter Myth Setup %mythtv-setup
- Go to www.systm.com to see how to setup Myth Note: It's important to run the myth tv setup as the mythtv user
Fill the listings of myth
%mythfilldatabase
- This takes a long time. Don't worry if you get some errors - some errors are ok. Myth will be the test of if it worked out or not.
We need to configure the backend to start when we turn on the computer. %echo "su -mythtv -c \"mythbackend -d\"" | sudo tee /etc/init.d/mythtv-backend Start the myth backend %mythbackend -d &
http://www.mythtv.org/docs/mythtv-HOWTO-singlehtml.html This will start the myth daemon
Restart the computer System->Logout->Restart Start up myth! Currently, there is a bug in Ubuntu where the mythbackend won't start up automatically. So, we start it ourselves. Remember that the mythbackend must be started by the mythtv user %mythbackend %mythfrontend Myth will tell you that it couldn't connect to the database and give you some options. Tell Myth the username and Password of your mysql database you entered earlier in this tutorial.
You should be able to watch TV at this point. If you can't it's likely that you didn't setup myth properly. Please revisit mythtv-setup.
Setting up the Hauppauge Remote Control
http://ubuntuforums.org/showthread.php?t=30612&highlight=lirc http://www.abarbaccia.com/content/view/18/31/
Need to install Linux Kernel source code Find the kernel version %uname -r This yields something like 2.6.12-10-386 We will use the first three numbers %apt-get install linux-source-<kver>
where <kver> are the first three numbers
Now we need to extract the source we just downloaded and link it to the right directory %tar xvjf /usr/src/linux-source-*.tar.bz2 -c /usr/src/ %ln -s /usr/src/linux-source-<kver> /usr/src/linux %ln /usr/src/linux /lib/modules/$(uname -r)/build %cp /boot/config-$(uname -r) /usr/src/linux/.config %cd /usr/src/linux %make oldconfig %make /include/linux/version.h %make modules
Visit the LIRC homepage and download the latest LIRC software to your desktop
- www.lirc.org
Unzip the firmware using the Ubuntu unzip utility as discussed before and extract it to your desktop Feel free to delete the zip file now. In your Software/tv/pvr_firmware directory, make a directory called remote_control %cd ~/Software/tv/pvr_firmware %mkdir remote_control Move the lirc* directory to the remote control directory %cd remote_control %mv ~/Desktop/lirc* ./ Install Dialog %apt-get install dialog Move into the lirc directory %cd lirc* Run setup %./setup.sh Select Driver Configuration Select TV Card Select 'Hauppauge TV Card' Choose 'Save Configuration and Run Configure' Make and install %make %make install Note:
- If there are errors during the make or make install, then might try performing the following command. %touch /usr/src/linux/Rules.make Now re-run make and make install
%depmod %modprobe lirc_i2c %chmod 666 /dev/lircd %lircd
Test using irw %irw Point your control at your ir receiver and push a button. The name of the button should be displayed on the text screen. If it doesn't work, then there's something wrong.
We will now setup the remote control so that it will start after we shutdown the computer Open up the modules file to be edited %vi /etc/modprobe.d/aliases Add the following line above the 'ivtv' line that we added before 'alias char-major-61 lirc_i2c' Now change permissions of lircd First find out where lircd is %which lircd This command will reveal a path. Enter that path into the following command %chmod 555 /usr/local/sbin/lircd
- Replace '/usr/local/sbin/lircd' with the path revealed by the 'which' command
Save your changes and exit the editor Open up another file %gedit /etc/udev/udev.rules Add the following line at the end of the file
KERNEL=="lirc0", SYMLINK="lirc" Need to download a script in order to get lirc to startup at boot time %cd /home/mythtv/ %wget http://www.abarbaccia.com/mythtv/lirc
- I did not create this script, and I don't know who did. If it was you, thank you VERY much.
%mv lirc /etc/init.d/lirc %chmod 755 /etc/init.d/lirc %update-rc.d lirc defaults 99 Restart the computer and login %cd ~/Software/tv/pvr_firmware/remote_control/lirc* Enter the irw command %irw Press some buttons on your remote control. If you get the right output, then it works. If not, something is wrong. Did you remember to plug in the ir receiver? Is your remote control supported?
Getting the remote control to work during Myth
%wget http://wilsonet.com/mythtv/lircrc-haupgrey-g3.txt %mv lircrc-haupgrey-g3.txt /home/mythtv/.lircrc %ln -s /home/mythtv/.lircrc /home/mythtv/.mythtv/lircrc
- Make sure to run the myth front end as the mythtv user or the remote control won't work
You may need to edit the .lircrc file. Do so by using gedit. %cd /home/mythtv %gedit .lircrc Use the irw program to know what the output from the remote control is called. For example, if the output of irw is the following:
- 0000000017b4 01 Forward Hauppauge_350
then that button of the remote control is called 'Forward'. This string goes in the 'button' field of the relevant section of the .lircrc file. Identify the proper button to be used by Mythtv by viewing the myth documentation at www.mythtv.org. For example, if you want the 'Forward' button of the remote control to be used to advance 1 second, then you would use the '>' button. '>' would go in the 'config' field of the relevant section of the .lircrc file. Continue editing the file to suit your own needs.
Upgrade the firmward to version 2.0.24.23035 Visit the ivtv website and download the driver of the above version www.ivtvdriver.org/index.php/Firmware Unzip the file Copy the HcwMakoA.ROM file to /lib/modules/ Copy the HcwFalcn.rom file to /lib/modules/ivtv-fw-enc.bin %depmod %modprobe ivtv
Set up the backend so that it starts upon boot up
Do this by adding a line to the /etc/init.d/mythtv-backend file %gedit /etc/init.d/mythtv-backend Add the following line in the file
- 'HOME=/home/mythtv' Note: Do not add the quotes
Set it up so that the mythtv user doesn't use screen savers: login as the mythtv user Edit a startup configuration file %gedit ~/.xinitrc It is likely that you are creating this file from scratch. Enter in the following line 'xset s off'
- Note: do not use the quotes
If you would like myth to start automatically when you login as the mythtv user, then add the following line as well.
- 'mythfrontend'
Sysem->Preferences->Sessions Click the Startup Programs Tab Click the 'Add' Button The first command removes the screen saver so it won't appear when you watch TV Enter in 'xterm s off' Set its order as 199 The second command starts up the myth front end Click the 'Add' Button Enter in 'mythfrontend' Set its order as 200.
You now have a myth system installed on your computer.