eudev-project / eudev

Repository for eudev development
GNU General Public License v2.0
529 stars 144 forks source link

udevd error message on boot: Error calling EVIOCSKEYCODE on device node ... Invalid Argument #281

Closed lukeflo closed 5 months ago

lukeflo commented 5 months ago

I'm not totally sure if this is the correct repo to post this issue, but after searching seems to be the best fit.

System

I'm running Void Linux, Kernel 6.6.31_1, using runit instead of systemd for service management.

The installed udev package is eudev.

udevd --version gives 251.

Error message

On every boot I get the following error messages:

2024-05-19T20:59:19.61478 daemon.err: [    4.444792] udevd[848]: Error calling EVIOCSKEYCODE on device node '/dev/input/event16' (scan code 0x8, key code 190): Invalid argument
2024-05-19T20:59:19.61479 daemon.err: [    4.444829] udevd[848]: Error calling EVIOCSKEYCODE on device node '/dev/input/event16' (scan code 0xd, key code 247): Invalid argument
2024-05-19T20:59:19.61479 daemon.err: [    4.444856] udevd[848]: Error calling EVIOCSKEYCODE on device node '/dev/input/event16' (scan code 0x42, key code 193): Invalid argument
2024-05-19T20:59:19.61480 daemon.err: [    4.444882] udevd[848]: Error calling EVIOCSKEYCODE on device node '/dev/input/event16' (scan code 0x43, key code 192): Invalid argument

Everything works fine, but the messages disturb the login process/display manager

Debug

I tried debugging the error message with the following commands. The output is attached:

udevadm info -a /dev/input/event16:

  looking at device '/devices/virtual/input/input33/event16':
    KERNEL=="event16"
    SUBSYSTEM=="input"
    DRIVER==""

  looking at parent device '/devices/virtual/input/input33':
    KERNELS=="input33"
    SUBSYSTEMS=="input"
    DRIVERS==""
    ATTRS{uniq}==""
    ATTRS{inhibited}=="0"
    ATTRS{properties}=="0"
    ATTRS{phys}==""
    ATTRS{name}=="Ideapad extra buttons"

Afterwards I run a test:

sudo udevadm test /devices/virtual/input/input33/event16:

calling: test
version 3.2.14
This program is for debugging only, it does not run any program
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.

=== trie on-disk ===
tool version:          3
file size:         9962204 bytes
header size             80 bytes
strings            2426364 bytes
nodes              7535760 bytes
Load module index
timestamp of '/usr/lib64/udev/rules.d' changed
timestamp of '/run/udev/rules.d' changed
Reading rules file: /usr/lib/udev/rules.d/01-md-raid-creating.rules
Reading rules file: /usr/lib/udev/rules.d/10-dm.rules
Reading rules file: /usr/lib/udev/rules.d/11-dm-lvm.rules
Reading rules file: /usr/lib/udev/rules.d/11-dm-parts.rules
Reading rules file: /usr/lib/udev/rules.d/13-dm-disk.rules
Reading rules file: /usr/lib/udev/rules.d/40-gphoto.rules
Reading rules file: /usr/lib/udev/rules.d/49-sane.rules
Reading rules file: /usr/lib/udev/rules.d/50-udev-default.rules
Reading rules file: /usr/lib/udev/rules.d/60-autosuspend.rules
Reading rules file: /usr/lib/udev/rules.d/60-block.rules
Reading rules file: /usr/lib/udev/rules.d/60-cdrom_id.rules
Reading rules file: /usr/lib/udev/rules.d/60-drm.rules
Reading rules file: /usr/lib/udev/rules.d/60-evdev.rules
Reading rules file: /usr/lib/udev/rules.d/60-fido-id.rules
Reading rules file: /usr/lib/udev/rules.d/60-input-id.rules
Reading rules file: /usr/lib/udev/rules.d/60-persistent-alsa.rules
Reading rules file: /usr/lib/udev/rules.d/60-persistent-input.rules
Reading rules file: /usr/lib/udev/rules.d/60-persistent-storage-tape.rules
Reading rules file: /usr/lib/udev/rules.d/60-persistent-storage.rules
Reading rules file: /usr/lib/udev/rules.d/60-persistent-v4l.rules
Reading rules file: /usr/lib/udev/rules.d/60-sensor.rules
Reading rules file: /usr/lib/udev/rules.d/60-serial.rules
Reading rules file: /usr/lib/udev/rules.d/60_smfp_samsung.rules
Reading rules file: /usr/lib/udev/rules.d/63-md-raid-arrays.rules
Reading rules file: /usr/lib/udev/rules.d/64-btrfs-dm.rules
Reading rules file: /usr/lib/udev/rules.d/64-btrfs-zoned.rules
Reading rules file: /usr/lib/udev/rules.d/64-btrfs.rules
Reading rules file: /usr/lib/udev/rules.d/64-md-raid-assembly.rules
Reading rules file: /usr/lib/udev/rules.d/65-libwacom.rules
Reading rules file: /usr/lib/udev/rules.d/66-kpartx.rules
Reading rules file: /usr/lib/udev/rules.d/66-kvm.rules
Reading rules file: /usr/lib/udev/rules.d/68-del-part-nodes.rules
Reading rules file: /usr/lib/udev/rules.d/69-dm-lvm.rules
Reading rules file: /usr/lib/udev/rules.d/69-md-clustered-confirm-device.rules
Reading rules file: /usr/lib/udev/rules.d/69-xorg-vmmouse.rules
Reading rules file: /usr/lib/udev/rules.d/70-camera.rules
Reading rules file: /usr/lib/udev/rules.d/70-infrared.rules
Reading rules file: /usr/lib/udev/rules.d/70-joystick.rules
Reading rules file: /usr/lib/udev/rules.d/70-memory.rules
Reading rules file: /usr/lib/udev/rules.d/70-mouse.rules
Reading rules file: /usr/lib/udev/rules.d/70-touchpad.rules
Reading rules file: /usr/lib/udev/rules.d/75-net-description.rules
Reading rules file: /usr/lib/udev/rules.d/75-probe_mtd.rules
Reading rules file: /usr/lib/udev/rules.d/78-sound-card.rules
Reading rules file: /usr/lib/udev/rules.d/80-dotool.rules
Reading rules file: /usr/lib/udev/rules.d/80-drivers.rules
Reading rules file: /usr/lib/udev/rules.d/80-libinput-device-groups.rules
Reading rules file: /usr/lib/udev/rules.d/80-net-name-slot.rules
Reading rules file: /usr/lib/udev/rules.d/80-udisks2.rules
Reading rules file: /usr/lib/udev/rules.d/81-net-dhcp.rules
Reading rules file: /usr/lib/udev/rules.d/90-alsa-restore.rules
Reading rules file: /usr/lib/udev/rules.d/90-libinput-fuzz-override.rules
Reading rules file: /usr/lib/udev/rules.d/90-pulseaudio.rules
Reading rules file: /usr/lib/udev/rules.d/90-usbmon.rules
Reading rules file: /usr/lib/udev/rules.d/95-dm-notify.rules
Reading rules file: /usr/lib/udev/rules.d/wacom.rules
rules contain 196608 bytes tokens (16384 * 12 bytes), 26597 bytes strings
12133 strings (105711 bytes), 9821 de-duplicated (81427 bytes), 2313 trie nodes used
GROUP 25 /usr/lib/udev/rules.d/50-udev-default.rules:29
IMPORT builtin 'hwdb' /usr/lib/udev/rules.d/60-evdev.rules:8
IMPORT builtin 'hwdb' returned non-zero
value '[dmi/id]modalias' is 'dmi:bvnLENOVO:bvrGGCN20WW:bd01/13/2021:br1.20:efr1.20:svnLENOVO:pn82KA:pvrLenovoV14G2ITL:rvnLENOVO:rnLNVNB161216:rvrNODPK:cvnLENOVO:ct10:cvrLenovoV14G2ITL:skuLENOVO_MT_82KA_BU_idea_FM_V14G2ITL:'
IMPORT builtin 'hwdb' /usr/lib/udev/rules.d/60-evdev.rules:18
IMPORT builtin 'hwdb' returned non-zero
value '[dmi/id]modalias' is 'dmi:bvnLENOVO:bvrGGCN20WW:bd01/13/2021:br1.20:efr1.20:svnLENOVO:pn82KA:pvrLenovoV14G2ITL:rvnLENOVO:rnLNVNB161216:rvrNODPK:cvnLENOVO:ct10:cvrLenovoV14G2ITL:skuLENOVO_MT_82KA_BU_idea_FM_V14G2ITL:'
IMPORT builtin 'hwdb' /usr/lib/udev/rules.d/60-evdev.rules:23
RUN 'keyboard' /usr/lib/udev/rules.d/60-evdev.rules:23
IMPORT builtin 'input_id' /usr/lib/udev/rules.d/60-input-id.rules:5
capabilities/ev raw kernel attribute: 13
capabilities/abs raw kernel attribute: 0
capabilities/rel raw kernel attribute: 0
capabilities/key raw kernel attribute: 400000000000000 0 0 6000800000000000 100000000000 0 81000800100c03 4400000000300400 0 2
properties raw kernel attribute: 0
test_key: checking bit block 0 for any keys; found=1
test_key: checking bit block 64 for any keys; found=1
test_key: checking bit block 128 for any keys; found=1
test_key: checking bit block 192 for any keys; found=1
IMPORT builtin 'hwdb' /usr/lib/udev/rules.d/60-input-id.rules:6
IMPORT builtin 'hwdb' returned non-zero
IMPORT builtin 'hwdb' /usr/lib/udev/rules.d/65-libwacom.rules:20
IMPORT builtin 'hwdb' returned non-zero
handling device node '/dev/input/event16', devnum=c13:80, mode=0660, uid=0, gid=25
preserve permissions /dev/input/event16, 020660, uid=0, gid=25
preserve already existing symlink '/dev/char/13:80' to '../input/event16'
created db file '/run/udev/data/c13:80' for '/devices/virtual/input/input33/event16'
ACTION=add
DEVNAME=/dev/input/event16
DEVPATH=/devices/virtual/input/input33/event16
ID_INPUT=1
ID_INPUT_KEY=1
KEYBOARD_KEY_08=f20
KEYBOARD_KEY_0d=rfkill
KEYBOARD_KEY_42=f23
KEYBOARD_KEY_43=f22
MAJOR=13
MINOR=80
SUBSYSTEM=input
USEC_INITIALIZED=4438204
run: 'keyboard'
Unload module index

Unfortunately, I'm not as familiar with udev to understand those messages fully. It seems to have something to do with my Lenovo extra buttons. But so far, everything works fine.

Nevertheless, the messages are annoying on boot, as mentioned above.

Can anybody explain what all this means concrete and how to solve the error or at least surpress the messages for that special event?

lukeflo commented 5 months ago

Could fix ist myself. Maybe also a solution for people with a similar problem.

solution

For some reasons udev tries to load some keyboard assignments from /lib/udev/hwdb.d/60-keyboard.hwdb which deal with the wlan switch of a Lenovo Idea Pad. Since I have no Idea Pad but some other Lenovo notebook, those keys can't be assigned which causes the error.

Thus I just copied the file /lib/udev/hwdb.d/60-keyboard.hwdb to /etc/udev/hwdb.d/60-keyboard.hwdb and uncommented the particular lines mentioned at the end of the udevadm test call above:

# IdeaPad
evdev:name:Ideapad extra buttons:dmi:bvn*:bvr*:bd*:svnLENOVO*:pn*:*
# KEYBOARD_KEY_0d=rfkill                                 # airplane mode switch (toggle all wireless devices)
# KEYBOARD_KEY_08=f20                                    # micmute
# KEYBOARD_KEY_42=f23
# KEYBOARD_KEY_43=f22

After that, just rebuilt the hwdb-database with sudo udevadm hwdb --update.

Now the warnings on boot are gone. I recognized no other drawbacks, which isn't surprising since the switch does not exist on my notebook.