Bug 1187195 - tumbleweed battery drain
tumbleweed battery drain
Status: RESOLVED FIXED
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Kernel
Current
x86-64 Other
: P5 - None : Normal (vote)
: ---
Assigned To: openSUSE Kernel Bugs
E-mail List
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2021-06-10 20:17 UTC by Sebastian Turzański
Modified: 2023-01-10 08:37 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---
tiwai: needinfo? (dpbasti)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Turzański 2021-06-10 20:17:11 UTC
pulsaudio consumes half of total power needed by system

powertow run on dell xps17 shows 17W drain of pulsaudio.
If input is set to capture mode (enough to enable mic capture in alsamixer) pulsaudio then consumes even double of that.

For reference the whole Fedora 34 desktop consumes about 6W on the same machine !
Comment 1 Takashi Iwai 2021-06-13 09:04:04 UTC
Try to switch to pipewire.  Does it work better in this regard?

And, if it's confirmed, you'd better report to the upstream Issue tracker.  It's a generic problem, as TW basically follows upstream; the only patches we have so far are some upstream backports for BT headset support.
Comment 2 Sebastian Turzański 2021-06-14 19:57:17 UTC
no sound in pipewire after following https://en.opensuse.org/openSUSE:Pipewire
no soundcards detected

interestingly after returning back to pulseaudio it's not using that much power still powerconsumption is huge in opensuse tumbleweed on XPS 9700

battery times:

- Opensuse tumbleweed runs 1:30
- Fedora 34 runs almost 10 hours
- Ubuntu runs almost 10 hours

the difference is devastating
Comment 3 Sebastian Turzański 2021-06-14 19:58:21 UTC
PowerTOP 2.14     Overview   Idle stats   Frequency stats   Device stats   Tunables   WakeUp       

The battery reports a discharge rate of 39.5 W
The energy consumed was 802 J
The estimated remaining time is 1 hours, 26 minutes

Summary: 2903,7 wakeups/second,  0,0 GPU ops/seconds, 0,0 VFS ops/sec and 31,4% CPU use

Power est.              Usage       Events/s    Category       Description
  17.3 W     19,9 pkts/s                Device         Network interface: wlp0s20f3 (iwlwifi)
  6.11 W      5,1%                      Device         Display backlight
  176 mW      4,5 ms/s     544,1        Timer          tick_sched_timer
  146 mW     11,7 ms/s     451,8        Process        [PID 2190] /usr/bin/Xorg.bin -nolisten tcp -
 84.8 mW     90,4 ms/s     261,8        Process        [PID 3122] /usr/lib64/firefox/firefox
 51.5 mW    667,7 µs/s     159,1        Interrupt      [17] idma64.1
 44.6 mW     15,7 ms/s     137,6        Process        [PID 2389] /usr/bin/kwin_x11
 41.0 mW     39,9 ms/s     126,5        Process        [PID 3239] /usr/lib64/firefox/firefox -conte
 34.4 mW      3,9 ms/s     106,1        Process        [PID 2390] /usr/bin/kwin_x11
 30.6 mW      1,6 ms/s      94,5        Timer          hrtimer_wakeup
 26.2 mW      3,9 ms/s      81,0        Process        [PID 3140] /usr/lib64/firefox/firefox
 24.3 mW      2,6 ms/s      75,0        Process        [PID 2738] /usr/bin/pulseaudio --daemonize=n
 17.9 mW      4,3 ms/s      55,2        Interrupt      [0] HI_SOFTIRQ
 17.1 mW      1,0 ms/s      52,8        Process        [PID 963] [irq/27-DELL098F]
 13.7 mW      1,6 ms/s      42,3        kWork          engine_retire
Comment 4 Takashi Iwai 2021-06-15 07:30:36 UTC
It sounds more like some device being used (e.g. the discrete GPU) without power-saving.  Is it with a Nvidia GPU?  Please give hwinfo output and the full dmesg output.

The powertop outputs shows the WiFi being the most consumption.  What if you disable the WiFi temporarily?  (e.g. via rfkill).  powertop isn't always the accurate output, so you cannot trust the result.

Also, if you run powertop --auto once, does the result change?
Comment 5 Sebastian Turzański 2021-06-15 08:02:17 UTC
it is not nvidia as due to another bug I filled since last zypper DUP my GPU does not work in tumbleweeed :)

I see that rfkill helps so wlan is the one to blame 
which is strange as I sit 2 meters from my hotspot and I'm not transferring anything more than this bugzilla page.
Comment 6 Takashi Iwai 2021-06-15 08:07:04 UTC
Actually, a system without a GPU driver *might* consume higher power because it keeps the chip active without runtime PM.  And nouveau as fallback doesn't work always well.

But you confirmed that it's WiFi, and this can be easier to handle, I assume.
Could you check whether the similar behavior is seen on the older TW kernels (without Nvidia graphics)?  You can find the old kernel packages in my OBS repos, e.g. home:tiwai:kernel:5.11, home:tiwai:kernel:5.11, etc.
  http://download.opensuse.org/repositories/home:/tiwai:/kernel:/5.11/standard/

It'd be helpful if you can figure out whether a kernel regression or not (and which kernel starts showing the bad performance).
Comment 7 Sebastian Turzański 2021-06-15 20:01:05 UTC
Hi I tested 5.11 kernel
it seems like the results are fairly similar.
I think powertop result is not that reliable as it shows now 10W total while it estimates iwlwifi to be 17,5W

Still i was distrohoping between Fedora34 and Ubuntu 20.04 to find out ahat after returning to Tumbleweed batterylife magically improved.

I no longer get a burning lap from my xps 17 laptop. Even on standard kernel.

I'm marking the bug as resolved for now and reopen when more data is available.
Comment 8 Sebastian Turzański 2021-06-15 20:04:37 UTC
Original problem with pulsaudio being the source of powerdrain disapeared after removing pulseaudio , switching to pipewire and returning to pulseaudio.

now the major consumption comes from wifi driver iwlwifi and backlight
Comment 9 Sebastian Turzański 2021-06-16 22:32:51 UTC
I have done more testing 
Fedora 34 power consumption is going as low as low as 3.14 W/h
with the same scenario (cpu idle - below 1%, no gpu, almost idle desktop) opensuse tumbleweed hits 17 W/h on average.
Ubuntu 20.04 also gets close to Fedore 34


You can say powertop is inaccurate but I can really feel the difference in laptop heat.

The battery reports a discharge rate of 17.3 W
The energy consumed was 329 J
The estimated remaining time is 3 hours, 50 minutes

Summary: 3145,5 wakeups/second,  0,0 GPU ops/seconds, 0,0 VFS ops/sec and 70,3% CPU use

Power est.              Usage       Events/s    Category       Description
  11.5 W      5,1%                      Device         Display backlight
  5.85 W     58,5 pkts/s                Device         Network interface: wlp0s20f3 (iwlwifi)


I can understand it can vary between OSes but this  is huge difference on work hours in the end I get almost several times more on other Linuxes in comparison to OpenSuse.

I tried home:tiwai:kernel:5.11 but not much improvement if any
Comment 10 Takashi Iwai 2021-06-17 06:31:08 UTC
The best way to compare would be to install Fedora kernel somehow onto the openSUSE TW system and check whether it shows the similar problem or not.
If Fedora kernel works better, it's likely some difference of kernel configuration that matters, and we need to compare.
Comment 11 Takashi Iwai 2021-06-17 16:29:13 UTC
And, if it's about the iwlwifi, it might be worth to try to change the firmware files.  The firmware files are found in linux-firmware git repository, and you can take the older versions from there, too.
Comment 12 Sebastian Turzański 2021-06-17 19:04:16 UTC
(In reply to Takashi Iwai from comment #11)
> And, if it's about the iwlwifi, it might be worth to try to change the
> firmware files.  The firmware files are found in linux-firmware git
> repository, and you can take the older versions from there, too.

I tried that - no help

I made some other observations - I think the total power consumption is just much higher and somehow powertop tries to find a a victim to blame.
SOmetimes it says it's because of display backlight even if I put it to 5% brightness.
Even more
WHen I plugged an usb dock/hub with ethernet and usb keyboard it started to report several Wats ! on keyboard . In other case on usb drive in other case on ethernet adapter.
Comment 13 Sebastian Turzański 2021-06-18 10:10:51 UTC
here's the evidence

I switched wifi off and unloaded it's module iwlwifi and now ethernet shows high Wats
I switched internal display totally and dispaly backlight still shows high Wats

ower est.              Usage       Events/s    Category       Description
  15.9 W      0,0%                      Device         Display backlight
  11.0 W     15,9 pkts/s                Device         Network interface: enp0s20f0u2u1i5 (cdc_ncm)
  833 mW      6,6 ms/s     694,0        Timer          tick_sched_timer
  385 mW     30,4 ms/s     320,8        Process        [PID 1937] /usr/bin/Xorg.bin -nolisten tcp -auth /run/sddm/{92cb42bd-59ed-4f40-8df3-0c837fb32379} -background none -noreset -di
  170 mW     23,4 ms/s     141,3        Process        [PID 2145] /usr/bin/kwin_x11
  151 mW     52,4 ms/s     126,1        Process        [PID 2641] /usr/bin/konsole
Comment 14 Takashi Iwai 2021-06-18 14:25:58 UTC
Yes, powertop output seems somehow screwed up.  Not sure whether it's a bug in powertop or some inconsistency in kernel ABI via sysfs, but the result doesn't look reliable, in anyway.

We'd still like to fix any real issue; it'd be helpful if you can test other kernel (e.g. from Fedroa) on top of the TW system and see whether it really saves the power.  Once confirmed, we may confirm the difference of kernel configs that may matter.
Comment 15 Sebastian Turzański 2021-06-18 21:04:21 UTC
no idea how to test fedora kernel in suse
Comment 16 Sebastian Turzański 2021-06-23 18:36:16 UTC
i tried OpenSuse kernel 5.4

usage on idle  was arround 12-17 Wats , a bit less than current but still 200%-500% worse than Ubuntu20.04-Fedora34
Comment 17 Sebastian Turzański 2023-01-10 08:37:26 UTC
Seems to be resolved with current tumbleweed