2012-10-03, 09:35
I normally run XBMC under Win 7, but I decided to take XBMCbuntu out for spin.
The MCE Remote works out of the box, but the MCE Keyboard was stone dead (well the remote keys worked, but not all the other keys...).
After some intense googling I found a solution;
XBMCbuntu is based on Ubuntu11.10, and the kernel in 11.10 does not include the required support for the MCE keyboard. (Included in 12.04 and later).
So first install the MCE keyboard support:
Now you should se an entry in dmesg (after reboot) similar to this.
However the MCE keyboard is still not working.
Install ir-keytable (apt-get install ir-keytable) and do:
Note that LIRC is the only enabled protocol, to have the MCE keyboard working RC-6 needs to be enabled as well.
Enable RC-6, and keep LIRC since the MCE Remote is using lirc.
The "-c" is added to clear already added keymappings (done from /lib/udev/rules.d/40-ir-keytable.rules). Having both LIRC and keymapping via ir-keytable would result in double key presses.
The MCE keyboard should now work!
Now to the tricky part. To persist the above change during reboots I decided to add a udev rule.
Add the following to /etc/udev/rules.d/90-mce-ir.rules:
However, after a restart the only enabled protocol was still LIRC :-(
After hours of trouble shooting a came to the conlclusion that the udev rule was correct but the protocol is reset to LIRC by the init script for lircd. The init script is called from
/lib/udev/rules.d/85-lirc.rules, which is run before my script. The init script is also called from somewhere else, which I can't find (if someone know, please post).
EDIT: The udev rule stops and restarts lirc. The lirc init script then does something that triggers the udev rule yet again. Lirc is also started as normal via init. Seems to be a mess...
So the solution was a hack in /etc/init.d/lirc, change the in_kernel_support method to the following:
The init script will now only add LIRC to the enabled protocols when started.
Now the MCE keyboard should finally work after a reboot as well, and if you disconnect/connect the ir-receiver.
Note in this setup we use both ir-keytable and lirc. There is really no use to keep lirc, but it requires that all remote keys are mapped with ir-keytable instead. There are lot of information about this on the forum.
References:
http://www.foosel.org/linux/htpc
https://launchpad.net/~jon-hedgerows/+ar...rc-mod-mce
http://forum.xbmc.org/showthread.php?tid=101151
and README files for udev and ir-keytable
The MCE Remote works out of the box, but the MCE Keyboard was stone dead (well the remote keys worked, but not all the other keys...).
After some intense googling I found a solution;
XBMCbuntu is based on Ubuntu11.10, and the kernel in 11.10 does not include the required support for the MCE keyboard. (Included in 12.04 and later).
So first install the MCE keyboard support:
Code:
apt-add-repository ppa:jon-hedgerows/lirc-mod-mce
apt-get update
apt-get install ir-mce-kbd-decoder-dkms # this will fail due to a bug in the postinst script
dkms add -m ir-mce_kbd-decoder -v 3.1
dkms install -m ir-mce_kbd-decoder -v 3.1
Now you should se an entry in dmesg (after reboot) similar to this.
Code:
[ 9.425749] input: MCE IR Keyboard/Mouse (mceusb) as /devices/virtual/input/input8
However the MCE keyboard is still not working.
Install ir-keytable (apt-get install ir-keytable) and do:
Code:
ir-keytable
Note that LIRC is the only enabled protocol, to have the MCE keyboard working RC-6 needs to be enabled as well.
Enable RC-6, and keep LIRC since the MCE Remote is using lirc.
Code:
ir-keytable -c -p LIRC,RC-6
The "-c" is added to clear already added keymappings (done from /lib/udev/rules.d/40-ir-keytable.rules). Having both LIRC and keymapping via ir-keytable would result in double key presses.
The MCE keyboard should now work!
Now to the tricky part. To persist the above change during reboots I decided to add a udev rule.
Add the following to /etc/udev/rules.d/90-mce-ir.rules:
Code:
ACTION=="add|change", SUBSYSTEM=="rc", RUN+="/usr/bin/ir-keytable -s $name -c -p LIRC,RC-6"
However, after a restart the only enabled protocol was still LIRC :-(
After hours of trouble shooting a came to the conlclusion that the udev rule was correct but the protocol is reset to LIRC by the init script for lircd. The init script is called from
/lib/udev/rules.d/85-lirc.rules, which is run before my script. The init script is also called from somewhere else, which I can't find (if someone know, please post).
EDIT: The udev rule stops and restarts lirc. The lirc init script then does something that triggers the udev rule yet again. Lirc is also started as normal via init. Seems to be a mess...
So the solution was a hack in /etc/init.d/lirc, change the in_kernel_support method to the following:
Code:
in_kernel_support() {
if [ -d /sys/class/rc ]; then
for file in `find /sys/class/rc/*/ -name protocols`; do
if [ "$1" = "disable" ]; then
echo "+lirc" > $file
fi
done
fi
}
The init script will now only add LIRC to the enabled protocols when started.
Now the MCE keyboard should finally work after a reboot as well, and if you disconnect/connect the ir-receiver.
Note in this setup we use both ir-keytable and lirc. There is really no use to keep lirc, but it requires that all remote keys are mapped with ir-keytable instead. There are lot of information about this on the forum.
References:
http://www.foosel.org/linux/htpc
https://launchpad.net/~jon-hedgerows/+ar...rc-mod-mce
http://forum.xbmc.org/showthread.php?tid=101151
and README files for udev and ir-keytable