akorb / SteamShutdown

Automatic shutdown after Steam download(s) has finished.
MIT License
362 stars 28 forks source link

Why windows sleep activated before SteamShutdown shutdown? #54

Open FreePhoenix888 opened 10 months ago

FreePhoenix888 commented 10 months ago

I have set windows 11 power settings this way: Sleep after 30 minutes of inactivity. I expected SteamShutdown to disable right after steam download is finished, but on the morning I have found out that my PC was sleeping, not turned off. Why can this happen? Note that in SteamShutdown I have checked "Shut Down", not "Sleep" Here are my Kernel Power logs:

Information 12/7/2023 4:22:03 AM    Kernel-Power    107 (102)
Information 12/7/2023 4:21:58 AM    Kernel-Power    42  (64)
Information 12/7/2023 4:21:58 AM    Kernel-Power    40  (36)
Information 12/7/2023 4:21:57 AM    Kernel-Power    566 (268)

I am not sure whether sleep was activated by windows itself or by SteamShutdown because I see that the game download is finished at 4:21 AM: image And sleep event occured right at the moment, not after 30 minutes after download finish. I also wonder why is the last event says "The system has resumed from sleep" whether my pc was sleeping until the next day and was enabled on 2:31 PM:

Information 12/7/2023 2:31:01 PM    Kernel-Power    130 (33)
Information 12/7/2023 2:31:01 PM    Kernel-Power    131 (33)
Information 12/7/2023 2:31:01 PM    Kernel-General  1   (5)
akorb commented 10 months ago

I verified in the Microsoft manual that the command I use to shutdown the machine, i.e., shutdown /s /t 0, should also work for Windows 11.

That the Download finished at 4:21 am and that the machine was shut down at 4:21 am is unlikely to be a coinsidence. Either SteamShutdown did it, but this should have shutdown it completely as you say, or Windows did it itself. My vote is on the latter.

I hardly use Windows anymore so I don't know about its inactivity behavior, especially not about Windows 11. Maybe it says that 30 minutes inactivity means that no user interaction happened, like no key strokes and no mouse movement. And as soon as the machine is in idle then, i.e., no hard drive and network activity, it sends the machine to sleep. That's just a guess, though.