Battery Life?

with kernel 4.18.0-305.10.2.el8_4.x86_64 from rocky linux, I got just under 2.5h last night while watching netflix. It was sitting on a blanket w/ temps between 50 and 70C. @nrp mentioned toying with tuned, so I took a look. by default its in max-throughput mode, so I’ll give max-powersaver a try sometime and report again.

Here’s what tuned says this morning.

11:04:52> tuned-adm list
Available profiles:
- accelerator-performance     - Throughput performance based tuning with disabled higher latency STOP states
- balanced                    - General non-specialized tuned profile
- desktop                     - Optimize for the desktop use-case
- hpc-compute                 - Optimize for HPC compute workloads
- intel-sst                   - Configure for Intel Speed Select Base Frequency
- latency-performance         - Optimize for deterministic performance at the cost of increased power consumption
- network-latency             - Optimize for deterministic performance at the cost of increased power consumption, focused on low latency network performance
- network-throughput          - Optimize for streaming network throughput, generally only necessary on older CPUs or 40G+ networks
- optimize-serial-console     - Optimize for serial console use.
- powersave                   - Optimize for low power consumption
- throughput-performance      - Broadly applicable tuning that provides excellent performance across a variety of common server workloads
- virtual-guest               - Optimize for running inside a virtual guest
- virtual-host                - Optimize for running KVM guests
Current active profile: throughput-performance

Here’s sensors from last night. (on battery, on a blanket, load: netflix)

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

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

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

But yea, to answer your question@Oskars_Cizevskis, It got about 2.5h.

4 Likes

Anyone have any comments on real-life battery life under Windows?

1 Like

@Kimberlee_Model eagerly avaiting max-powersaver results : )

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