Computer doesn't go to Sleep After running Steam

My computer goes to sleep after X minutes of inactivity.

However I’ve noticed that after playing certain games (not all) on Steam, my computer doesn’t go to sleep. For example, right now, I’m playing Factorio and it does something that even after exiting Steam, my computer still refuses to go to sleep

Is there a way to diagnose and fix the issue?

Steam blocks sleep even when a game is not running (but this can be fixed). But if Steam is closed it should not do that so maybe your game does something, not Steam.

Maybe check the command xset q on a fresh boot, then when you start steam, then when you start your game, then when you quit the game, and then when you quit Steam, to see the information about monitor stuff, these parts specifically not the rest:

Screen Saver:
  prefer blanking:  XXX    allow exposures:  XXX
  timeout:  XXX    cycle:  XXX

DPMS (Display Power Management Signaling):
  Standby: XXX    Suspend: XXX    Off: XXX
  DPMS is XXX

Compare the command output at each ‘stage’ of the operation and see what changes.

1 Like

Thank you for that command, its a cool one that I didn’t know about.

I’m going to try to copy and paste, but I don’t know how to format it as you did. But nothing changed under the Screen Saver settings; but under DPMS, everything got set to zero for some reason.

I don’t know if it matters, but I’m running KDE and have used the power controls in Settings, to tell my computer to go to sleep after 6 min.

Here’s before Factorio
Screen Saver:
prefer blanking: yes allow exposures: yes
timeout: 0 cycle: 600
DPMS (Display Power Management Signaling):
Standby: 600 Suspend: 600 Off: 600
DPMS is Disabled

Post Factorio:
Screen Saver:
prefer blanking: yes allow exposures: yes
timeout: 0 cycle: 600
DPMS (Display Power Management Signaling):
Standby: 0 Suspend: 0 Off: 0
DPMS is Disabled

Timeout being 0, the screen saver is disabled. DPMS is also disabled.

Maybe try to manually fix the timeout to something like 10 seconds, see if it works, then play your game, quit, see if it still works after 10 seconds, reboot, see if it still works after 10 seconds.

If it works then set it to appropriate value you desire.

But as I understand, playing your game may/will reset these settings… maybe we should do things more logically. First you need to make sure what does what. You say “certain games (not all)”, you need to make it 100% sure, is it some specific games only that trigger the issue? if so, then do the list. If it is completely random game, then make it clear. That is our proper starting point I think.

If it is only some specific games, then we can think about it.

1 Like

Yes, I don’t use the screen saver, as sleeping turns the display off also.

However I am confused why DPMS is disabled; but the thing is that sleeping works just fine on a regular basis. Maybe my monitor just shuts itself off when it detects no signal from the computer.

Should I try to manually force DPMS via typing in the terminal: xset +dpms

And see if that resolves the issue? But then what is KDE’s setting not doing right in this case?

Hmmm…so regarding teh Game list.

That will take a while to filter as tehre are a lot. Some games result in weird bugs: for example the computer will go to sleep…but then wake itself up somehow. Then go to sleep again, and wake itself up. Adinfinitum.

But I don’t believe its random. Factorio DEFINITELY sets those quantities to zero; maybe other games do it randomly, but Factorio is a definite.

My bad I don’t know why when I read sleeping I was thinking about the monitor energy saving.

I don’t really use sleep on my computer so I’m not sure if there is a Steam issue, or if some games can create the issue you describe.

So an update:

I did a few restart tests.

I think the culprit might be somewhere beyond the xset q output.

If I restart here’s the output of xset q:
Screen Saver:
prefer blanking: yes allow exposures: yes
timeout: 0 cycle: 600
DPMS (Display Power Management Signaling):
Standby: 600 Suspend: 600 Off: 600
DPMS is Disabled

If I ONLY launch Steam and close it immediately afterwards (with no games launched) the values get set to zero:
Screen Saver:
prefer blanking: yes allow exposures: yes
timeout: 0 cycle: 600
DPMS (Display Power Management Signaling):
Standby: 0 Suspend: 0 Off: 0
DPMS is Disabled

However (granted I haven’t tested it right now), normally my computer goes to sleep just fine after running and exiting Steam. I’ll a do a quick test in a few minutes to see if something has changed, but it does go to sleep even if DPMS values get set to zero.

These are only for the monitor energy saving, as I wrote earlier I was on that when you were talking about system SLEEP, not monitor energy saving.

I’m not sure what to look for, if the issue is with system sleep. Maybe look for errors in journal when the issue arises.

Don’t do that. Seriously, don’t do that. Because it will then also go to sleep during a big update, with as a result that you’ll end up with a broken system.

If you want the computer to sleep, then make it do so manually, not automatically.

The solution to that is real simple: I don’t do updates unless if I’m sitting in front of my computer.

Considering how infrequent updates are vs how often I step away, it seems automatic sleep is a real convenience.

Sitting in front of the computer is not going to stop your system from automatically going to sleep.

The energy you save by having it go to sleep all the time is negligible, and the frequent temperature changes inside the machine are not exactly beneficial to the longevity of the circuits on your motherboard.

It’s a UNIX system. It was designed to be kept running 24/7. Shutting it down every day — or even twice every day if you shut it down over lunch — is still somewhat understandable. But having the whole machine come to a halt every time you step away from the keyboard is a bad idea, for so many different reasons.

Still, you don’t have to listen to my advice. It’s your computer, and it’ll still be yours (to fix) if and when it breaks.

:man_shrugging: