All manual sleep triggers cause pc to immediately wake but auto sleep functions (mostly) correct

I'm having a hard time figuring out why this is happening. If I wait for my pc to sleep automatically (see settings below) then things function as expected (screen turns off, pc lights/fans turn off, pressing any key wakes the pc). But if I press my power button to sleep the pc, go to the start menu and press sleep, or run systemctl suspend the computer will enter sleep for like 2 seconds and then just wake up on it's own. I don't even know where to start diagnosing what is going on since sleep does work but only when it kicks in automatically. EDIT: Also the reason for the "(mostly) correct" in the title is one time my pc automatically entered sleep mode (screen turned off) but my pc lights were on and my fans were running at full speed. It seemed to be a one time fluke and I didn't have anything unusal open.
Solution:
Okay the last comment on that reddit thread was my issue. I narrowed it down to my wireless logitech G502 X mouse causing my pc to wake 1-2 seconds after going to sleep. My best guess as to why the mouse wasn't doing this when the computer went to sleep naturally is that the mouse/usb dongle were going into a low power state after not being used for awhile. I also have an old wired logitech keyboard (like very old, weird eyeball logitech logo old) but thankfully that was not causing my pc to wake. After doing the below changes I can sleep my pc manually and it does NOT wake up 1-2 seconds later on its own. The downside is I can't move my mouse to wake my pc but thats not a big deal for me since I can just tap a key on my keyboard and it wakes. A very similar (but technically separate) issue can occur if you have a gigabyte motherboard, in which case use the fix that Cilantro linked in their message below this one. Steps to fix (mostly copied from that reddit comment with some tweaks):...
Jump to solution
17 Replies
Mules
Mules3mo ago
Sleep Settings:
No description
Cilantro Limewire
Having the same issue I believe, here’s a video. 3900x and 7900xt with A520i gigabyte mobo
Cilantro Limewire
Also updated to latest bios but still same behavior
No description
Cilantro Limewire
Bump on this
Aru
Aru3mo ago
From my own experience, Gigabyte mobos usually have trouble with suspend in Linux
Aru
Aru3mo ago
^ just an example of one, I had basically this exact same issue on my Gigabyte mobo. different mobo model from the post, but same issue
Mules
Mules3mo ago
I have a 7950X3D/7900XTX with an ASUS PRIME X670E-PRO WIFI mobo
Solution
Mules
Mules3mo ago
Okay the last comment on that reddit thread was my issue. I narrowed it down to my wireless logitech G502 X mouse causing my pc to wake 1-2 seconds after going to sleep. My best guess as to why the mouse wasn't doing this when the computer went to sleep naturally is that the mouse/usb dongle were going into a low power state after not being used for awhile. I also have an old wired logitech keyboard (like very old, weird eyeball logitech logo old) but thankfully that was not causing my pc to wake. After doing the below changes I can sleep my pc manually and it does NOT wake up 1-2 seconds later on its own. The downside is I can't move my mouse to wake my pc but thats not a big deal for me since I can just tap a key on my keyboard and it wakes. A very similar (but technically separate) issue can occur if you have a gigabyte motherboard, in which case use the fix that Cilantro linked in their message below this one. Steps to fix (mostly copied from that reddit comment with some tweaks): 1. Run sleep 20 && systemctl suspend and then unplug one usb device. If the computer continues to wake on its own a few seconds after sleeping that device is not the issue, repeat this step with other usb devices until the pc stays asleep. Then wake your pc manually and plug your problem usb device back in. 2. Run lsusb and make a note of the ID <vendorId>:<productId> 3. cd /etc/udev/rules.d/ and sudo vim 99-fix-logitech-wakeup.rules and paste the following in:
ACTION=="add|change", SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="XXXX", ATTRS{idProduct}=="YYYY", ATTR{power/wakeup}="disabled"
ACTION=="add|change", SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="XXXX", ATTRS{idProduct}=="YYYY", ATTR{power/wakeup}="disabled"
Replace XXXX with your usb device's vendorId and replace YYYY with your usb device's productId. You will need to add a line in this file for each usb device that is causing this issue. (Since it was just my mouse I only have the one line) 4. Run sudo udevadm control --reload-rules && sudo udevadm trigger 5. Manually sleep your pc to test if it stays asleep
Mules
Mules3mo ago
@Cilantro Limewire let me know if the above fixed you issue and I'll mark it as the solution
Cilantro Limewire
i was able to correct the behavior in all sleep scenarios by running the script here https://github.com/DAK404/OpenSUSE-Setup-Scripts/blob/main/GigabyteDesktop_Sleep_Fix.sh seems to be a different issue than the one you did above, it was not about the USB device waking, more about a bios bug with GPP0 Thread with the script and more deets at: https://www.reddit.com/r/gigabyte/comments/p5ewjn/b550i_pro_ax_f13_bios_sleep_issue_on_linux/ @Aru any chance something like this could be rolled into the baz onboarding tool as an optional system fix? id love to not have to remeber to apply this each time I re-install on a PC with a gigabyte mobo. new file so far seems to survive system updates and reboots.
GitHub
OpenSUSE-Setup-Scripts/GigabyteDesktop_Sleep_Fix.sh at main · DAK40...
A set of useful scripts that can help in setting up and maintaining OpenSUSE Tumbleweed systems - DAK404/OpenSUSE-Setup-Scripts
Reddit
From the gigabyte community on Reddit: B550i Pro Ax F13 BIOS sleep ...
Explore this post and more from the gigabyte community
Aru
Aru3mo ago
that'd be a question that @Kyle Gospo could answer better than I. I'm assuming you could maybe make an optional ujust. not sure about the onboarding portal though.
Mules
Mules3mo ago
Kind of funny how this issue can present in seemingly the exact same way but have two different root causes. I'll mark my message as the solution with the note about the gigabyte motherboard.
Cilantro Limewire
what hardware are you using? I suppose I may also have the USB issue if I had mouse and keyboard hooked up but this is mostly a living room steam machine in my use so I may not see the same use case
Mules
Mules3mo ago
7950X3D/7900XTX with an ASUS PRIME X670E-PRO WIFI mobo I'm using it with desktop bazzite since most of my gaming I use kbm That thread you linked does have one comment saying it fixed their issue with their ASUS board and that they had to disable XHC0. So it's possible your fix would have worked for my hardware but at this point it's fixed for me and I don't want to mess with it
Cilantro Limewire
interesting, nice that the fix can be found in this thread for those in the discord, but I still think its something worth considering bundling with onboarding or the post install add on tool (I forget the name of it) if @Kyle Gospo agrees
Pim
Pim3mo ago
been on fedora kde/nobara, same issue. its always the GPP0 messing up with gigabyte boards
Want results from more Discord servers?
Add your server