lirc – gentoo – devinput
I’ve been using linux infrared remote control (lirc) for a while in Gentax, i.e. I have a remote control and I use that to change channels in mythtv. When I first started using it, it was a pain to configure. For the last 2 years or so it has for the most part just worked. Recently there have been a number of changes to put it into the kernel and make things better going forward. The biggest change is that the most popular drivers were moved into the kernel so in order to get a device working it can be as easy as selecting it in the kernel config and compiling it. The kernel actually does 2 things now it supports the device and it can use the device using its built in event subsystem. If you have a really simple setup with a popular remote you shouldn’t actually need any additional packages at least in Gentoo like inputlircd or lircd since the kernel can handle it all. However as I recently found out if you have any complexity then it can be a pain to figure out whats going on.
My problem is that I wanted to use the ir blaster as well since I am now using a digital cable box and I needed mythtv to control it. First, devinput / event / input subsystem does not support the ir blaster functionality so you shouldn’t use that if you want things to work. Secondly the kernel is now building the device driver, so in gentoo compiling lirc with mceusb does nothing. Thirdly the order that the kernel loads the drivers determines whether it works or not.
The way to get gentoo lirc to support the device with ir blaster is to build it with the “userspace” device. I was getting key-map not recognized errors in dmesg, to fix that I built into the kernel the following and built my device as a module to ensure it loads after correctly. I also saw another site that makes you blacklist it at load and then force load it in the correct order but this is simpler and more likely to work going forward.
Compile Remote Controller Keymap modules,
Enable IR raw decoder for RC6 protocol – for my vista mceusb remote,
Enable IR to lirc bridge – to allow lirc to use the device and create the /dev/lirc0 device
It is working perfectly now and I was finally able to get it working after a couple days and multiple sources of information. I will post my setup and config below. These sites were helpful for me.
http://www.mythtv.org/wiki/MCE_Remote
http://www.mythtv.org/wiki/LIRC#Gentoo
http://en.gentoo-wiki.com/wiki/LIRC
My current setup as of Oct 2011 is vista mceusb remote that came with a HVR1600 in Gentoo 2.6.39 and lirc-0.9.0.
make.conf
INPUT_DEVICES="keyboard mouse lirc evdev" LIRC_DEVICES="userspace"
.config - Kernel config
# Multimedia drivers # CONFIG_RC_CORE=y CONFIG_LIRC=y CONFIG_RC_MAP=y # CONFIG_IR_NEC_DECODER is not set # CONFIG_IR_RC5_DECODER is not set CONFIG_IR_RC6_DECODER=y # CONFIG_IR_JVC_DECODER is not set # CONFIG_IR_SONY_DECODER is not set # CONFIG_IR_RC5_SZ_DECODER is not set CONFIG_IR_LIRC_CODEC=y # CONFIG_IR_ENE is not set CONFIG_IR_IMON=m CONFIG_IR_MCEUSB=m # CONFIG_IR_ITE_CIR is not set # CONFIG_IR_NUVOTON is not set # CONFIG_IR_STREAMZAP is not set # CONFIG_IR_WINBOND_CIR is not set CONFIG_RC_LOOPBACK=m
conf.d lircd
LIRCD_OPTS="-d /dev/lirc0"