[TRACKING] Linux battery life tuning

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?

There may be a deeper USB power saving or (auto) suspend setting I have overlooked thus far. But simply putting in an empty USB-A expansion card (no flash drive or USB dongle connected to it) does make current_now go up slightly, and I am at a loss to explain how or why.

2 Likes

Yeah i just figured that mounting probably doesn’t affect power draw that much, but maybe one could dig deeper and unbind/rebind drivers?

How would I enable this on Arch? im on kernel 5.15.6 and with the cat command from above it does not seem enabled for me.

1 Like

It’s a cmdline option given to the kernel at boot time. i915.enable_psr=1

Enable via grub, rEFInd, etc config files

1 Like

I’m on the grub boot screen rn, can you elaborate on how I would enable it? I’m pretty new to linux.

1 Like

@Linen , these appear to be a decent set of instructions on the subject:

3 Likes

Thanks followed the guide and is now enabled but I still can’t hit C10 only C9. I’m guessing that’s because I have the 1tb expansion plugged in?

1 Like

As I understand it, if you are deeper than C8, then yes PSR is working. Not sure what’s blocking you from C10. Can you test your theory with the 1TB expansion removed?

I was shocked at how much of an impact this had. Removing my expansion cards dropped me from 5.5W to about 3.9W.

2 Likes

is there someone here with enough bash experience and a Framework laptop at hand who would be willing to give this a shot? I could probably figure out how to write the required script but i’m in Batch 8.

I’m willing to give it a shot although I don’t have that much experience with bash & linux, I’m guessing by binding and rebinding you mean this?

1 Like

Exactly! And don’t worry about experience, if you open a git repo somewhere i’m sure people (including me) will be happy to contribute where needed and possible.

update:
here’s what a quick search yielded for executing a script on screen lock/unlock (since we obviously can’t receive insertion signals with the drivers unbound) :

Both questions are a tad old but i think the answers are largely still helpful. I admittedly don’t know that much about Linux evil maid mitigations, but I think by binding the function of the expansion cards to the lock state of the screen, we might actually increase security a bit as well.

EDIT:
forgot to mention: since there seems to be no abstract, linux-universal interface for this, one would probably have to write a bit more code to make the daemon linux-universally applicable.

1 Like