HTPC(Home-theater PC) Setup


Get Firefox!

Home Free Software Faq Blog Microblog GNU/Linux Faq Free Media Faq's NRI Faq Immigration Faq Notes Donations About me..

Here I will document some of the things which I learned during building an HTPC(Home Theater PC),of course it is GNU/Linux based. I have spent countless hours to figure these things out and hence I wanted to document it here so that you won't have to spend time for things which I already figured out.

OS
My current setup is based on Knoppix running it from an ISO from my hard drive.The reason I chose this route as opposed to a full install of Debian is that I prefer my OS to run in a read-only mode that is my main OS should not change.Running from an ISO image allows me to keep my OS safe as the ISO never gets overwritten.The only minor problem with this approach is that on every reboot you have to perform all the customizations again on your base OS, but with scripts its a non-issue. I have used this approach to boot the ISO from GRUB.

Hardware
PC ($200)
A cheap  Dell Dimension 2400 desktop serves as the heart of my HTPC project.It has 1GB of RAM and no AGP slot.
It is currently connected to my LCD TV via a VGA cable.

IDE to USB 2.0 Adapter($13)
Bought this Adapter from ebay for $13 shipped so that I could connect my internal DVD IDE drive to the HTPC desktop.Works fine on GNU/Linux.Note that it gets mounted as a scsi drive for example on my machine it is /dev/scd0
You might wonder why did I buy this considering that I have a desktop and it can very well go in the desktop.
The main reason I bought this was to increase the FAF(Family Acceptance Factor) of my HTPC.Now with a long USB cable I just put this DVD drive over the furniture so that it gives a feel of a STB(Set-top box).

Generic 2.5" Hard drive enclosure(Free-after Rebate)
Dell Dimension has a single bay to hold a single hard drive.An additional bracket just to hold an additional hard drive costs about $30 from Dell, what a ripoff.Anyways I bought these hard drive enclosures from Fry's which allow me to connect my laptop's 2.5 inch hard drive as an external USB 2.0 device.Also it is powered by the USB hub so one less power cord in the house.

HDTV($1200 including tax)
Syntax 37" ÖLEVIA LCD TV
Here is my lines for knoppix in GRUB

title            Knopix DVD TV 

kernel           (hd0,0)/boot/knoppix.402/linux ramdisk_size=100000 init=/etc/init lang=us noapm noacpi  nomce quiet bootfrom=/dev/hda1/*.iso   noprompt dma screen=1280x1024  xvrefresh=60 noddc fb1280x1024 xmodule=i810  home=scan myconf=/dev/hda3 desktop=icewm
initrd           (hd0,0)/boot/knoppix.402/minirt_usb2.gz
boot

I spend lots of hours in configuring these and lots of reboots to make this work.The TV just would not display anything correctly.With the above lines in my GRUB I was able to successfully display 1280x1024 on this TV.I chose to use icewm as it is pretty light-weight and the startup time is very less compared to KDE.

Also with this TV I noticed that KDE's displayed the title bar pretty huge and no matter how much I tweaked I was not able to change the titel bar to the correct size.The whole setup was looking awkward as rest of the screen except title bar was with proper size.
If you own this TV there is a very good forum
Software
libdvdcss
One of the first things you would need to install on your GNU/Linux based PC is libdvdcss.This is the software which will decrypt encrypted DVD's.Without this software you will not be able play any commercial DVD's.The legality in fair use of this software(especially in USA, where I live) has not been established.So I would say use it at your own risk.Pls make sure you get the version 1.2.9 or above. I spend quite a few days on trying to play encrypted DVD's and due to a bug in previous versions of libdvdcss I had a very very hard time playing encrypted DVD's , some would play, some would play only the first chapter and some wouldn't play at all. The main problem was that players like Xine were giving me wrong error messages like "Your computer might be too slow and your graphics card is dropping frames at a very high rate"  , the error was misleading.

x11vnc
If you are using XFree86 one of the first things you will want to do is remotely control your htpc.
Now the main challenge will be to share the SAME display on your HDTV and on your laptop or other computer.
I chose to go with VNC.Now the traditional way of running VNC to achieve sharing between the display (say for example display 0 ) won't work. So what you have to do is run a tool called x11vnc on your HTPC desktop.You can even download the source code and compile x11vnc yourself it is very very straightforward.
Once you have x11vnc compiled you can then any user on the HTPC can run it(you don't need root privileges).Just run "x11vnc -forever" , please note that by default x11vnc runs passwordless.Once x11vnc runs on the HTPC you can remotely control the same desktop session via vncviewer from another machine.

Xine
I use Xine as my media player as that is what is shipped with Knoppix.I didn't go with other players like mplayer simply because they are not shipped with Knoppix and if it is not shipped with knoppix in order to install you would have to install it on RAM(remember my base OS is read-only) and of course RAM is pretty precious.
Launching xine
xine -p=fd &

I have seen that it is better to refer to your dvd drive as /dev/dvd.I have one more cdrom on that machine and by default knoppix symbolically links /dev/dvd to my /dev/cdrom.So I unlinked the default /dev/dvd and relinked it to /dev/scd0.

Xine Configuration changes
Some of the customizations I made to the config files were


Environment
One of the other things you will notice after setting up your HTPC is that your screen will go blank say after 15 minutes(or whatever is your power saver mode time) of non-use.Now when the next time you turn on the TV you will not see anything or you will see a blank screen.The reason is that your HTPC has turned the power-saving feature of XFree86 .But power-saving does not make sense considering that the TV is turned off to begin with.
In order to stop X from going into power saver mode you would need to run the following commands
xset s off
xset -dpms
I use Xine as my media player as that is what is shipped with Knoppix.I didn't go with other players like mplayer simply because they are not shipped with Knoppix and if it is not shipped with knoppix in order to install you would have to install it on RAM(remember my base OS is read-only) and of course RAM is pretty precious.

TODO
Design Principles




Submit thread to Digg | Submit to del.icio.us |
Home Free Software Faq Blog Microblog GNU/Linux Faq Free Media Faq's NRI Faq Immigration Faq Notes Donations About me..

This site is optimized for open-source/standards compliant browsers like Mozilla.org or Konqueror only.This site may not work with non-standards/proprietary browsers like Internet Explorer.
Disclaimer All the opinions expressed on this site are my personal opinions and not of my employer.
Please use this site responsibly and at your own risk.I do not guarantee or take responsiblity for any data and its accuracy.