[TRACKING] Linux battery life tuning

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”

Adnan Hodzic (auto-cpufreq dev) mentioned that it’s a complete replacement for tlp & cpufreq. Caz he merged both of their codebases & automated the cpu governor toggles in the fly.

That might be true for the latter, but it only replaces the CPU-related parts of TLP. If you disable those, you should be able to run them in tandem from what I’ve read. I plan on doing that, as I want TLP to manage the power draw of my wifi card and SSD.

Hello has anyone experienced regression with the newer versions of Firefox and ungoogled-chromium? Hardware acceleration doesn’t work for me now. Currently on Arch 5.16.9, Firefox 97.0-1, and Ungoogled-chromium 98.0.4758.102-1.

Just wanted to add my result regarding power consumption in suspended mode:
10h = 14% drain
i7 1165G7
16 GB RAM
512 GB SSD
Elementary OS 6.1
Linux 5.13.0-28
Deep Sleep enabled (s2idle [deep])
BiOS 3.0.7

Just got hibernate and suspend-then-hibernate working on Ubuntu 21.10 following this guide, and I wanted to share in case anyone else runs into the same issues. I had to add resume and resume_offset to my grub and initramfs configs. However, mem_sleep_default caused a lot of problems for me, presumably because it was already enabled. Hibernate would work just fine, but when I ran suspend or suspend-then-hibernate, my WM (i3) would reload and appear fine for a few minutes, but then crashed. It seemed that the OS wasn’t aware of what was in $PATH, but I couldn’t find anything useful in my systemd logs that would indicate what the problem was. Removing mem_sleep_default from my grub config solved the issue.

2 Likes

Works for me, I’m on void, kernel 5.16.11, brave-browser (chromium’s derivative).

I have

--ignore-gpu-blocklist
--enable-gpu-rasterization
--enable-zero-copy
--enable-features=VaapiVideoDecoder
--use-gl=desktop
--disable-features=UseOzonePlatform

flags on ~/.config/brave-flags.conf.

And have enabled these options under chrome://flags

2 Likes