Kodi Community Forum

Full Version: Lircmap.xml seems to be ignored
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I've been fighting with this for over a week, and it's really driving me nuts. I've gone through many guides, wiki pages, forum posts and can't seem to find the right combination to work for me.

I have a fresh install of Ubuntu 16.04.01 (kernel 4.4.0-59-generic) with Kodi 17.0-RC3 Git:20170119-nogitfound running on a Haswell NUC.

After following the notes on the NUC wiki page, most of the buttons work OK by default, but a few important ones do now. If I can get the procedure down for remapping one key, I'm sure I could handle the rest myself. I'm just using the kernel builtin support, no lirc is installed.

Here is my ir-keytable output:
Code:
Found /sys/class/rc/rc0/ (/dev/input/event7) with:
        Driver nuvoton-cir, table rc-rc6-mce
        Supported protocols: unknown other lirc rc-5 jvc sony nec sanyo mce-kbd rc-6 sharp xmp
        Enabled protocols: lirc rc-6
        Name: Nuvoton w836x7hg Infrared Remote
        bus: 25, vendor/product: 1050:00c3, version: 0x0033
        Repeat delay = 500 ms, repeat period = 125 ms

First, I'm fighting to get the menu button on the remote working.

ir-keytable -t output:
Code:
1485007442.439068: event type EV_MSC(0x04): scancode = 0x800f040d
1485007442.439068: event type EV_KEY(0x01) key_down: KEY_MEDIA(0x00e2)
1485007442.439068: event type EV_SYN(0x00).
1485007442.667915: event type EV_MSC(0x04): scancode = 0x800f040d
1485007442.667915: event type EV_SYN(0x00).
1485007442.917075: event type EV_KEY(0x01) key_up: KEY_MEDIA(0x00e2)
1485007442.917075: event type EV_SYN(0x00).

Entry I added in ~/.kodi/userdata/Lircmap.xml (complete copy here)
Code:
<lircmap>
        <remote device="mceusb">
...
                <menu>KEY_MEDIA</menu>
...
       </remote>
</lircmap>

kodi.log debug output (complete log here)
Code:
10:10:46.366 T:139774570330496   DEBUG: Keyboard: scancode: 0xea, sym: 0x00b9, unicode: 0x0000, modifier: 0x0
10:10:46.366 T:139774570330496   DEBUG: OnKey: launch_media_center (0xf0c3) pressed, action is

In the kodi.log it is reading as "launch_media_center" with no associated action. What else do you need to know or what should I try?

Thank you!!!

~Whysyn

Edit: More details on my setup.
I stumbled probably into the same problem.

I've just upgraded from Jarvis to Kodi 17.0-RC3 and my remote control stopped working inside of Kodi. I didn't change anything of the config.

I'm using inputlirc with an iMon Soundgraph receiver. When I link /dev/lircd to /var/run/lirc/lircd and start irw, I can catch the signals in the console:

Code:
67 0 KEY_UP irremote
6c 0 KEY_DOWN irremote
69 0 KEY_LEFT irremote
6a 0 KEY_RIGHT irremote
1c 0 KEY_ENTER irremote

Kodi recognizes the device at startup:
/home/xbmc/temp/kodi.log
Code:
00:44:53.356 T:139880623068928  NOTICE: Register - new imon device registered on usb->/sys/devices/pci0000:00/0000:00:1d.1/usb3/3-2: iMON HID device (15C2:0036)

/home/xbmc/userdata/Lircmap.xml
Code:
<remote device="irremote">
        <left>KEY_LEFT</left>
        <right>KEY_RIGHT</right>
        <up>KEY_UP</up>
        <down>KEY_DOWN</down>
        <select>KEY_ENTER</select>

Inside the settings dialog (System->Input) the device is shown as IMON HID DEVICE. But I can't configure anything.

But for some reason, nothing happens If I press any button on the remote control.

Update: some one else with the same problem
http://forum.kodi.tv/showthread.php?tid=296932

Update 2:
Tried to start Kodi not as standalone but from an existing X-Session according to this thread: http://forum.kodi.tv/showthread.php?tid=298276
But didn't help too. The remote control didn't give me any feedback in Kodi.
Strange thing in my case is the arrows, OK button, numbers, etc. all work, I just can't seem to remap the buttons that don't work (Menu, Info, Guide, etc). It worked perfectly on my Kodibuntu system, even under 17.0 RC1, but I did a fresh install of Ubuntu 16.04 with 17.0 RC3 from ppa because I was having an issue with PVR addons... Really wish I'd have taken an image of the system before I wiped it. At this point I, and the misses especially, would much rather have a usable remote than PVR.

Edit: typos
@OP - Use lirc and disable the native support. See my sig for a guide using different hardware.
@graysky - None of the guides I used mentioned blocking the input devices in X11 - that was the magic sauce I needed to get rid of double key presses when using lirc. Switching back to lirc and giving it a go again.

Thank you!
Progress but not perfect... If I run irw I can see commands are being received, however Kodi is not getting them at all. If I enable debug logging in kodi then tail the file nothing comes up when I press buttons.

Here's a new debug log, I'm not sure what to look for other than it sees and connects to lirc.
http://pastebin.com/ZQ9QjGwY

Any other info needed I'll gladly provide. I feel like I'm getting there.
Should I jump to a new thread since this is a different issue now?
(2017-01-22, 13:04)graysky Wrote: [ -> ]@OP - Use lirc and disable the native support. See my sig for a guide using different hardware.
Any reason for this recommendation? Inputlirc has worked for years now without any problems. And moreover inputlirc has been developed as the successor of lirc. The big advantage is, that you receive the commands as simple input events. There's no need for any userspace configuration anymore.

(2017-01-22, 15:51)whysyn Wrote: [ -> ]Progress but not perfect... If I run irw I can see commands are being received, however Kodi is not getting them at all. If I enable debug logging in kodi then tail the file nothing comes up when I press buttons.
So we are more or less on the same state. As I wrote above: If I link /var/run/lirc/lircd to /dev/lircd I receive the the remote control commands with irw. Only Kodi isn't evaluating them.

Due to the fact, that it worked perfectly in Kodi-16.x there seem 3 things possible to me:
  • It's a bug or
  • The expected location of Lircmap.xml has been changed or
  • The expected syntax of the Lircmap.xml has been changed

Found something related on Github:
https://github.com/xbmc/xbmc/pull/10993
It worked out of the box on Kodi 16.x, and when that system was upgraded to Kodi 17 RC1 it still worked. It was running Kodibuntu so based on Ubuntu 14.04 LTS I believe. I'm now on a fresh install of Ubuntu 16.04. If irw sees the keypresses and Kodi says it's attaching to lirc I don't understand why Kodi doesn't see the keypresses.

I'm willing to give inputlirc a shot, but I'm not sure what documentation to follow. I've tried so many things the past 10 days and I know I tried inputlirc but I don't remember what my problem was with it.

Alternatively if I just use the built-in kernel handling for IR, Lircmap doesn't seem to apply... is that expected behavior? If so how do I remap actions for buttons that are useless out of the box?
Drop inputlirc. Tried to get it working again, but failed in every single part.

But I got a step forward with another approach:
https://wiki.ubuntuusers.de/Kodi_Remote/ (it's in German). I'll try to make the story short:

  1. install v4l-utils, if not already done. You need the command: ir-keytable and the keymaps in /lib/udev/rc_keymaps.
  2. stop lirc, inputlirc services, if started
  3. Check, if your device is recognized with:
    Code:
    ir-keytable
    The output looks like
    Code:
    Found /sys/class/rc/rc0/ (/dev/input/event13) with:
        Driver imon, table rc-imon-pad
        Supported protocols: other rc-6
        Enabled protocols: other
        Name: iMON Remote (15c2:0036)
        bus: 3, vendor/product: 15c2:0036, version: 0x0002
        Repeat delay = 500 ms, repeat period = 125 ms
  4. Check the supported protocols: (in my case: other, rc-6)
    Code:
    ir-keytable -c -t
    Your goal is to get an output like this:
    Code:
    Protocols changed to other
    Testing events. Please, press CTRL-C to abort.
    1485301915.439880: event type EV_MSC(0x04): scancode = 0x2000022
    1485301915.439880: event type EV_KEY(0x01) key_down: KEY_NUMERIC_5(0x0205)
    1485301915.439880: event type EV_SYN(0x00).
    1485301915.607838: event type EV_KEY(0x01) key_up: KEY_NUMERIC_5(0x0205)
    1485301915.607838: event type EV_SYN(0x00).
    1485301915.815802: event type EV_MSC(0x04): scancode = 0x2000022
    1485301915.815802: event type EV_KEY(0x01) key_down: KEY_NUMERIC_5(0x0205)
  5. Copy the matching keymap (listed in ir-keytable above):
    Code:
    cp /lib/udev/rc_keymaps/imon_pad /etc/rc_keymaps/imon_pad
  6. Activate the keytable:
    Code:
    ir-keytable -c -w /etc/rc_keymaps/imon_pad

if you now start kodi, at least the cursor keys should work. To make the activation persistent, you could put that stuff into a systemd unit (/etc/systemd/system/ir-keytable.service):
Code:
[Unit]
Description=Activate Keytable

[Service]
ExecStart=/usr/bin/ir-keytable -c -w /etc/rc_keymaps/imon_pad

[Install]
WantedBy=multi-user.target
and enable it. (systemd daemon-reload; systemd enable ir-keytable.service, systemd start ir-keytable)

That's the half way. Unfortunately Kodi didn't accept the defined keys. And instead of the keycodes defined in the keymap, I get something like this:
Code:
01:46:32.656 T:140251637356864   DEBUG: Keyboard: scancode: 0xa2, sym: 0x1008ff7f, unicode: 0x0000, modifier: 0x0
01:46:32.657 T:140251637356864   DEBUG: GetActionCode: Trying Hardy keycode for 0xf200
01:46:32.657 T:140251637356864   DEBUG: Previous line repeats 5 times.
01:46:32.657 T:140251637356864   DEBUG: OnKey: 0 (0xf200, obc-61697) pressed, action is

I suspect, Kodi doesn't use the Lircmap.xml but expects something like a keyboard. Not sure. Will investigate in the next days.
You're at the exact point I started from: kernel handling IR, only a few of the buttons work, and when it's set that way Lircmap seems to be ignored. Probably have to redo quite a bit of the keyboard map... for example the <menu> item in keyboard.xml appears eight different times with a different action assigned depending upon which screen Kodi is on when its pressed. Several buttons are like this.

This just seems like such a leap backward from Lircmap allowing keyboard.xml to be used as written out of the box.

Edit: typos
The strange thing is to me:

ir-keytable -t

gives me the Keycodes, which I also addressed in Lircmap.xml. Means KEY_NUMERIC_1, KEY_MENU etc.

Activating the debug log in Kodi doesn't use this keycodes. Some keys on the remote control are ignored completely. Kodi doesn't seem to recognize those keys anyway. Some standard keys (those which worked for you too) are recognized as obc-keys (universal remote buttons).

So generally it doesn't matter, if we use inputlirc, lirc or ir-keytables. The keycodes are delivered by all backends correctly. But for some reason the keycodes are not recognized by Kodi.

Means, instead of researching lirc, inputlirc or ir-keytables something should be missing inside Kodi.

Update:
Have you tried the Keymap Editor Addon. Maybe this thing finds something, we have missed.
I can only speak to LIRC, not inputlirc. Which remote did you configure when installing LIRC? You need to use "Linux input layer", which you then refer to as <remote device="devinput"> in your Lircmap.xml. I think you're missing the correct LIRC configuration, check your /etc/lirc/hardware.conf, these are the important bits:

Code:
REMOTE="Linux input layer (/dev/input/eventX)"      # description only
REMOTE_DRIVER="devinput"                            # this connects lirc to the ir-keytable stuff
REMOTE_DEVICE="/dev/input/eventX"                   # you can do some udev wizardry to create a unique device name based on your receiver
REMOTE_LIRCD_CONF="devinput/lircd.conf.devinput"    # this tells LIRC which scancode to assign to which key

Hope that helps.
@bedouin - think this is making me worse off... ir-keytable -t sees key presses, but irw & kodi do not. Seems like a step backward from where I had irw also seeing them.

Here's my latest lirc hardware.conf:
http://paste.ubuntu.com/23880279/
After two weeks of hell, I wiped this out, installed Ubuntu 16.10 and setup from scratch. Still no dice. I updated the BIOS on my NUC and it works perfectly. D'oh!

Ubuntu 16.10, lirc, Kodi 17 RC3 and it works out of the box...
Pages: 1 2