I recently bought a Lenovo ThinkPad E14 Gen 2 (AMD) with a Ryzen 4500U processor and 8GB of RAM soldered.
First thing I did was install another 32GB of 3200MHz DDR4 SO-DIMM RAM. Now I have 40GB of RAM.
Installing Xubuntu 20.04 has presented a number of issues. Some are solved, others are not.
Keyboard/Touchpad Stopped Working After Several Minutes
Soon after installing Xubuntu I discovered that the keyboard and touchpad would simply stop responding after some time, maybe 5 minutes, of inactivity.
Eventually I figured out I could press CTRL-ALT-F1 to switch to a text console and log in there. On examination of /var/log/Xorg.0.log I would see entries like:
[ 310.542] (II) event3 - Power Button: device removed
[ 310.565] (II) event5 - Video Bus: device removed
[ 310.585] (II) event0 - Power Button: device removed
[ 310.605] (II) event2 - Sleep Button: device removed
[ 310.621] (II) event8 - Integrated Camera: Integrated C: device removed
[ 310.662] (II) event4 - AT Translated Set 2 keyboard: device removed
[ 310.710] (II) event6 - ETPS/2 Elantech TrackPoint: device removed
[ 310.741] (II) event14 - ThinkPad Extra Buttons: device removed
I was able to restart my X session by typing sudo systemctl restart lightdm. This would restart the X manager and I could log in again with a working keyboard/touchpad.
By chance I tried the command xflock4 to test the screensaver – but every time I did the same thing would happen, keyboard/touchpad stop working, and log messages like the above would be produced.
I discovered that if I killed the xfce4-screensaver process then xflock4 would work, lock the screen (screen would go blank/black, and I could log back in again after a keypress on the keyboard to activate the display.
In the end I ran apt-get remove xfce4-screensaver to remove the xfce4-screensaver package altogether.
No more failing keyboard/touchpad.
Suspend to RAM Not Waking Up
Every time I tried suspend to RAM the laptop would seemingly suspend okay, the power button (and lid LED that forms the dot above the i in the word “ThinkPad”) would slowly fade in and out to indicate suspension, but on wake-up the laptop would backlight the keyboard but the screen would stay blank/black.
Later I discovered, from reading a forum post, that I could wake the laptop (with the blank/black screen), press CTRL-ALT-F1 to switch to console mode (still no display), type in my username and password, enter sudo shutdown -r now and re-enter my password (for sudo) and the laptop would reboot okay.
To test suspend I did the following:
$ cat /sys/power/pm_test # what test modes are available?
[none] core processors platform devices freezer
$ cat /sys/power/state # what power-down states are available?
freeze mem disk
$ sudo bash -c "echo core >/sys/power/pm_test" # test as much of the suspend process as possible
$ cat /sys/power/pm_test
none [core] processors platform devices freezer
$ sudo bash -c "echo mem >/sys/power/state" # initiate suspend for 5 seconds
This process worked with no problems. The suspend would occur, a delay of 5 seconds was then encountered, and the system then woke up, display working, keyboard working, everything working.
So what fixed it? Turns out Xubuntu 20.04 (as of 2020-12-19) comes with Linux kernel version 5.4. But it is kernel version 5.8 that is needed for proper support of the AMD GPU.
I had to update my /etc/apt/sources.list and add focal-updates as a source.
Then I installed linux-generic-hwe-20.04-edge:
$ apt-get install linux-generic-hwe-20.04-edge
This installed a version 5.8 kernel, specifically Linux version 5.8.0-33-generic (buildd@lgw01-amd64-010). After a reboot suspend-to-RAM worked, and so did waking up, the screen was reactivated (you might have to tap a key, e.g. SHIFT, to activate the display).