[TRACKING] Linux battery life tuning

With deep sleep, I measured a drain of 2.7%/hour overnight a few months ago. Yesterday I switched back to s2idle with nvme.noacpi=1, and I measured the same 2.7%/hour again last night. I can live with that, and I’m thrilled to see it wake up instantly again, but I’m just wondering: Has anyone has seen anything like 0.8%/hour in the wild? Could I get that if I hopped from Manjaro over to Fedora? It’s hard to believe the distro would make such a big difference.

I have 32 GB of RAM and three USB-A cards. I’m guessing the 0.8%/hour was with 8 GB and all USB-C cards.

1 Like

In my case, running Manjaro, 64gb, 4x usb-c, I am typically at less than 10% drain overnight - anywhere from 8-12 hours. I’ll make a note tonight and reply back with more accurate numbers. The drain that I am seeing is on the order of 1%/hour, nowhere near 2.7%/hour.

Update - overnight went from 81% to 73% in 9 hours, so a rate of .89%.

1 Like

Yes, see:

That is with an 11th gen i7, 16Gb, and (most importantly!) all USB-C.

I had this problem too, fixed it by changing the powertop tunable to “bad” for:

Autosuspend for USB device Goodix USB2.0 MISC [Goodix Technology Co., Ltd.]

Tlp on or off made no difference.

I just tested an hour of sleep with the 1135, 8GBx2 RAM, 2x type A, 2x type C cards a loaded up Firefox few other things open, wifi on 0.9% drop in an hour.

Ok, yeah, I ran another experiment last night with my USB-A cards removed, and it came in under 0.8%/hour as advertised with s2idle and nvme.noacpi=1 and the other tweaks in this thread (68% to 62% over 8 hours last night vs. 67% to 45% the previous night).

I’m seeing the same. On my system (i5-1135g7, 32GB, 2x USB-C and 2 slots empty, Fedora 36 with kernel 5.17.11-300) with s2idle and nvme.noacpi=1, I saw a drop of 20% over 28 hours… so roughly 0.71%/hr.

1 Like

Is there a way to monitor one’s battery level and get a graph of battery charge level over time?

I have been wanting this for a while. I have not been able to find it. It would help to answer questions like “when is my battery level going down faster than I think?” and “is my battery too old and not holding a charge?” and many others.

Any suggestions?

Just a PSA, I get very different standby consumption values if I do “sudo systemctl suspend” from command line versus selecting suspend from KDE GUI. The former is the ~.8% per hour that others are reporting, the latter results in somewhere between twice and three times as much. Using s2idle in both cases.

Either way, one my EndeavourOS install, the keyboard backlight gets left on when entering suspend, which I would not consider to be a desirable behavior. I have not spent much time to troubleshoot this, though, as I do not use suspend very often in my daily workloads.

So I think we should standardize on command-line initiated, manually verified keyboard backlight off before lid close when trying to compare suspend power draws.

There used to be something like that for gnome, but I wasn’t able to find something that was distributed as a standard. So I use a script:

#!/usr/bin/env python3
from datetime import datetime
from time import sleep
import argparse

def logpow(n):
    d_old = None
    c_old = None
    while True:
        d = datetime.now()
        D = d.strftime("%Y-%m-%d %H:%M:%S")
        with open('/sys/class/power_supply/BAT1/charge_now','r') as F:
            C = F.read().strip()
        c = int(C)
        if c_old is not None:
            p = (c-c_old)/((d-d_old).total_seconds())*3600*1.54e-5
            print("{}, {}, {:.2f}W".format(D,C,p), flush=True)
            print("{}, {}".format(D,C), flush=True)
        d_old = d
        c_old = c
parser = argparse.ArgumentParser(description="log battery charge at regular time intervals")
parser.add_argument("-i","--interval", type=float, default=60, help="log interval in seconds (default 60)")
args = parser.parse_args()

and redirect the output to a file. You can parse that file and make a graph. It also prints the average power use between two samples, which with 1 minute gaps is pretty reliable. Most of the time, that’s sufficient info for me.

On Fedora 35 with Gnome, the keyboard backlight goes off, as far as I can tell. I usually don’t use the CLI or menu options to suspend though: I usually close the lid or press the power button (briefly).

1 Like

Gnome power statistics, I use it with Fedora 35.

1 Like

For folks who are seeing improvements in battery life during standby after setting the “nvme.noacpi=1” kernel parameter, could you share what SSD you are using and if possible, what version of firmware is running on it?

We’ve worked with Western Digital and found that SN750 with 111110WD and older firmware needs that workaround, but updating to 111130WD and newer does not.

Edit: Also, for folks who are not seeing improvements with “nvme.noacpi=1”, could you also share your SSD and the firmware version on it?

1 Like

I have the SN750 running 111130WD. Now I’m curious to see what I’ll get if I remove the “nvme.noacpi=1” and leave it in s2idle overnight again.

By the way, you commented in September about working to resolve the drain by USB-A and HDMI cards. Will the 3.08 BIOS finally do that?

Tagging along…Does the 12th gen board have the same issue, or is it fixed?

Samsung 980 Pro 1TB
Firmware 3B2QGXA7 (not latest, 5B2QGXA7)

WDC PC SN730 SDBPNTY-512G (11140000)

I’m pretty sure nvme.noacpi=1 made a huge difference for me.

Oh thanks! That’s what I used before. I don’t know how I missed it still exists. One draw-back is in the “rate” tab it’s rather difficult to see the actual discharge rate over suspended periods.

1 Like

Guys, if you want to know your BIOS firmware version, you will find the way at BIOS guide - #118 by Simon_Brand .

@junaruga I think there’s a little misunderstanding here: Nirav most probably meant the SSD firmware version, not the BIOS firmware version.

1 Like

Oh I didn’t know that the SSD has the firmware. Thanks for explaining it to me.

My experiment last night showed a significant difference despite having the newer SN750 firmware…

s2idle without the “nvme.noacpi=1” parameter: 4%/hour

s2idle with the “nvme.noacpi=1” parameter: 2.7%/hour

deep sleep: 2.7%/hour

The s2idle tests were running the Linux 5.17.9 kernel, and I had three USB-A cards and one USB-C card installed. The deep sleep test was running the Linux 5.14.10 kernel.