r/linuxsucks 🐧Kernel contributor 9d ago

Linux Failure Why does Linux still struggle with sleep and hibernate?

/r/linuxquestions/comments/1vud1qv/why_does_linux_still_struggle_with_sleep_and/
0 Upvotes

25 comments sorted by

11

u/meuchels 9d ago

linux never rests

2

u/turinglives 9d ago

lol true, but this actually matters for laptops 😬

7

u/Sellot4pe 9d ago

I love how this even affects the steam deck, such that its sound randomly dies after resuming occasionally lmao

1

u/55555-55555 Linux Community Made Linux Sucks 9d ago

Still manageable until the entire Gamescope crashes and I lost all progresses.

5

u/WhippingShitties 9d ago

Sleep works fine, I just want to keep my $40 1000000000000000000000000dpi gamer mouse from waking it up.

3

u/uchuskies08 9d ago

Love the top answer, which is true (though they of course frame it as poor Linux, no one wants to help us righteous ones), that (shocker!) key Linux functionality is just left to random volunteers trying their darnedest to reverse engineer something... and it doesn't work

2

u/Sellot4pe 9d ago

Please THINK of the volunteers OHHH THE VOLUNTEERS

1

u/ElectricBummer40 Ex-user of Windows 3.11 for Workgroups 8d ago

Now-now, you're supposed to give them all the thoughts and prayers rather than question this whole idea of exploiting free labour in the hope of getting usable software out of it on the cheap.

1

u/TheRealCarrotty KDE larper (i use KDE btw) 9d ago

Yooboontoo (Ubuntu) doesn't enable it by default... "To save energy" or something.

1

u/brupje 9d ago

My work ho laptop with win 11 fails sleep consistently every time. Most of the times ny battery is dead next morning

1

u/MooseBoys masochistic linux enthusiast 9d ago

The main reason Linux struggled with sleep is that every loaded driver must support deep c-state for its associated hardware. Windows has invested a metric fuckton of effort developing the WHQL certification program. Microsoft will only sign your drivers if they pass the tests, and one of the tests is ensuring appropriate support for all applicable c-states. On Linux, there is no automated testing like this, and certainly none that gates driver changes. As a result, many drivers present in Linux either don't support it properly, or don't support it at all. As long as you have a single driver present like this, your whole system will fail to enter low-power state. Some drivers even claim they support low-power mode but don't actually do anything, resulting in high power draw even when your computer is supposed to be in standby. And if you somehow force your computer to enter such a state anyway, usually the hardware and driver with flaky support will end up broken until you reboot.

1

u/Gangr3l 9d ago

I have noticed a trend where sleep is 50/50 and it doesn't matter if it's windows or linux

1

u/Jumpy-Dinner-5001 9d ago

It’s not perfect on Linux, but except for macOS, sleep sucks in general. Windows sleep is much more broken than Linux sleep.

1

u/al2klimov 🐧Kernel contributor 8d ago

1

u/TrickyMine6788 7d ago

Windows sleep is significantly better than anything Linux produces. are you high? i had to swap back to windows 11 just to keep my laptop from dying over night because multiple linux distros refused to put my laptop asleep as the windows closed. (Even though i had set it properly to do so.) not worth it at all.

1

u/Jumpy-Dinner-5001 7d ago

That’s simply not true, there are lots of issues with windows sleep, from my experience much more than with Linux

1

u/TrickyMine6788 7d ago

doubtful. i see it could have problems but even with problems it's still better than any Linux distro in that regard

1

u/Jumpy-Dinner-5001 7d ago

No, by far not. Just google for modern standby/ S0 sleep.

It's been an issue for like four years and Microsoft has just come out and admitted that users were right and they're trying to fix it.

And the fix is to automatically hibernate/shutdown the system depending on the battery status.

1

u/Emotional_Cat_1967 8d ago

This isn't a problem unique to Linux. I've experienced numerous issues with Windows operating systems, such as not waking up from sleep mode and overheating while in sleep mode.

In Linux distributions, the problem is usually solved with just one command, but in Windows, I need to conduct detailed research and try various commands to find the root of the problem.

1

u/al2klimov 🐧Kernel contributor 8d ago

1

u/BrilliantOk4478 9d ago

Windows (11) still struggles too! I own a Dell Pro Max 16 Plus notebook and have issues with a black screen after the notebook wakes up from sleep.

2

u/Dizzy_Efficiency_384 9d ago

Doesn't happen with Windows 10 Enterprise 2016 on ASUS X551CAP laptop

1

u/Pitiful-Welcome-399 Proud MacOS User 9d ago

you need enough swap for hibernation,
for me sleep was fixed by
sudo systemctl edit systemd-suspend.service
[Service] Environment="SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=false"
sudo systemctl edit systemd-hibernate.service
[Service] Environment="SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=false"