[TRACKING] Suspend on linux drains a lot of battery compared to other laptop

@Matt_Hartley - what expansion cards do you have in the system during the test?

@lbkNhubert I wasn’t not happy with the early tests, going to re-do them with matching cards as much as I have available (multiple laptops). Saw something with Fedora 37 that had me go “hmmm”, so I want to re-run this in a more consistent way.

Going to update this tomorrow after re-testing accordingly:

Pop OS 22.04, Ubuntu 22.04 and Fedora 37.

TLP on Ubuntu and Fedora, system76-power on Pop OS.

I will update as I have further details.

2 Likes

@Matt_Hartley - thanks for the reply, and thank you for this and everything else that you are doing! I look forward to seeing your results. Have a good evening!

Here’s what I ended up with. 11 hours suspend on each, no external monitors attached, no applications running at suspend.

Fedora 37 is 81%, TLP, (Gnome power profile disabled), 2 USB C, 1 hdmi, 1 DP. 12th Gen. s2idle deep.

Pop OS 24.04 at 61% system76-power 1 USB C, 1 hdmi, s2idle deep.

Ubuntu 22.04 at 89% TLP (Gnome power profile disabled), 1 USB C, 1 hdmi, s2idle deep.

2 Likes

@Matt_Hartley The statistics mentioned above by me Suspend on linux drains a lot of battery compared to other laptop - #26 by Matt_Hartley
i.e. 33% discharge for 3 hrs sleep, is for Ubuntu 22.04. I have done the battery optimization TLP, have only 2 USB C and 1 USB A expansion card without any connection.

So, according to your measurements 1% battery discharge on Ubuntu 22.04 should be achievable. Isn’t it?

BTW, for anyone doing testing, I made an app that logs suspend/resume events into a SQLite DB and should give some more fine-grained data/does some math for normalized power drain (%/hr, %/day) that might be useful: Linux Utility to Help Track Framework Battery Usage

1 Like

Just an FYI besides the power tuning thread and @anarcat’s excellent testing, I also did a bunch of testing scenarios (including idle, near idle, suspend, and the touchpad thing) that I’ve been collecting here: 2022 Framework Laptop DIY Edition 12th Gen Intel Batch 1 · lhl/linuxlaptops Wiki · GitHub

One useful addition to a best practices guide might be a standardized/reproducible scripts/list of tools to allow users to compare their Framework’s power efficiency w/ their specific setup (OS, modules, etc) vs your official baseline 11th/12th gen, or even other laptops.

3 Likes

I’m new to Framework and I’m having a problem whereby closing the lid of my Framework causes the battery to drain such that when I open it the next, the machine is completely dead. Is that related to this issue, and if so, what is the solution?

You could try the newst BIOS version for the 12th gen CPU (or for the 11th gen).

Also make sure to post your exact setup. Which expansion cards do you use, which plugs are active, etc.

I love this idea. Working on this. No ETA yet, but I’m definitely going to explore this first part of Jan.

5 Likes

Hey Matt, did you ever get a chance to look into this? I’ve been doing some longer trips with my Framework lately and realizing my real-world battery drain is actually pretty bad for my regular usage (the past few months, I’ve only been doing plugged in/short commutes and haven’t properly run-down my battery). I used gnome-battery-bench to do some testing w/ a Firefox: 2022 Framework Laptop DIY Edition 12th Gen Intel Batch 1 · lhl/linuxlaptops Wiki · GitHub

Between batterylog and Selenium code I have lying around, I feel like it wouldn’t be so hard to have some standardized workloads - although the most interesting bits I think might be gathering data points with different setup info (platform, modules plugged in, BIOS versions, system versions, background processes, RAPL settings etc) to see the variance across setups.

Still on my list (it’s a large list). That said, one of the first things that is coming will be a guide on suspend to hibernate which is what people in Linux “should” rely on for overnight off power status. On those occasions where I am unable to suspend while connected to AC power, it’s what I use.

Guide is coming. It’ll be among the first.

One big problem with hibernate is with encrypted partitions - besides setup being pretty tricky if you don’t want to jump through hoops (or if you encrypt your partitions wrong), the real killer is that unlike w/ encrypted volumes in other OS’s, after hibernation there’s AFAIK there’s no way to avoid having to do a LUKS decrypt after a hibernate on Linux. With the Framework draining on average 1-2% during suspend, you have to balance how aggressively you hibernate with how often you want to type a very long password between resumes.

(That being said, for my recent travel, suspend/hibernate wasn’t the limiting factor for my battery life situation. My Framework simply wasn’t able to last through basically any of my flights (I mean, not even half of a single trans-pacific flight) and also couldn’t handle long travel days/media offload without a lot of babying/powerbank/plug juggling. The I/O power situation is also really dire, the microSD module is basically unusable. I’ve actually thrown in the towel and picked up an M2 MBA as a travel laptop.)

3 Likes

Not a problem if the TPM holds the key and self-unlocks after measurement. Sad about needing to get a macbook tho.

Yeah, sadly, there was basically no other option for an ultralight non-Windows laptop that I could pick up/get the same day while traveling w/ 10h+ of battery life. It’s been interesting to revisit and see how the other half lives. Also, I’ve been going through the list and disabling daemons I don’t need one by one. It’s sort of amazing how many Apple services are running OOTB these days.

I’m reading about the tpm2 config stuff now, the guide I used for my initial setup didn’t include that. It looks like systemd 251+ even has added PIN support.

I’m getting frankly miraculous battery life on Fedora 37 somehow. Over 8 hours of VS Code scripting, and around 8% lost overnight! Not to sure why this is happening though ;-;

3 Likes

I totally get that. However, suspend on Linux is a terrible way to save power longer than a few hours IMHO. Hibernate does have some hoops, however, it’s doable and a matter of copy and paste.

Long term, we’re working on getting power management improved for daily usage.

2 Likes

That’s fantastic to hear! Are you using default power profiles, TLP, or? Just curious as this usually involves something unique to the end user’s config.

This! Although I didn’t expect it to work this well xD

Right on. So install it, as is? I get pretty good battery life out of a default install as well, but not quite that good. :slight_smile:

1 Like