Skip to content(if available)orjump to list(if available)

Diagnosing bugs preventing sleep on Windows

ncann

Troubleshooting sleep is an exercise wrapped in pain.

Figuring out which program prevents sleeping is the easy part - there are tools that show that, and you can also usually just brute force it by killing programs one by one.

Then comes figuring out why a system claims to be sleeping but isn't (e.g. the fan is still spinning). Usually this is because of the Modern Standby/S0 crap and in many cases there isn't a solution because the BIOS removed support for S3.

The other class of issue is after sleeping the system won't wake up, or wake up randomly, or wake up with random glitchy graphics/sounds/etc.

Sleep is easily Windows's most bug-ridden area.

jchw

As a long-time Linux user, it's also a pretty damn buggy area of Linux, although I have been much more fortunate with getting hardware that works decently enough with sleep on Linux over the years than some people have.

The main benefit of Linux, though, even though it's pretty clear it doesn't have the best support for suspend/resume, is that it won't yield the resume function against you to force you to run Windows Update and yeet all of the stuff you've been working on overnight or light your bag on fire. You'll still have to get hardware that works well, but that's it. And.. and hope the AMD driver doesn't break suspend again. I actually do like running Linux, even if it might be hard to tell sometimes :)

The_SamminAter

I believe the AMD sleep issue was just fixed, and is available in 6.14: https://nyanpasu64.gitlab.io/blog/amdgpu-sleep-wake-hang/

nine_k

As a long-time laptop Linux user, I'd say that "suspend to RAM" is adequate lately, and booting from scratch is paradoxically often faster than restoring from sleep, even on an NVMe.

fuzzfactor

Since Windows 8 as well, you're pretty much doing something wrong if it takes more than a few seconds to cold boot whenever you actually are going to use the PC.

Nothing saves more energy than turning it all the way off, this used to be a no-brainer. Sure makes laptop batteries last years longer.

Plus the failure to perfect partially-powered states over the decades doesn't have to have an impact.

AndrewDavis

> Usually this is because of the Modern Standby/S0 crap and in many cases there isn't a solution because the BIOS removed support for S3.

Also, modern windows won't let you select S3 sleep if it detects support for S0. There used to be a simple registry edits you could do but Microsoft seem to have closed that loophole.

I chose my current laptop because in the BIOS it has a sleep setting, and if you pick the oddly named "Linux sleep" it disables S0 sleep. Thereby allowing S3 sleep in Windows.

This is after having a previous laptop act like a heater to my lunch in my bag, or being dead despite being full charged after waking up overnight and running hard till the battery ran out. Or perhaps the most obnoxious, my wife closing her laptop with a video running and at 3am her laptop bringing itself to life waking us up.

taneq

I’ve had ongoing problems with my new laptop either not sleeping properly or waking up randomly in my backpack and toasting itself until it shuts down with a critical overtemp error. My solution is to set the power button to hibernate, and just press the power button if I expect it to be in my bag for more than 15 minutes.

Aardwolf

> There used to be a simple registry edits you could do but Microsoft seem to have closed that loophole.

Why? I mean, what incentive does MS have to say "people are still trying to use the non-buggy sleep that doesn't cause fires, let's close the loophole to force using the buggy sleep"?

layer8

Probably because "Switching between S3 and Modern Standby cannot be done by changing a setting in the BIOS. Switching the power model is not supported in Windows without a complete OS re-install."

Quote from, and more info about Modern Standby, here: https://learn.microsoft.com/en-us/windows-hardware/design/de...

S3 is considered “legacy”: https://learn.microsoft.com/en-us/windows-hardware/design/de...

The main motivation for Modern Standby was to enable instant wakeup and push notification-like functionality during standby, like smartphones. That’s not possible with the traditional sleep modes. Unfortunately it doesn’t work as seamlessly as one would like.

ncann

The non-buggy sleep (S3) isn't even supported in the BIOS in many new laptops now (in the Dell I'm using for example). So MS probably decided to kill that option off for everyone. To be honest it's a very confusing situation since there are so many hardware configurations under Windows and if you search online I think some people are still able to disable S0 on their new laptop/latest Windows, but some (myself) definitely cannot.

fodkodrasz

The most annoying crap with modern sleep is that it doesn't lock the computer, only after some time has elapsed in sleep. I want the computer be locked immediately. Also Keepass cannot hook the sleep event, and lock the database. This is a security nightmare for me, really inconvenient.

Other is that the slightest mouse movement wakes the computer. Disabling wake devices does not work anymore. Guides say disable it in your bios. If there is a configuration option... I don't have (neither on a Lenovo, nor on a Beelink) such option. (Yes, I did the powercfg -wake-armed/device manager rain-dance, to no avail, it worked reliably to configure wake sources on S3)

S3 sleep was good enough for me, and S0 is a large step back in reliability and usability, for no perceived benefit. Unfortunately my newer machine does not support S3 anymore.

With MS copying all the bad ideas from MacOS it is getting ever worse, slowly Windows (being my get stuff done desktop) becoming as unusable my Mac. (ps. I'm was a long time, 10+ years, Linux desktop user, but constant flux of the platform made me move away)

kbolino

The Macs (at least the Apple Silicon ones) do it much better, though. In most cases I can see minimal battery loss even over days. Whereas the Windows laptops are good for maybe a few hours on sleep. Whatever Apple is doing is miles apart from Windows/PC in terms of implementation even if they are theoretically the same.

However, the "trick" to disabling mouse wake-up for me has been to go into Device Manager and disallow the individual mouse from waking the machine up. It's annoying because I'd still like to have it wake up on button press but it extends the battery significantly. Even on desktop, it's useful to keep the system asleep and not spinning up the hard drive and waking the monitor pointlessly in the middle of the night.

7bit

I use Hibernation instead of Standby. I have an SSD so the difference boils down to maybe 10 seconds. Which is time I do have :)

ncann

Hibernate is great, except for the part where it wears down your SSD much faster, especially if you have a machine with big amount of RAM.

layer8

Hybrid standby is the best, but requires S3 support.

ryandrake

> The other class of issue is after sleeping the system won't wake up

The last company where we used Windows, we'd all walk around from conference room to conference room carrying our laptops opened up, because nobody was sure they would work again without a hard reboot if you closed the lid.

vikingerik

Did anyone try the setting for "when laptop lid closes" set to "do nothing"? I've always used that on a half dozen Windows laptops over the years and never seen it not work. Even if sleep is finicky, that will just make it stay fully running. If you want it to sleep, do that separately from the start menu or whatever, don't tie the sleep state to the lid state.

fuzzfactor

I always set it just the opposite, close the lid and it shuts down completely.

Untying the sleep state to the lid can still be the advantage even if the full power state takes it place.

vo2maxer

I’ve never had an issue finding the source. I usually run powercfg /lastwake in an admin terminal, then follow up with Event Viewer. Most recently, it was HP Print Scan Doctor waking the computer during the night.

Dennip

My PC if put to sleep will completely randomly just wake up in the middle of the night. Its infuriatingly annoying to figure out why/which app is causing it as its not easily reproducible

vo2maxer

Here’s a surprisingly thorough and reasonable checklist—considering the source: https://www.pcmag.com/how-to/stop-your-computer-from-randoml...

izacus

sigh Yeah, I'm just battling with the fact that Win11 just won't sleep anymore after I updated the wifi card to a new one. It *claims* to sleep in sleep study, but the power indicator doesn't go out, the disk activity doesn't stop and the battery trains in couple of hours.

It's infuriating.

fuzzfactor

Try booting in admin safe mode, looking in Device Manager, Show Hidden Devices, and manually uninstall the phantom old wifi device that's not really there any more.

No guarantees but that's what I would do before expecting great progress otherwise.

The theory is that Windows is lying awake at night wondering if their old familiar accomplice is going to ever be seen again or not ;)

NL807

>because the BIOS removed support for S3.

i hate this so much

InsideOutSanta

I just want to say that I absolutely love these articles. Reading these kinds of investigations is like brain candy to me. I don't know why, but in my head, this falls into the same genre as a Sherlock Holmes novel.

v1ne

If it's not a user-space, but a driver issue, I found powercfg /sleepstudy pretty helpful to determine why a W11 machine didn't enter or exited sleep too often, after the fact.

On my laptop, this led me to discover that my Qualcomm X55 WAN is a real standby drain and that my Lenovo Thunderbolt dock really likes to disable its sleep mode after some big Windows updates, leading to a standby drain after the first time I plugged it in. I'm still surprised how many pitfalls there are with standby, even on Windows.

jvdvegt

Quite worrysome they think that the screen not auto-locking after a time out is a small issue, but not auto-suspending is a big issue. That might be the case for laptops, but for desktops I'd say it's the opposite. Not auto-locking is a security incident.

IshKebab

I found that leaving a playstation controller plugged in prevents sleep. Unfortunately I didn't have any clever tricks to find it. I just unplugged everything and then gradually plugged them back in. None of the software tools I could find would tell me the cause.

sebazzz

What is even more frustrating is having Windows wake up after a successful sleep and it being braindead. White cursor on a black screen, supposedly being stuck between the user session and winlogon. And no way you can at least friendly shutdown the system or can get any response except from the moving cursor.

lightedman

Too many things will prevent Windows from going to sleep in a proper manner. Update available? It won't sleep half the time until you restart the system to allow the update to install. OBS's virtual camera being active? No sleep.

I had kept thinking my cat had gotten onto my desk and stepped on the keyboard or moved the mouse around - security camera showed that to not be the case.

cosmic_cheese

Loads of USB accessories can do it too. Granted this isn’t necessarily fully Microsoft’s fault since average USB gadget firmware quality is poor at best, but it’s a problem.

jchw

I think I once accidentally stopped Windows from locking or dimming the screen by opening a context menu somewhere (maybe on the taskbar?) - Haven't recreated it so it could've been a freak accident but I thought that was surprising. (Who knows. If anyone can reproduce it, maybe it'll make a nice quick workaround to bypass org policies for whatever reason.)

On the other hand, on Linux, I have found that if I have YouTube fullscreen'd in Firefox, it's a crapshoot whether or not KDE Plasma will decide it's OK to sleep after the video ends. Not a big deal, but rather amusing nonetheless.

dmitrygr

I used to be good at this. And then I bought a Mac. I don’t miss this.

vo2maxer

Not to rain on your Mac-triumphant lap, but Apple has a long list of suggestions for sleep and wake issues: https://support.apple.com/guide/mac-help/if-your-mac-sleeps-...

dmitrygr

And i'll worry once I hit any one of them. So far: none.

47282847

Hm. I have a Macbook M3 and it doesn’t come up from sleep every third time or so, freezing and then force-restarting all running apps in the background. Most other times it takes up to a minute to show the login screen. No idea how to debug. Still hoping for some update to magically fix it.

vo2maxer

Better keep my link handy. ;)

derriz

You must be lucky. I've wasted hours or tens of hours diagnosing sleep issues on my mac. What's infuriating is that this used to "just work" and was a major selling point for MacOs. It was one of the reasons that made me abandon an experiment to switch to using a Linux laptop. Windows was even worse.

I now avoid leaving my MacBook unplugged overnight because I fear the battery draining to zero will cause it damage. This has happened a number of times when I've had some heavy Safari pages open when closing the lid. Some other process wakes the OS and now Safari stars chewing up power.

I tried systematically dealing with each cause and eliminated most of them but am still plagued by a few issues including some mDNSResponder stuff that is ungoogleable.

Nothing that the Macbook has done while "helpfully" waking from sleep has EVER provided any value to me while on multiple occasions, it has caused issue by draining the battery - which, long term, is actually damaging to the hardware. I wish I could have the old MacOS Sleep behavior back.