Hacker News new | ask | show | jobs
by ncann 436 days ago
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.

7 comments

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 :)

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.
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.

I believe the AMD sleep issue was just fixed, and is available in 6.14: https://nyanpasu64.gitlab.io/blog/amdgpu-sleep-wake-hang/
> 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.

> 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"?

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.

What if I don't want push notifications and want laptop closed to mean to not do anything? Does this new mode still support that, or is the notifications and heat-up-in-your-backpack thing there on purpose and not disablable? In other words, is this new thing forcing this new behavior only, or does it also support the same things as S3 if you choose to want that?

Note that I use Linux and a less-than-a-year-old thinkpad that has traditional standby, but I'd like to know what the inevitable that's coming is

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.
> So MS probably decided to kill that option off for everyone.

not so, because of.

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.
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)

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.

Unfortunately having disabled all devices as wake sources does not help in my case (actually a HP and a Dell machine are also affected in the household). It doesn't matter if I click through the device manager or the powercfg (they are equivalent). S0 is disappointing for me so far.

My Mac (M1 Air) does this a bit better indeed, but I hear colleagues also cursing it for heating up in the backpack, and such (M2 CPU). Still I think most of the copied stuff made windows worse (lots of UI/UX stepbacks also).

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 :)
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.
The impact is minor. SSDs are super durable nowadays and Hibernating for years won't really make a difference. The SSDs will outlive the need for a bigger disk anyway. But technically I agree.
Hybrid standby is the best, but requires S3 support.
> 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.

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.
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.

I’ve been taught through years of people closing the lid of my laptop that “do nothing” is the right setting to use.
I've done that too, just don't put it back in the briefcase without checking if it's still running first :)
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.
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
Here’s a surprisingly thorough and reasonable checklist—considering the source: https://www.pcmag.com/how-to/stop-your-computer-from-randoml...
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.

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 ;)

>because the BIOS removed support for S3.

i hate this so much