[TRACKING] Suspend on linux drains a lot of battery compared to other laptop

Not a problem if the TPM holds the key and self-unlocks after measurement. Sad about needing to get a macbook tho.

Yeah, sadly, there was basically no other option for an ultralight non-Windows laptop that I could pick up/get the same day while traveling w/ 10h+ of battery life. It’s been interesting to revisit and see how the other half lives. Also, I’ve been going through the list and disabling daemons I don’t need one by one. It’s sort of amazing how many Apple services are running OOTB these days.

I’m reading about the tpm2 config stuff now, the guide I used for my initial setup didn’t include that. It looks like systemd 251+ even has added PIN support.

I’m getting frankly miraculous battery life on Fedora 37 somehow. Over 8 hours of VS Code scripting, and around 8% lost overnight! Not to sure why this is happening though ;-;

3 Likes

I totally get that. However, suspend on Linux is a terrible way to save power longer than a few hours IMHO. Hibernate does have some hoops, however, it’s doable and a matter of copy and paste.

Long term, we’re working on getting power management improved for daily usage.

2 Likes

That’s fantastic to hear! Are you using default power profiles, TLP, or? Just curious as this usually involves something unique to the end user’s config.

This! Although I didn’t expect it to work this well xD

Right on. So install it, as is? I get pretty good battery life out of a default install as well, but not quite that good. :slight_smile:

1 Like

While I’m sure suspend could be better in Linux, and I agree that hibernate is the way to go for extended periods, I also hope Framework is able to really improve the power management. My previous Linux laptop, a 15" Tong Fang PF5 (Ryzen 4800H) weighed almost the same (1.4kg) but had a 91Wh battery and the suspend power drain is less than half the Framework’s power drain (so on a percentage battery basis, <1/4 the battery drain). I could leave that suspended overnight and basically lose only 2-3% battery while the Framework loses like 15% (and that’s with only USB-C and USB-A expansion modules!).

1 Like

Absolutely our goal. It’s something that’s actively being worked on.

5 Likes

Looks like I need to try TLP. I’m getting about 6 hours on a default Fedora 37 Gnome install, with about 10% battery drain overnight in sleep, which frankly is pretty good. 8 hours would be fantastic.

Even default TLP is great, once you remember to take care of the power-profiles-daemon. TLP says to remove it, I say disable, stop and mask it.
Follow this guide, section 3.3.

1 Like

(Note this was not installed my default on my Debian Bullseye, even after installing TLP.)

I think TLP recommends removing it because power-profiles-daemon may become unmasked after certain updates. I do believe this is less of a problem now, since most distros appear to have uncoupled it from hard gnome dependencies.

Yeah, I’ve heard similar. I made sure to link the official recommendation from TLP so the user can opt for what works best for them.

Agreed, this has been my experience as well. :slight_smile:

Hi,
I keep on loosing battery when suspending and suspend-then-hibernate simply does not work (neither after a defined time nor after 5% battery is reached.) I never can be sure whether my framework 11 is simply at 0% and powered off (luckily no data loss so far) if I do not put it on power. Any help to get suspend-then-hibernate really working would be very welcome.
Kind regards, Andreas.

@Andreas_Tille - as noted in this post farther upthread, systemd v252 breaks suspend-then-hibernate: [TRACKING] Suspend on linux drains a lot of battery compared to other laptop - #24 by Eddie_Zaneski

The good news is that the behavior was added back in in systemd v253. I am running it on my setup and am happy to report that suspend-then-hibernate is again working for me.

So you might see if it’s feasible to upgrade that package, or wait until it is the default.

Good luck, and have a great day!

I should have mentioned that I’m running Debian testing which actually has systemd v253 and its not working (and never worked under any systemd version. :frowning:

@Andreas_Tille - my mistake, I tried to look up the version and must have gotten it wrong somehow. If you are on systemd 253 then I believe that you should be able to get it going. It’s unfortunately not completely straightforward to set up, but once you have it working it’s great.

These pages were very helpful to me when working through getting it going on my system:

https://www.kernel.org/doc/html/latest/power/basic-pm-debugging.html
https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate

Running dmesg helped me to see if there were any issues going into or coming out of hibernation.

Hopefully this is somewhat helpful.

Hi
I confirm that hibernation in principle works perfectly on my system (after I increased the swap partition to fit the size of my memory). The links you provided explaining how you get hibernation working. This is not my problem. My system just does not hibernate from suspend neither after the time I defined nor when low on battery (which is really bad since my battery now went to zero for a couple of times which is bad for battery life). I simply want to make sure my battery will not went to zero in suspend mode.
Any help is welcome, Andreas.

Hi @Andreas_Tille, thanks for the information. I’m running manjaro with gnome, and reading your post reminded me that when I moved to v253 of systemd I had to set automatic suspend to be longer than that configured in my logind.conf file (or turn it off). I have the values for automatic suspend there set to 30 and 45 minutes on battery and power, respectively. For reference, here are my logind.conf and sleep.conf files:

logind.conf:

#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it under the
#  terms of the GNU Lesser General Public License as published by the Free
#  Software Foundation; either version 2.1 of the License, or (at your option)
#  any later version.
#
# Entries in this file show the compile time defaults. Local configuration
# should be created by either modifying this file, or by creating "drop-ins" in
# the logind.conf.d/ subdirectory. The latter is generally recommended.
# Defaults can be restored by simply deleting this file and all drop-ins.
#
# Use 'systemd-analyze cat-config systemd/logind.conf' to display the full config.
#
# See logind.conf(5) for details.

[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#UserStopDelaySec=10
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
#HandleLidSwitch=suspend
HandleLidSwitch=suspend-then-hibernate
#HandleLidSwitchExternalPower=suspend
HandleLidSwitchExternalPower=suspend-then-hibernate
#HandleLidSwitchDocked=ignore
#HandleRebootKey=reboot
#HandleRebootKeyLongPress=poweroff
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#RebootKeyIgnoreInhibited=no
#HoldoffTimeoutSec=30s
#IdleAction=ignore
IdleAction=suspend-then-hibernate
IdleActionSec=15min
#RuntimeDirectorySize=10%
#RuntimeDirectoryInodesMax=400k
#RemoveIPC=yes
#InhibitorsMax=8192
#SessionsMax=8192

sleep.conf:

#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it under the
#  terms of the GNU Lesser General Public License as published by the Free
#  Software Foundation; either version 2.1 of the License, or (at your option)
#  any later version.
#
# Entries in this file show the compile time defaults. Local configuration
# should be created by either modifying this file, or by creating "drop-ins" in
# the sleep.conf.d/ subdirectory. The latter is generally recommended.
# Defaults can be restored by simply deleting this file and all drop-ins.
#
# See systemd-sleep.conf(5) for details.

[Sleep]
#AllowSuspend=yes
#AllowHibernation=yes
#AllowSuspendThenHibernate=yes
#AllowHybridSleep=yes
#SuspendMode=
#SuspendState=mem standby freeze
#HibernateMode=platform shutdown
#HibernateState=disk
#HybridSleepMode=suspend platform shutdown
#HybridSleepState=disk
#HibernateDelaySec=180min
HibernateDelaySec=720min

I apologize if the below is covering things that you already know. When I was troubleshooting I set the suspend and hibernate delay values to something very short, say one minute until suspend and three until hibernate, then let the machine go through the process, woke it up, and checked dmesg to see if it had gotten into hibernation after suspending, and if not, what was preventing it.

Fingers crossed that this helps you to get it working.

1 Like