MythTV w/PVR-250 Setup on Ubuntu Linux 5.04


I’ve been taking advantage of the open source scene for quite some time now with nothing really to show for giving back with the exception of buying box sets of distributions every now and then. That’s going to change tonight… No – I’m not contributing software but just a little how-to for the Ubuntu community on getting your MythTV box with a PVR-250 up and running in, what, should be rather simple instructions. Ubuntu has to be one of the most impressive distributions in terms of things just working out of the box (enter: opinion – not flame bait). MythTV just seems to depend on a few too many things to make it ‘apt-get install’ and have it work. So… Here goes!


This guide assumes that you have a base Ubuntu 5.04 system up and running. Obviously, if you don’t have this this just ain’t gonna get you nowhere! I really did finish my undergrad – honest.


There are a few intricacies I’ve found with installing MythTV on Ubuntu. First of all, lets install MySQL and a few other things first that Myth is dependent on. Why you ask? Just trust me… It works better this way. Order is important and I make no guarantee in your Myth box working at all if you skip a step. Another thing is we’ll do most all of this from command line (apt-get). Feel free to substitute Synaptic at will. Now – on to the show...


Phase One

Step One – Setup ‘sources.list’ File

Hopefully this is the hardest part of the whole installation! Basically what we want to do is enable universe and multiverse. To do so let’s start by:


  1. Open up a root terminal (Applications System Tools Root Terminal)

    Type your password, blah, blah, blah…

    Now at your prompt enter:

    gedit /etc/apt/sources.list

    You don’t need the very first line, so take it out. It probably looks like this:

    deb cdrom:[Ubuntu 5.04, blah, blah, blah…]

    Now, go down to the two lines that are commented out and uncomment them. After you do that append the line with ‘multiverse’. That and why don’t we append ‘multiverse’ to the very last two lines as well. Now save that sucker and close it.

    So when you're done that file should look something like this (without all the comments of course):

    deb http://us.archive.ubuntu.com/ubuntu hoary main restricted

    deb-src http://us.archive.ubuntu.com/ubuntu hoary main restricted

    deb http://us.archive.ubuntu.com/ubuntu hoary-updates main restricted

    deb-src http://us.archive.ubuntu.com/ubuntu hoary-updates main restricted

    deb http://us.archive.ubuntu.com/ubuntu hoary universe multiverse

    deb-src http://us.archive.ubuntu.com/ubuntu hoary universe multiverse

    deb http://security.ubuntu.com/ubuntu hoary-security main restricted

    deb-src http://security.ubuntu.com/ubuntu hoary-security main restricted

    deb http://security.ubuntu.com/ubuntu hoary-security universe multiverse

    deb-src http://security.ubuntu.com/ubuntu hoary-security universe multiverse

    Now, with your root terminal go for this:

    apt-get update; apt-get upgrade

    This will make sure we have the right software database available and make sure everything we’re running already is up to date. K, now we can get onto actually installing MythTV related applications.


Step Two – Install Apache

Why install Apache? Well – for starters I like MythWeb and we’re also going to show you how to allow your MythTV setup to allow backend clients. Both of these are most easily done with Apache already there and to simplify the MySQL tasks we’ll use PHPMyAdmin. Cringe if you must, I’m trying to make this easy.


apt-get install apache2

apt-get install mysql-server

apt-get install phpmyadmin


When the phpmyadmin package asks if you want to restart apache2 now, agree. Just do it, you know you want to.


Now – here’s some magic, open up firefox and in the address bar type:


localhost


Voila! Apache is up and running and there’s our phpmyadmin directory. Now, click on the hyperlink for phpmyadmin and let’s get your database setup with a password.


Type in ‘root’ at the login form with no password. Find the “Change password” link towards the bottom of the main frame. Click on that and put in what you want your root MySQL user password to be. This is NOT your system root password. Make it different, but don’t forget it! Or make it the same, whatever – it’s your box.


After it’s set, now click “Back”. Almost done – now click on “Reload MySQL”. To make sure you did this all right logout from phpMyAdmin now. Log back in and put root as user with no password. DENIED! OK, so try your password you set. Hopefully NOT DENIED!


Logout of there if you logged back in – I don’t want you breaking shtuff.


Phase Two

Step One – IVTV

OK, now onto MythTV related items. Well, all have been so far, but none directly relating. Let’s get these ivtv modules compiled and installed. Since the package that exists currently sucks ass this will probably be the hardest part.


We need to grab some things from the Intarweb! Woo hoo! Hopefully you have the Intarweb – if not, I have no idea how you’re reading this.


So open FireFox back up, sorry I had you close it and if it's open you suck at following directions. Anyway - head on over to:


http://ivtv.writeme.ch/tiki-index.php?page=DownloadIvyTv


OK, so what you want is the current stable version of IvyTV (IVTV). No, you don't have to Google for 'ckennedy ivtv' because the stable version supports the 2.6 kernels now.


Save off whatever current *.tgz is on that page, as of this writing it’s:


ivtv-0.2.0-rc3i.tgz


Put that in your home directory for now.


OK, then move on over to grab some firmware. Same site, different place:


http://ivtv.writeme.ch/tiki-index.php?page=FirmwareVersions


Scroll down and you'll find one that's marked with ***. It's probably the recommended firmware to use, so get that one. As of this writing it's:


pvr48wdm_1.8.22037.exe


Minimize FireFox for now...


Go back to your root terminal and let’s get some compiler action installed:


apt-get install build-essential


Now – I assume that you are running the kernel you want to be running before you do this. The only reason I mention this is that if you upgrade to a more hardware specific kernel you’ll probably have to recompile or move these modules that you’re going to be making here shortly. Don’t ask me for help on this – if you don’t understand it, it’s probably better off you don’t mess with it. Not to be rude, but this is a MythTV HOW-TO, not an all-in-one-save-the-earth-fix-my-now-broken-kernel HOW-TO. Duh.


OK, let’s add some kernel headers. Unless you are running a different kernel than stock this should be sufficient. If you are, say running, a K7, AMD64, etc... kernel substitute where appropriate.


apt-get install linux-headers-386


Now… Still in your root terminal type:


cd /usr/src

mv ~[enter-your-username-here]/ivtv-0.2.0-rce1.tgz ./

mv ~[enter-your-username-here]/pvr48wdm_1.8.22037.exe ./


For those wondering, no, don’t use the []’s and where it says ‘enter-your-username-here’, yeah, that’s the user that you are now. If you’re not sure who you are:

  1. type ‘halt’ and run far, far away

  2. type ‘whoami’


You pick.


Untar your ivtv stuff:


tar zxvf ivtv-0.2.0-rc3i.tgz


Now, just follow this part and you’ll be fine. But do all the steps and do them in the right order!


cd ivtv-0.2.0-rc3i/utils

./ivtvfwextract.pl ../../pvr48wdm_1.8.22037.exe

cd ../driver

make


Right before we do the 'make install' let’s move something that will, otherwise, complain.


mv /lib/modules/2.6.10-5-386/kernel/drivers/media/video/msp3400.ko /lib/modules/2.6.10-5-386/kernel/drivers/media/video/msp3400.ko.original


Note: The above command is all one line!


NOW, we can do this… Just in case – we didn't want to nuke that module.


make install


Hopefully everything worked. If not… Drink beer.


Now more fun with editing files!


gedit /etc/modules


At the end of the file add:

ivtv


Save, close, you know the drill.


Now let’s put the modules somewhere we can use them:


cp /lib/modules/2.6.10/ivtv/* /lib/modules/2.6.10-5-386/kernel/drivers/media/video/


Now, let’s see if these suckers load:


depmod

modprobe ivtv


This should return nothing.

Now if you type:


dmesg


You should see at the end of your output that ivtv was all loaded. Yee haw, fat, dump and happy! No offense. It’s late and I’m doing this on a fresh box going from my Mac to my *nix box – just for YOU! I don’t know why that matters – but it just does. Taco bell is still open. That sounds gross but good at the same time...


OK, just FYI at this point. I know there's lots of ways to setup these modules and some might say you need the options to define your tuner in modprobe.d and all that jazz. But, from what I've read you only need to define those options if you have problems or want extra debug, etc... On my box everything works well without it. So – why put it in if you don't need it?


Just for fun – let’s reboot at this point. I know, it’s not world of Winblows, but. I want to make sure your modules will load unattended. That’s why… See, I have reasons for everything. So don’t question me again bitch.


Step Two – Install MYTHTV!

Ha, you thought we'd never get to this point. Well, log back in, and get your root terminal back up. Stay with me now... Real tough:


apt-get install mythtv


OK, so when that's close to being done it's going to ask you for your database password you set awhile ago. Put that in when prompted. Remember, it's not your root system password, but the root account of MySQL. This is so the installer can setup the DB structure. At the end it's going to tell you you have to run the daily mythfilldatabase cron job too. Don't worry about that for now.


After this is all done the mythbackend will try to start. Don't worry if it doesn't for now. We still have some work to do.


First of all – we're close so you'll need to go grab a Zap2It account for channel listings in your area. Here's the link:


http://labs.zap2it.com


So yeah, go make an account.


Now let's go back to that root terminal and change the mythtv user password. So in the terminal:


passwd mythtv

(follow prompts to change it to something you can remember)


After that's all said and done we're going to setup Myth. So since we want to do this as the mythtv let's do this from the Gnome “Applications” menu:


Applications

System Tools

Run as different user


Select the 'mythtv' user from the drop down box and then in the run menu put in:


mythtv-setup

So now, when prompted for the password, put int the one you just changed it to.


So at this point you'll be in the full screen menu for setting up the myth backend stuff. Go through 'General' – you should be able to figure out the right settings there. If not – there's always the MythTV documentation.


After you get back to the main menu select 'Capture Cards'. Then follow these menus and settings:


New capture card

Card type: MPEG-2 Encoder Card

Video device: /dev/video0

Default input: Tuner0

Finish


Now 'Esc' back out to the main menu. Go down and select 'Video Sources'. Then follow these menus and settings:


New video source

Video source name: PVR-250-1

XMLTV listings grabber: NorthAmerica (DataDirect)

User ID: [whatever user ID you created at the Zap2it Labs site]

Password: [whatever password you created at the Zap2it Labs site]


Now select 'Retrieve Lineups' – it may take a minute, but it should grab the TV listings you signed up for. If not – make sure you have everything put in correct for account settings. Select 'Finish' and then 'Esc' back out to the main menu. Select 'Input' and then follow these menus and settings:


Select 'Tuner0'

Video Source, should be set to: PVR-250-1

Finish


Now 'Esc' back out to the main menu. Done! 'Esc' once more and you should be returned to your desktop.


Back to the root terminal. Run:


mythfilldatabase


This will take a few minutes, so be patient. You may get some 'Unauthorized' errors, but those are OK. After that's all done we should be good to go!


One last couple of sanity checks here. So, since MythTV doesn't play nice with the sound server, let's disable it. Sorry if you like the lame Ubuntu sounds! Follow these menus if you want sound with your TV:


System

Preferences

Sound

Uncheck 'Enable sound server startup'


And then one more thing... Back to your root terminal.


cat /etc/group | grep video


Now, if the users are already listed that you want to be there good. You need to see the user you will run 'mythfrontend' with as well as the 'mythtv' user. If you don't see those users, add them!


Let's restart one last time – only because we disabled the sound server and we need to make sure it's not holding the sound device.


After you reboot, log in and as your user run:


mythfrontend


Watch TV!!!


Props to everybody who wrote any parts of this software... You guys rock and my documentation of putting this on Ubuntu is shitty at best. Hopefully this will be a good starting point and I can get some feedback with fixes to make this better. I did find an easy and quick way to get the LIRC modules going on Ubuntu as well! That was part of the delay in actually finishing this. I'll add that, maybe Sunday... Until then, either try yourself, but don't get too frustrated, just wait 'till I finish this document.


Hopefully I didn't forget anything and my appologies for the delay!


Regards,

David J. Meier

djmeier at slash32 dot com


Feel free to e-mail me with feedback or comments!