ValveSoftware / steam-for-linux

Issue tracking for the Steam for Linux beta client
4.22k stars 174 forks source link

Steam sometimes prevents system from going to sleep #9509

Open buu342 opened 1 year ago

buu342 commented 1 year ago

Your system information

Please describe your issue in as much detail as possible:

I've been having this issue ever since I've had this desktop (so almost a year now). I've always run Kubuntu (Ubuntu using KDE Plasma as my DE) on it, starting originally with 22.04 LTS, and then I moved to 22.04 rolling release, and I've basically been keeping the system up to date up until 23.04. Same goes for the kernel, originally starting on 5.26 and I'm currently on 6.2.

When I try to suspend my system, it will fail to do so every now and then. Typically when suspending, the desktop fades to black, leaving only the mouse cursor visible, and then eventually the cursor disappears too and the system goes to sleep. But every now and then, the cursor will not disappear, and eventually the black will fade into my lock screen. I assumed this was a random Kubuntu bug for a while, but I one day got annoyed with the issue and decided to try to figure out why it was happening. I used journalctl -b, and the only information I could find was this:

https://gist.github.com/buu342/822bfa2e433281f288206cb25d893ef6

For reference, here is a successful suspend:

https://gist.github.com/buu342/8e8da5f40158da2ec309fe420dce9960

I doesn't seem to tell me anything interesting. I then tried killing different applications and suspending each time. The key was killing Steam. The past two months, whenever my system randomly decides to not sleep, I exit Steam (I have to wait until the Steam process is completely dead) and then suspend will work without flaw. I haven't been able to figure out why it happens specifically. Steam has managed to suspend without problems during updates or shader precaches, but will fail to suspend when it seems to be completely idle. It seems utterly random, which sucks because it makes harder for me to provide a minimal reproducible example.

Steps for reproducing this issue:

  1. Try to suspend the system
  2. It does not
  3. Login and kill the Steam process
  4. System suspends without issues
buu342 commented 1 year ago

If there are any other logs worth sharing besides journalctl, let me know and I'll post them as soon as the system fails to suspend again.

buu342 commented 1 year ago

Ok, minor update. I have confirmation that it really is Steam that is blocking sleep, straight from KDE's power manager: image

It might be possible this is a duplicate of #5607

A-UNDERSCORE-D commented 1 year ago

Seeing this as well, its stopping my (KDE, OpenSUSE Tumbleweed) machine from auto-locking. Even when steam is minimised to the tray

@kisak-valve Appears this covers more than just Ubuntu. Maybe a KDE thing?

buu342 commented 1 year ago

Updated title to reflect that :slightly_smiling_face:

Nitrousoxide commented 1 year ago

This seems to be happening for me too on Fedora in Gnome. Killing steam will let the computer sleep.

buu342 commented 1 year ago

Ok, so it's not just KDE then? It's just straight up: Steam prevents Linux from going to sleep.

DarSin1 commented 1 year ago

Confirmed here as well. EndeavourOS-KDE.

Nitrousoxide commented 1 year ago

My computer seems to be able to sleep again after I untoggled "Enable GPU accelerated rendering in web views (requires restart) under Settings -> Interface.

I have an amd gpu so drivers shouldn't be an issue in Linux.

buu342 commented 1 year ago

That's interesting. I have noticed that if I open steam and browse the community tab, in around a minute, KDE will report that Steam is inhibiting sleep. So I always had an inkling it was related to the web browser somewhat. However, I have gotten this inhibition without using the browser, so I didn't put it in the OP. I'll try toggling the GPU acceleration and see if that helps.

buu342 commented 1 year ago

Unfortunately, no dice on my end.

Nitrousoxide commented 1 year ago

yeah it's not fixed it for me now either so who knows. Closing steam still seems to let the system sleep though so I'm still pretty sure that's it.

Nitrousoxide commented 1 year ago

It seems to have fixed itself now? Perhaps it was something to do with the animation running for the summer sale? With that gone in the store page it now seems like the computer can correctly sleep even with steam open.

buu342 commented 1 year ago

It seems to have fixed itself now? Perhaps it was something to do with the animation running for the summer sale? With that gone in the store page it now seems like the computer can correctly sleep even with steam open.

No dice here, unfortunately. Still buggered.

DataCpt commented 1 year ago

I tried launching steam and leaving it alone. Still prevents sleep.

JohnMcLear commented 1 year ago

Ubuntu too

jose@ryzin:~$ dbus-send --print-reply --dest=org.gnome.SessionManager /org/gnome/SessionManager org.gnome.SessionManager.GetInhibitors
method return time=1692784843.604859 sender=:1.43 -> destination=:1.1420 serial=37596 reply_serial=2
   array [
      object path "/org/gnome/SessionManager/Inhibitor4941"
      object path "/org/gnome/SessionManager/Inhibitor169"
   ]
jose@ryzin:~$ dbus-send --print-reply --dest=org.gnome.SessionManager /org/gnome/SessionManager/Inhibitor169 org.gnome.SessionManager.Inhibitor.GetAppId
method return time=1692784857.675175 sender=:1.43 -> destination=:1.1422 serial=37605 reply_serial=2
   string "Steam"
jose@ryzin:~$ dbus-send --print-reply --dest=org.gnome.SessionManager /org/gnome/SessionManager/Inhibitor4941 org.gnome.SessionManager.Inhibitor.GetAppId
Error org.freedesktop.DBus.Error.UnknownMethod: Object does not exist at path “/org/gnome/SessionManager/Inhibitor4941”
jose@ryzin:~$ dbus-send --print-reply --dest=org.gnome.SessionManager /org/gnome/SessionManager org.gnome.SessionManager.GetInhibitors
method return time=1692784871.083863 sender=:1.43 -> destination=:1.1424 serial=37607 reply_serial=2
   array [
      object path "/org/gnome/SessionManager/Inhibitor169"
      object path "/org/gnome/SessionManager/Inhibitor4942"
   ]
jose@ryzin:~$ dbus-send --print-reply --dest=org.gnome.SessionManager /org/gnome/SessionManager/Inhibitor4942 org.gnome.SessionManager.Inhibitor.GetAppId
method return time=1692784875.939375 sender=:1.43 -> destination=:1.1425 serial=37608 reply_serial=2
   string "Steam"
jose@ryzin:~$ 

And for some reason it's creating new AppId's periodically.

JohnMcLear commented 1 year ago

My computer seems to be able to sleep again after I untoggled "Enable GPU accelerated rendering in web views (requires restart) under Settings -> Interface.

I have an amd gpu so drivers shouldn't be an issue in Linux.

Mine is untoggled and I have this issue so I'm sceptical that's the cause or solution.

gwaewion commented 10 months ago

Arch+KDE. The same issue.

gabevenberg commented 10 months ago

not just a kde thing, seeing on arch+i3 as well.

credomane commented 5 months ago

In the past I could just make sure that Steam client was on the library tab and this was a "non-issue", if you will. However either my update to KDE6 or one of steam's march updates (or perhaps a mixture of both?) this "trick" of staying on the library tab work around to no longer solve the issue. Now my computer will refuse to go to sleep unless I completely exit steam.

EndeavourOS w/ KDE6.

stardude900 commented 5 months ago

Fedora39 + Cinnamon with Kernel 6.8, same problem.

samwcoulter commented 5 months ago

Ubuntu 22.04 and i3wm, same issue.

aaannestad commented 3 months ago

Been experiencing the same bug for many months on Manjaro and Arch. Running systemctl suspend manually works just fine, but as long as Steam is running, the system will never automatically suspend itself.

I don't suppose anyone knows any workarounds? (beyond 'manually shut down Steam whenever you're not playing a game')

materemias commented 3 months ago

for arch based systems there is a workaround in the AUR: steam-screensaver-fix

Cherser-s commented 2 months ago

Same issue on Gentoo with i3wm.

AceBlade258 commented 1 week ago

Fedora (40) with i3wm, and I am experiencing this.

It seems to be related to certain games; in particular if I play Satisfactory or SMITE, then Steam will keep the screen from sleeping. It does seem to exclusively be limited to games run through proton (e.g. playing only Factorio since steam launch doesn't cause this), but it's not all games run through proton (e.g. I have no issues when the only game I've played is Apex Legends).

I have a suspicion it's related to Proton, but I have not been able to establish a clear link, since it's inconsistent.