[TRACKING] Linux battery life tuning

Ah, I am only running usb-a/usb-c expansion cards. I took them out and it seems to have lowered usage just a little. Still sitting at ~8-9w discharge writing this post with a few tabs open and powertop (and basic system services).

I’m running firefox with 10+ tabs, telegram desktop, various virtual machines, wine, have an ethernet dongle, and powering a 43 inch monitor at 4k resolution.

The last few 20 second intervals have been while I’ve been doing stuff have been:
10.1W
10.3W
9.8W
10.5W
10.7W
9.83W
10.1W

Edit - in addition, playing a youtube video upped it to 12.5W

Interesting, I just spiked up to ~15-20W discharge for around 5 minutes and now am hovering at ~12w. Watching my system monitor I am only averaging 5-15% on all cores. No idea what is taking up all the power. Using a steady 2.3gb of ram and no significant network usage. Nothing has changed since typing the posts.

Omg wow. Ya I have 6 tabs open, all of them various wiki sites and one system monitor TUI. I am running DWM with Picom using startx (no display manager) so it should be extremely minimal on power consumption.

edit: and my cpu frequency clearly has TLP working as powertop has showed it to be consistently at around 1000mhz

Yah, you should also check the idle stats tab on powertop. I’m hitting C6 states 20% of the time while I’m typing and getting 8W usage.

I’m not sure how much frequencies have to do with it. My frequencies are all 1100-1250Mhz.

@IPGentlemann - I’m trying to understand which parts I can put into the wiki/first post. It looks like the power profile daemon is a Fedora-only project?

Is there something specific that the power profile daemon does to reduce the power usage that can be useful in general for non-Fedora?

@TJ1 The power-profiles-daemon is not Fedora-only. I believe it comes Out of the box with Fedora re-spins (will be standard with Fedora 35)

https://fedoraproject.org/wiki/Changes/Power_Profiles_Daemon

and some of the latest Ubuntu Releases.

I know some packages exist for Arch as well.

https://security.archlinux.org/package/power-profiles-daemon

If I recall the daemon originally started as a project targeting Linux systems that were running the standard GNOME desktop,

The power-profiles-daemon project was created to help provide a solution for
two separate use cases, for desktops, laptops, and other devices running a
“traditional Linux desktop”

but KDE/Plasma started support for it fairly recently as well.

I believe I’ve seen some other posts mentioning people running it with other Linux OS’s like NIX, I’ll reply with them linked if I find them again.

1 Like

Created a Max SoC vs Avg Watts vs Battery Life Hours table for the 55 Watt-Hour battery if anyone wants for reference:

@ERLindeman, is the table for all framework configurations in general, or is that with a specific config in mind?

eg: freshly installed fedora instance, or a freshly installed Debian instance with TLP installed… etc. Not just CPU/RAM configs.

@mrwm
It is for a 55 Wh battery, which is the same across all framework laptop configs.
Watts used against Watt-hours of battery to get Hours of life is just division, agnostic of other hardware. All the hardware and configs only change the “Watts Used” variable, which powertop can give you. This table helps you figure out the rest.

So has it been determined whether or note Ubuntu 21.04 needs TLP or Powetop? I have power profiles under the power settings in 21.04. I do use a gnome extension that also me to change the max and min processor states as well as disable turbo boost, and I’m seeing very temps as a result. (My primary focus is keeping temps down, while still doing all of the work I need.)

So I’m just curious if powertop is still necessary?

1 Like

I don’t think you need PT if you run TLP, (there are obvious conflicts to be weary of if running both) but I do, only using PT for monitoring and ‘Tuneables.’

I’m seeing a bad interaction between battery tuning and suspend. I’m running stock Ubuntu MATE 21.04 with the following TLP changes:

CPU_ENERGY_PERF_POLICY_ON_BAT=power
PCIE_ASPM_ON_BAT=powersupersave

With these changes I’m reliably reaching pc10; however, if I suspend (s2idle) the laptop, when it resumes I get only pc1/pc2. After rebooting, it gets down to pc10 again.

Is anyone else seeing this?

1 Like

I’ve been poking at s0ix (“s2idle”) power usage, since the 12-second wakeup delay with S3 (“deep”) annoys me more than the power savings it gives.

I’m using Debian unstable, which has kernel 5.14.9. I’m using TLP with DEVICES_TO_DISABLE_ON_STARTUP=“bluetooth wwan” and PCIE_ASPM_ON_BAT=powersupersave, and everything else at Debian’s defaults. Powertop’s tunables tab says everything is good except the VM writeback, which it seems TLP sets more aggressively than Powertop likes.

I’ve been using /sys/class/power_supply/BAT1/charge_now to check usage with a bit more granularity than looking at percents, which measures in microamp-hours rather than watts or watt-hours. You can convert from amp-hours to watt-hours by multiplying by voltage, but /sys/class/power_supply/BAT1/voltage_now seems to vary which makes the conversion a bit iffy. Based on the battery being stated as 55Wh and charge_full_design saying 3.572Ah, I’m guessing 15.4V is about the right conversion.

I’ve found s2idle reports reaching s0i3.0, which is good.

With 2 USB-C cards and 2 USB-A cards, one on each side, I see about 0.143 amps power usage over extended suspend, which seems to be somewhere around 2.20W or 4%/hour. Not great, but could be worse.

If I take out the USB-A cards, it drops to about 0.096 A (1.48W or 2.74%/h). Putting both A cards on the same side is slightly better than one on each side. The C cards don’t seem to make a difference. I haven’t tried others.

S3 suspend seems to do about 0.03 A better (0.46W or 0.86%/h).

I’ve noticed the same thing, although I get up to pc3. I’ve also found that doing an S3 (“deep”) suspend also seems to fix it.

I also noticed that the ISH line in /sys/kernel/debug/pmc_core/ltr_show shows bogus values after an s2idle suspend if the relevant kernel modules are loaded, and the modules can’t be unloaded in that state. That too is fixed by a reboot or S3 suspend. But I don’t know that that’s directly related, as without the kernel modules loaded ISH doesn’t show bogus values but the CPU still won’t go past pc3.

It doesn’t seem to be anything TLP is doing, as the same happens if I disable TLP.

Yes. Coming out of suspend, I have to re-initiate either or both the powertop --auto-tune or restart tlp. Haven’t figured out why yet, but definitely seen it.

1 Like

Does that fix it for you? It doesn’t seem to do anything when I try it, it still won’t go past pc3.

Yes, I get back to pc8. I’ve never hit pc10, still need to work on that one.

Elevated Systems just posted a review of various Linux distros running on the Framework laptop. He did this in “beginner mode” so he avoided any complicated tweaks to improve performance.

At the end he shows a graph that says across the board the framework laptop in linux, per hour, loses about 30% while active and has a few chrome tabs open, 5% during sleep. in windows he saw 16% active 1.5% sleep.

How does this compare to the experience when the power usage tweaks discussed in this thread are applied?

2 Likes

Not sure why Elevated Systems is getting these results but Ubuntu 20.04.3 does closer to 3.5% during suspend by default, no tweaks. That is using S2 suspend and not the more power efficient S3. S3 gives 1.6%/hr with 32GB of RAM, likely less with 16. Also as a side note distro hopping, hoping to find one that works well out of the box for certain hardware is a fool’s errand. The time spent doing that would likely be better invested in learning how to get a distro work well on that hardware. Sadly I didn’t get that when I started using Linux 15 years ago either. :sweat_smile:

I agree, but someone else distro hoping and sharing results saves me time :slightly_smiling_face:.
I’ll stick with distros I’m comfortable with, though. Saves me time searching for solutions in the long run.

True. I guess my point is that what distro just so happens to work on certain hardware configuration is not a great merit of a distro. I can see how it could be for a complete novice. But once you go just a smidge over the initial noviceness, then other merits become much more important. For example documentation (docs, wikis, community sources like SO, AskUbuntu, forums), size of software package collection, testing quality of that package collection, stability of those packages, timely application of security patches to packages in that collection, ability to install and manage proprietary software, being supported by open-source and proprietary vendors. For example being able to go to a project’s web site and always finding it’s packaged for your distro along with installation instructions is indispensable.

And this is a really important merit I skipped above since you mentioned it specifically. Proficiency and therefore comfort with a particular distro. That’s actually partially the result of the documentation merit. I do believe that the successful, productive and fun use of Linux is best achieved by picking a distro that scores high on those merits and then spending the time to learn how to use and manipulate the OS, this achieving proficiency and comfort with it. Something wrong with audio? Oh, I know, let me look at the PulseAudio config and logs. I know where my distro stores that and so I know where to look.

1 Like