This document describes how I build my own PVR (Personal Video Recorder) at home for Over the Air (OTA) TV signals. Originally I wanted to be able to handle both ATSC and NTSC signals, however since Canada is doing the switchover to ATSC only in August I've decided to ignore support for NTSC.
After evaluating many options including Freevo, MythTv, XBMC and many others I originally chose to go with MythTV. After much work and effort I was able to get Myth to function correctly, however every upgrade brought its own issues and eventually I found that it's media play just couldn't handle some formats. I then went back to my list of evalaution choices and settled upon XBMC for the front end and tvheadend for the backend.
This document will outline all of the steps done to acheive a fully functioning media center using Debian, XBMC and tvheadend.
This document is broken down into a few separate sections.
Please note that all of the information found in this page is based on my recollection of the actions taken during installation. If you have questions feel free to drop me an email and I may be able to help out. Please don't vent at me if you can't get things working, multimedia on Linux has, at least as I've found it, been difficult at best to get working. I also assume no liability for any actions taken by you or others based on this document.
There are two components to my setup, however all of the software could be setup and configured on a single piece of hardware. The setup for this document is a front end system that is hooked up to my TV and a backend system that is used as the PVR system which has no display attached to it.
A base debian installation was performed (squeeze) using the net install image. The only options selected during the task selection was the SSH Server. Once the base install was complete the debian multimedia apt repository was added and the rest of the /etc/apt/sources.list file was updated to look like this:
deb http://mirror.kernel.org/debian squeeze main contrib non-free deb http://multimedia.debian.org/ squeeze main non-free
The apt repository was updated (apt-get update) and then the xbmc package was installed and all associated components
apt-get update apt-get install xbmc xbmc-standalone xmbc-live
Because the frontend system is using the NVIDIA chipset it was easiest to configure the Xorg system using the nvidia-config command. So that was needed as well from the apt repository
apt-get install nvidia-config nvidia-config cp xorg.conf /etc/X11/xorg.conf
In order for the xbmc-live system to start during bootup and allow it to always be running it requires that a boot paramater of xbmc=autostart. This was done by editing the /boot/grub/grub.cfg file and appending the xbmc=autostart to the first menuentry section for the linux line. My system has the following:
menuentry 'Debian GNU/Linux, with Linux 2.6.32-5-amd64' --class debian --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set 12345678-9abc-def1-2345-6789abcdef12
echo 'Loading Linux 2.6.32-5-amd64 ...'
linux /boot/vmlinuz-2.6.32-5-amd64 root=UUID=12345678-9abc-def1-2345-6789abcdef12 ro quiet xbmc=autostart
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-5-amd64
}
Once the frontend system was rebooted the XBMC system came up without an issue and I was able to the proceed configuring things through the GUI tool. I did add some network mounts via NFS at the OS layer, but depending on your configuration you can adjust to suit your needs.
I first attached the HVR-850 USB adapter to my system. I then made sure I had the firmware-linux, firmware-linux-nonfree and firmware-linux-free packages installed. I also installed the dvb-utils package, but this was more for testing than a requirement.
Once all of these was installed I made sure that I added the repository for tvheadend to my apt sources.list file:
deb http://www.lonelycoder.com/debian/ hts main
Then it was a simple matter of apt-getting the tvheadend package and then proceeding with the configuration from the front end.
apt-get install hts-tvheadend
I did intially have some difficulty in getting the hts-tvheadend system to show my adapter and configure things. There is a lack of error messages in any of the logs, but eventaully I found out that I had more than one copy of the application running which was causing my issues. Manully killing the process and restarting the hts-tvheadend system solved this issue.
All of the configuration done after getting the software installed was done through the GUI front ends (either HTTP or via the UI). One thing to note is that tvheadend only responds to http traffic via port 9981. So make sure to visit the server it is running on, on that port to configure things.
To get live TV to work you will need to add a video source in the video section of XBMC. In the menu listing there is an option specifically for TvHeadEnd. So it makes it easy. Make sure to use the correct username and passowrd, if you've setup additional accounts you will need to make sure you are using the correct credentails. My advice is to get it right the first time. Figuring out how to edit entries in XBMC was a bit tricky.