Random notes on two player gaming on Linux in the lounge

Thursday, November 18, 2010

imon with mce remote under maverick

I upgraded my MythTV system to Maverick last week, and my remote control stopped working. I found there has been some significant work done on remote control drivers in Linux recently.

After switching to the new drivers and configuring lircd to use devinput I had the original imon remote working again.

Unfortunately I use a Harmony 670 which does not play nice with the imon's native command set. Luckily the imon receiver hardware can be set to decode Microsoft MCE (RC-6) remote commands.

Prior to Maverick, I used the "ir_protocol" option to the imon driver to set it to MCE mode. To do the same with the new drivers was slightly more complicated, and not very well documented. I thought I'd share what I did for others.

$ git clone http://linuxtv.org/git/v4l-utils.git
$ cd v4l-utils/utils/keytable
$ make
$ ./ir-keytable 
Found /sys/class/rc/rc0/ (/dev/input/event7) with:
        Driver imon, table rc-imon-pad
        Supported protocols: other      Enabled protocols: 
$ sudo ./ir-keytable -c
Old keytable cleared
$ sudo ./ir-keytable -w rc_keymaps/imon_mce
Read imon_mce table
Wrote 83 keycode(s) to driver
/sys/class/rc/rc0//protocols: Invalid argument
Couldn't change the IR protocols

It appears from the ir-keytable code that the protocol string has changed from "rc6" to "rc-6", and Maverick's backported kernel changes haven't been updated yet.
We can do the protocol change ourselves though as follows:
$ cat /sys/class/rc/rc0/protocols
$ echo rc6 | sudo tee /sys/class/rc/rc0/protocols
$ cat /sys/class/rc/rc0/protocols

The brackets indicate that the protocol has now been selected.

After all this my remote is working as it was in lucid, aside from some buttons repeating more than they should. I'll get around to looking at this one day.

Other useful links:
Ubuntu bug 666493 dealing with this issue.
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.