You are not logged in.

#1 2018-01-27 17:26:22

Jens Clasen
Member
Registered: 2018-01-27
Posts: 19

[Solved] Xorg doesn't accept keyboard events

Hey and good evening!

I'd like to request some help with troubleshooting/diagnosing/finding my absent keyboard for my Xorg server setup.

The given situation is a fresh arch 64bit install inside a VirtualBox (Version 5.2.97, but the problem persists, if I downgrade. A matching version of the guest addons is installed at the guest system). Inside the guest os I can use my keyboard, as long as I don't start X. Inside X (version 1.19.6-2), the mouse works, but the keyboad does not. The problem happens regardless if I use Xfce4 or mate, if that is of importance.

I guess, this should be the relevant part of the log:

[  3397.825] (II) config/udev: Adding input device AT Translated Set 2 keyboard (/dev/input/event0)
[  3397.825] (**) AT Translated Set 2 keyboard: Applying InputClass "libinput keyboard catchall"
[  3397.825] (II) Using input driver 'libinput' for 'AT Translated Set 2 keyboard'
[  3397.829] (II) systemd-logind: got fd for /dev/input/event0 13:64 fd 30 paused 0
[  3397.829] (**) AT Translated Set 2 keyboard: always reports core events
[  3397.829] (**) Option "Device" "/dev/input/event0"
[  3397.829] (**) Option "_source" "server/udev"
[  3397.832] (II) event0  - (II) AT Translated Set 2 keyboard: (II) is tagged by udev as: Keyboard
[  3397.832] (II) event0  - (II) AT Translated Set 2 keyboard: (II) device is a keyboard
[  3397.832] (II) event0  - (II) AT Translated Set 2 keyboard: (II) device removed
[  3397.832] (**) Option "config_info" "udev:/sys/devices/platform/i8042/serio0/input/input0/event0"
[  3397.832] (II) XINPUT: Adding extended input device "AT Translated Set 2 keyboard" (type: KEYBOARD, id 11)
[  3397.835] (II) event0  - (II) AT Translated Set 2 keyboard: (II) is tagged by udev as: Keyboard
[  3397.835] (II) event0  - (II) AT Translated Set 2 keyboard: (II) device is a keyboard

(Complete log can bei found here on Dpaste)

A keyboard seems to be found and it seems to be handled by libinput. I made sure, that this was the right one by first listing all libinput devices  and finding this one:

Device:           AT Translated Set 2 keyboard
Kernel:           /dev/input/event0
Group:            6
Seat:             seat0, default
Capabilities:     keyboard 
Tap-to-click:     n/a
Tap-and-drag:     n/a
Tap drag lock:    n/a
Left-handed:      n/a
Nat.scrolling:    n/a
Middle emulation: n/a
Calibration:      n/a
Scroll methods:   none
Click methods:    none
Disable-w-typing: n/a
Accel profiles:   n/a
Rotation:         n/a

(complete result is here)

Next I checked, if libinput was reacting to key events by calling libinput debug-events and again that worked. I got events for event0 when I pressed a key.

The next thing I did is to make sure, that I had no conflicting xf86-input drivers on my system. I found some (e.g. evdev), but removal didn't solve my problem.

According to the Xorg.0.log, there's only one error which might pertain to the keyboard:

[  3397.212] (EE) Error loading keymap /var/lib/xkb/server-0.xkm
[  3397.213] (EE) XKB: Failed to load keymap. Loading default keymap instead.

To get around that, I tried first to reset the keyboard settings, using "localectl set-x11-keymaps de pc105 nodeadkeys terminate:ctrl_alt_bksp" and later I even removed /etc/X11/xorg.conf.d/00-keyboard.conf and tried it without.

As of now, I'm out of ideas. The troubleshooting section of the wiki and google didn't help and I could use somebody with a fresh mind taking a look at this problem.

Does anybody have any ideas, what to try next? Thanks in advance for any help/idea you can provide.

// EDIT about 2h after writing the above:

Thinking about this problem and remembering earlier times, I thought of something. When X still needed a config file, you needed a server layout section listing the identifiers of input devices to be used. Additionally, you had to configure an input device with a matching name. Nowadays it seems, as if only the latter part is needed, either in /etc/X11/xorg.conf.d or in /usr/share/X11/xorg.conf.d. The server layout part seems to be handled by some kind of defaults.

Does anybody know the needed identifiers/names for a keyboard? Would it be possible, that I somehow can or have to tell X, which input device it has to listen to? At least one of my devices, listed by libinput is pretty strange, therefor we could be talking about a conflict between two devices.

Could it be possible, that this device causes some kind of conflict:

Device:           Video Bus
Kernel:           /dev/input/event4
Group:            3
Seat:             seat0, default
Capabilities:     keyboard 
Tap-to-click:     n/a
Tap-and-drag:     n/a
Tap drag lock:    n/a
Left-handed:      n/a
Nat.scrolling:    n/a
Middle emulation: n/a
Calibration:      n/a
Scroll methods:   none
Click methods:    none
Disable-w-typing: n/a
Accel profiles:   n/a
Rotation:         n/a

The last X server setup I did was about 8 years ago. I don't know, if a video bus device in libinput devices is a regular occurrence. Especially one with keyboard capabilities.


Regards, Jens

Last edited by Jens Clasen (2018-01-28 11:22:45)

Offline

#2 2018-01-28 10:17:21

Jens Clasen
Member
Registered: 2018-01-27
Posts: 19

Re: [Solved] Xorg doesn't accept keyboard events

Some further information and another request:

Working on the assumption that libinput receives keyboard events, they must either be ignored by libinput or they are getting lost somewhere after that.

For the first part, I can only imagine, that libinput is in tablet mode. If that was the case, libinput would ignore all keyboard events. I could't find out, how to test for that, though. Does anybody know, how I can get libinput to dump it's currently running state into a file? Is there some kind of log I don't know about?

For the second presumption (events getting lost): Since I want to use a non English keyboard, I tried to make sure, that there's nothing mapping all my keys to /dev/null. This is the output from "setxkbmap -print verbose 10", running in my keyboardless X session:

Setting verbose level to 10
locale is C
Trying to load rules file ./rules/evdev...
Trying to load rules file /usr/share/X11/xkb/rules/evdev...
Success.
Applied rules from evdev:
rules:      evdev
model:      pc105
layout:     de
variant:    nodeadkeys
options:    terminate:ctrl_alt_bksp
Trying to build keymap using the following components:
keycodes:   evdev+aliases(qwertz)
types:      complete
compat:     complete
symbols:    pc+de(nodeadkeys)+inet(evdev)+terminate(ctrl_alt_bksp)
geometry:   pc(pc105)
xkb_keymap {
	xkb_keycodes  { include "evdev+aliases(qwertz)"	};
	xkb_types     { include "complete"	};
	xkb_compat    { include "complete"	};
	xkb_symbols   { include "pc+de(nodeadkeys)+inet(evdev)+terminate(ctrl_alt_bksp)"	};
	xkb_geometry  { include "pc(pc105)"	};
};

The strange parts for me are "locale is C" and the fact that those are evdev rules. I would have expected another locale, since my /etc/locale.conf points to a German locale. Furthermore, I wouldn't have expected evdev here, since I thought I was using libinput. Libinput depends on libevdev, though. Therefor this might be normal.

I have no running X system available (OK - I have none, which is recent enough), to compare my broken one against a working copy. Could somebody please provide me with an Xorg.0.log, preferably from an Xorg server 1.19.6-2 inside a more or less current VirtualBox hypervisor? Furthermore the output of "setxkbmap -print verbose 10" would be helpful to track down this problem.

Thanks for your consideration!

Regards, Jens

Offline

#3 2018-01-28 11:33:56

Jens Clasen
Member
Registered: 2018-01-27
Posts: 19

Re: [Solved] Xorg doesn't accept keyboard events

OK - I found the culprit. After a reboot and a couple of further tests, I got an error message from X, which did not appear in the log, but only on STDERR on the first startx call. Subsequent calls did not return the same error message. It seems as if xkbcom is recompiling keymaps only at the first X start or if some kind of config was changed. At least that's what I suspect.

The error message was: The XKEYBOARD keymap compiler (xkbcomp) reports a syntax error in line 1538 of inet. (Sorry - I only have an image, no paste possible)

Running with that message, I found the file /usr/share/X11/xkb/symbols/inet to be corrupted. All previous attempts with different keymap settings referenced that file and indeed, all my key strokes where send to the nirvana.

The problem was solved by reinstalling xkeyboard-config, using pacman. How the file got corrupted? I've no idea. I didn't even download a new package file, but now my keyboard works as expected in X.

Thanks anyway to everyone, who took the time to read this thread.

Regards, Jens

Last edited by Jens Clasen (2018-01-28 11:36:29)

Offline

Board footer

Powered by FluxBB