[TRACKING] Linux battery life tuning

@nrp Could you please update, if the issue is resolved or what all subissues are pending? Its 1 year since the post was posted, would be nice to have a summary on the updates.

2 Likes

For those following along at home, can you quote what issue or subissues you’re referencing? This is a general linux battery tuning thread so I think this is primarily a collection of best practices/discussion of workarounds, I don’t think there’s any single resolution expected for this thread.

I think the biggest known remaining battery issues are non-Linux specific:

  • higher-than-average battery drain in suspend, exacerbated by attached USB device expansion cards (Windows generally gets around this by hibernating automatically at 5% battery usage and in Linux you can do something similar with suspend-and-hibernate; I wrote a simple tool to track battery drain in suspend btw).
  • potential RTC boot issues if left off and unplugged for an extended period of time (weeks)

Each of these problems has their own threads and hopefully updates go there (or in this thread that was gathering known issues).

4 Likes

Sorry for the late reply, you might need to select “BAT1” in the config though I don’t recall needing to set it.

2 Likes

I’m seeing something strange: deep is using more power than s2idle. Anyone else see this?

I have a 12th Gen with Debian Bookworm A1 (kernel 5.19.11-1). Letting the system suspend for about 10hrs in s2idle results in about 7% battery loss. If I use deep, an overnight suspend uses 15%. I have not tuned or set any other parameters.

Note that I used echo deep... for testing. I’ll try with a boot variable and initram update. Maybe the setting isn’t completely taking with only the echo change? Also note I used systemctl suspend instead of letting the power manager timer initiate the suspend. Not sure that matters but it is different than my previous tests.

1 Like

In my tests, deep is what made the most radical change (apart from removing costly expansion cards) in standby usage, so no, I haven’t seen that yet. :slight_smile:

1 Like

I didn’t see a significant change after adding that boot option. Debian GNU/Linux testing/bookworm, Linux 5.19.11, WD Blue SN570 1TB SSD version 234100WD. LVFS says it has no pending firmware upgrade.

Detailed notes in this section of my review. I’m seeing fluctuating power usage: I somehow managed to go down to 14mA, but now I’m back at ~75mA, not sure what’s causing it.

1 Like

Wow, what a great writeup! Inspired by your post, I did some more detailed testing.

I’m still seeing backwards behavior in that deep uses about 3x more than s2idle. Specifically I see about 25mA for s2idle and 75mA for deep. This is consistent across multiple tests for various durations of 2-10 hours. I’ve tried various changes like nvme.noacpi, initiating manually/automatically, disabling AX210 radio, nothing seems to make a signifcant difference.

I’m using a 12th Gen, BIOS 3.05, Debian Bookworm A1, Xfce, SN770 1TB.

No one else is seeing this backwards behavior? Maybe I have a bad build or BIOS?

2 Likes

What app is this?

Now that you mention it, I have just tried, and I actually can’t suspend to s2idle anymore, at least not if I printf deep > /sys/power/mem_sleep; the machine just doesn’t suspend at all!

Definitely something fishy going on here… sigh.

update: turns out doing the runtime change doesn’t work. rebooting with mem_sleep_default changed does work though.

i’m doing more thorough tests to analyze what is taking up power during standby now, stay tuned.

1 Like

It’s a Gnome extension called Vitals

5 Likes

Some more testing and it looks like my 2x USBA adapters may be the culprit. Removing them doesn’t affect s2idle much (still about 25mA) but deep is now 19mA. Less than s2idle and nowhere near the 75mA I was seeing. A very strange result but the only correlation I can find. I tried an NVMe firmware update, loading additional i915 firmware, etc. nothing affected deep until I removed the USBA adapters.

1 Like

Actually… back in April, you seemed to be saying that nvme.noacpi=1 had an effect only in s2idle (as opposed to deep) sleep mode, any update on that?

1 Like

I did that here:

It looks like s2idle vs deep doesn’t have as big of an effect as I thought it would, about 50mW difference. nvme.noacpi=1 shaves off only 10mW, possibly within the margin of errors of my measurements.

Still, 50mW, over the whole battery life, means two less days battery, so deep is definitely worth it for me.

1 Like

There are some news about upcoming enhancements in kernel too.

12 Likes

I’ve edited the wiki to reflect that disabling rdd is not only not required to get hardware decoding working, it actively reduces the security of the browser by disabling the sandbox.

5 Likes

Did someone notices worse battery performance with kernel 6.0.6 ?
The camera is sucking power even if not used according to powertop.
I checked if autosuspend was set, and it is.
Manually flipping the hardware switch to off fixes the issue.
But I didn’t have to do that in 6.0.5.

Edit: I rollbacked an old kernel and still have the issue, so it’s something else.
Edit2: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/2669

2 Likes

@IPGentlemann

I enabled the powertop service. It always shows the following:

$ sudo systemctl status powertop -l
○ powertop.service - Extend the battery life of laptop
     Loaded: loaded (/lib/systemd/system/powertop.service; enabled; vendor preset: enabled)
     Active: inactive (dead) since Wed 2022-11-02 17:39:20 CET; 2min 4s ago
    Process: 192272 ExecStart=/usr/sbin/powertop --auto-tune (code=exited, status=0/SUCCESS)
   Main PID: 192272 (code=exited, status=0/SUCCESS)
        CPU: 3.266s

Nov 02 17:39:15 lamy powertop[192272]: glob returned GLOB_ABORTED
Nov 02 17:39:18 lamy powertop[192272]: Leaving PowerTOP
Nov 02 17:39:20 lamy powertop[192272]: Cannot load from file /var/cache/powertop/saved_parameters.powertop
Nov 02 17:39:20 lamy powertop[192272]: File will be loaded after taking minimum number of measurement(s) with battery only
Nov 02 17:39:20 lamy powertop[192272]: Cannot load from file /var/cache/powertop/saved_parameters.powertop
Nov 02 17:39:20 lamy powertop[192272]: File will be loaded after taking minimum number of measurement(s) with battery only
Nov 02 17:39:20 lamy powertop[192272]: To show power estimates do 113 measurement(s) connected to battery only
Nov 02 17:39:20 lamy systemd[1]: powertop.service: Deactivated successfully.
Nov 02 17:39:20 lamy systemd[1]: Finished Extend the battery life of laptop.
Nov 02 17:39:20 lamy systemd[1]: powertop.service: Consumed 3.266s CPU time.

How can I find out if its working fine?

1 Like

Looks like you haven’t run powertop while on battery, it hasn’t written any metrics to those files yet. Once you do run powertop while on battery, those files will be created and they’ll store the parameters they are talking about.

The service just essentially runs powertop --autotune for you. You’ll know it worked if all the services under the tunables tab in powertop are reporting good.

1 Like

A bit late to the party but I noticed my 11th gen has considerably better battery once my VPN kill switch was enabled, I believe this is due to it disabling wifi on standby

1 Like

So, just for reference for folks. I installed the Linux-Clear kernel today. I also removed the redshift package, and with these changes, I dropped my average poweruse down to about 5.47 wh, with Bluetooth and wifi active. I don’t know what that Intel kernel has going for it, but this has been a reduction of power use by about 30% for me.

4 Likes