Tuesday, December 7, 2010

Building a Ubuntu HTPC - Day ????

I've made tons of progress getting my HTPC in a fully functional state, I'd stay it's at least 85% done of the functionality I want. I just haven't been updating the blog...well these things happen :)

Highlights:

1. Sound "crackle" problems are now fixed. Turns out, when you modprobe the cx18 driver, you can select the tuner type. My HVR-1600 was a Phillips tuner of type 43. It had been just using some "default" tuner type which wasn't reading the audio input correctly. This also fixed ivtv-tune not being able to get high signal strength or pick up channels.

In short:

1. Create a file in "/etc/modprobe.d" called "cx18.conf" (as root)
2. Add the following line: options cx18 tuner=43 radio=0 (your tuner # may be different)
3. Save the file and restart. The module should now be loaded with the correct options and the cracking should be gone for good.

Reference:
http://www.linuxquestions.org/questions/showthread.php?p=4164862

2. Lirc: Lirc support is now fully functional, both blaster and receiver. You have to put your own lirc from source, and modprobe the kernel driver, but it should work fine.

The main recipe I got to work is here: http://ubuntuforums.org/showpost.php?p=9548142&postcount=9

Don't forget to modprobe the driver! You can add it to /etc/modules in Ubuntu 10.04 to have it load on boot.

Additional References you may find helpful:
http://www.blushingpenguin.com/mark/blog/?p=24
http://www.gossamer-threads.com/lists/mythtv/users/442250
http://wilsonet.com/?p=40
http://www.mythtv.org/wiki/Hauppauge_HVR-1600

I had some trouble at first getting the remote to work with MythTV. Make sure your lirc socket (e.g. /dev/lirc0) has a+rw permissions (e.g. chmod a+rw /dev/lirc0)

In addition, if you follow the instructions above, the lirc socket you connect will *not* be /dev/lirc0, but rather /var/run/lirc/lircd. This is what you must configure MythTV to connect to in order to get it to work. You can find a sample .lircrc file for MythTV here, and modify it to your needs. One thing I did is make an entry to start MythTV with the Go button:

begin
button = Go
prog = irexec
repeat = 0
config = "/home/jason/Scripts/startmyth"
end

The contents of my startmyth script:

#!/bin/sh
# Run MythTV front end on display 1
export DISPLAY=:0.1
mythfrontend

You can use the DISPLAY variable to decide what X-session you want MythTV to start if you use a Dual-Head setup, like me.

Also, you'll want to start the lircd daemon on start. Here's my start lirc script:

mkdir /var/run/lirc
/home/jason/Development/lirc-0.8.6/build/sbin/lircd --device=/dev/lirc0 --logfile=/home/jason/Development/lirc-0.8.6/build/lircd.log
chmod a+rw /dev/lirc0

To run as root on boot, add it to your /etc/init.d/rc.local

3. I've cleaned up the video output a bit. Using a longer, single cable has helped but there's still a bit of interference.

4. I'm working on getting a custom Start up and Shut down program working. I've done some tests with ACPI_Wake and hit seems to work, just nailing down the details with the mythtv database, similarly, I also working on a shutdown application to turn off the computer at points after recording. I should be posing back after I get them running!

No comments:

Post a Comment