Repeated keypress from remote

  • Finished installing my first LibreELEC (LibreELEC-RPi.arm-9.2.6), simple 3-pin IR receiver connected to GPIO.

    Followed Infra-Red Remotes wiki and got an old Pioneer DVD-remote to work - the HARD way (not using LIRC Support section).

    My Logitech Harmony 200 is configured as that remote in the DVD-setting, but it apparently transmits several (usually 3) quick keypress events per keypress, and they're passed on to KODI.

    I tried to stop (kodi and) eventlircd and start it by hand using --repeat-filter, but the result seems to be the same:

    /usr/sbin/eventlircd --repeat-filter -f --evmap=/etc/eventlircd.d --socket=/run/lirc/lircd &

    irw confirms the repeated keys.

    I guess it should be possible to filter aout the extra events - any help is appreciated.

  • Thank you both.

    HiassofT

    I have thought of that, but the remote is old and the software does not offer this option, even though the Logitech link suggests it.

    Da Flex

    Then I'll have to configure each of my mapped keys (25 so far) to be directed to the same script.

    I haven't got a clue about how to do this, so I'll try that as a last resort (lazyness + lack of knowledge).

    I was hoping for a pointer to a suitable configuration setting somewhere in the chain from IR to Kodi.

    Or maybe bringing lircd back in play - would it be doable configuring it to suppress repeating events?

  • You could try increasing the delay before repeat kicks in - use eg ir-keytable -D 750 to increase it from 500 to 750ms.

    This will work while kodi/eventlircd are running so you can experiment with the values.

    so long,

    Hias

  • I did like this:

    Code
    piLibreELEC:~ # ir-keytable -D 3000 -c -w keys-exp.txt
    Read pioneer-remote table
    Old keytable cleared
    Wrote 15 keycode(s) to driver
    Protocols changed to nec
    Repeat delay = 5000 ms, repeat period = 125 ms
    Changed Repeat delay to 3000 ms and repeat period to 125 ms

    plus your suggestion and several other values for -D - and there was NO difference whatsoever.

    I'm not sure I understand the -D value: is it applied to interval between down+up event pairs or the interval from a long press ie. from down to up?

  • Can you post the output of "ir-keytable -t" when you do a short button press on the remote?

    Usually remotes send the scancodes every (approx) 100ms while the button is pressed, this is interpreted as a "held down" button by the input subsystem - you'll see an initial "key down" event and then get further key down events after the specified repeat delay.

    If the scancodes are too far apart linux will detect them as separate button presses (i.e. key down followed by key up some 150ms afterwards).

    If the scancodes are only a bit too far apart then tweaking the receive timeout (ir-ctl -t VALUE_IN_MICROSECONDS, eg ir-ctl -t 125000) can help to detect these as a held down button - ideally the Harmony remote should behave like standard remotes though and follow the protocol specs though.

    so long,

    Hias

  • Here's the test output:

  • The output of "play" looks fine (as expected when the Harmony repeats the command 3 times): It sends the scancode 0xab22 three times, which then results in a single key_down event.

    The "left" test is odd though, the Harmony transmits two different scancodes, first 0xab2c and then 0xaf63, and repeats that three times. This doesn't end well, when a different scancode is received it's interpreted as a release ("up") of the previous scancode.

    That's something you need to fix in the Harmony configuration - make sure a button sends a single scancode.

    so long,

    Hias

  • Quote

    ... make sure a button sends a single scancode.

    I've scratched my head quite a bit - how do I do that?

    If I instruct ir-keytable to show all codes for all protocols for PLAY, PAUSE, RIGHT, LEFT:

    (made a bit more readable), it shows one event for PLAY and PAUSE, but two for RIGHT and LEFT.

    I could read the last two as: first event is a generic 'special code follows', the second a specific button - can I configure my way out of that?

    Thanks for your patience!

  • I don't have a Harmony remote but AFAIK the selected remote profile is what defines the scancodes to be sent - so dig into that.

    My guess is the remote profile sends two different scancodes on left/right to support two (slightly) different DVD players - which might work with the original players but is highly non-standard with anything else.

    Check if there are other similar remote profiles if you want to stick to the Pioneer DVD profile or just configure the Harmony to use the Microsoft Media Center remote (not the MCE keyboard!), this will work out-of-the box in LE.

    If you plan to use both your original pioneer remote and the Harmony to control LibreELEC you can still do this when the Harmony is configured as MCE: Enable both nec and rc-6 protocols in the keymap and add the key/scancode definitions from rc6_mce to your keymap (we do a similar thing in the default libreelec_multi keymap to support Xbox remotes in addition to MCE).

    so long,

    Hias

  • Ok - got that.

    I must admit that I didn't know what I was venturing into when I selected that remote - next I'll try to find another remote in my collection (with some nicer codes + Harmony support), so I still can have my 3-device Harmony control 4 devices, and have your suggestions as a safe fallback.

    Thanks for your answers, this is a very responsive forum.