Forum
[Howto] mceusb driver with lirc protocol instead of rc-6/devinput - Printable Version

+- Forum (http://forum.xbian.org)
+-- Forum: Hardware (/forum-7.html)
+--- Forum: Remotes and CEC support (/forum-26.html)
+--- Thread: [Howto] mceusb driver with lirc protocol instead of rc-6/devinput (/thread-2003.html)

Pages: 1 2


[Howto] mceusb driver with lirc protocol instead of rc-6/devinput - teekay - 12th Jan, 2014 11:25 PM

Hi,

I'm brand new to XBian - really good work, guys. I migrated XBMC from my zaphod headed main box to a RPi (in order to get rid of the HDMI cable across the living room doorstep)

One thing that bugged me on the main box already back when I set it up was the fact that the LIRC devinput driver caused some laggyness with my mceusb receiver.

Hardware used:
- USB Formosa21 eHome Infrared Transceiver
- Logitech Harmony 650

Symptoms with devinput:
- first button press is ignored very often when the remote hasn't been used for some minutes/hours
- huge lags on key repeats every now and then

Solution:
Use mceusb driver with the lirc protocol instead of rc-6 via the input event layer.

This also fixes (see comments below):
- Microsoft MCE 1039 remote unmapped keys

These are the steps needed:

1. Edit /etc/lirc/hardware/custom.conf (this gets sourced by the main hardware.conf and takes precedence if at least one of the variables in there is uncommented and not empty)
Code:
#DRIVER="" # do _not_ set devinput here
DEVICE="/dev/lirc0"
MODULES="lirc_dev mceusb ir_lirc_codec"

echo lirc > /sys/class/rc/rc0/protocols

2. Edit /etc/lirc/lircd.conf and add at the top:
Code:
include "/etc/lirc/remotes/mceusb.conf"

3. Restart lirc and xbmc
Terminal
# service lirc restart
# service xbmc restart

Took me about an hour to find out how this needs to be set up in XBian. Dead simple, actually.
My remote feels a lot snappier now.

Hope it helps others with USB MCE receivers, too.


RE: [Howto] mceusb driver with lirc protocol instead of rc-6/devinput - sievo - 22nd Jan, 2014 08:01 AM

Thank you!

After quite a bit of searching, this is exactly what I needed to get my Microsoft MCE 1039 remote to work with Xbian. There were a few other posts on the forums about this particular remote, but not many clear solutions (though this post looks equivalent).

It worked OOTB with Xbmcbuntu, so I assumed it would here too. Although the key mapping is a little different (I may still look into modifying it), it now works flawlessly! Until now only arrows and enter worked.


RE: [Howto] mceusb driver with lirc protocol instead of rc-6/devinput - teekay - 23rd Jan, 2014 05:45 AM

Glad it helped you!

The keymapping was a little different here too, compared to my Arch main box. But as I was using a custom Lircmap.xml anyway, I just copied it over and edited the few changed keys in there. Another way would be to copy over the lircd.conf file from your Xbmcbuntu install to /etc/lirc/remotes/ under a new name, and either include it in the main lircd.conf or specify it in hardware/custom.conf.

Oh, and I realized that this setup somehow doesn't survive a reboot, so I have to restart lirc and xbmc services manually after boot. But I have no idea why that happens.


RE: [Howto] mceusb driver with lirc protocol instead of rc-6/devinput - mk01 - 25th Jan, 2014 05:33 PM

@teekay

so you mean XBMC starts faster than LIRC?


RE: [Howto] mceusb driver with lirc protocol instead of rc-6/devinput - teekay - 25th Jan, 2014 06:53 PM

@mk01: no, it's more like: lircd does start, but the hardware/custom.conf isn't sourced from main hardware.conf at boot.
/sys/class/rc/rc0/protocols shows rc-6 as active, and the lircd process has --driver=devinput.

Manually restarting lirc afterwards works fine.


RE: [Howto] mceusb driver with lirc protocol instead of rc-6/devinput - mk01 - 26th Jan, 2014 12:49 AM

so maybe ir-keytable taking care ?

put the keytable module into blacklist.

ir-keytable will show you which module it is. then edit any file in /etc/modprobe.d/ having line "blacklist my_rc_6_module"


RE: [Howto] mceusb driver with lirc protocol instead of rc-6/devinput - sievo - 28th Jan, 2014 05:28 AM

Not sure I'm quite following. The ir-keytable command returns:
Terminal
xbian@xbian ~ $ ir-keytable
Found /sys/class/rc/rc0/ (/dev/input/event0) with:
Driver mceusb, table rc-rc6-mce
Supported protocols: NEC RC-5 RC-6 JVC SONY SANYO LIRC other
Enabled protocols: RC-6
Repeat delay = 500 ms, repeat period = 125 ms

I tried adding "blacklist mceusb" to /etc/modprobe.d/xbian.conf then rebooting and now the remote doesn't work at all
Terminal
xbian@xbian ~ $ ir-keytable
/sys/class/rc/: No such file or directory

I also tried blacklisting rc-rc6-mce without any effect. What exactly is the module to blacklist?


RE: [Howto] mceusb driver with lirc protocol instead of rc-6/devinput - teekay - 28th Jan, 2014 05:55 AM

Blacklisting anything codec/decoder whise but ir_lirc_codec does the trick here. Thanks @mk01.

@sievo: don't blacklist the mceusb driver, as that is the main driver for the device. Just blacklist all the ir_rc*_decoder etc like:
Code:
# cat /etc/modprobe.d/lirc.conf
blacklist ir_mce_kbd_decoder
blacklist ir_sony_decoder
blacklist ir_nec_decoder
blacklist ir_jvc_decoder
blacklist ir_sanyo_decoder
blacklist ir_rc5_decoder
blacklist ir_rc6_decoder
blacklist rc_rc6_mce



RE: [Howto] mceusb driver with lirc protocol instead of rc-6/devinput - mk01 - 3rd Feb, 2014 06:22 PM

@teekay

ok, as we have a solution, would you be so kind and create new post, small how-to with short step-by-step summary of all this being told?

I will make the post sticky and lock.

would you?

thanks!


RE: [Howto] mceusb driver with lirc protocol instead of rc-6/devinput - teekay - 3rd Feb, 2014 08:06 PM

I'm not sure yet if the solution is valid. I rebootet the box a few times, and it seems that blacklisting sometimes works, sometimes not.
I mean all ir protocol/codec modules are loaded despite the blacklist config. No idea were to look at in te module-init tools/upstart corner.

What seems to be working constantly is moving the
Code:
echo lirc > /sys/class/rc/rc0/protocols
to /etc/rc.local

Maybe someone could confirm this before we turn it into a locked sticky thread. Also, wouldn't the wiki be a better place for something like this?


RE: [Howto] mceusb driver with lirc protocol instead of rc-6/devinput - mk01 - 4th Feb, 2014 02:06 AM

look also at

/etc/rc_maps.cfg

it is association list - so if a module X is loaded - keymaps are loaded automaticaly.
(and this is not happening via modprobe but ir-keytable). you have to disable module or delete mapping.


RE: [Howto] mceusb driver with lirc protocol instead of rc-6/devinput - _JJ_ - 3rd Apr, 2014 07:00 PM

Same issue here. Some keys on the remote work, some don't and some take multiple presses before something happens. (HP MediaCenter IR receiver with generic MCE remote) It stopped working somewhere in the process of upgrading from Beta 2 to RC1 and all updates after. No idea when. Followed most items in this thread to fix it but with a couple of changes:

This did nothing for me:
Code:
# cat /etc/modprobe.d/lirc.conf
blacklist ir_mce_kbd_decoder
blacklist ir_sony_decoder
blacklist ir_nec_decoder
blacklist ir_jvc_decoder
blacklist ir_sanyo_decoder
blacklist ir_rc5_decoder
blacklist ir_rc6_decoder
blacklist rc_rc6_mce

This did nothing for me (in rc.local)
Code:
echo lirc > /sys/class/rc/rc0/protocols

This worked for me (add to /etc/udev/rules.d/99-input.rules. Adapted from http://forum.xbmc.org/showthread.php?tid=141868 )
Code:
ACTION=="add|change", SUBSYSTEM=="rc", RUN+="/usr/bin/ir-keytable -s $name -c -p LIRC"

JJ


RE: [Howto] mceusb driver with lirc protocol instead of rc-6/devinput - mk01 - 3rd Apr, 2014 07:37 PM

@_JJ_

so using kernel mapper to emulate LIRC interface on IR receiver and then use of default lirc service ?


RE: [Howto] mceusb driver with lirc protocol instead of rc-6/devinput - ditschi - 9th Jul, 2014 06:38 PM

Thanks, with the guide from post#1 I got my MCE remote working.

I still these Problems are left:
- After every reboot the remote receiver is not available (and echo lirc > /sys/class/rc/rc0/protocols fails because /sys/class/rc/rc0/protocols doesn't exists) - I have to unplug and replug the USB on my PI after every boot to make the ir being recognized

- I have to enter the echo ... command manually after I replugged the IR Receiver - rc-6 is set as default every time
How can i set lirc as default service for ir? or How to automatically execute the echo when IR is connected?

- "ir-keytable -t" isn't showing any events regardless if lirc or rc-6 is selected.
ir-keytable output shows that remote is recognized:
Code:
$ ir-keytable
    Found /sys/class/rc/rc0/ (/dev/input/event0) with:
    Driver mceusb, table rc-rc6-mce
    Supported protocols: NEC RC-5 RC-6 JVC SONY SANYO LIRC other
    Enabled protocols: LIRC
    Repeat delay = 500 ms, repeat period = 125 ms



RE: [Howto] mceusb driver with lirc protocol instead of rc-6/devinput - Yoda - 9th Jul, 2014 11:03 PM

I have been struggling with this for several days as well.

Firstly I have very limited Linux knowledge so I not sure exactly what is going on. Confused

I do not have a usb receiver but I have a TSOP34838 receiver wired to the GPIO pins of the Raspberry Pi. To get that to work I first had to add lirc_rpi gpio_in_pin=18 to “/etc/modules”

Then I followed the opening post. This made my remote work. However it stopped working after a reboot.
Then I edited “/etc/default/xbmc” and added WAITFOR="lircd"
Now after a reboot it survives. (I have rebooted several times today)
As mentioned I have limited Linux experience so I cannot tell you exactly what I did. I think xbmc now waits until lirc is started before it continues to start???

Also when I do not use the: echo lirc > /sys/class/rc/rc0/protocols line, it still works fine for me.