[TRACKING] Linux battery life tuning

OK. But I tried to add a comment without any link now, and I still see the “403 …” message.

Well, that’s weird. I just updated my comment above successfully. I’ll now try updating it with a link

UPDATE:
Even that worked. Maybe try again?

Doesn’t appear to be affecting me. I’m on gnome wayland with PSR enabled. Using cpupower-gui (‘powersave’ governor, ‘power’ energy preference) and powertop.

Now I tried to edit, and it doesn’t work. I saw you edited your comment area with adding a link. But what I am seeing the 403 message is on the wiki area on the top of this thread. Could you try to edit the wiki area, not comment area?

Here is the actual message.

Interestingly, seeing the history of the edits on this wiki, the latest change is by “me”. But the change is actually not by me. Maybe a table data in the database related to wiki in Discourse is broken.

Edit: My guess for this issue is maybe the wiki table data is unintentionally locked by my user account “junaruga”, as a past update for this table might be failed in the process of the transaction.

1 Like

@junaruga i get the same error there, but just earned the badge ‘Wiki editor’, so i second your guess about the database.

1 Like

OK! Let’s wait Framework team to fix this issue.

By the way, I think in the process of tuning the battery life, measuring numbers in a reliable way and easily. So, I investigated the possible ways. Here is my article about it. I checked it on Fedora Linux 35. I see the PowerTop (powertop), UPower (upower) and PowerStat (powerstat) could be useful. I see the powertop is often mentioned on this forum.

I thought the “discharge rate” or “energy-rate” is the numbers to measure how good the battery life tuning is, and I find the following commands are convenient to get the numbers. But I am not sure why the following number is different between in the powertop and upower. Do you know why? Do you have a recommendation for the command and numbers to measure the battery life tuning?

powertop

$ sudo powertop --csv

$ grep 'discharge rate' powertop.csv
The battery reports a discharge rate of:  5.72  W;

upower

$ upower -i $(upower -e | grep BAT) | grep energy-rate
    energy-rate:         7.4074 W
1 Like

I wouldn’t call it a significant increase, but I am noticing stronger “pulses of activity” when watching current_now. If you leave the system alone to get to C10 idle, it settles down into a sawtooth pattern of increased use every 8 to 10 seconds, that tapers off across 8 to 10 seconds, and repeat. The spikes in current usage are a little bit higher, but do settle down a bit deeper. Wonder if whatever tool you are using to display W used is catching more of the usage wave crests vs troughs.

Coincidentally, my best lowest record current_now value (137000, converts to maybe ~2.1W) has been on 5.15.12.

A quick update for Fedora/KDE users, As of Fedora 35, Udev is no longer needed to switch between power profiles. Switching profiles on battery/AC is now an option in KDE’s power management settings.

For those looking to make other changes when on battery/AC you can run scripts on profile change as well. I currently have scripts that change the power settings of Linux’s scaling governor. The scripts for AC and Battery run these two commands respectively:

echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
echo power-saver | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

This changes the cpu frequencies based on power profiles that are built into the cpufreq governor. These changes mean that I can run at full horsepower while connected via AC and be more conservative about power usage when I’m relying on the battery. Typically when I am on battery I am sing a more basic workflow with a few applications and a web browser open, and I have not noticed any dip in overall performance when running the power-save profiles for both powerprofilesctl and my cpu governor.

Between these changes and others I have mentioned on this thread, I have been able to pretty consistently achieve around 10 hours of battery on a full charge.

4 Likes

How did you measure around 10 hours? Did you just run KDE without anything from battery 100% to 0%, right? Or did you do something during the 10 hours?

This is an estimate compiled from both powertop’s and the OS’s estimates on battery life and what I have personally observed using this as my daily driver for around 5 months now. If you have some other benchmark utility you want me to give a whirl I would be more than happy to run it and tell you what I get.

1 Like

Alright I was able to get it around 10 hours as well. Just today I finally jumped ship and got myself arch, with the setup I need, which is quite minimal and some HW acceleration and TLP under gnome I was able to get something like that. Didn’t test it throughly tho

Quick question, does hw-decoding for FFox & Chromium work for anybody? I have tried everything that I could find and still could not get it to work. I’m assuming that having hw acceleration on would greatly help battery life? Maybe extend it by an hour and a half? If not then I won’t bother with it then.

I could edit the wiki on this thread now. Maybe it was fixed at the following timing.

@Linen

I got this to work with Fedora 35 with Chrome, it does help some, thought it seems some but not all video vendors use codecs that Chrome supports.

See my post below.

Did everything in the post you showed and even more still could not get it to work :frowning: Although I’m wondering if this is because I’m using ungoogled-chromium instead of the normal chrome / chromium browser. Nevertheless I might just go with the yt-dl/mpv option if I see a significant increase in battery life. Thanks!

Hello just updated my system and found out that I have to remove either tlp-rdw or power-profiles-daemon since they are in conflict. Which one should I remove? Is one better than the other? Thanks!

@Linen If you want to use TLP you should remove the daemon, that is used by gnome to regulate power profiles and TLP can handle that, you just would lose the toggle in the gnome ui

I was investigating how to improve the battery drain after powered off (shutdown).

I found some tips.

  • shutdown -H -P +0 is better than shutdown -h now in a new hardware?
  • Is the command like hwclock --systohc --local executed when doing shutdown? If it is, it might cause the battery to drain when the laptop is off.
1 Like

Did anyone test auto-cpufreq ? Heard that it’s a replacement for TLP & also does the job of cpu-freq & indicator-cpufreq.

Increase and Optimize Linux Laptop Battery Life here is one example, I’m sure you can find a few more by searching for “auto-cpufreq”