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

Hi,
I have read the issue Battery drain in deep suspend but IMHO the answer to switch to hibernate is not really convincing. I have a Framework Laptop DIY Edition (11th Gen Intel® Core™) with an up to date Debian testing installed (current Linux kernel is 6.0.0). I compared the Frame.work with some “random” laptop I have at hand. On both laptops I called date; acpi closed the lid, left the laptops alone for a couple of hours, reopened and again called date; acpi to know what time was left and see what the battery status might be. Here are the results:

Frame.work

frame.work:~ $ acpi
Battery 0: Discharging, 100%, 38:33:15 remaining
frame.work:~ $ date
Mo 14. Nov 09:03:17 CET 2022
frame.work:~ $ acpi
Battery 0: Discharging, 73%, 04:03:00 remaining
frame.work:~ $ date
Mo 14. Nov 15:00:55 CET 2022
### closing lid again
frame.work:~ $ acpi
Battery 0: Discharging, 55%, 05:23:12 remaining
frame.work:~ $ date
Mo 14. Nov 18:22:16 CET 2022

Huawei Matebook 13

matebook:~ $ acpi
Battery 0: Charging, 96%, 00:16:31 until charged
matebook:~ $ acpi
Battery 0: Discharging, 96%, 05:03:42 remaining
matebook:~ $ date
Mo 14. Nov 09:03:02 CET 2022
matebook:~ $ acpi
Battery 0: Discharging, 93%, 06:23:38 remaining
matebook:~ $ date
Mo 14. Nov 15:01:00 CET 2022
### closing lid again
matebook:~ $ date
Mo 14. Nov 18:16:08 CET 2022
matebook:~ $ acpi
Battery 0: Discharging, 92%, 05:28:43 remaining

So if I compare both laptops I could say that the Frame.Work is loosing about 50% battery in about 12 hour suspend while the Matebook looses only 10% (both roughly estimated.)

I know hibernate could do better here but hibernation takes more time and is unacceptable for short breaks. IMHO there should be some improvement if the Frame.Work is five times worse than some random laptop I had access to.

Kind regards, Andreas.

This is a known issue. Quite a bit comes down to how the laptop is designed. Improvements are actively being worked on. Currently there is a beta DP expansion card firmware that is meant to improve drain from the card while asleep. HDMI version is currently in the works. Battery improvements discovered while creating the Chromebook FW variant may be backported to regular FW but it is unclear if or when that might occur. There are some mitigations found in the Linux Battery Life Tuning thread but they don’t solve the issue tbh, just mitigate the worst offenders.

Basically I’m saying that searching this forum will dig up a wide variety of literature on this topic.

1 Like

Hi @Andreas_Tille, echoing @GhostLegion on this. The thread in question: Battery Life Tuning.

Additionally one of my next steps is put together a power usage best practices doc in the coming days. I don’t have an exact eta yet, but it is one of my first projects coming up.

One right now thing you can do is to install powertop and set the tunables. You can use this as a non-destructive approach that I would argue outshines anything seen with tlp and other approaches. What I like about it is you can see an immediate difference.

apt install powertop

While still in the terminal, run powertop as root or sudo. Then set your tunables by tab keying to the Tunables tab, using the space bar to make a temporary change. More in-depth help is coming.

5 Likes

It takes my laptop 10 seconds to recover from hibernate. 11th Gen with Manjaro. Granted 10 seconds is much longer than instantaneous, but it’s far from painfully long.

1 Like

It takes longer if you use FDE, from POST to desktop, it takes closer to 1 min. Which…still isn’t that bad but in the age of NVMe, it’s not great.

Hibernation time depends from size of memory and since I have 64GB this takes a bit. In addition I’m using an encrypted disk so it requires me to type a password. When I mentioned hibernation I just wanted to express that I searched the forum (may be not sufficient enough) and want to discuss suspend issues here in the thread exclusively. :wink:

1 Like

@Andreas_Tille - I am sorry that you are running into issues. I have my system set up to suspend, then hibernate after 12 hours. Overnight it typically does not hit the hibernate stage, and I am losing roughly 10% charge, my estimate is between 1-1.5% per hour. I only have usb-c expansion cards installed. The system is 11th gen 1165, 64gb ram, sk hynix p41.

What cards are in your system, and what loss of charge do you see if you remove them then sleep the machine? Hopefully the community can help you to get your system to a more reasonable state.

Have a good day.

1 Like

@Matt_Hartley Hello! Can you please tell me where can we find what value to expect for battery discharge rate per hour? Is it given in the Intel 12 Generation processor manual?

I just want to know whats the absolute best case discharge rate? I am using Ubuntu 22.04. Unless I know what should be the baseline value, I don’t know how to compare.

I have 2 USB 3c, one USB 3 and one MicroSD.
How can I setup the “hibernate after 12h feature”?
I’ve done the powertop configuration now and will do my next experiments soon. Then I’ll try to remove some of the cards.
Thank you for the hints.

1 Like

The MicroSD card for whatever reason draws a lot of power. You might try your test again with it removed. The USB-A is lower, but still a small draw.

Regarding suspend-then-hibernate, I will have to revisit the steps that I took. My recollection is that it involves first setting the system up so that hibernate is an option. Once that has been done, then one needs to enable the setting in a config file and set the time before hibernate in another. I am on Manjaro now, so the config files may be slightly different than Debian.

This thread has very complete measurements on power use during “normal power on”, s2idle, and deep:

The expansion cards have a non-negligible power use during s2idle/deep.

For your measuring accuracy: I wouldn’t go with “estimated time till drained”, since that involves a highly variable estimate of power use-while-on. I think you’ll get more reliable results by querying the estimated charge of the battery (in mAh or in W). It’s not perfect either, but the runtime estimate is based on it, so you’'ll get more stable results.

2 Likes

May be I’m quite naive but if I would design a suspend mode I would switch of all extensions if nothing is plugged in. I admit I need the MicroSD card extremely rarely (would love to have a normal SD card extension) but simply leaving the slot empty to save battery seems to be quite strange.

@Andreas_Tille - found the files.

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 have these relevant lines:

#AllowSuspendThenHibernate=yes
HibernateDelaySec=720min

The AllowSuspendThenHibernate line is commented out but that is the default so it is fine.

I hope that this helps.

1 Like

Here in lies the rub. To the laptop, there is something plugged in, the expansion card. Plus I don’t think USB autosuspend is enabled by default on Linux but you can enable it.

Hello @Andreas_Tille best tip I have for you is to make this file etc/udev/rules.d/10-runtime-pm.rules as mentioned in a solution to this question over at serverfault
This one solution basically corrects mostly all the “bad” errors powertop will show.

Additionally, I have configured power profile daemon to stay on power save while on battery, it gives me an hour or so of extra battery time.

Hi @Matt_Hartley looking forward to your guides on this.

1 Like

Hi @Lamy and @Andreas_Tille,

Lamy, that’s a tough one to give a specific figure. But I can share the following.

First off, @Cipher’s tip is absolutely correct and while a bit more hands on, works great.

For a more “do it for me” approach, install TLP with its defaults is “pretty good.”

My rationale for recommending TLP first is that it doesn’t really do anything drastic that might create unintended behavior.

Short version: If your focus is taking care of those tunables, Cipher’s recommendation is absolutely the way to go. If you are “okay” with one or two of them being bad, default TLP is also fine.

Anything pulling power is going to be a consideration. Modules connected for DisplayPort, HDMI, etc. PowerTOP can give you it’s best guess estimates for sure. But even after running calibration, PowerTOP isn’t going to be exact. It will fluctuate.

True. 32G is sufficient for me, so my recovery time is faster.

1 Like

@Matt_Hartley I can understand that its impossible to give exact values due to many variables, but a rough estimate, like for e.g.

0.5% to 1% battery discharge rate per hour in sleep (not hibernation and not a hybrid sleep, a true sleep state).

Can you give a rough estimate? A rough idea. Does Intel provides this information?

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

3 Likes