[TRACKING] Linux battery life tuning

My laptop is shipping soon and I plan to install manjaro Gnome (for wayland).

I see a lot of varying or (maybe?) conflicting recommendations in this thread.

Would anyone be willing to put together maybe a github gist or something like that with linux battery tweaking instructions for the framework? Then as new things are figured out people can submit PRs to make it better.

If not, I’ll do what I can as a seasoned linux user but with no experience with this stuff, and post the repo here with an open invitation to add to/change it. With any luck we can even make a script for people who don’t want to get their hands dirty

3 Likes

Pretty sure we have to wait for the UEFI to support it first, then it can probably be exposed through TLP (in addition the UEFI settings).

1 Like

Fresh Fedora 35 KDE install yesterday, manually installed but did not customize tlp, and two scripts to invoke powerprofilesctl on plug in or plug out.

Seeing as little as 2 hours estimated under heavy download, install, high brightness use case. Goes out to 7-9 hour range under medium brightness and light web browsing use case.

I would prefer to see more longevity playing video though. VLC playing 1080p h.264 from a samba share, YouTube 720p, playing a local 1080p copy of Sintel, etc all bring the estimated battery life under 4 hours. That’s a little odd to me after having run 5Y70 and 6Y30 class processors that get 5-7 hours of local or streamed video playback time from even smaller batteries… Good thing I have a 90w USB-PD source to recharge quickly, and the blending battery + weak USB power source thing is nice too.

Overall not too bad for a OOTB+super easy tweak setup.

Wonder if it’s possible to bring the frame rate down from 60 to 30 to increase battery longevity even further…

Sintel@1080p on YouTube, mid brightness, max sound

Idling at r/Framework, mid brightness

Ubuntu 20.04 w/ TLP on Batch 5, i5, 32GB RAM, WD SN550

Only non-default setting in tlp.conf is CPU_ENERGY_PERF_POLICY_ON_BAT=power.

2 Likes

So thing I learned today … TLP and Fedora’s default “power profiles daemon” aka PPD aka powerprofilesctl do not work together. Install and use one or the other, but not both. TLP seems to do a far better job for me in both Fedora and Arch.

Tried the new Endeavor OS iso that was released on 03 Dec (and using it with tlp only), to see if I get any better longevity from my favorite distro family, which is arch.

Further update, I think some of the power difference between Fedora and Endeavour was Bluetooth being off by default in endeavorOS. Adding the necessary packages and enabling it on my framework supplied AX210 (no vpro) has put 1-2W back into the usage reported by powertop, even with tlp correctly setting powersave on the AX210 card. Without power save on that card, usage is more like a constant 3+W regardless of Wifi / BT utilization. Longevities are similar with BT on in Endeavour and Fedora, with a noticable edge towards Endeavour.

Anyone trying to get more battery life should consider temporarily disabling Bluetooth and/or Wifi when possible. The AX210 seems to be a relatively power hungry card compared to the Intel cards I have in my older ultrabooks (8260 IIRC).

6 Likes

Further update:

EndeavourOS didn’t seem to have PSR on by default (C8 was the deepest it would idle OOTB). Adding the cmdline option into grub has definitely turned it on. With it on, I’m seeing true idle power consumption down another ~1-1.5W, CPU now reaching C10 state. However, the output of

cat /sys/kernel/debug/dri/0/i915_edp_psr_status

did not change from before to after the cmdline change.

Using kernel 5.15.6 currently btw.

2 Likes

After installing TLP, I run
systemctl start tlp.service
systemctl enable tlp.service

and then
systemctl status tlp.service
shows that its enabled and running…

reboot

tlp-stat -s still shows output, but

systemctl status tlp.service
shows inactive.

Am I missing something, or is this how TLP functions?? Is this thing on??? :stuck_out_tongue:

Thanks, all.

pAULIE42o
. . . . . . . . .
/s

I’m showing the same results using Manjaro with Gnome 41. I’ve seen several notes about conflicts between tlp and the power-profiles-daemon service. See Questions regarding the new gnome 41 power controls - GNOME - Manjaro Linux Forum

I dunno if anyone else has mentioned this, but I noticed the display backlight was the highest consumer of battery.
Adding this to my GRUB_CMDLINE_LINUX_DEFAULT seems to greatly reduce power use:

edit: removed the command since it doesn’t work

1 Like

@cameron_lambert I tested with and without the video.use_native_backlight=1 option and couldn’t see any difference. Under identical circumstances, powertop showed 6-7W either way.

However, my network interface usually uses significantly more power than my backlight, as I keep my brightness moderately low.

I was actually imagining it, probably from the difference in brightness settings between tests. And looking at dmesg shows “unknown parameter… ignored”.

I’m also testing:
acpi_backlight=native

But it’s too early to tell how much it’s changed anything

Just to confirm, this is supposed to be set to true, right?

Just read something interesting: apparently, using wayland instead of Xorg can save around 3W of power usage, both in GNOME and KDE Plasma.

This may explain why e.g. @Chiraag_Nataraj (he uses sway) seems to get ok battery life while others don’t quite get there. Apologies if this is common knowledge, after all it seems intuitive that eliminating the middleman (X-server) saves power.

EDIT: the test was conducted on a Thinkpad T14s with Ryzen 5850U, so it might not be exactly comparable. But even 1W would be great savings imo.

From my own month ish of testing, I would say it’s not quite as simple as Phoronix is laying it out to be. Yes Wayland does seem to be a bit more efficient at doing the “basics”, i.e. simple desktop, few programs, only one monitor, etc. Difference in efficiency is probably more than .5W, close to 1W, but probably less than 1.5W in my estimation, but definitely not anywhere close to 3W.

Add two monitors, eGPU, badly behaved programs ( wine, Steam, many browsers with their own window toolkits and not well hardware rendering optimized stacks), certain games, etc, and that general rule goes out the window very quickly.

I’ve found certain use cases where Wayland is consuming way more idle and heavy load power than X11, on both KDE and GNOME.

Bottom line is, the only way you’ll know is with your own testing, and re-do the testing after major updates to any component in your kernel, driver, DE, app, etc. stack. Powertop, htop, etc are your friends in this “Endeavour”!

2 Likes

Thank you who ever started this thread, I will hold on my purchase because I don´t want to lose my battery life with linux but again it seems the linux support doesn’t include the actual power & battery handling.

I will return when these issues are solved with proptiery firmware software or self build kernel or something.

If there’s a specific use case scenario you need a battery life test or target for, let me know.

I have gotten idle at graphic desktop power down to as low as 2.2W, or 24+ hours longevity.

Typical light web browsing workload I am routinely over 8 hours estimated longevity.

Playing video is more like 6 hours.

Unfortunately some badly behaved apps like zoom can bring that to under 3 hours.

But all in all I would say the battery life is very competitive with other offerings in this price class / and use category. NotebookCheck seems to agree with that assessment as well.

1 Like

My typical work on this machine would be editing pdf files and editing schematics with kicad and viewing 3D CAD models on the job site without power sockets, so I would need 10-12 hours minimum and if +16 hours is possible then it would last even the longest work days. Company provides BricsCAD or AutoCAD.

For free time I planning to use eGPU to handle my gaming & 3D modeling / editing needs.

Edit: The problem what I have with powertop and all other ´scripts´ is that when I need the power from CPU I won´t get it without going to CLI and killing battery saver scripts and tune ups. End user shouldn´t have to manually tell the computer I need power now and I don´t need the power now. Other thing is when you go low power mode it usually has meant on laptops that you´re not anymore that snappy, browsing web pages becomes slow.

Hey man @D.H how did you get that kind of battery life? Was wondering what should I do in order to increase mine.

Heres the list of factors that made a difference in getting to ~2.2W idle draw, in roughly the order of effectiveness from high to low…

  1. Brightness manually set to 1 (this is the single biggest factor I have found)
  2. Airplane mode (ax210 is pretty power hungry even when doing nothing)
  3. TLP bat mode sets all the rest of the important power saving and tunables automatically
  4. PSR turned on allowing for C10 idle state (no issues with this observed in kernel 5.15.x for me).
  5. Arch Linux + Plasma + Wayland (there may be even lighter DEs out there that I haven’t tried, though)
  6. Hynix P31 SSD (noatime, and VM.swappiness=1 to avoid writes)
  7. Hynix RAM (I run 2x8GB, but single stick of 8GB might be even more miserly)
  8. All expansion cards removed (ssd, SD, HDMI cards are all active and draw 1+W each according to others, but it looks to me like even the passive USB-A cards cause ~ .2W draw each somehow…)

Of course, I wouldn’t travel or use the computer in such low power limbo mode all the time, but it’s good to know what to trade in or out for each usability vs longevity scenario…

TLP mostly does this all on its own, but you could easily automate additional scripts modifying fan behavior, etc if you wanted more fine grained control over power usage. Powertop is just the measuring tool to see how effective your adjustments are. You could also watch cat /sys/class/power_supply/BAT1/current_now to get battery draw info, but then you have to do math to get it back to watts.

But yes you’re looking at pretty long longevity needs. Good news is the Framework will charge from decent usb-pd power bank sources, or blend in power from weak ones while running. I have an older 6000mah 18W usb-pd source that was good for 2-3 hours longevity boost to the F.w in normal web browsing use case. I’m guessing a good quality 30000mah one would likely get you to your time away from plug target. If you fly commercial airlines, though, check the current limitations on battery pack size in carry on luggage.

7 Likes

couldn’t one create a service or something that unmounts them when nothing is inserted or when the screen is locked and remounts them when that’s not the case anymore? I’m not that deep into linux yet but technically that should be possible right?