Battery Life?

Ran the same “test” again in powersave mode. lasted about 3h50m, so pretty dramatic. Here’s the temps under about the same conditions (same load, same blanket).

iwlwifi_1-virtual-0
Adapter: Virtual device
temp1:        +39.0°C  

acpitz-virtual-0
Adapter: Virtual device
temp1:        +58.8°C  (crit = +210.0°C)

coretemp-isa-0000
Adapter: ISA adapter
Package id 0:  +56.0°C  (high = +100.0°C, crit = +100.0°C)
Core 0:        +52.0°C  (high = +100.0°C, crit = +100.0°C)
Core 1:        +55.0°C  (high = +100.0°C, crit = +100.0°C)
Core 2:        +50.0°C  (high = +100.0°C, crit = +100.0°C)
Core 3:        +54.0°C  (high = +100.0°C, crit = +100.0°C)
1 Like

3-4 hours from a full charge sounds way off. Is Linux known to not be as battery-optimized as Windows out of the box?

There’s a second thread you may be interested in Performance, CPU temp, and battery life on Linux - #17 by A_L

I’m getting a bit longer on a newer kernel (5.13) with tuned set up, about 5-6 hours while browsing/watching videos with Firefox.

3 Likes

@Framework, seems like the HDMI expansion card is taking up around 1W of power (with no HDMI cable plugged in), which seems quite high. Did a ton of A/B tests on both Fedora and Windows, but basically idle and normal usage discharge rates are ~1W higher with the HDMI expansion card plugged in, vs. without.

The USB-C and USB-A cards seem to draw a negligible difference.

Right now, I’m running with the HDMI expansion card unplugged, and I don’t have another card to fill that hole :sweat_smile:. Also, is there any way to disable the HDMI card from drawing power? Tried a few things in Windows and Linux (using Powertop: Tunables tab, turn “Bad” to “Good” for “Autosuspend for USB device HDMI Expansion Card [Framework]”), but doesn’t seem to help.

Some general battery life information:
I’ve done a fair share of testing battery discharge rates in both Windows and Linux.

Will do a longer write up later, but tldr:
PSR (Panel Self Refresh) saves about 0.5W, which works in Windows but unfortunately is broken (stuttering issues) in Linux for now.

Have been able to hit peak low idle discharge rates (5% display brightness, keyboard light off, 2x8GB 2400MHz (to upgrade soon :relieved:), PSR on):
Fedora 34: ~2.2W (so ~2.8W with faulty PSR off)
Windows 10: ~2.6W

But usually it’s around 3W-4W. Seems PSR is needed to achieve C10 states, which save that extra ~0.5W. If PSR is off, only C8 can be achieved. Can check C-States via Powertop on Linux, or ThrottleStop on Windows.

Power profiles:
Windows: battery saver mode
Fedora: I’m using Bastien Nocera / power-profiles-daemon · GitLab and using the “power-saver” mode

6 Likes

@Michael_Wu Under what circumstances was this energy usage recorded? Did you change anything else in the BIOS? I’m curious what your real-life usage is (browsing on firefox for example), because I’m nowhere near 2.8W (5 W with literally nothing but KDE up), with most of the recorded usage by the backlight. I practically get 6 hours or so with tuned while browsing.

For HDMI, I used powertop2tuned:

sudo dnf install tuned \
    tuned-switcher \
    tuned-gtk \
    tuned-utils
sudo powertop --calibrate
sudo powertop2tuned -e -n power-saver --force
sudo vi /etc/tuned/power-saver/tuned.conf
sudo tuned-adm profile power-saver

Depending on what slot it’s plugged in, you should have something like

# Autosuspend for USB device HDMI Expansion Card [Framework] 
/sys/bus/usb/devices/3-3/power/control=auto

in your tuned.conf. With this setting, I don’t see the 1W usage by the HDMI card.

4 Likes

My personal expectation (even before I ordered) is that any module that does conversion from USB-C to other things is going to draw power, and only removing the module will stop that.

I’m OK with that because I ordered extra modules.

@Michael_Lingelbach

The only thing I changed in the bios was turning PS/2 Mouse Emulation? From auto → disabled (iirc) when I first got the laptop diagnosing touchpad issues, and left it like that. Oh and setting up the EFI boot sequence!

Hardware:

  • CPU: DIY 1165G7
  • Memory: 16GB (2x8GB SK Hynix 2400MHz sticks from an old Dell XPS 15 9550)
    SSD: 512GB (LITEON CA3-8D512 from an old 2018 Huawei Matebook X Pro)
    WIFI: AX210 from Framework

2.8W was recorded under:

  • Fedora 34
  • Gnome 40 for a standard/baseline, extensions disabled (though
  • powertop --auto-tune (all tunables set to good)
  • power-saver profile using power-profiles-daemon
  • No expansion card connected
  • PSR disabled
  • 5% display brightness
  • Keyboard backlight off

Note, I primarily use Sway with Waybar (1.6.1-3, wlroots 0.14.1-2 pulled from F35 repo). Though I think Waybar and/or my config is drawing some unnecessary power, so Sway alone with no Waybar seems to consume similar to Gnome 40. Gnome 40 seems to be pretty power efficient, shrugs

Surprisingly, removing the AX210 card entirely vs. being connected to my wifi (though I’m right by my wireless AP) seemed to make negligible difference in power consumption.

I just checked, with Sway/Waybar + Microsoft Edge Beta, 5 tabs of the Framework forum ;), and powertop, I idle in the low 4W. Note in my Waybar at the top, cpu frequency is wrong. The battery current is correct and usually matches up with powertop, but it’s set to a lower refresh interval so I can keep an eye out on battery drain, for now. I think it spiked when I went to screenshot, or something. Edit: display brightness at 30%, speakers at 75%, wifi connected, bt on but not connected to anything.) Edit 2: I’m pretty sure powertop’s reporting of nic:virbr0 is incorrect.

Edge is currently running off XWayland, might be more efficient with native Wayland.
I think with regular browser usage, with a fair number of tabs, I idle maybe 5-7W?
I can give concrete numbers later, and also test with Firefox, XWayland and Wayland. Are there any websites you’d like me to open and keep idle for testing purposes?

Also, for video playback, hardware encoding and VA-API make a pretty substantial difference, about 1-2W less with a 1080P file. 30% brightness, 75% speakers with Wayland MPV + VA-API, I saw around ~6-6.5W during playback (iirc). Got around the same in Windows 10 using the default media player, same file.

Note: power-saver profile with power-profiles-daemon seems to make a huge difference, and it also seems to cap max frequency at 1600MHz.

I haven’t really done much real-world usage testing (and it really depends on my workflow/what I’m doing), but from the last few days tinkering/testing, I’d estimate I can get around the same battery life as Windows 10 just looking at discharge rates, or perhaps more (perhaps less). Fans seem to spin up less in Fedora – I don’t plan on using Windows for an entire full battery discharge, but I can test if anyone needs.

Edit: @Michael_Lingelbach, just double checking, do you have any rogue tasks taking up cpu cycles? I had this happen to me, and came across a fix:

Basically, I saw that kworker/u16:X+events_unbound was causing like 99% usage on a thread randomly, eating up battery. sudo btrfs balance / + a reboot seemed to have fixed it, though.

Whew, that was a lot of stuff, might be messy cause I just kinda dumped all this. I have numbers written down that I plan on (hopefully) putting together, and doing another run through – hope this helps!

As for powertop2tuned, are you sure that setting is actually working? I did that in powertop tunables, with:

echo 'auto' > '/sys/bus/usb/devices/3-4/power/control'

And it seems like it does nothing. Hm, maybe I need to persist the setting, and reboot…
Have you tried physically disconnecting the HDMI expansion card and seeing if it makes a difference? I’m going to try powertop2tuned, thanks – will report back!

1 Like

I don’t see much of a difference between sway/waybar and KDE to be honest. I hover around 4.2 watt if I let everything sit undisturbed. I’m not seeing any rogue processor usage, but I do have double your ram (2 x 16 gb crucial) and a more power hungry SSD (the sn 850) which might explain the difference.

powertop2tuned should persist if you set the profile, but I’m not sure if it does any frequency capping.

2 Likes

That’s an understatement. In many cases it is drastically behind in terms of battery life. After a lot of tweaking big improvements can be made, as seen in this thread, but battery life compared with Windows? Forget about it.

@2disbetter Wow, been using Linux desktops this whole time so I had no idea. That’s kinda depressing…

The HDMI Expansion Card should drop into a low power state when a display isn’t plugged into it. We’ll check if we can replicate this, @Michael_Wu

6 Likes

This is just not true. If anything Linux distros are usually less bloated, and if sanely configured battery life should be equal or better compared to windows. On certain hardware you may see Windows perform better if e.g. the Linux drivers are bad, which is to be expected since most manufacturers only develop with windows in mind, and Linux support often relies on volunteers in the community. However on popular/standard hardware with good Linux support, or on hardware designed with Linux in mind, Linux is no worse than Windows in terms of battery. The Lemur pro from System76 for instance has incredible battery life, and no way it would improve further with Windows.

4 Likes

That is a fair point.

On all of the Linux laptops I’ve owned, getting 5 hours of battery life was considered good. Forget about 8-10 hours.

On the flipside getting 10-12 hours is pretty normal on a lot of Windows laptops.

Not a competition. I would prefer using Linux myself. It is just that Windows has undeniably better thermal and power management. (This is not the fault of Linux per se.)

2 Likes

Interesting. Guess I’ll try Linux on my Framework with and without the HDMI card

1 Like

We’ve confirmed that the card itself is entering the low power state, so it sounds like the system itself is entering a higher power state with the card inserted. We’re seeing if we can replicate this.

5 Likes

@Michael_Lingelbach

I installed tuned/did your steps, in /etc/tuned/power-saver/tuned.conf it showed

# Autosuspend for USB device HDMI Expansion Card [Framework]
/sys/bus/usb/devices/3-4/power/control=auto

Confirmed tuned-adm active shows power-saver, and also tried the power-saver profile.

Unfortunately, I’m still seeing an extra ~1W draw from the HDMI expansion card.

Also, not sure what was happening, but tuned seemed to bork my S3/deep suspend. It would either:

  • fail to suspend, resuming immediately
  • fail to resume from suspend (on but stuck on a black screen)

No worries though, uninstalled it and went back to power-profile-daemon as I seem to have good results/battery with that.

As for the cpu frequency capping, tuned’s power-saver and powersave profiles didn’t seem to cap the max cpu frequency.

By my tests

  • unplugged, on battery
  • using s-tui’s stress option, to…stress the cpu
  • Powertop to measure battery discharge

Uncapped frequency results:

  • CPU turbos up to ~3.9GHz, ~39W peak draw. Fans loud.
    Then shortly after settles down to 2.8GHz, drawing ~24.7W. Fans a little less loud.

With power-profile-daemon’s power-saver profile capping frequency at 1.6GHz (and idk what else it does):

  • CPU stays at 1.6GHz results in a max of ~14W, with fans barely audible.

@nrp Thanks! I was looking at Fedora logs and saw some errors regarding starting/restarting whichever USB port the HDMI expansion card was being plugged into? Can try to replicate if needed. However, I double and triple checked in Windows 10 and still saw similar deltas, leading me to believe that it isn’t solely a Linux-issue.

I’m using Powertop on Linux and BatteryBar on Windows to track power consumption.

Of course, please let me know if I can provide anything to help.

3 Likes

@Michael_Wu sorry you went through that hassle!

I tested power-profiles-daemon with power-saver mode and I also don’t see any energy draw from my HDMI card. I’m not sure if it makes any difference but it’s in the right slot closest to me (as opposed to one of the rear slots).

I’m getting about the same power draw with power-profiles-daemon as with tuned, (although powertop complains some settings are “Bad”) so power-profiles-daemon is probably the way to go. It looks like while browsing this will get about 7 hours consistently which seems pretty good? The lowest idle power usage I recorded on sway/waybar was 4.25 W.

1 Like

@Michael_Lingelbach no worries! I wanted to try out tuned at some point, anyways :grinning:

Yeah, I dedicate the front left slot to it but have tried other slots – same thing. Hmm, just to confirm, if you unplug the HDMI card completely does your lowest idle power remain the same?

From my previous testing, with just a terminal running Powertop:
powertop --auto-tune, which turns all tunables to Good, seemed to save around 0.3W during idle vs. the defaults.
Note that each setting can and probably should be tested for stability/side-effects/power savings, and extra steps are needed to persist the settings upon reboot. I’m currently using Powertop just for monitoring and not adjusting tunables to avoid any harmful side-effects, though.

In prior testing, I noticed that power-profile-daemon’s power-saver profile idled about 0.5W lower than the balanced profile, with nothing open but a terminal showing Powertop.

7 hours would be 55Wh/7 hours ~= 7.857W on average, which I would say is in line with what I’ve noticed just with normal browsing – but of course, these are very rough estimates.
Edit: in the spirit of not misleading anyone, the better wording would be my own varied/constant browsing, which can also vary wildly between which browser I’m using, the websites I visit, the number of tabs open, the idling time between scrolling/typing/video-watching. I can sit on a few resource-light websites/tabs, just reading, and maybe achieve 10 hours (5.5W average usage).

With that edit being typed, does anyone have any suggestions for cross-platform and/or Linux battery benchmark tools/standardization? MobileMark isn’t available on Linux, would be nice imo if people could see battery run times (perhaps of various tasks) with a detailed breakdown of peoples’ hardware/settings!


Some notes on power-profiles-daemon:

Fedora 34’s current stable version is 0.8.1, which does not support saving the last used profile after reboot. Defaults on boot to the balanced profile. 0.9.0 does support it (currently available on Fedora 35 stable), along with this neat feature:

support for “holding” a power profile while running a task
or application, making it possible to switch to a performance profile during
a compilation, or to a power-saver profile when low on battery, reverting to
the original profile when done.

Running powerprofilesctl list:

  performance:
    Driver:     intel_pstate
    Inhibited:  no

* balanced:
    Driver:     intel_pstate

  power-saver:
    Driver:     intel_pstate

powerprofilesctl get (currently active profile)
powerprofilesctl set power-saver|balanced|performance

Fedora 35 (Changes/Power Profiles Daemon - Fedora Project Wiki):

will install power-profiles-daemon in Fedora Workstation and enable it by default.


Side-note, maybe some of this info should go under

and/or

not sure how to proceed, though, so I’m just going to link the two pages :sweat_smile:

3 Likes

@Michael_Wu wrt. battery benchmarking not anything well known. Ars did their battery test by just playing a video on BBC via a browser, for instance.

There is gnome-battery-benchmark as well, which allows you to set custom loops of actions and run them for a certain amount of time and measure your average power consumption. I haven’t used it personally, though.

1 Like

@Michael_Wu thanks for the HDMI card information. I measured the card power draw when plugged in with no HDMI cable attached, and it is around 0.1W. I suspect if the system power went up by 1W it may be related to powering up the retimer as well, but will need to do some more measurements to see if this is what is causing the higher power draw.

5 Likes