Media Center Remote Control

Introduction
To use an infrared remote control in gentoo, and indeed in any linux setup, the only choice used to pretty much be to use LIRC. Since version 2.3.5 however, remote control support has been added to the kernel.

This tutorial will explain how to install a usb Media Center Remote Control with the in-kernel drivers, which is arguably easier than using LIRC used to be.

Basically to use these receivers you just load the appropriate kernel modules and plug the device in. It will then appear as an input device in /dev/input and X will automatically pick up certain events, such as volume control.

Hardware
This tutorial was written using a custom compiled 2.6.38 kernel and up to date gentoo system (baselayout-2, openrc).

This was tested with two HP brand infrared receivers and corresponding remote control purchased second hand. The first receiver is a model TUTSI-IR01 (p/n 5070-2584) and the second a model OVUM400103/00.

The transmitter has RC6Ir boldly printed on the back of the battery case, and inside a sticker has RC1314619/00 (p/n 5070-1006).

Kernel configuration
Start by compiling the appropriate kernel modules. I believe you can skip this step if you use genkernel, as the modules will have already been built.

Fire up menuconfig, you may prefer gconfig:

The modules you need are found here :

Check the following options :

"Windows Media Center Ed. eHome Infrared Transceiver" this is the ir receiver driver, per se. The kernel module name is "mceusb".

"Enable IR raw decoder for the RC6 protocol" this part concerns the remote transmitter. The kernel module name is "ir_rc6_decoder".

"Compile Remote Controller keymap modules" this is a collection of keymaps for different remote controls that can be loaded as kernel modules. The module for our remote is called "rc_rc6_mce".

If you prefer you should be able to compile this directly into the kernel rather than as modules (you would then have to copy over your new kernel and reboot).

Now recompile the kernel. If you use ccache this can be quick.

If you compile the drivers directly into the kernel rather than as modules, don't forget to copy over your new kernel image to your boot partition (mount it first if need be) and reconfigure GRUB or your preferred bootloader.

Loading modules
Once the modules are compiled, you should be able to load the modules and use your remote immediately.

The order in which the modules are loaded is important. "rc_rc6_mce" and "ir_rc6_decoder" must be loaded before "mceusb".

Testing / Usage
Once your modules are loaded, you should be able to press the volume up and volume down buttons to change volume in X. The play button should pause and unpause some media players (such as totem).

Your remotes should appear as input devices in /dev/input/ (named eventX), and also in /dev/input/by-id/ as usb-Philips_eHome_Infrared_Transceiver_PH00VvIy-event-if00 and usb-TopSeed_Technology_Corp._eHome_Infrared_Transceiver_TS000E2J-event-if00 for our two devices.

If you cat these files, you should see garbage coming out of them when you press buttons on the remote.

You should even be able to set shortcuts for buttons on your remote. For example under Gnome, select "Keyboard shortcuts" from the preferences menu, you should be able to set a shortcut to the remote by editing the appropriate shortcut and pressing a button on your remote.

Automatically loading modules at boot
Add the following line to /etc/conf.d/modules to have them load at boot. If you have an older version of gentoo, you may have to use /etc/modules.autoload.d/kernel-2.6.

However, this is not enough to get them to load in the correct order. It seems that mceusb is loaded as soon as the device is detected at boot, and so will not work since the other two modules are missing (if this happens you could unload and reload the "mceusb" module to get it working again).

The solution is to blacklist the "mceusb" module so that it is not automatically loaded. Add this line to /etc/modprobe.d/blacklist.conf :

Make sure you run this :

Hardware info
Here is the output for some commands, for reference :

Here is the output from kern.log for each device when it is plugged in : usb 4-2: USB disconnect, address 2 usb 4-2: new full speed USB device using uhci_hcd and address 3 usb 4-2: New USB device found, idVendor=0471, idProduct=0815 usb 4-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 usb 4-2: Product: eHome Infrared Transceiver usb 4-2: Manufacturer: Philips usb 4-2: SerialNumber: PH00VvIy Registered IR keymap rc-rc6-mce input: Media Center Ed. eHome Infrared Remote Transceiver (0471:0815) as /devices/pci0000:00/0000:00:1d.2/usb4/4-2/4-2:1.0/rc/rc3/input9 rc3: Media Center Ed. eHome Infrared Remote Transceiver (0471:0815) as /devices/pci0000:00/0000:00:1d.2/usb4/4-2/4-2:1.0/rc/rc3 mceusb 4-2:1.0: Registered Philips eHome Infrared Transceiver on usb4:3

usb 2-2: new full speed USB device using uhci_hcd and address 5 usb 2-2: config 1 interface 0 altsetting 0 endpoint 0x1 has an invalid bInterval 0, changing to 32 usb 2-2: config 1 interface 0 altsetting 0 endpoint 0x81 has an invalid bInterval 0, changing to 32 usb 2-2: New USB device found, idVendor=1784, idProduct=0006 usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 usb 2-2: Product: eHome Infrared Transceiver usb 2-2: Manufacturer: TopSeed Technology Corp. usb 2-2: SerialNumber: TS000E2J Registered IR keymap rc-rc6-mce input: Media Center Ed. eHome Infrared Remote Transceiver (1784:0006) as /devices/pci0000:00/0000:00:1d.0/usb2/2-2/2-2:1.0/rc/rc4/input10 rc4: Media Center Ed. eHome Infrared Remote Transceiver (1784:0006) as /devices/pci0000:00/0000:00:1d.0/usb2/2-2/2-2:1.0/rc/rc4 mceusb 2-2:1.0: Registered TopSeed Technology Corp. eHome Infrared Transceiver on usb2:5