IR remotes: eventlircd interfering with longpress support?

  • I'm using a simple IR receiver hooked up to the GPIO of my RPi and it's working just fine - both with the lirc_rpi driver plus userspace lircd and with the in-kernel gpio-ir-reciever driver from the rc framework (which doesn't need userspace lircd). But I couldn't get the longpress keyboard/remote modifier in kodi keymaps working.

    For testing I used a very simple remote.xml - long-pressing left should do a right and vice versa:

    In a standard setup (eventlircd running, picking up the input events from user/kernel-space lirc and relaying them to kodi via the lirc socket) the kodi log looks quite funny. First a short press then a long press:

    Code
    13:06:45 447.539246 T:1962627072   DEBUG: LIRC: Update - NEW at 69863:69 0 KEY_LEFT devinput (KEY_LEFT)
    13:06:45 447.539459 T:1962627072   DEBUG: OnKey: 169 (0xa9) pressed, action is Right
    13:06:45 447.799103 T:1962627072   DEBUG: LIRC: Update - NEW at 70122:69 0 KEY_LEFT_UP devinput (KEY_LEFT_UP)
    
    
    13:06:50 452.380463 T:1962627072   DEBUG: LIRC: Update - NEW at 74704:69 0 KEY_LEFT devinput (KEY_LEFT)
    13:06:50 452.380676 T:1962627072   DEBUG: OnKey: 169 (0xa9) pressed, action is Right
    13:06:52 454.378815 T:1962627072   DEBUG: Previous line repeats 28 times.
    13:06:52 454.378906 T:1962627072   DEBUG: LIRC: Update - NEW at 76702:69 0 KEY_LEFT_UP devinput (KEY_LEFT_UP)


    Note that in both cases the KEY_LEFT was translated to "Right". It looks like the longpress modifier in the remote section was ignored.

    With eventlircd stopped and kodi picking up the input events from lircd/kernel (handled as keyboard input) it looks as expected:

    Code
    13:16:31 1033.300049 T:1962508288   DEBUG: Keyboard: scancode: 0x69, sym: 0x0114, unicode: 0x0000, modifier: 0x0
    13:16:31 1033.579834 T:1962508288   DEBUG: OnKey: left (0xf082) pressed, action is Left
    
    
    13:16:35 1037.757080 T:1962508288   DEBUG: Keyboard: scancode: 0x69, sym: 0x0114, unicode: 0x0000, modifier: 0x0
    13:16:36 1038.136719 T:1962508288   DEBUG: Previous line repeats 2 times.
    13:16:36 1038.136841 T:1962508288   DEBUG: OnKey: long-left (0x100f082) pressed, action is Right
    13:16:36 1038.216309 T:1962508288   DEBUG: Keyboard: scancode: 0x69, sym: 0x0114, unicode: 0x0000, modifier: 0x0


    Short and long presses are detected and the correct action is performed.

    Now I'm wondering what I'm missing.

    Is longpress support with LIRC supposed to work at the kodi side? Eventlircd would generate _UP events but are they handled in kodi? Do I need some config setting or some special lircmap configuration for that?

    Or is longpress support only available on keyboard/input devices and eventlircd is the culprit?

    so long,

    Hias

  • Unfortunately not yet. Kodi still can't cope with a several linux input keycodes, eg KEY_OK, KEY_CHANNELUP etc, they all result in XBMCK_UNKNOWN.

    But there's a workaround: you can use a custom lircd.conf file (if you are using userspace lirc) or a custom rc-keymap (if you are using in-kernel decoding) and substitute the problematic keycodes with working ones (eg KEY_ENTER instead of KEY_OK). Then you can disable eventlircd, kodi will see the linux input events and long-press works.

    You'll also have to make sure the kodi http://remote.xml/keyboard.xml match the codes you are using, so that's mainly a solution for more experienced users.

    so long,

    Hias