For those of you who were following my MythTV saga from a few posts ago, I am happy to report that as of tonight, all the buttons on my remote control now work from within MythTV. How much work required though really offers some more insight as to how badly broken usability in Linux is.
Originally, I thought I would be able to take advantage of the fact that the kernel knows what remote control ships with the device and is automatically generating input events by default (assuming you remove the cx88-ir driver from the hald blacklist). So for example, when I hit the “Channel Up” button on the remote, a KEY_CHANNELUP input event was being generated. Unfortunately, MythTV doesn’t understand any of these input events that are Linux specific. Myth relies on a table of input events provided by the QT library, which provides a common portability layer (at the cost of only offering the lowest common denominator). Hence, even though my remote control was detected by the kernel, and unique events were being generated for each key, there was no way for MythTV to identify the events.
I could probably make it work if I were willing to extend the MythTV source to know how to handle non-standard events (and I might still do that in the future). If such work were done, MythTV would start to “just work” with all of the remotes that are shipped with tuner products by default.
So I ditched that idea and figured I would go with the lirc approach. When I had tried running “gnome-configure-lirc” previously, it had failed to show my cx88 card in the list. But now that I had removed it from the hald blacklist, now it showed up properly. I selected the cx88 and specified the “Hauppauge silver/black remote” I had kicking around.
I saved the configuration and exited the program, but at that point the lircd service would not start, claiming that it could not load the kernel modules. It turns up the default lircd configuration file specifies two single quotes (”) as the name of the modules to load, and says that loading of the lirc kernel module is required, even though my device uses the inputdev interface. Edit the configuration file to say that no modules need to be loaded, retry, and find that now it’s complaining that it cannot open device profile (”), since the gnome-configure-lirc also doesn’t bother pointing lirc at the remote control configuration I had just created. More edits to the configuration, and now the lircd daemon *finally* starts.
I run the “irw” test utility and start whacking buttons on the remote, and it is showing the correct info for *most* of the buttons. However, several buttons fail to register at all, like the “OK” and “Back/Exit” button, both of which are fairly important. So now I’m running “irrecord”, a handy little command line application for mapping buttons to keys that, from the crappy usability, you would think was written by a twelve-year-old. You’re expected to know the exact names of the input mappings in advance, or else you have to run “irrecord –list-namespace” in a separate window to dump out the list. Oh, and it doesn’t do incremental updates properly so if you run the program twice it proceeds to trash out whatever keys you defined previously (forcing you to output to a temp file and merge the results by hand with a text editor).
It’s worth noting that the remote control profile setup by gnome-configure-lirc *does* have mappings for the buttons in question – they just don’t match what is actually being generated by my remote control for whatever reason.
I get past *that* point and now irw is showing the correct buttons, but MythTV doesn’t work still. It turns up at some point “mythbuntu-lirc-generator” got run, creating a profile based on a different remote control. It’s not quite clear to me what sort of black magic this program does to setup MythTV, but after digging through the frontend logfile it became clear that I needed to run it again.
In total, I spent about 90 minutes fumbling around before I finally got it all to work. There is clearly considerable room for improvement in this process. In fact, one might argue that it’s pretty pathetic how much work was required given it’s an extremely popular card and I couldn’t even get it to work with the stock remote that shipped with it.
At least my fiance can now finally use the MythTV box in my living room without having to know the esoteric commands like how the left and right bracket  keys on the keyboard control the volume.