Background and Hardware
This has got to be my all-time favourite gadget I’ve ever had; a Linux based HTPC. It’s low power, silent, capable of comfortably playing full-HD content with 5.5TB of disk space.
Why bother? First up – TV. Well, I have a Sky HD+ subscription but it just doesn’t cut it. Let’s face it, the TV we have today is just terrible. We have a few months of the year where there’s something worth watching and, in the UK, we get those decent shows months after airing in the US. I want to be able to turn on the TV and have a selection of good stuff to watch, when I want to watch it.
Secondly – Movies. I’m sick and tired and all those Disks floating about, in the wrong box (because I’m lazy) or on the Side getting scratched where I’ve had the urge to jump onto the Playstation for a Call of Duty session. Having my Movie collection fully digitised is a no-fuss, “it just works” solution.
Cost wise; it wasn’t bad at all. I really wanted one of the NVidia ION boards so I went for the following set-up: -
This took the total to a respectable £247.84 for a fully working machine. I also added an MCE remote off Ebay for about £12 and I added a spare 1.5TB hard-drive I had kicking about and a 2TB External USB drive to backups etc.
One thing I can’t stress enough is this motherboard is the most fussy piece of kit I’ve ever seen. You must adhere to the Qualified Vendor List (QVL) or it just wont boot. I went through 3 sticks of RAM before I learnt that lesson. Despite that, it’s easy to build, even for beginners as the Motherboard, CPU and GPU are a fixed unit.
Installing the Operating System
You may have noticed I don’t have an optical drive, because of that I used the USB stick installation. Grab the latest distro from the Ubuntu home page and you’re off.
I’m no Linux expert by far but I know enough to get around. I went for 6GB for the root partition and the rest dumped to a secondary partition for data.
First thing you will want to grab the latest ION Graphics drivers from the NVidia website. Download the NVIDIA-Linux-x86-xx.xx.xx.run file and save to disk, then run: -
cd /path/to/file/
chmod 755 NVIDIA-Linux-x86-xx.xx.xx.run
sudo ./NVIDIA-Linux-x86-xx.xx.xx.run
Once complete, reboot the system. You’ll see a nice new crisp display in a decent resolution.
If the edges of the screen cant be seen you need to adjust the over scan settings. You can do this in the NNidia settings panel, run the following, find the setting and drag the sliding bar until it fits.
nvidia-settings
Post installation
After I got it up and running, it took me a good 10 days to sort out all the problems. Here are the big ones.
Tearing
This looks like the top half of the screen was being rendered a few milliseconds before the second half of the screen, creating a “horizontal line”. It was very, very notable, especially during fast-paced scenes. Also, without knowing what the issue is or what it’s actually called, you try finding how to fix “Weird line on screen” in Ubuntu amongst all the crap on forums.
To fix this, you need to uninstall “compiz”. From what I can tell, it’s like Aero for Linux; makes things pretty. You don’t need it as you’ll be spending all your time in XBMC which has a very sexy UI. Run this in a terminal: -
sudo apt-get purge compiz
You may also want to enable the “Sync to VBlank” option inside the NVidia settings. Run the following in a terminal: -
nvidia-settings
Find the option for both XVideo and OpenGL and tick it.
Audio Over HDMI
The version of Ubuntu I’m using (10.04 was the last update I did) didn’t a high enough version of ALSA to support the sound card out of the box for the NVidia board. If you’ve got the same problems as me, you’ll need to upgrade.
First check that the card isn’t recognised, run this in a terminal: -
rob@HTPC:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC887 Analog [ALC887 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: ALC887 Digital [ALC887 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: NVIDIA HDMI [NVIDIA HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: NVIDIA HDMI [NVIDIA HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 8: NVIDIA HDMI [NVIDIA HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 9: NVIDIA HDMI [NVIDIA HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
If you see the NVidia card (in bold), but still don’t get sound, skip down to the mixer bit below, otherwise continue in upgrading ALSA.
Grab the script from here and run it with the following: -
sudo ./AlsaUpgrade-1.0.23-2.sh -d
sudo ./AlsaUpgrade-1.0.23-2.sh -c
sudo ./AlsaUpgrade-1.0.23-2.sh -i
sudo reboot
For some stupid reason, the line is muted by default. You need to un-mute it in the mixer. Run: -
alsamixer
Press F6 and select the NVidia card. The “MM” means muted, select each of the channels and press “m” on the keyboard so they show “00″.
Now find the card and device that maps to the HDMI port. You’ll need to grab the card and device numbers from running: -
aplay -l
For each entry listed, run the following: -
aplay -D hw:{{CARD_NUMBER}},{{DEVICE_NUMBER}} test.wav
When you get some sound coming out, you now tell ALSA to use that card by default: -
nano ~/.asoundrc
Now paste the following into the file, replacing the card and device numbers with what you found above.
pcm.!default {
type hw
card 1
device 7
}
pcm.default {
type hw
card 1
device 7
}
From now on the sound in the system should be routed to the HDMI port by default.
Fixing the MCE Remote
The remove I bought half worked out the box, that being, half the buttons didn’t do anything. The reason for this is that it’s modelled as two separate Human Interface Devices (HID) and LIRC (The infra-red application for Linux) was only interpreting one of them.
I can’t remember the exact steps I used to fix it but I know I had to merge to two channels for “Keyboard” and “Mouse” that the remote is sending to with a hack. This post got me most of the way through it but there was a lot of trial and error involved.
Installing XBMC
XBMC is available through Aptitude so just run: -
sudo apt-get install xbmc
I then just dumped it in the start up applications of Ubuntu so it loads when XServer is up and running. You can find that in the menu System -> Preferences -> Sessions
I would advice you keep your Movies and TV separate, using different scrapers for each. Check out here and here.
Conclusion
You should now have a very sexy Home Theatre PC capable of playing HD videos but that’s not the end of it, you can set it up to fully automate your TV downloads, work as a NAS device, web server, Remote Backup location for friends/family… and more.
Thanks
I just wanted to say thanks to the contributors of these pages. You helped me solve all my (HTPC) problems!