Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There's 2 supported sleep modes, referred to as "s2idle" and "deep" in /sys/power/mem_sleep. My limited understanding is this:

- "s2idle" = S0ix and "deep" = S3

- S0ix is similar to how smartphones go to sleep by just idling everything and not actually sleeping. On the Framework it drains around 1 or 2% per hour (I haven't measured exactly.)

- S3 sleep is the more familiar suspend-to-RAM functionality. The power drain is significantly less than S0ix.

Both sleep modes work fine in Ubuntu 21.10 on my Framework. I actually have mine set to S0ix because while S3 sleep has less battery drain, it takes something like 10 seconds longer than S0ix to wake back up after opening the lid. And since I'm mostly working from home, the battery drain isn't an issue for me.

Still, the difference between the two is significant enough that I kind of wish there were separate menu options for both. Though I realize that having "sleep" and "deeper sleep" menu options is not the most user-friendly design.

Of course you can also get hibernate (i.e. suspend to disk and turn off power completely) running, but my understanding is that hibernate is currently incompatible with Secure Boot, since it's non-trivial to verify that the system is resuming with the same kernel as the original boot. So you have to choose which one you want, hibernate or SB.



Thank you for adding these details.

My current Linux laptop (released in 2015) can sleep for about week, resume in 3-4 seconds. Am I reading your comment correctly that buying a Framework would degrade my user experience?


Yes, at least from what I've experienced, you can have "resume in 2 seconds" or "sleep for a week" but not both. (S0ix and S3 respectively)

To be fair, I don't think this is Framework's fault. My understanding is that this is a limitation of the current generation of Intel CPUs, so pretty much any current-gen Intel-based computer will have the same issue.


> you can have "resume in 2 seconds" or "sleep for a week" but not both. (S0ix and S3 respectively)

The way Windows laptops do this is to go from light sleep to deep sleep after being idle for a long period. You should be able to pull off the same trick in Linux.


I would actually greatly appreciate such a feature. Essentially hybrid sleep except that the two types of sleep are different kinds of low power states instead of suspend to RAM and disk.


Set up your laptop to RTC wake up x hours after suspend, go to deeper sleep. Should be 100% userspace, shouldn't need code changes in anything preexisting, and be mostly a question of configuration.


How do you tell if the wakeup is due to the RTC wake event or due to something initiated by the user (e.g. lid open, power button pressed, etc.)? Obviously you want to deep sleep after the former but not after the latter.


Maybe you can ask the RTC alarm whether it's still armed. I don't know if they automatically clear the enabled flag when the alarm occurs. See RTC_WKALM_RD in https://man7.org/linux/man-pages/man4/rtc.4.html

If not, well, you know what time the alarm is. That leaves a race, but there's a race regardless -- the human might have opened the laptop lid exactly after the RTC alarm went off.

EDIT: Yup, confirmed in kernel source, Linux makes sure /sys/devices/platform/rtc_cmos/rtc/rtc*/wakealarm is single-shot, so you can see whether it triggered.


depends a bit on the specific setup if and where it's exposed. dmidecode can sometimes see it, and various other bits might also log it so it's worth poking around dmesg/journalctl/...


Yes. This is why I switched to simply hibernating, which has worked flawlessly for me. The shutdown and startup times are obviously a bit longer (it takes 10 seconds to get to the bootloader, after which its about 12 seconds to wake up), but since it's truly off, it can remain asleep indefinitely.


Do you have a link to a community thread or any other link on how to implement the hibernation? Right now, anytime I am closing the lid, the battery is draining out.


I just used the Arch wiki for basic setup:

https://wiki.archlinux.org/title/Power_management/Suspend_an...

https://wiki.archlinux.org/title/Power_management#Suspend_an...

I have my machine set to suspend on lid close and hibernate on power button.


Does it really take only 3 seconds to resume from hibernate? That seems implausibly fast, faster than S3 resume.


Nope! I absolutely lied!

Decided to actually time it.

It's 10 seconds from power button to grub bootloader, then 12 seconds from bootloader to login screen.

I decided to run the same test coming out of S3, and it takes 14 seconds on my macine to go from power button to login screen.

So waking from hibernation is roughly 8 seconds slower, or approximately the time it takes to get to grub.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: