Linux Ubuntu 17.04 lircd vs. mceusb problems
#1
I have updated my host machine to Ubuntu 17.04 and now my remote control is hardly working and I am starting to go crazy. Maybe someone can help. Here is the situation:

The new lirc version 0.9.4 has new locations for the lircd file instead of /dev/lircd it is in /var/run/lircd/lircd but Kodi seems to just load /dev/lircd.
Additionally Ubuntu now loads the mceusb kernel module which means duplicate key presses for the directional keys.
If I do not use lirc I can "navigate" in Kodi using the mceusb modules bindings but just the directional keys work, all others do not do anything in Kodi (event Enter/OK does not work).
When I symlink the new run file to /dev/lircd Kodi finds the lirc connection, but directional keys are registering double (because of mceusb and lirc triggering them).
If I remove the mceusb kernel module (via blacklist) then Kodi finds the lirc connection but all buttons are going crazy (pressing up makes it go up and up and up infinitely).
If I modprobe mceusb then, the repeated buttons suddenly stop and it will go to registering them twice for each press. If I then rmmod mceusb the lirc commands are handled correctly.
Now this means after every reboot I have to symlink /dev/lircd so kodi finds lirc, then I modproble mceusb and press the directional buttons (to basically initialize the remote device) and then rmmod mceusb after which it works. Until I need to reboot which for some reason is every few days right now.

Since mceusb correctly initializes the device, I think it could be an option to just ditch lirc altogether and switch to mceusb. But I am not sure how I can make the other buttons on the remote work for mceusb. Any help is greatly appreciated.
Reply
#2
there is a --lircdev option in kodi where you can override the lirc device.
And you can simply blacklist the mceusb module in /etc/modprobe.d
Reply
#3
You can work around this by creating a custom rc_keymap - then you don't need to use userspace lircd:

apt-get install the "ir-keytable" package, copy /lib/udev/rc_keymaps/rc6_mce (could also be in /usr/lib/udev/rc_keymaps) to /etc/rc_keymaps, edit it and change KEY_OK to KEY_ENTER.

Then either reboot or use "ir-keytable -c -w /etc/rc_keymaps/rc6_mce" to switch to your customized keymap.

Pressing "OK" on the remote will then show as a normal keyboard "enter" key in kodi.

Note: you may need to change several other buttons like channelup/down, exit as well.

so long,

Hias
Reply
#4
I tried the lircdev option and it works kind of. After a reboot the buttons are still wonky but they seem to fix themselves after some seconds. At first the directional keys will try to repeat. Much better than before but I hope this might get better in future releases. Don't know if it is a lirc or Kodi issue.

Thanks for the mceusb instructions. I might try those if I find some spare time.
Reply
#5
(2017-05-12, 14:30)HiassofT Wrote: You can work around this by creating a custom rc_keymap - then you don't need to use userspace lircd:

apt-get install the "ir-keytable" package, copy /lib/udev/rc_keymaps/rc6_mce (could also be in /usr/lib/udev/rc_keymaps) to /etc/rc_keymaps, edit it and change KEY_OK to KEY_ENTER.

Then either reboot or use "ir-keytable -c -w /etc/rc_keymaps/rc6_mce" to switch to your customized keymap.

Pressing "OK" on the remote will then show as a normal keyboard "enter" key in kodi.

Note: you may need to change several other buttons like channelup/down, exit as well.

This worked perfect for me! on a clean install of kubuntu 17.04 and kodi, my usb mceremote would work with the direction buttons, but not many of the other buttons, using the above method to modify the other buttons simply works and without fuss, and its the only place you have to make an edit, and then everything just works. Thank you so much for posting that solution because I had spent hours trying to follow other outdated guides for setting up lirc for kodi, and I was having nothing but issues. (I have set it up just fine with the older guides on kubuntu 16.04, but it seems things have changed since then.)

here are all the ones I changed on my mceusb remote

its weird because some keys worked without changing anything, such as KEY_PLAY but not KEY_STOP which had to be changed to KEY_X

sudo cp /lib/udev/rc_keymaps/rc6_mce /etc/rc_keymaps/
sudo nano /etc/rc_keymaps/rc6_mce
Code:
    OLD                NEW

    KEY_OK            KEY_ENTER
    KEY_STOP        KEY_X
    KEY_POWER        KEY_S
    KEY_REWIND        KEY_R
    KEY_FASTFORWARD    KEY_F
    KEY_PAUSE        KEY_SPACE
    KEY_PREVIOUS    KEY_PPAGE
    KEY_NEXT        KEY_NPAGE
    KEY_INFO        KEY_I
    KEY_EXIT        KEY_BACKSPACE
    
    KEY_MEDIA        KEY_M    (windows > open menu)
    KEY_RECORD        KEY_Q    (record > add to queue)
    KEY_ENTER        KEY_Z    (extra Enter > Zoom/aspect ratio)
    KEY_PVR            KEY_A    (RecordedTV > Audio delay control)
    KEY_TUNER        KEY_T    (LiveTV > toggle subtitles)    
    KEY_EPG            KEY_L    (Guide > Next subtitle)
sudo reboot

sudo ir-keytable -t (test events, useful to find the name of the key your replacing)
Reply
#6
Hi, this worked very well for me, also! I started with a fresh Ubuntu 17.10 installation on my ASRock 330, with Kodi 17.6.
I fixed my rc6_mce file and managed to have almost all buttons working.
I have not been able to configure the MENU button to show the ContextMenu. I have tried many constants: KEY_C, KEY_EPG, KEY_MENU but none worked.

From my keyboard I can access the contextmenu with a short C press (long C press opens the side menu) or pressing the "context menu" key.
KEY_C has been tested and it does not work, I suppose because my remote cannot discriminate between short and long press, and Kodi just ignores this command. Can someone help me understand which constant value should I associate with the button to simulate the "contextmenu" key? I have been searching and searching but I cannot find anywhere an exaustive list of the constants that Kodi expects.

thank you!
Reply
#7
For the MCE USB I really recommend using the kernel input layer and no longer using lircd. I got all the buttons working this way. I enabled debug logging in kodi (settings/system) and let "tail -f kodi.log" run in a terminal. Then pressing buttons on the remote and watching for the keynames kodi recognizes. After that, you can edit your keymap.xml the way you want it. You might need an updated Lircmap.xml. I recommend grabbing the one from LibreELEC which is close to perfect. Only issue left is that the volume buttons are missing autorepeat. I found a kernel patch on the net that fixes this. If you need it, I can dig it out.
Reply
#8
(2018-01-30, 21:14)Schreibwaise Wrote: ...You might need an updated Lircmap.xml. I recommend grabbing the one from LibreELEC which is close to perfect....
 Hi thank you for your answer. Do I need the lircmap.xml even if I don't use lirc? I mean, Kodi uses this file to translate commands even if lirc is not installed and I use kernel layer?

BTW yesterday I discovered that the ContextMenu pops up also on long ok press, and that seems to work on my remote, so I have a workaround. But I still wasn't able to assign the "show context menu" command to a specific remote button.
Reply
#9
(2018-01-31, 11:21)cuginosgrizzo Wrote:  Hi thank you for your answer. Do I need the lircmap.xml even if I don't use lirc? I mean, Kodi uses this file to translate commands even if lirc is not installed and I use kernel layer?
Yes. Kodi ships with a Lircmap.xml, but the one from LibreELEC is more complete. AFAIK the additions from LibreELEC have been submitted to the kodi people, so they should show up there as well or are even already in.
Reply
#10
Thank you, copying the lircmap.xml file solved it for me!
Reply

Logout Mark Read Team Forum Stats Members Help
Ubuntu 17.04 lircd vs. mceusb problems0
This forum uses Lukasz Tkacz MyBB addons.