Kodi Community Forum
Solved IR: Multiple keypresses - only after reboot - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Linux (https://forum.kodi.tv/forumdisplay.php?fid=52)
+---- Thread: Solved IR: Multiple keypresses - only after reboot (/showthread.php?tid=317903)



IR: Multiple keypresses - only after reboot - baka0815 - 2017-07-08

I'm having a kinda curious problem with my remote.

Everytime after I reboot my system, the keys from my remote will be sent multiple times until I press a different button or a key on the keyboard.

Here is the output of irw:
Code:
# irw
0000000080010067 00 KEY_UP devinput
^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[Ax0000000080010067 00 KEY_UP devinput
0000000080010067 00 KEY_UP devinput
0000000080010067 00 KEY_UP devinput
0000000080010067 00 KEY_UP devinput
As you can see the KEY_UP event is recognized but directly after that ^[[A (the key code for KEY_UP AFAIK) is sent endlessly until I hit "x" on my keyboard, after that every press on the KEY_UP button is registered correctly and doesn't misbehave - until after the next reboot.

Here is another example with the "1" key:
Code:
# irw
0000000080010002 00 KEY_1 devinput
11111111111111111111111111111111111111111111111111111111111111111111x0000000080010002 00 KEY_1 devinput
0000000080010002 00 KEY_1 devinput

Currently after the reboot I'm pressing KEY_LEFT, KEY_RIGHT, KEY_UP, KEY_DOWN, KEY_VOLUMEDOWN, KEY_VOLUMEUP, KEY_BACK.
This somehow works as KEY_BACK also seems to end the multiplication of the keys.

I've tried to reconfigure lirc again (regenerated the devinput.lirc.conf using lirc-make-devinput, removed unnecessary packaged, ...) but without success.

My kernel is "4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u2 (2017-06-26) x86_64 GNU/Linux", but I've also tried 4.3 (4.3.1-2) and 4.11 (4.11.6-1) without changes.

Installed lirc-packages:
Code:
# dpkg -l "*lirc*" | grep ^ii
ii  liblirc-client0:amd64 0.9.4c-9     amd64        infra-red remote control support - client library
ii  liblirc0:amd64        0.9.4c-9     amd64        Infra-red remote control support - Run-time libraries
ii  lirc                  0.9.4c-9     amd64        Infra-red remote control support - daemons and utils
ii  lirc-doc              0.9.4c-9     all          Infra-red remote control support - website and manual docs

Any help is greatly appreciated!


RE: IR: Multiple keypresses - only after reboot - P.Kosunen - 2017-07-09

Check Xorg log, it might use your lirc device as input device.

/etc/X11/xorg.conf.d/blacklist.conf:
Code:
Section "InputClass"
     Identifier      "Ignore Nuvoton IR"
     MatchProduct    "Nuvoton"
     MatchIsKeyboard "True" # May not need this line
     Option          "Ignore" "True"
EndSection

Blacklisting device from X will help in that case.


RE: IR: Multiple keypresses - only after reboot - baka0815 - 2017-07-10

Thanks for the hint.

I don't have any specific xorg.conf for input devices only for the intel chip to use the intel ddx instead of modesetting.

Will try if blacklisting the device works and report back.


RE: IR: Multiple keypresses - only after reboot - baka0815 - 2017-07-13

The remote is already on a blacklist and as such not recognized (see below).
Code:
[     5.580] (II) config/udev: Adding input device cx23885 IR (TerraTec Cinergy T PCIe Dual) (/dev/input/event20)
[     5.580] (**) cx23885 IR (TerraTec Cinergy T PCIe Dual): Ignoring device from InputClass "MCE USB Keyboard mimic blacklist"

However event21 is recognized as a keyboard (lird-uinput).
Code:
[     5.580] (II) config/udev: Adding input device lircd-uinput (/dev/input/event21)
[     5.580] (**) lircd-uinput: Applying InputClass "evdev keyboard catchall"
[     5.580] (II) Using input driver 'evdev' for 'lircd-uinput'
[     5.580] (**) lircd-uinput: always reports core events
[     5.580] (**) evdev: lircd-uinput: Device: "/dev/input/event21"
[     5.580] (--) evdev: lircd-uinput: Vendor 0 Product 0
[     5.580] (--) evdev: lircd-uinput: Found 20 mouse buttons
[     5.580] (--) evdev: lircd-uinput: Found keys
[     5.580] (II) evdev: lircd-uinput: Forcing relative x/y axes to exist.
[     5.580] (II) evdev: lircd-uinput: Configuring as mouse
[     5.580] (II) evdev: lircd-uinput: Configuring as keyboard
[     5.580] (**) evdev: lircd-uinput: YAxisMapping: buttons 4 and 5
[     5.580] (**) evdev: lircd-uinput: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
[     5.580] (**) Option "config_info" "udev:/sys/devices/virtual/input/input24/event21"
[     5.580] (II) XINPUT: Adding extended input device "lircd-uinput" (type: KEYBOARD, id 13)
[     5.580] (**) Option "xkb_rules" "evdev"
[     5.580] (**) Option "xkb_model" "pc105"
[     5.580] (**) Option "xkb_layout" "de"

How do I write a blacklist entry for that? udevadm doesn't return a vendor or a product.
Code:
# udevadm info --query=property --name=/dev/input/event21
BACKSPACE=guess
DEVNAME=/dev/input/event21
DEVPATH=/devices/virtual/input/input24/event21
ID_INPUT=1
ID_INPUT_KEY=1
ID_INPUT_KEYBOARD=1
ID_SERIAL=noserial
MAJOR=13
MINOR=85
SUBSYSTEM=input
USEC_INITIALIZED=5352436
XKBLAYOUT=de
XKBMODEL=pc105



RE: IR: Multiple keypresses - only after reboot - P.Kosunen - 2017-07-13

Code:
Section "InputClass"
    Identifier      "Blacklist lircd-uinput"
    MatchDevicePath "/devices/virtual/input/input24/event21"
    Option          "Ignore" "True"
EndSection

Or

Code:
Section "InputClass"
    Identifier    "Blacklist lircd-uinput"
    MatchProduct  "/dev/input/event21"
    Option        "Ignore" "True"
EndSection

Edit: http://www.lirc.org/html/lircd-uinput.html

Disable lircd-uinput service, if it is running.


RE: IR: Multiple keypresses - only after reboot - baka0815 - 2017-07-16

Looks like I'm stupid or blind, but I don't see a way to disable lircd-uinput. The only option I see is a parameter for a "disabled buttons" file, but that doesn't look like it will disable lircd-uinput completely.
On the other hand when I kill lircd-uinput, the duplications goes away, so I'm pretty sure, that it's the culprit.

Here is my /etc/lirc/lirc_options.conf:
Code:
# These are the default options to lircd, if installed as
# /etc/lirc/lirc_options.conf. See the lircd(8) and lircmd(8)
# manpages for info on the different options.
#
# Some tools including mode2 and irw uses values such as
# driver, device, plugindir and loglevel as fallback values
# in not defined elsewhere.

[lircd]
nodaemon        = False
driver          = devinput
device          = auto
output          = /var/run/lirc/lircd
pidfile         = /var/run/lirc/lircd.pid
plugindir       = /usr/lib/x86_64-linux-gnu/lirc/plugins
permission      = 666
allow-simulate  = No
repeat-max      = 600
#effective-user =
#listen         = [address:]port
#connect        = host[:port]
#loglevel       = 6
#uinput         = ...
#release        = ...
#logfile        = ...

[lircmd]
uinput          = False
nodaemon        = False

# [modinit]
# code = /usr/sbin/modprobe lirc_serial
# code1 = /usr/bin/setfacl -m g:lirc:rw /dev/uinput
# code2 = ...


# [lircd-uinput]
# release-timeout = 200

I tried setting
Code:
uinput = False
in the [lircd] section (it's already false in the [lircmd] section) but that doesn't change a thing.
How do I disable lircd-uinput or keep it from starting?

I'm on Debian testing with systemd if that's relevant.


RE: IR: Multiple keypresses - only after reboot - P.Kosunen - 2017-07-16

https://wiki.debian.org/systemd

List services:
Code:
systemctl

Disable example1 service:
Code:
systemctl disable example1



RE: IR: Multiple keypresses - only after reboot - baka0815 - 2017-07-16

Oh, didn't know that lircd-uinput was a systemd service, will take a look, thanks!


RE: IR: Multiple keypresses - only after reboot - baka0815 - 2017-07-18

It worked, thanks for the help!