[TRACKING] Linux battery life tuning

Perhaps… I wonder if that’s some e-core weirdness? I’ll list the apps I have open below, in case that’s helpful.

intel_gpu_top lists very little load, so that’s doubtful. Also, I took measurements with gdm3 stopped and it was still above 8w, where no gui anything was running.

For apps, I have:
Firefox ESR
Ungoogled Chromium with memory/energy saver
Evolution mail client (defaults to no fancy html)
Signal Beta
Android Messages (unofficial desktop client, basically just an electron wrapper)
gnome-terminal (busiest tasks being top and intel_gpu_top)

None of these apps report really any major usage, in fact adding up the top 15ish processes in top only adds up to like 65% cpu usage… So that load average doesn’t make a lot of sense (unless it doesn’t account for cpu frequency scaling?)

Let me know if y’all catch anything in this that I don’t see.

  • You’re also running discord and steam. Discord is notorious for this kind of thing.
  • It looks like you’re using gnome with X and, given the gnome-shell CPU usage, you may not be offloading enough to the GPU. I’d definitely try wayland.
2 Likes

Electron has a reputation for being a giant waste of resources. Considering that you’re running Signal, Discord, Android – and also running Steam – it’s a feat that you’ve got power consumption down as much as you have.

2 Likes

Uhmmm…yeah those apps are reporting a crazy amount of usage…for apps that are supposed to be idle. Discord is a cpu and gpu hog. I would never use Discord while trying to conserve battery, whether the app itself or through a browser it turns your battery into a firehose and it wants to drink every last dreg of juice it has. Also looks like you might have two browsers open…why? This all looks like a problem with your expectations versus the actual tuning of the laptop.

1 Like

I prefer Firefox but I need Chrome for work

With HW Acceleration off, it should only be a cpu hog.

I’ve had constant issues with wayland in general, so I’m generally hesitant to use it (just today, I had an issue with spice-vdagent not cooperating.) Are the battery improvements that significant?

Either way, 1. the power draw after killing my entire desktop environment is still above 6w and 2. nothing actually is reporting high power draw? I mean, I get discord isn’t the most efficient thing in the world, but on every laptop I’ve had in the past it wasn’t a big deal (and measuring it now, it’s still not affecting the power draw after turning it off, measuring on a full battery using a usb-c power meter just in case software estimates are wrong.)

I’ll test in a moment from the logout screen but the power draw was still high last I checked, even with no graphical interface at all.

Ok, I do have to partially take this comment back. after killing gdm3, power draw was around 3.5-4w, not the 6 I had remembered from earlier. That’s still pretty high for a laptop doing not that much, but that leaves 8w unaccounted for in the system. I’ll look in to some gnome optimizations, as that seems to be the common thread.

And you configured it to do all the power saving stuff while plugged in?

I would not expect my laptop to idle anywhere near as low while plugged in as when on battery without some serious configuration changes.

1 Like

What are you using Chrome for specifically then? I have found claims that something works in Chrome but not Firefox are often a case of simply making some changes under the hood.

Well that at least is a positive.

I think the benefits to power savings from Wayland are not huge but they are there to be had. Since you are having issues with Wayland what distro are you using (I may have missed it), distro version (or none if using a rolling distro), and what items are giving you issues. I use Linux all day every day, work (sysadmin) and play. I have been pure Wayland for two or three years now, and have not run into any RDP style issues. These kinds of issues mostly have solutions at this point, but sometimes they require letting go of a well practiced paradigm.

Two things interest me here. First how can you say Discord is not a big deal if it is pushing CPU usage up to 20%? If it is using CPU it is using power. Checking in top my percentages are much lower sitting at or under 5-15% while plugged in for the entire system. When on battery these results average even lower.

Second item how exactly are you measuring power draw on battery with a usb-c power meter? These only work when plugged into a power source. Your draw on battery can only be measured by software. When plugged in the power saving profile is out the window, turbo is on, bluetooth is on, everything should basically be on, so yeah you are going to get some pretty high numbers, it has everything it could ever possibly want at this point. Now if you have a usb-c power meter that works differently and can somehow measure power differently I would love to know what model it is, and how it works.

If you dont have a power meter that works differently than every other power meter I have ever come across then try this, unplug the thing and run sudo powertop --calibrate . It won’t really let you know when it is done, but give it fifteen minutes, dont touch it during that time, make sure no devices are plugged in and the only thing running is a temrinal running powertop. Once it is done calibrating we are ready to begin getting real measurements. Let us know what you are seeing now.

I get between 4-5w on average running battery appropriate work loads. This would be in my instance a browser usually Firefox preferably with no tabs running animations or other forced autoplay elements in the background. If I am not in that tab it better be essentially silent and if can’t be Snooze it (Snooze Tabs Extension in Firefox). Evolution mail client and this is interesting html elements in emails that are animated suck power. So if you got an email from Newegg for instance with little active graphics…yeah it will jack up your power usage. Turn that off or delete the spam. A music player like Lollypop or Quodlibet (After years of being on Quodlibet I am the dude in that meme right now/power draw is almost exactly the same and Lollypop…pops), occassionally I like to listen to musci while working, and lastly a terminal with multiple tabs and ssh connections. 35% display brightness (I have this set plugged or unplugged the display is damn bright no sense in jacking it all the way up unless I am outside in the sun. Blueetooth off. No extended video usage or video calls, these will dominate your power usage. I get projected battery life of 10+ hours, and based on extended tests it is reasonably accurate. On a regular basis I run on battery for 6-8 hours and have the expected amount of power left at the end (i.e. 20%-40% ish). If I have some calls in there or watched a bunch of youtube I am looking at more like 7 hours, but I do very well avoiding this when I am on battery…I have a phone, I try to take calls on that since it is optimized for it. I am on a 12th gen i7-1260p with 64GB RAM, and a 2TB SKHynix P41 Platinum Nvmen with Fedora 38, so you should see similar or improved numbers in general.

In short you can get the battery life you want if you do the right things. You will find a lot of people on this forum who will gladly help you get the most out of the hardware that you can get.

6 Likes

To answer both of these up front, I told tlp to go into battery mode, and I don’t have any other active power adjusting software (I assume thermald doesn’t count.) I also tried playing with the gpu clocks inside of tlp, but that didn’t change very much.

I did that way at the start of this all. I am curious though if it would be better to run it from a tty with gdm killed or not. Either way, the numbers I get agree with the power meter when I’m on AC power and don’t significantly change when I’m on battery (drops down towards like 8W, but that’s still pretty high.)

This might be somewhat just an issue with what percentages I see as normal. I’ll play with discord a bit to see if it changes, though closing it out did not significantly affect the power draw.

Putting this in a big category of “wayland,” I run Kali and haven’t been having issues on wayland recent because I haven’t tried it. I hate trying to troubleshoot with something when I might not have a browser on the machine to do research on how to fix the problem (and doing that on a phone kinda sucks.)

A few things, Chrome’s profiles for different accounts gets over having some issues with sites that don’t understand multi-user google environments (google forms tend to be one,) plus I frequently have weird issues with copy/paste, fonts, formatting, etc in google docs on firefox, which might just be a matter of some configs, but that’s not really something I want to get in to. Also, I write software for work involving some semi-advanced websocket virtual-machine interface nonsense that is somewhat client-specific for performance and features, and since all my users use chrome, it makes sense to just use chrome for testing it.

Could I get away with just running firefox if I spent a lot of time tuning stuff just right? Maybe, but I have way more things on my plate at the moment.

I agree that I should be able to match your results fairly easily, but I’m concerned there’s a 13th gen kernel bug or something. I can’t really be sure (kernel development is a bit beyond my wheelhouse) so I’m trying to narrow down variables. It also doesn’t help that it seems like my power usage varies a lot, so it’s hard to keep track of trends.

The one abnormal powersaving measure I’ve tried so far is when I close my laptop I have ACPI trigger a bash script to disable all but two of my cpu cores, and to undo that when I open the lid back up. It’s imperfect but it seems to sorta help?

Hi there,
Using my FW intel 12th gen for a year now. Happy.
I have followed the TLP tutorial and set everything.
Also I am getting “nic:br” in powertop using about half of the power… is this the CPU package ?

1.76 W 0,0 pkts/s Device nic:br-e6d2715d466d

Hey Iann, if you use a wired LAN adapter that’s probably your Network Interface Card (NIC). I’ll go out on a limb and guess that “br” is an abbreviation of Broadcom.

Dino

2 Likes

Hi all, there’s been an update to the TLP and TLP UI on Ubuntu 22.04 that seems to have broken my sleep – the laptop turns on and burns the battery down even when the top is closed. Any ideas what that could be? I’m mystified. I know it could be something else but not sure how to troubleshoot that.

1 Like

@gido5731 I skimmed your posts – get the baseline power draw of you system, at idle. Quit anything obvious that noticeably increases your CPU usage. Or better yet, all programs that you’ve installed on top of your base operating system.

You mentioned you get around 3.5-4w:

So, if that really was the idle power draw, then start and measure each program’s power draw one by one.

For example, from 4W idle (measuring with e.g. Powertop open):

  1. Start Discord
  2. Let it settle
  3. Look at what your new idle power draw is with Discord running in the background
  • Let’s say it’s now 8.5W. You can safely guess that Discord uses and adds 3.5W to your total power draw (8.5W new idle - 4W old idle).

Rinse and repeat for your other running/background programs/processes. For some programs like browsers, rogue extensions could cause increased CPU usage/power draw, so you can use the same measuring method by disabling all extensions, and then enabling/measuring each one. Could be per website as well, etc.

After doing that, you’ll know roughly how much power your programs use. In the future, if your system is using abnormally high amounts of power, you’ll have something to check against.

You can also work in the reverse. For example, your system is idling at 14W. You know it should be idling at 3W. You quit Discord, it drops down to 10.5W. You can safely guess Discord uses 3.5W (14W old idle - 10.5W new idle). Or disable an extension, stop your music, close a specific website’s tab, etc.

With this method, you should be able to pinpoint exactly what’s causing the excess draw. This works with USB peripherals, programs, changing kernels, etc. You can make the decision if something’s power draw is worth keeping it running.

IME The Linux Discord client is not power efficient (haven’t measured in a while, may be better now), so I don’t keep it running. Probably poor Electron usage or the like, because VSCode uses Electron but can be very power efficient at idle.

Firefox and Chromium (and Edge, but unsure now since I haven’t used it in a very long time) are now all pretty power efficient at idle, with no heavy websites nor extensions, that even keeping all three open should only draw maybe 1-3W max (IME guesstimate). That’s with nothing happening, though. Once you have, say, some extension/website in Firefox constantly consuming CPU cycles, and another in Chrome, power draw can shoot up heavily.
I do mostly use Firefox with ~12 extensions (where I’ve ensured the extensions aren’t rogue power hungry omnomnom) and it can idle power efficiently even with a bunch of tabs.

What @truffaldino said, and likely that’s an inaccurate measurement from Powertop. It’s quite common, but it doesn’t mean that adapter is actually using that much power.

Some things to try in no particular order:

  • Generate a report over time with Powertop (check man powertop for usage) to check if something is using excess power.
  • Roll back your TLP version, kernel version, any software updates, etc. to see if your sleep works with earlier versions – then you can reinstall the updated version to pinpoint if it broke it.
  • Maybe a TLP update had breaking changes to the config and part of your TLP config file/settings is no longer valid.
  • Maybe your systemd sleep config got messed up (or some other config).
  • Checking logs with journalctl and dmesg might clue you in to the cause.
  • Maybe it’s hungry and needs some food! :eyes:

This is far more likely to be related to a systemd change than tlp. TLP does not control sleep behavior, it can however be configured to prevent autosuspend on things like your dock so you don’t keep losing the connection. In short look at your systemd

/etc/systemd/sleep.conf

and verify your actual suspend settings. The only way TLP is affecting any of it is if you have something plugged in that should be set to autosuspend but is not, in which case this external device might be periodically waking your system. An external nic, dock are the most likely culprits.

I’ve just joined to ask a question.
Setting this option: PCIE_ASPM_ON_BAT=powersupersave
in Arch, Debian 12.1 and Debian Sid is causing my whole laptop to crash. Any ideas why?
I have a Ryzen 3500U, 8GB RAM and 512GB SSD.

1 Like

thats not a framework laptop am i right? Im also not so experienced (yet) with powersaving stuff. but are all connected devices compatible with Active State Power Management? like, the SSD? seems like this would be more for a reddit post or more general support site.

1 Like

How are you all getting such low power? Particularly around the wifi usage. Is 3-4 watts normal usage there? Because I can’t get it lower than that with any of the tuning I’ve tried.

Also, is it normal for the battery to report a larger discharge than powertop shows as system baseline estimate? It’s consistently 2W or so more. For example

The battery reports a discharge rate of 9.46 W
The energy consumed was 187 J
System baseline power is estimated at 6.64 W

I have 3 usb-c cards and 1 usb-a and that’s it.

I don’t care so much about battery usage, what’s most important to me is heat, as I use it on my lap most often. It’s not bad, I’m just wondering how cool I can actually get it.

1 Like

I can only speak about the 11th gen but I don’t think 3-4 watts is normal except when idle.

  • I get 4w when the screen is at half brightness and I’m not doing anything.
  • I get 6-8w when actually interacting with the system.
  • I can get 2w-3w when the screen is off but the system is otherwise on.

@Falmarri just off the top of my head…I am guessing you are using Bluetooth while on battery and that is what is driving that wattage up. As to the powertop discrepancy while you will often see some difference just from it being slightly out of sync there is a good chance you did not run sudo powertop --calibrate or it may be in need of doing it again. Usually this takes about 10-15minutes. I would start there and note that the usb-a expansion card uses more energy.

As regards heat you should probably make sure you are using thermald which will use the intel provided thermal envelope for the particular cpu in your unit. This should aid in keeping temperatures under control.