Lirc the pcHD5500 and E\/il

A couple days ago, (at least 100 years ago) i managed to break the ir receiver’s connector to my Hauppauge PVR-150 leading to Epic FAIL. I had the device and the remote working perfectly with lirc using the hauppauge driver that comes with lirc. Being the lazy person that i am, i’m very irritated in having to get up and walk to the keyboard near the TV to change channels or volume (or anything else) with MythTV.

Just when all seemed lost, i remembered that the pcHDTV card that i have also has an IR receiver. I remembered that when i purchased the card, this feature was unsupported, but i assumed being several years later that developers would be all over that. I was wrong. It seems like it can be done, but it’s certainly not a self-explanatory process. Hopefully my journey will be useful to others:

First off, all i really had to go on was this newsgroup thread from 2006: pcHDTV – Infrared Chip. It looks like very little to no work has been done in this area (which seems typical of the pcHDTV team).

The first thing that must be done is to modify the kernel source slightly:

if you look at the cx88-input.c file in ./linux-2.6.X-whatever/drivers/media/video/cx88 in the kernel sources, you can see two places where there’s a line:

case CX88_BOARD_HAUPPAUGE_HVR1100:

In both places add the following line directly under the previous:
case CX88_BOARD_PCHDTV_HD5500:

now recompile:
make clean
make modules


I’ll let you decide how you want to get the new cx8800.ko and cx88xx.ko files into the tree. (I did it the “bad” way, but technically you should completely regenerate the kernel and module tree.) Whatever you do, don’t forget:

depmod -a

I’m using Gentoo, so my instructions from this point are specific to this distribution. If you’re using a different distro, your mileage may very. Next edit: /etc/make.conf add the line (or change the existing line) to be:

LIRC_DEVICES="devinput"

Now (as root, of course) recompile lirc.
emerge -v lirc

Here’s where it starts to get a little dodgy: You need to edit the keyboard entry in /etc/X11/xorg.conf add the lines:


Option "Dev Phys" "isa0060/serio0/input0"
Option "CoreKeyboard"
Option "Protocol" "evdev"


into Section "InputDevice"

The reason for doing this is because X11 will detect the input device that will be created (/class/input/input5 your input# may be different) as being a keyboard. The arrow keys and the enter key will work, but none of the other keys on the remote. To have lirc working properly, we don’t want X using the remote as a keyboard as well. The above lines explicitly specify the keyboard by bus ID. You can check which device your keyboard is be running:
cat /proc/bus/input/devices

At this point, reboot your machine. This will allow the newly created cx88 and lirc kernel modules to be loaded.

This is where i currently am. I’ll be updating this as i proceed in the debugging process

~~~-edits: 4:08PM CST 1/3/09

Okay 180 degree turn in strategy here. It appears that the kbd driver is somehow being assigned to the ir device. It seems when most other people have this problem it’s the Hardware Abstraction Layer of Linux, but i don’t have HAL installed, so it must be something similar, but not quite the same. Current suspect is udev. It appears that it has all to do with lircd being able to “lock” the input. Clearly this isn’t happening. It seems like all the codes in /etc/lircd.conf may need to change because of the different input interface. Also the way the kernel module works it assigned keycode to most of the bottens on the remote anyway.

It just so happens there’s another very small, simple program called inputlirc It’s very simple, but it interfaces with all the apps that lircd does, but take only one configuration file (since the buttons are already assigned codes, there’s not need for two set of files).

The program can be compiled easily by checking it out of subversion:

svn co http://svn.sliepen.eu.org/inputlirc/trunk/
cd trunk
make


The program created is the entire inputlirc system. Further updates (and the .lircrc file) i end up using once i’m done.

Web pages with useful or related information:

http://www.pchdtv.com/forum/viewtopic.php?t=1529
http://www.mythtv.org/wiki/index.php/LIRC
http://ubuntuforums.org/showthread.php?t=985311
http://parker1.co.uk/mythtv_tips.php
http://ubuntuforums.org/showthread.php?t=678835

~ by lucidity on January 3, 2009.

Leave a Reply