You are not logged in.
Hello everyone,
I have a rare, but relatively long-standing problem, that my computer sometimes shows balck screen after waking up from hybernation. I had an idea, that this might be related to some hardware. After a lot of testing plugging in and out peripherals, while and after hibernating, I think, I found out the sequence which always leads to a problem.
When I hibernate and then unplug a dongle of my wireless keyboad and then try to wake up, above mentioned black screen comes up. The builtin keyboard of my laptop is lit, and I can even adjust backlight using function keys. But waking up process is stuck.
If on the other case I wake with dongle is the same state, as during hibernation, whether plug in or not -> everything works great.
I have looked into Troubleshooting section from here: https://wiki.archlinux.org/title/Power_ … _hibernate
- I checked that
Watchdogstuff is off in systemd config.
- That I have only
intel_lpss_pcimodule in MODULES in
/etc/mkinitcpio.conf- I dont have
nvidiafbmodule, checked with
lsmod | grep nvidia.
How do I go about fixing it? I always forget about this and then end up having to restart the PC, losing the session and workspaces.. ![]()
Last edited by TiredButExcited (2024-06-12 08:16:48)
Offline
a lot of testing plugging in and out peripherals, while and after hibernating … When I hibernate and then unplug a dongle of my wireless keyboad and then try to wake up, above mentioned black screen comes up. The builtin keyboard of my laptop is lit, and I can even adjust backlight using function keys. But waking up process is stuck.
Generally https://bbs.archlinux.org/viewtopic.php … 4#p1960554
When this happens, can you
- switch to another VT (ctrl+alt+f3)
- reboot the system w/ the https://wiki.archlinux.org/title/Keyboa … el_(SysRq) (nb. that you'll have to explicitly enable the feature before) to hopefully preserve the journal of the failing resume?
As for mitigation, you could (logically) remove the usb dongle w/ a suspend/hibernation hook, https://unix.stackexchange.com/question … ice-dongle
Online
Thanks a lot for your answer
switch to another VT (ctrl+alt+f3)
- reboot the system w/ the https://wiki.archlinux.org/title/Keyboa … el_(SysRq) (nb. that you'll have to explicitly enable the feature before) to hopefully preserve the journal of the failing resume?
This does not work. I enabled the button with `sysctl kernel.sysrq=1`
After some more testing I discovered that wake up only hangs if mouse dongle is connected together with keyboard. Weirdly enough disconnecting mouse dongle with PC off does not do anything.
As for mitigation, you could (logically) remove the usb dongle w/ a suspend/hibernation hook, https://unix.stackexchange.com/question … ice-dongle
Could you please point me in the right direction how to make this hook? I think answer in the link only works if usb-port does not change, as otherwise path in /sys/bus/usb/drivers/ will change.
Offline
You'd loop through /sys/bus/usb/devices/* until you find the device w/ the relevant /sys/bus/usb/devices/*/id{Product,Vendor}
Online
I wrote a bash script, that finds the device and disconnects it.
Do I understand correctly, that now I need to make a systemd service with WantedBy=hibernate.target ?
I also checked the list of targets with `systemctl list-units --type=target` and did not find hibernate.target. Do I need to create it manually, or does it exist and is not shown in the list?
Offline
You can also just use the infrastructure for shell drop-ins, https://wiki.archlinux.org/title/Power_ … stem-sleep
Online
Thanks a lot seth. Now it works. Just a summary for other people:
0. Find out your `vendorID:deviceID` using `lsusb`.
1. Create a script to switch off keyboard just before hibernation. Here is a minimal example:
#!/bin/sh
# $1 parameter to a function is a number. 0 - for keyboard_off, 1 - for keyboard_on
toggle_keyboard () {
for device in /sys/bus/usb/devices/*;
do
[ "$(cat "$device"/idProduct 2> /dev/null)" = "<your-keyboard-id>" ] && { echo "$1" | sudo tee "$device/authorized"; }
done;
}
case "$1/$2" in
pre/*)
toggle_keyboard 0
;;
<Add additional checks if needed.>
esac2. Put / link your script to /usr/lib/systemd/system-sleep/
Parameters $1 / $2 are passed by systemd. We only need to accept and process them. More options:
You can also just use the infrastructure for shell drop-ins, https://wiki.archlinux.org/title/Power_ … stem-sleep
Offline