Massively increased power draw when pipewire is running (due to usb camera?)
PipeWire version 1.2.1 Fedora Rawhide Gnome Latest kernel
(It's been happening for a year+ on ubuntu/arch/fedora, this is the latest I just tested to check if the problem still happened )
Description of Problem:
When pipewire is running, package doesn't go below C3 state (intel) or appear to sleep properly (AMD) and power draw is massively increased from around ~4W to ~8W. This will of course depend on your exact machine.
Running systemctl --user stop pipewire.service pipewire.socket
gets C7/massively lower power draw.
By using some procedure specified in the kernel docs by Intel on how to diagnose Cstate residency I found the culprit in the XHCI bus. Because one of my laptops had 1 thing on the bus, the webcam, I instantly noticed what was going on.
By disabling the webcam in the UEFI I was able to have pipewire running AND deeper cstates. The AMD system exhibited a similar behavior power-draw wise, just much harder to actually check what is happening as they don't expose their internal power saving states to powertop.
By using rmmod uvcvideo
and others I could also make it work properly iirc
I remember seeing various issues about this already posted, but I cannot find them. I also think an attempt to address this was made a while ago, as the culprit may be just bad webcam hardware or firmware.
How Reproducible:
This has been happening to me for a year+, on a Thinkpad L13 with 10th gen Intel, on another L13 AMD gen3 with a 5xxx something CPU and now on a random Clevo with 12th gen Intel. I don't know if it affects everyone, but it has affected my last three laptops.
Some laptops may need further tweaking to reach deeper cstates even with pipewire stopped, a common one is enabling power saving on the NVMe drive. You can do it quickly in powertop too, although the full fix is more laptop-dependent and may involve kernel cmdline (see: framework laptop power saving tricks)
I'm afraid this may be widespread and I think someone knowledgeable should take a look. This almost halves battery life on my model(s) under light use, but at the same time it may be outside of pipewire's control and these models need a config to tell pipewire to ignore webcams entirely.
Steps to Reproduce:
- Check power draw and cstates with powertop
- Stop pipewire
- Check power draw again
Actual Results:
Package suddenly can reach much deeper cstates
Expected Results:
No difference in power draw with or without pipewire running