MCE Remote and XBMC

Getting the Hauppage MCE USB Remote KIT to to work seems to be kind of a hassle every time a new system is installed or major changes take place.
(date: March 2013)

Initial notes:
- There is no need to use LIRC. This remote has kernelmodules available and can work

    without LIRC

- Some keys on the remote work immediately, mainy navigation ( left/right) and play and pause. However, what does not work are “OK” and “Back” ( whichis annoying since without them you cant navigate :-) )
-So, the default keymapping does not match so changes are needed.

Assumption and setup:
- XBMC is installed
- The kernelmodules are installed (mine is called “ZZ REF”).
- Use a modern kernel ( mine is 3.8.4, but the kernelmodules for this MCE remote have been there since some time already so a somewhat older kernel should work as well.
- UDEV 197 (so the location of devices in /dev might be different compared with older versions of udev)
- In my case : The hardware is an early model ASROCK ION 330 (so somewhat outdated).

Install ir-keytable
We need to use ir-keymap to map the new keybindings:
emerge ir-keytable

Check if the remote is detected and works using ir-keytables:
ir-keytable -s rc1 -t
Note that rc1 might be another node in your case, for example rc0. Now press some puttons on the remote. This should give something similar to:
(none) # ir-keytable -s rc1 -t
Testing events. Please, press CTRL-C to abort.
1364276112.820767: event MSC: scancode = 800f0410
1364276112.820767: event key down: KEY_VOLUMEUP (0x0073)
1364276112.820767: event sync
1364276112.955744: event MSC: scancode = 800f0410
1364276112.955744: event sync
1364276113.202434: event key up: KEY_VOLUMEUP (0x0073)
1364276113.202434: event sync

Also, press “OK” and “BACK” and see that the codes are recognised:
(none)# ir-keytable -s rc1 -t
Testing events. Please, press CTRL-C to abort.
1364276386.608950: event MSC: scancode = 800f0422
1364276386.608950: event key down: KEY_OK (0x0160)
1364276386.608950: event sync
1364276386.742948: event MSC: scancode = 800f0422
1364276386.742948: event sync
1364276386.992447: event key up: KEY_OK (0x0160)
1364276386.992447: event sync
1364276388.535968: event MSC: scancode = 1f3f
1364276388.535968: event sync
1364276388.611966: event MSC: scancode = 800f0423
1364276388.611966: event key down: KEY_EXIT (0x00ae)
1364276388.611966: event sync
1364276388.744979: event MSC: scancode = 800f0423
1364276388.744979: event sync
1364276388.992479: event key up: KEY_EXIT (0x00ae)
1364276388.992479: event sync

Now copy the “regular” keymap to a new file (so we dont have to edit the original) :
cp /etc/rc_keymaps/rc6_mce /etc/rc_keymaps/rc6_mce_mod

Editing the rc6_mce_mod keymapfile to allow OK and BACK
Some of the buttons “just work”, but OK and BACK do not.
This has to do with the way the key-presses are translated: KEY_C means its translated to the same as pressing a C on a keyboard.
KEY_OK however has no keyboard-equivalent, so we will change the key that that specific scancode relates to to “ENTER”

- Find the scancode to “KEY_OK”:
0x800f0422 KEY_OK
Change this to :
0x800f0422 KEY_ENTER

Quit and save the modified file and load the new keyfile using ir-keytable :
ir-keytable -s rc1 -c -p RC-5,RC-6 -w /etc/rc_keymaps/rc6_mce_mod

Thats it, now the OK button sends “enters” to XBMC, making it possible to select items in the menu :-)
Check again using ir-keytable -s rc1 -t as above , pressing OK should now give “KEY_ENTER” instead of KEY_OK.

Wake On Remote Power Button
You can use the powerbutton to start the hardware from suspend (Note that it is nog possible to do a “cold” boot; suspend is needed first).

echo enabled > /sys/bus/usb/devices/2-3/power/wakeup
echo enabled > /sys/bus/usb/devices/usb2/power/wakeup


Q: – IRW doesn’t show any characters at all when I press buttons ?
A: – Well, this bothered me too… spend to many time trying to fix this, but in the end just left it (not working) since apperently my remote wirks with XBMC. No LIRC or IRW needed here….

Q: – Using ir-keytable says “Not found device rc0″
A: – Using the “-s” option lets you define where to look for the device. try both “-s rc0″ and -s rc1″ .
For example, first try ir-keytable -t

If this results in an error try some other node:

ir-keytable -s rc1 -t
ir-keytable -s rc0 -t

This entry was posted in HTPC, Linux. Bookmark the permalink.