A few weeks ago, I updated 18.04 through 19.04 to 20.04 on my Acer laptop. Everything was fine. A few weeks later, without having done any major update or operation I can remember, I booted up to find that the laptop internal keyboard and touchpad do not do anything, both in the login screen and from then on.
Both work when I boot into Windows, so it can't be a hardware issue. And I've been through what feels like every search result on the Web tangentially related to this, installed packages, uninstalled packages, reinstalled packages, nothing has worked.
During said process I learned several things that narrow down what's happening.
- The devices are clearly OK at some lower level; when the system is asleep / suspended, pressing a key or the touchpad easily wakes it up -- after which, they refuse to work again.
- Strangely, the brightness key combos (Fn+←/→) and one that turns off the screen (Fn+F6) do work, but others such as volume (Fn+↑/↓) do not work.
- I see all expected key output when I run
sudo libinput debug-events --device /dev/input/event4 --show-keycodesand type keys.
- When I plug in an external USB keyboard and mouse, they work correctly while the internal keyboard and touchpad remain the same.
- 18 Sep When I use the gear icon to login with "Ubuntu" instead of "Ubuntu on Wayland", etc. the touchpad works but the keyboard remains the same. If I set
sudo systemctl restart gdm3.service, my touchpad also works on the login screen as well; keyboard still broken. Wayland trouble? But even using X does not help my keyboard.
Thus, it seems to be something to do with GNOME. Of course, I've tried reinstalling gnome-this and gnome-that and restarting, but still no success. Here's what looks like a relevant section from the system logs (
Sep 17 11:36:20 joel-Aspire-E5-511 systemd: Startup finished in 17.580s. Sep 17 11:36:20 joel-Aspire-E5-511 gnome-shell: Registering session with GDM Sep 17 11:36:20 joel-Aspire-E5-511 gsd-media-keys: Failed to grab accelerator for keybinding settings:rfkill Sep 17 11:36:20 joel-Aspire-E5-511 gsd-media-keys: Failed to grab accelerator for keybinding settings:playback-repeat Sep 17 11:36:20 joel-Aspire-E5-511 gsd-media-keys: Failed to grab accelerator for keybinding settings:playback-random Sep 17 11:36:20 joel-Aspire-E5-511 gsd-media-keys: Failed to grab accelerator for keybinding settings:hibernate Sep 17 11:36:20 joel-Aspire-E5-511 colord: failed to get session [pid 1460]: No data available Sep 17 11:36:20 joel-Aspire-E5-511 systemd: GNOME session X11 services is not active. Sep 17 11:36:20 joel-Aspire-E5-511 systemd: Dependency failed for GNOME XSettings. Sep 17 11:36:20 joel-Aspire-E5-511 systemd: gsd-xsettings.target: Job gsd-xsettings.target/start failed with result 'dep> Sep 17 11:36:20 joel-Aspire-E5-511 systemd: Starting GNOME XSettings... Sep 17 11:36:20 joel-Aspire-E5-511 dbus-daemon: [session uid=121 pid=1231] Activating service name='org.freedesktop.port> Sep 17 11:36:20 joel-Aspire-E5-511 dbus-daemon: [session uid=121 pid=1231] Successfully activated service 'org.freedeskt> Sep 17 11:36:20 joel-Aspire-E5-511 gnome-shell: The XKEYBOARD keymap compiler (xkbcomp) reports: Sep 17 11:36:20 joel-Aspire-E5-511 gnome-shell: > Warning: Unsupported maximum keycode 569, clipping. Sep 17 11:36:20 joel-Aspire-E5-511 gnome-shell: > X11 cannot support keycodes above 255. Sep 17 11:36:20 joel-Aspire-E5-511 gnome-shell: > Internal error: Could not resolve keysym Invalid Sep 17 11:36:20 joel-Aspire-E5-511 gnome-shell: Errors from xkbcomp are not fatal to the X server Sep 17 11:36:21 joel-Aspire-E5-511 systemd: Started GNOME XSettings.
I tried to figure out when exactly
xkbcomp and how it invokes it; I searched in its source code but could not find my answer. I learned what
systemd is and had a look at files like
gsd-xsettings.target but still could not track down how or where
xkbcomp is being invoked. If I search the web for the
xkbcomp error message I get things that look related but differ in details (e.g. instead of being unable to resolve keysym
Invalid, it's something else) and pursuing them yields no success.
Next to the Xorg logs -- I'm confused that I have two:
/var/lib/gdm3/.local/share/xorg/Xorg.0.log. The GDM one has smaller timestamps than the local one, so does that mean this one comes first?
Anyway, the GDM log shows many devices (e.g. video bus, webcam) being "configured as Keyboard", and the log file ends with "failed to set mode - permission denied". Could this be relevant? There's also part of my local Xorg log showing more complicated device adding / removal (e.g. "Video Bus: device is a keyboard").
(I would like to show the logs, but including the relevant sections makes the question too long.)
I'm posting this question here as a last resort: how does any of this relate to each other, what's going on, and how can I diagnose / fix what's going on with my keyboard and touchpad?
18 Sep OK, I have three kernel versions available through GRUB:
4.15.0-112. First two do nothing, last one fixes my problems. This suggests it's a kernel bug that could in principle be narrowed down to some version.
I would like to try
5.4.0-42 as commenter Kasonnara mentioned, but this looks more complicated that I first thought. The archive given in this answer doesn't seem to have any specific version under
5.4.0-xxx, while it has all the others. Do I have to build it from source, or what?
24 Sep OK, turns out I only need to run
sudo apt install linux-image-5.4.0-42-generic. I booted into it to find that the keyboard works but that the touchpad doesn't. Also, Wifi doesn't seem to be there in the top right menu and I have no internet connection.
I know 4.15.0-112 is Good and 5.4.0-42 is Broken. I see here under "Versions Published" that 20.04 (Focal) was shipped with 5.4.0-26. Thus, I install and boot that. Keyboard still working, touchpad and WiFi still broken.
I am now super confused as 20.04 worked for several weeks after I upgraded to it. Surely it was running kernel 5.4.0-26?
I could still narrow down the keyboard issue, however 5.4.0-43 and -44 don't seem to be Ubuntu packages (I get
E: Unable to locate package in
apt; can confirm that simply changing the 3 or 4 to a 5 shows me a valid already-installed package).
Thus I conclude so far that something between 5.4.0-42 and -45 broke my keyboard. The situation with the touchpad is far less clear; I could say between 4.15.0-112 and 5.4.0-26, but it's less clear because the latter ought to have been the working kernel I used after installing 20.04.
Next, I created a 20.04 bootable USB stick and ran "try Ubuntu". Keyboard and touchpad work fine, and when I
cat /proc/version ... I see
Linux version 5.4.0-42-generic.
Does this mean it's not a kernel problem after all? I'm perfectly willing to admit it's something to do with X or Wayland or GNOME or
gthat.d or whatever ... I'm just not enough of an expert to know what to do next...
25 November Windows has been so terrible that it drove me back to fix this. Finally bit the bullet and reinstalled after backing up my personal files. Keyboard and touchpad STILL don't work! (with the above caveats, e.g. brightness combo works). And now I don't have the old 4.15 kernel in my list anymore!!
To reiterate: the Ubuntu 20.04 LTS install USB works fine with my keyboard and touchpad, yet the actual installed system breaks it!
I'm really frustrated here. Can nobody help me with this?? Whatever arcane steps I need to do on my own, I'll do them! Just give me a pointer!
Concretely, I would benefit from a way to trace the lifetime of a keystroke event, from hardware up to when it (should) appear on screen. Again, I'm convinced the problem is with GNOME or some middle layer. But I've no idea how to narrow it down from there.