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

@Lamy It’s tough. I’m brand new, so I have not had time to do any proper benchmarking…yet.

The best thing to do until I have time to really dial this:

  • Make sure you’re using the latest available firmware.
  • Some expansion modules will use more power than others.
  • Early testing has me on Fedora 37, latest kernel 6.0.8.300, YT video on a loop. No touchpad interaction with PowerTOP open is looking to be 3-5 hours, likely will hit 4 hours with YT playing the entire time.
  • My daily use sees about 4-6 hours depending how much I use.

To get really dialed in information on discharge rates, please use this command in the terminal for discharge rates:

upower -i /org/freedesktop/UPower/devices/battery_BAT0

Hopefully this helps.

1 Like

@Matt_Hartley I have an idea.

Yesterday night I had put my Ubuntu 22.04 in sleep and went to bed. Today morning, I could boot only after charging the battery for at least a minute and saw that the battery was at 2%. Clearly the battery has completely discharged overnight in a span of about 8 hours.

IDEA

We have 2 LEDs on our laptop. One is used while the laptop is charging from its 2 USB C ports. May be one could have a setting in the bios, that when enabled can use another LED to glow continuously if the rate of discharge of battery is beyond certain percentage say 5%. And may be both LEDs can glow when the laptop is not being charged at all!

So, if I suspend my laptop and see that the LED is glowing I would know that something is wrong and I would do the shutdown.

4 Likes

Two things occur to me.

  • First, this is a very cool idea and I will pass this along. No idea what this would look like specifically, but the idea has merit.

  • I need to get to work on a hibernation how-to because suspend isn’t going to be ideal for all use case scenarios. Myself, I rarely suspend more than a lunch break. But I definitely get the need.

2 Likes

@Matt_Hartley My old ASUS Laptop had one LED blink once every minute when in sleep. It used to only not beep while the laptop was on, or hibernated or shut down.

1 Like

@lbkNhubert Thanks to the hints in this thread my laptop does now way better. Thanks a lot to all who provided helpful suggestions. The only thing I did not got working is the suspend-then-hibernate method. I did as suggested

In /etc/systemd/logind.conf I have the following relevant lines:

HandleLidSwitch=suspend-then-hibernate
HandleLidSwitchExternalPower=suspend-then-hibernate
IdleAction=suspend-then-hibernate

In /etc/systemd/sleep.conf I’ve set only 3hours which makes sense for me:

#AllowSuspendThenHibernate=yes
HibernateDelaySec=180min

Unfortunately the laptop does not switch to hibernate (neither the framework not the other laptop where I wanted to configure this.
Anything I might have forgotten?
Kind regards, Andreas.

@Andreas_Tille see the post I just made and check your version of systemd

1 Like

@Matt_Hartley Bios 3.05

Nov 21 17:43:54 lamy systemd-sleep[3345771]: Entering sleep state 'suspend'...
Nov 21 20:49:34 lamy systemd-sleep[3345771]: System returned from sleep state.

3 hrs sleep, battery discharged 33%

Thanks for the update. Early testing thus far on my end:

Note, because attaching anything is naturally a potential power draw if it fails to suspend with the laptop, this was done as a suspended laptop Framework laptop only. No applications loaded, next round will be with Chrome open and then suspended.

  • Ubuntu 22.10 on 12th gen, overnight lid close suspend with a 90% charge, late afternoon following day, 80% - this isn’t bad. 5.19.0.23 kernel, s2idle is deep. Wi-Fi had question mark reconnect, shows question mark, but INTERNET IS WORKING.

  • Ubuntu 22.04 on 12th gen, overnight lid close suspend with a 90% charge, late afternoon following day, 80% - this isn’t bad. 5.15.0.23 kernel, s2idle is deep. Wi-Fi displays normal and also connects fine.

Next will be Fedora 37 testing.

In the meantime, please feel free to open a ticket and they’ll ask you to follow a specific set of guidelines to gather specific logs. This will allow me to better see what is happening at tier 3 support.

4 Likes

At what power state is the drain being measured? S0ix, S1, S2 or S3? “deep” is supposed to be S3, is that state actually being reached?

@Matt_Hartley - what expansion cards do you have in the system during the test?

@lbkNhubert I wasn’t not happy with the early tests, going to re-do them with matching cards as much as I have available (multiple laptops). Saw something with Fedora 37 that had me go “hmmm”, so I want to re-run this in a more consistent way.

Going to update this tomorrow after re-testing accordingly:

Pop OS 22.04, Ubuntu 22.04 and Fedora 37.

TLP on Ubuntu and Fedora, system76-power on Pop OS.

I will update as I have further details.

2 Likes

@Matt_Hartley - thanks for the reply, and thank you for this and everything else that you are doing! I look forward to seeing your results. Have a good evening!

Here’s what I ended up with. 11 hours suspend on each, no external monitors attached, no applications running at suspend.

Fedora 37 is 81%, TLP, (Gnome power profile disabled), 2 USB C, 1 hdmi, 1 DP. 12th Gen. s2idle deep.

Pop OS 24.04 at 61% system76-power 1 USB C, 1 hdmi, s2idle deep.

Ubuntu 22.04 at 89% TLP (Gnome power profile disabled), 1 USB C, 1 hdmi, s2idle deep.

2 Likes

@Matt_Hartley The statistics mentioned above by me Suspend on linux drains a lot of battery compared to other laptop - #26 by Matt_Hartley
i.e. 33% discharge for 3 hrs sleep, is for Ubuntu 22.04. I have done the battery optimization TLP, have only 2 USB C and 1 USB A expansion card without any connection.

So, according to your measurements 1% battery discharge on Ubuntu 22.04 should be achievable. Isn’t it?

BTW, for anyone doing testing, I made an app that logs suspend/resume events into a SQLite DB and should give some more fine-grained data/does some math for normalized power drain (%/hr, %/day) that might be useful: Linux Utility to Help Track Framework Battery Usage

1 Like

Just an FYI besides the power tuning thread and @anarcat’s excellent testing, I also did a bunch of testing scenarios (including idle, near idle, suspend, and the touchpad thing) that I’ve been collecting here: 2022 Framework Laptop DIY Edition 12th Gen Intel Batch 1 · lhl/linuxlaptops Wiki · GitHub

One useful addition to a best practices guide might be a standardized/reproducible scripts/list of tools to allow users to compare their Framework’s power efficiency w/ their specific setup (OS, modules, etc) vs your official baseline 11th/12th gen, or even other laptops.

3 Likes

I’m new to Framework and I’m having a problem whereby closing the lid of my Framework causes the battery to drain such that when I open it the next, the machine is completely dead. Is that related to this issue, and if so, what is the solution?

You could try the newst BIOS version for the 12th gen CPU (or for the 11th gen).

Also make sure to post your exact setup. Which expansion cards do you use, which plugs are active, etc.

I love this idea. Working on this. No ETA yet, but I’m definitely going to explore this first part of Jan.

5 Likes

Hey Matt, did you ever get a chance to look into this? I’ve been doing some longer trips with my Framework lately and realizing my real-world battery drain is actually pretty bad for my regular usage (the past few months, I’ve only been doing plugged in/short commutes and haven’t properly run-down my battery). I used gnome-battery-bench to do some testing w/ a Firefox: 2022 Framework Laptop DIY Edition 12th Gen Intel Batch 1 · lhl/linuxlaptops Wiki · GitHub

Between batterylog and Selenium code I have lying around, I feel like it wouldn’t be so hard to have some standardized workloads - although the most interesting bits I think might be gathering data points with different setup info (platform, modules plugged in, BIOS versions, system versions, background processes, RAPL settings etc) to see the variance across setups.