Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

mouse and keyboard dead on resume from hibernation.

Need help with peripherals or devices?
Post Reply
Message
Author
rayandrews
Posts: 117
Joined: 2014-01-31 21:32
Has thanked: 6 times
Been thanked: 1 time

mouse and keyboard dead on resume from hibernation.

#1 Post by rayandrews »

When I resume from suspend everything is fine, however when I resume from hibernation both my mouse and my keyboard are dead. Very dead -- my keyboard light up when it's on, but after hibernation it's dark, so it's as if the device is simply not powered up. The screens are fine, everything that should be there is there. Still with Debian 11 I never got hibernation to work at all, so we're moving in the right direction.

rayandrews
Posts: 117
Joined: 2014-01-31 21:32
Has thanked: 6 times
Been thanked: 1 time

Re: mouse and keyboard dead on resume from hibernation.

#2 Post by rayandrews »

in /etc/rc.loca:

echo 'on' > /sys/bus/usb/devices/5-2/power/control
echo 'on' > /sys/bus/usb/devices/8-1/power/control

... does the trick. Those being the right ports for my devices of course.

User avatar
FreewheelinFrank
Global Moderator
Global Moderator
Posts: 2117
Joined: 2010-06-07 16:59
Has thanked: 38 times
Been thanked: 232 times

Re: mouse and keyboard dead on resume from hibernation.

#3 Post by FreewheelinFrank »

To help diagnose what the issue actually is, some more information would be useful. This could help other users as well.

Are mouse and keyboard the same model? Do you have other models you could try?
Does the same issue occur using different USB ports on the computer?
What is kernel version and what are hardware details? Could you supply output of the following?

Code: Select all

$ inxi -Fxxxrz
What is the output of the following after the computer wakes up?

Code: Select all

# dmesg | grep -i USB
What's the USB controller?

Code: Select all

$ lspci -s <device>
Match from

Code: Select all

$ ls /sys/bus/pci/devices
with USB hub output from dmesg.

This information could pin the issue down to specific hardware/kernel version and allow a search for any solutions available.

rayandrews
Posts: 117
Joined: 2014-01-31 21:32
Has thanked: 6 times
Been thanked: 1 time

Re: mouse and keyboard dead on resume from hibernation.

#4 Post by rayandrews »

Frank:

If the devs wanted to pursue this I'd be happy to offer any cooperation.

l get the feeling that this is not a one-off problem tho -- I get the feeling that this is a deeper issue.

The output from those commands is huge, should I filter it a bit, or do you want the whole nine yards?

Meanwhile this is working in /etc/rc.local:

Code: Select all

# Wake up mouse and kb after hibernate.
echo 'on' > /sys/bus/usb/devices/5-2/power/control
echo 'on' > /sys/bus/usb/devices/8-1/power/control
# Wake up after suspend with either mouse or kb:
echo 'enabled' > /sys/bus/usb/devices/5-2/power/wakeup
echo 'enabled' > /sys/bus/usb/devices/8-1/power/wakeup
echo enabled > /sys/bus/usb/devices/usb5/power/wakeup
echo enabled > /sys/bus/usb/devices/usb8/power/wakeup


rayandrews
Posts: 117
Joined: 2014-01-31 21:32
Has thanked: 6 times
Been thanked: 1 time

Re: mouse and keyboard dead on resume from hibernation.

#5 Post by rayandrews »

... except that it seems the USB ports are assigned randomly at each boot :(

User avatar
fabien
Forum Helper
Forum Helper
Posts: 688
Joined: 2019-12-03 12:51
Location: Anarres (Toulouse, France actually)
Has thanked: 62 times
Been thanked: 161 times

Re: mouse and keyboard dead on resume from hibernation.

#6 Post by fabien »

rayandrews wrote: 2024-03-18 22:09 ... except that it seems the USB ports are assigned randomly at each boot :(
Seems scriptable (Bash example, probably wouldn't work as is in /etc/rc.local)

Code: Select all

$> while read -r dir; do [[ -f "$dir/power/control" ]] && cat "$dir/power/control"; done < <(grep -H "PRODUCT=46d/c077/7200" /sys/bus/usb/devices/*/uevent | sed 's/^\(.\+\)\(\/uevent:PRODUCT=.\+\)/\1/')
on
Note that mine is set to on even though I haven't done anything to it, so there is probably a more serious solution to your problem.

rayandrews
Posts: 117
Joined: 2014-01-31 21:32
Has thanked: 6 times
Been thanked: 1 time

Re: mouse and keyboard dead on resume from hibernation.

#7 Post by rayandrews »

I'm tinkering with a script myself. But as you say, there should be a more elegant solution to this. I wonder who else has the problem? I'd like to get a dev's opinion of this.

User avatar
FreewheelinFrank
Global Moderator
Global Moderator
Posts: 2117
Joined: 2010-06-07 16:59
Has thanked: 38 times
Been thanked: 232 times

Re: mouse and keyboard dead on resume from hibernation.

#8 Post by FreewheelinFrank »

rayandrews wrote: 2024-03-18 16:01
If the devs wanted to pursue this I'd be happy to offer any cooperation.

l get the feeling that this is not a one-off problem tho -- I get the feeling that this is a deeper issue.

The output from those commands is huge, should I filter it a bit, or do you want the whole nine yards?
I tested the commands on my computer and the output wasn't huge. I suppose if you are getting multiple USB kernel messages due to an issue, dmesg output might be large. If it is repeating the same thing over and over, just give us an excerpt, or use Pastebin.

A web search suggests it happens to other people, but it's certainly not universal. The issue is probably tied to certain hardware/kernel combinations.

The output would allow us to check this. No kernel devs here AFAIK, but the results might point us to other forums etc and possible workarounds, solutions or even bug reports for the same hardware, where kernel dev would be looking at the issue, assuming it is with the kernel as USB power does seem to be handled by the kernel.

rayandrews
Posts: 117
Joined: 2014-01-31 21:32
Has thanked: 6 times
Been thanked: 1 time

Re: mouse and keyboard dead on resume from hibernation.

#9 Post by rayandrews »

Frank:

Well I dunno. It's fixed itself. It was busted two days ago, it was busted yesterday. Ran the test five times to be sure. But today, I commented out those lines in rc.local and ... everything is fine. Maybe what I did yesterday somehow woke something up? I'm tweaking my new install of bookworm so I'm changing at tweaking all sorts of things -- somehow I did something that fixed it ... or so it seems. If it goes bad again we'll pursue it, but for now, let's let sleeping dogs lay. Thanks for your interest.

Post Reply