I recently bought a dual tuner card for my Mythtv box (and I discussed getting it working with mythtv here). The good news is that the IR receiver on the card is detected by the driver, however the bad news is that the remote does not work out of the box with Ubuntu 11.10 because Ubuntu doesn't have a keymap for it. You can see in the dmesg output that it loads the default rc-empty keymap:
[ 31.058541] Registered IR keymap rc-empty [ 31.058604] input: IR-receiver inside an USB DVB receiver as /devices/pci0000:00/0000:00:1e.0/0000:05:01.2/usb3/3-1/rc/rc0/input4 [ 31.058713] rc0: IR-receiver inside an USB DVB receiver as /devices/pci0000:00/0000:00:1e.0/0000:05:01.2/usb3/3-1/rc/rc0 [ 31.058716] dvb-usb: schedule remote query interval to 500 msecs.
So I sorted it out by creating my own keymap - its still a bit of a work in progress as I have no idea what functions some of the pictures on the buttons represent! To create the keymap, I used the programme evtest to capture the scancodes generated by the remote. I then added the scancode to a file and mapped it to a sensible looking event which I chose from this list (see also this one). I saved my keymap in the /etc/rc_keymaps directory and inserted it (I first closed mythtv and switched out of X to a terminal with ctrl-alt-F2 to ensure that no application had the event device open).
frankster@mythtv:/etc/rc_keymaps$ sudo ir-keytable -c -p NEC -w kworld_pc160-2t Read kworld_pc160-2t table Old keytable cleared Wrote 30 keycode(s) to driver Protocols changed to NEC
I then verified my keymap was working with ir-keytable. Now we receive as well as the scancode, a key up and down event every time a button is pressed.
frankster@mythtv:/etc/rc_keymaps$ sudo ir-keytable -t Testing events. Please, press CTRL-C to abort. 1329667198.608627: event MSC: scancode = 866b00 1329667198.608631: event key down: KEY_NUMERIC_1 (0x0201) 1329667198.608632: event sync 1329667198.859974: event key up: KEY_NUMERIC_1 (0x0201) 1329667198.859975: event sync
Its all very well being able to manually install the keymap, but we need to make this a bit more permanent. I am currently preparing a kernel patch so that this remote control can be handled automatically, but for now we can achieve the same effect in userspace. I added to /etc/rc_maps.cfg the following line:
af9015 * /etc/rc_keymaps/kworld_pc160-2t
ir-keytable could then load the appropriate keytable.
sudo ir-keytable -a /etc/rc_maps.cfg
This is the keymap I am currently using, I expect I will do some more tweaking as time goes on.
# table kworld_pc160-2t, type: NEC 0x866b1d KEY_POWER #0x866b0x kworld log button - not sure what this does #0x866b16 button between kworld button and power button 0x866b0a KEY_NUMERIC_0 0x866b00 KEY_NUMERIC_1 0x866b01 KEY_NUMERIC_2 0x866b02 KEY_NUMERIC_3 0x866b03 KEY_NUMERIC_4 0x866b04 KEY_NUMERIC_5 0x866b05 KEY_NUMERIC_6 0x866b06 KEY_NUMERIC_7 0x866b07 KEY_NUMERIC_8 0x866b08 KEY_NUMERIC_9 #0x866b09 some kind of reload symbol 0x866b14 KEY_MUTE #0x866b1e small rectangle and big rectangle #0x866b17 fullscreen? 0x866b1f KEY_HOME 0x866b0e KEY_BACK 0x866b20 KEY_UP 0x866b21 KEY_DOWN 0x866b42 KEY_LEFT 0x866b43 KEY_RIGHT 0x866b0b KEY_ENTER 0x866b10 KEY_CHANNELUP 0x866b11 KEY_CHANNELDOWN 0x866b12 KEY_VOLUMEDOWN 0x866b13 KEY_VOLUMEUP #0x866b19 scheduled recording? 0x866b1b KEY_RECORD 0x866b4b KEY_EPG 0x866b1a KEY_STOP 0x866b44 KEY_PLAYPAUSE 0x866b40 KEY_BACK 0x866b41 KEY_FORWARD #0x866b22 Tx button #0x866b15 looks like some kind of transmit or infrared symbol #0x866b0f widescreen? #0x866b1c screenshot? 0x866b4a KEY_SLEEP