PVR Goodness

Dec 06, 2004 00:36

So this is less of a journal entry, and more of a log of what exactly I had to do to get my PVR system up and running. I want to write it down now, while I remember it, just in case in the future I need to reformat my system and need to reset it back up. Saying it was a long process is a bit of an understatement, so I want to get it in writing.

First things first - I have a fairly large harddrive (160 gigs), however, I had this 60 gig Windows partition that I never used, 30 gigs of an archive partition that I never used, and my actual linux partition was pretty much filled up (I had like a gig free or something), so I needed to make a partition where all my recorded videos would sit (as well as my other media, such as mp3s and whatnot). The problem is the partitions I wanted to free up weren't contiguous nor complete (I still wanted to leave 15 gigs for my Windows partition), so:

I backed up the archives partition to my linux partition, removed the primary archives partition (/dev/hde4). I removed the Windows partition via cfdisk (/dev/hde1), and recreated a partition at the same starting location, only of a smaller size (15 gigs), which fucked with the Windows FAT32 table since it thought it was 60 gigs (which is better than totally wiping it out), but no biggie, I'll fix that later, I dont even use Windows really. This left a bunch of free space between /dev/hde1 and /dev/hde2.

I copied partition magic 7.0 over to the windows partition, and using it moved hde2 to start at the end of hde1, so there was no unused space. I let this run overnight, one because thats how long it took (60 gig linux partition), and two because if this had screwed up, I would have lost EVERYTHING and I didn't want to worry about it, so I slept. ;) I woke up and it was okay.

I moved hde3 (the swap partition) next to hde2. Now I had 77 gigs of free space. When i rebooted it didn't start up, because it was looking for LILO at the location of the old linux partition, so it just kind of shit on itself. This was tricky, because i needed to boot off a linux bootdisc to rerun lilo to fix it - but Linux bootdisks don't recognize my Promise IDE controller which is what the harddrive sits off of. So I had to open the computer up, disconnect my DVD-Rom from IDE0-Master, plugged my harddrive into it, and rebooted on the linux boot CD (not in rescue mode, in normal mode).

After it was booted up in normal mode, I changed the fstab entries to reflect the drive being on the MB's IDE controller (hda instead of hde), and changed the lilo.conf to locate the kernel on hda. Then I rebooted off the linux boot CD, only this time in rescue mode (rescue root=/dev/hda2) so as to mount /dev/hda2 as root.

After it booted up, I reran lilo, and then changed the fstab entries back to hde instead of hda. Then I turned the computer off, switched the harddrive back onto the promise controller, plugged the DVD rom back in, and booted off the harddrive.

LILO worked fine, booted into linux, changed lilo.conf back to use hde, reran lilo, and rebooted for good measure.

After I got back into linux, I cfdisked a new partition using the remaining space (77 gigs) and set it up as a linux partition (I originally was going to LVM with JFS but I figured fuck it, ext3 was fine, I just needed a journaled file system). Then I mkfs.ext3 the file system to format it. I added it to fstab under /mnt/media, created a music, video, and videobuffer directory, copied my mp3s to music, video and videobuffer were going to be for MythTV.

Drives good to go, I turned off the machine, installed the PVR-350, connected all the cables/coax. Booted back up, and recompiled the kernel to add a bunch of stuff in. A lot of this I don't remember (I know I had to add unloadable module support for lirc, full v4l support, bttv support for the tuner, framebuffer support). Its all listed in the ivtv installation guide, check there. I recompiled, which I think broke the NVIDIA X module (which is normal, looking at the kernel the wrong way breaks that thing), so I reran the last NVIDIA install program to remake the module. This fixed X with the new kernel. Then i downloaded the ivtv driver, ver 0.2.0-rc3 (which was a pain to find, the normal ivtv site doesn't offer it in an easy tgz file since its a development version, and Chris Kennedy's (The primary coder for the most up-to-date patch) website as listed on google was down. I hopped on the ivtv irc channel and got the most current web address (http://205.209.168.201/~ckennedy/ivtv/) and downloaded the driver. Its got install instructions in the docs, but it was pretty easy, just a make and a make install. It makes the modules and installs them. The only other part was editing the modutils/ and modprobe.d/ ivtv config files and added the major/minor alias lines, as well as the options to set the card and tuner type. I have a brand new PVR-350, and the chipset was new to the older versions posted on the web. I had to set the tuner type to 44 (even though its 47, the driver doesn't have support for 47, and type 44 has the same frequencies). After settings all the module options, I rebooted, did a modprobe on the ivtv module and it worked (if it freezes up it means something changed and you need to reinstall). Later I added this modprobe command to my lirc startup script. I think I had to mknod to create the /dev/video(0,1,2,3,16,24,32) files as well. If you mknod the character devices with the correct major/minor numbers, after you modprobe ivtv it will connect everything up right.

As I test I cat /dev/video0 > test.mpg and it outputed a mpeg file. I used ptune-ui to set the channel/composite in, and I recorded from both TV and my gamecube that i hooked up to the composite in at this point. (honestly it took me a long time to get the tuner working, but it was just that i wasn't setting it to type 44)

At this point the card was good to go, driver and kernel module wise. xine pvr:// showed TV. Now I needed to setup MythTV, which was the longest compile EVVVERRR. I downloaded the source, and made sure the 15 billion library requirements were okay (qt libraries, lirc stuff, lame encoder, mysql server backend, etc). Compiled, created the SQL database, ran the setup command for mythbackend, and ran mythbackend, and mythfrontend, and set up everything.

At this point my PVR system was pretty much done, computer wise. I had full TV viewing capability on my TV (change channel, pause live TV, rewind to any point in what i had watched). I setup my DataDirect account for XML tv data, populated the database, and I could see what was playing at what time, choose what I wanted to record - everything was great.

I wanted to add remote control support, so I uninstalled the debian lirc package, downloaded the latest lirc code, and make and make install. Since my hardware was new, the remote control codes weren't right either, so I had to run the config program and program each button to be read by irxevent. Added lirc startup to init.d.

I now had remote control capabilities and a fully functional PVR. Now i wanted to add MediaMVP support for my TV in the living room. I setup a /var/tftpboot server, changed /etc/inetd.conf to go here for tftp, downloaded the latest MediaMVP dongle.bin, changed the config to match my settings. Setup a DHCP server on my computer that would be used only when the MediaMVP unit was turned on the first time (to download the dongle.bin.mediamvp and dongle.bin.mediamvp.config) - I still use my router the rest of the time for DHCP.

Compared to everything else, setting up the MediaMVP was easy. It worked fairly quickly, I setup /mnt/media as an nfs export so I could access my movies and mp3s from my TV, the MythTV plugin worked automatically like a charm, and I was good to go.

TODO: A few things still don't work. The radio tuner doesn't work - I think because tuner type 44 doesn't work on the radio portions of tuner type 47. I won't be able to find out until ivtv's developers update the module to include type 47 support. But its no biggie - I don't listen to FM radio much with mp3s and internet radio.

Also, though I can setup X to use the framebuffer to send my desktop to my composite monitor, I can't get it to extend my desktop while using my computer monitor as the primary display - it hardcore locks my computer up (can't telnet in and kill the X daemon or anything). I didn't screw with this too much, because 1) its not that big of a deal, I would just use my composite monitor for live TV out and gamecube/ps2, and 2) everytime I had to reboot after a lockup it had to recheck my hde2 filesystem, which takes like 5 minutes, and its just irritating.

But really, besides those small two things everything works AMAZINGLY. I have it scheduled to record so much (Farscape, Star Trek TNG, Star Trek DS9, SeaLab 2021, Harvey Birdman, Aqua Teen Hunger Force, The Critic, a crapload of movies), and the quality is just freaking amazing. I'm watching Resident Evil right now, I watched Alien earlier - its exactly the same quality as if watching directly off the cable. I watched part of Alien on my TV in the living room, looks just as good out there. Its definitely worth the 250 dollars, and allows me to work off my computer while watching TV, which is good, as now I can be a little more productive at night.

HURRAY. Anyway, I really hope I DONT have to set this up again for a long time, it was a long weekend. ;)
Previous post Next post
Up