[TRACKING] Linux battery life tuning

Sure thing! That’s why I posted it and so that it can be used as a starting base for further discussion :slight_smile: I’ve been using my AMD laptop off and on (but not much heavy use) the last week while traveling and battery life has been much better than my previous 11th gen mainboard (didn’t measure hard numbers though).

I saw the PPD v TLP for AMD Ryzen 7040 thread – has anyone tested Mario’s comment from there yet?

When I get the chance I will test, and probably better off responding in the respective thread.

I’ve had great success TLP + Ubuntu (Wayland/Gnome) on my Intel 13th gen framework, but one thing I’ve noticed is that when on battery, gestures with the touchpad to change workspaces are terribly slow. If I switch TLP off or switch to AC, they become smooth again. I’ve played around with the TLP config a bit and none of my modifications seem to address this particular issue; I assumed it would be graphics related, but perhaps not?

Note: when I switch workspaces using the arrow keys it is quite smooth! Also, when I switch off the PCIe Runtime PM on BAT it gets a teeny bit smoother. But not enough.

I followed the latest optimization settings exactly.

Fedora Rawhide, PPD, Plasma, Firefox with 5 Tabs, Screen @ 20% (with PPD dimming), Wifi Connected (AX Ap), BT Off idling under 4W:

Likely a Gnome issue, most likely, the animation is just too CPU intensive on a single thread (which TLP heavily affects).
I used to have this issue on Gnome, but haven’t experienced any lag on Hyprland.

1 Like

Thanks for the reply!
You’re conclusion seems likely, though I’m curious why it isn’t a problem when I change workspaces with the arrow keys?

I tried disabling animations completely, which seemed to help slightly. I’ll try to find a way to only disable animations for gestures.

Edit: I was unable to find a way to disable gestures animations exclusively.

1 Like

Looking towards the future:
I think we/framework should make a more dummy proof solution here.

Can we maybe brainstorm a bit?
For example; would it be possible to create a TLP configuration file and share that via an official “guide”?

At the moment, and in the near future, it will be very difficult for the medium-tech-savvy people to optimize their new laptop in linux.
AMD is a new platform; I expect (configuration) improvements to happen from time to
And every bios release, people will find configuration improvements for battery optimization.
For all distro’s, every framework user probably benefits from the same configuration.

But not all of us have the time, or the hobby, to follow all the posts to stay up to date all the time.
What would be a good way to enable the whole community to stay as energy-efficient with their framework laptop as possible?



I attempted creating a custom Fedora image with the power saving techniques applied by default, you can see my original post linked below.

Totally agree with you though. Fundamentally for new users I think there needs to be a better out of box experience. System76, Slimbook, Tuxedo, and others have their own power management packages. I think it would be nice to have an official guide vs us cobbling things together after hours and hours of research that 90% of people would never do.

1 Like

You really need a custom kernel with your Ublue images I think to make this really worthwhile

There are several patches which apply to the amd framework that are worthwhile.


  • amd-pstate epp prefered cores
  • rtc-cmos fixup
  • cros_ec
  • PPD epp preference switching support
  • systemd tuning for auto power save for framework modules
  • packaging for ectool to support the EC querying

6.7-rc2 doesn’t include any of the above but DOES include power-supply fixups and amdgpu patches ; and is likely a good target to apply the above patches too (i’m using the fedora rawhide os-build as a starting point ; and have the above patches applied to my install).

Fedora kernel policy is NOT to include patches that have not already been accepted into the mainline kernel, and IMNSHO if you are going through the trouble of building an ostree image - shipping a custom kernel is a trifle to include.

OOTB apart from the PPD patch the userspace in FC39 is pretty spot on and there are not that many tweaks without the above out of distro/tree patches worth the effort of maintaining a specialized image for the fwamd specifically - sans kernel.

The two bits of hardware I am struggling with to find a working patchset are:

the USB-PD usci errors and ack bugs - this is still an issue and I’ve had instability with state changes around plug/unplug events leading to quite disturbing behavioiur with i.e upower reporting AC is present when it’s not and/or not triggering dbus on unplug to signal to PPD. This is AFAIC a kernel level/firmware bug with the PD controller interaction and should probably get a bit more attention from framework.

amdgpu issues with Memory management are still present for the phoenix platform, although potentially this might be fixable with a newer Framework BIOS patch for the AGPU.

And the last one is the Ambient light sensor - Can someone please let me know what model is in the amd framework? I’ve tried a number of out of tree patches for various ALS chips but I still can’t get the kernel to instantiate it correctly.


Custom kernels by their nature automatically exclude people who don’t want them. I know I will automatically write off an image with a custom kernel for a number of reasons, and i am very likely not the only person. Custom kernels are quite literally an individual preference, So if they feel like adding one in addition to a base image great, but as the default I would have to say no.

1 Like

Well the reality is right now; there is no other viable option than out of tree patches .

IME running older kernels with out of tree patches is worse than running the current vanilla head with patches. But you are right this is a personal preference. I guess I just look at the huge ammount of resources required to build-pipeline a whole ostree image when all that really is needed is a simple ansible playbook to be run against a base install which is all that that is really needed for FC39.

packaging of ectool probably should go to fedora packaging for inclusion ; and the systemd device ID’s should hopefully make there way into updates in the normal packages given I think @linuxlion submitted them upstream.

Everything else current is dependent on out of tree or non-existent bits or in PPD’s case a non-accepted patchset.

@jwp Thanks for the clarifications.

I wouldn’t assume that everyone here knows how to do what you are referring to. I have never built my own kernel, and I would assume the vast majority here haven’t either, nor would they know how to install a patched PPD.

I was trying to look into setting up COPR repos, but have zero experience with that as well. It sounds like you may have the know how / experience. Would you want to create a COPR for the PPD / Kernel with relevant fixes applied?

1 Like

A copr is a relatively good proposition. However a ublue ostree image is probably an easier way to distribute this and won’t require setting up i.e kernel signing keys/spec files etc; and whoever maintains the ostree image with custom kernel bits etc can do so much more easily.

Ideally the bits t hat can goes into upstream rawhide, and kernel bits will filter through eventually. But for today - given the OP has already started down an ostree style path - simply building on that is much simplier as it’s a matter of adding a tag to their existing image and pushing a whole delta of the osimage with the custom kernel/packages etc included.

There is already a framework ublue image (but currently for the intel only). And it would be simple to have a framework-amd13 split out with and without out of tree bits.

This would effectively be similar to other ublue images which include a heap of changes to base kernel/modules userspaces OOTB



Potentially if Framework wanted to start their own copr that might be a good supportable way forward.


It’s a Capella CM32183A3OP. Mine’s working out of the box with iio-sensor-proxy/GNOME 44.

It loads hid-sensor-hub (which isn’t conflicting with keyboard brightness keys unlike the 12th Gen) and appears as iio:device0 e.g.:

❯ cat /sys/bus/iio/devices/iio:device0/in_illuminance_raw
1 Like

On the AMD FW? I am getting nothing appear

Can you copy the output of : udevadm info --export-db|grep -A5 -B2 iio

and dmesg |grep als


This has been consistent fc38-fc39-rawhide and custom kernels based on those.

So if that is the chip it uses cm32181 module - which I indeed have compiled; modprobe cm32181 does not however net any change in behaviour:

modinfo cm32181
filename:       /lib/modules/6.7.0-rc2+/kernel/drivers/iio/light/cm32181.ko
license:        GPL
description:    CM32181 ambient light sensor driver
author:         Kevin Tsai <ktsai@capellamicro.com>
rhelversion:    9.99
alias:          of:N*T*Ccapella,cm32181C*
alias:          of:N*T*Ccapella,cm32181
alias:          of:N*T*Ccapella,cm3218C*
alias:          of:N*T*Ccapella,cm3218
alias:          acpi*:CPLM3218:*
depends:        industrialio
retpoline:      Y
intree:         Y
name:           cm32181
vermagic:       6.7.0-rc2+ SMP preempt mod_unload 
sig_id:         PKCS#7
signer:         Build time autogenerated kernel key
sig_key:        7A:E7:51:E6:BE:5F:E1:C5:54:22:20:3B:A2:94:54:C0:43:2B:ED:CF
sig_hashalgo:   sha512
signature:      70:52:E7:C3:E5:43:C4:2F:97:6D:E5:FD:06:79:99:FD:C3:CD:B4:CB:

If I manually unload the hid_sensor_als after modprobing the cm32181 I still get the same dmesg error I see on boot i.e:

[ 1872.851702] hid_sensor_als HID-SENSOR-200041.1.auto: failed to setup attributes
[ 1872.851711] hid_sensor_als: probe of HID-SENSOR-200041.1.auto failed with error -1

Can you also add the output of :

sudo /usr/libexec/iio-sensor-proxy -v -r


sudo iio_generic_buffer -A -N 0


For reference I get nothing - I had hoped this might have been some sort of magic init string I was missing but no.

** (iio-sensor-proxy:13116): DEBUG: 07:57:54.043: Starting iio-sensor-proxy version 3.5
(iio-sensor-proxy:13116): GLib-GIO-DEBUG: 07:57:54.045: Using cross-namespace EXTERNAL authentication (this will deadlock if server is GDBus < 2.73.3)
** (iio-sensor-proxy:13116): DEBUG: 07:57:54.085: No sensors or missing kernel drivers for the sensors
root@emiemi:/var/lib/power-profiles-daemon# sudo iio_generic_buffer -A -N 0
iio device number being used is 0
Failed to read name of device 0

I did some power testing and have to say am a little bit disappointed when comparing it to my beat up t480s. Sure it performs a hell of a lot better and the bigger battery also makes up for some of it but it is kind of frustrating seeing something much newer struggling to even match the low load efficiency of the old one.

Test setup is the AMD 13, 7840U, 2x32GB Kingston 5600cl40, 2Tb 980 pro and an ax210 (3usb-c and one usb-a in the front left slot for expansion cards, removing the a made no visible difference). My previous I am comparing it to is a T480s, i5 8250u, 36GB(4+32), 256GB 970 evo, ax210, LTE modem, built in unifying receiver (that draws about 0.1-0.2W all the time) and a modded in 1440p panel. Both run a relatively light arch+sway install with tlp and the thinkpad is undervolted.

Tests are run with wifi connected (about 2m from the access point), bluetooth on but not connected, display at 20%, keyboard backlight off, webcam off(physical switch or complete delete), microphone off on the framework. All measurements are taken with powerstat after they settled for a bit.

I am using the format [TEST] [FW 13 value]/[T480s value]

  • Idle (just sitting with 2 terminals open) 3.5W/3.4W
  • Idle with firefox open (a videos page on youtube) 3.8W/3.5W
  • Iperf3 (continuous runm wifi6 80mhz) 8.6W/6.3 (performance was roughly equal)
  • firefox hardware accelerated 720p 30hz (vp9 for the fw, h265 for the thinkpad) 8.5W/6.9W
  • kodi 4k 60hz h264 fullscreen (streamed over sshfs, confirmed hw accelerated) 11W/7.7W
  • kodi 720p 30hz h264 fullscreen (streamed over sshfs, confirmed hw accelerated) 8W/5.8W

Idle looks at least not worse but I think something with the hardware acceleration isn’t fully baked jet or something I can’t believe that a h264 decoder on a much newer node somehow actually needs more power than the old one, I hope this is fixable in software at some point.

1 Like

AMD 7640U, yep.

❯ udevadm info --export-db| grep -A5 -B2 iio
E: ID_PATH_TAG=platform-AMDI0010_00-platform-HID-SENSOR-200041_1_auto

P: /devices/platform/AMDI0010:00/i2c-0/i2c-FRMW0005:00/0018:32AC:001B.0002/HID-SENSOR-200041.1.auto/iio:device0
M: iio:device0
R: 0
U: iio
T: iio_device
D: c 242:0
N: iio:device0
L: 0
E: DEVPATH=/devices/platform/AMDI0010:00/i2c-0/i2c-FRMW0005:00/0018:32AC:001B.0002/HID-SENSOR-200041.1.auto/iio:device0
E: DEVNAME=/dev/iio:device0
E: DEVTYPE=iio_device
E: MAJOR=242
E: PATH=/nix/store/vfvv6a7fi7arynggi9mig1wibnnz5wvf-udev-path/bin:/nix/store/vfvv6a7fi7arynggi9mig1wibnnz5wvf-udev-path/sbin

M: trigger0
R: 0
U: iio
E: DEVPATH=/devices/platform/AMDI0010:00/i2c-0/i2c-FRMW0005:00/0018:32AC:001B.0002/HID-SENSOR-200041.1.auto/trigger0
E: PATH=/nix/store/vfvv6a7fi7arynggi9mig1wibnnz5wvf-udev-path/bin:/nix/store/vfvv6a7fi7arynggi9mig1wibnnz5wvf-udev-path/sbin

P: /devices/platform/AMDI0010:00/i2c-0/i2c-FRMW0005:00/0018:32AC:001B.0002/hidraw/hidraw1
M: hidraw1

❯ dmesg |grep als

❯ echo $?     

One thing to remember is that you really need to compare total consumed power over time for a job run; especially when paired with the epp prefered cores patches (basically ‘good cores’ on zen dies are ones that can boost higher for lower power input) means you have cores boosting high and finishing jobs quickly and drawing less power.

3-4W idle seems pretty good considering that’s as low (or lower) than a recent ARM SBC like an rk3588 - which can’t get anywhere near the same performance states as the zen4.

Doing a timed kernel compile test run and watching power use and time for it is going to provide a better reference point than monitoring idle ‘hypermile’ use.

My main usecase for battery is ‘can I get through several site vists in 2hr blocks without needing to reach for a Power Plug’ which I think this configuration manages pretty well.

Would I like a couple more hours runtime, yes. But Hopefully at some point battery Cell replacement with a higher ah rating might become an option.