(not really pipewire itself but an interaction with wireplumber/libcamera/the kernel, but pipewire is what triggers the problem)

As seen in https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/2669 and https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/4115

The camera’s /dev/video file is kept open (without streaming), sadly causing the camera to be powered on what looks to be most devices. For some reason, this completely nullifies the soc power management on modern laptops and can result in increases from 3W to 8W at idle!

On Intel laptops it’s a bit easier to debug because you can see the Cstates in powertop not going low but it also wrecks AMD ones. Some laptops can reach lower cstates, but the camera module wastes a few W anyway.

I can’t believe this shipped in Ubuntu, Fedora etc without anyone noticing, and for so long. This bug is quite literally wasting GWh of power and destroys the user experience of distros in laptops.

If you have a laptop with a switch that detaches the camera from the usb bus you are probably out of the water, just plug it when you use it and the problem is sidestepped. Removing uvcvideo and modprobing it on demand can also work. Disabling the camera in Lenovo’s UEFI is what I did for a year until I finally found the issue on the tracker. Some laptops also seem to not be affected, but for me it happens to every machine I’ve tested.

Thanks to this comment for another workaround that tells wireplumber to ignore cameras. ~/.config/wireplumber/wireplumber.conf.d/10-disable-camera.conf

wireplumber.profiles = { main = { monitor.libcamera = disabled } }

Software that only captures cameras using pipewire is rare and this hasn’t given me any problem. This should probably be shipped by distros while the problem is sorted out.

Note that most laptops will have other problems stopping them from reaching deep cstates, borked pcie sd card readers, ancient ethernet nics that don’t support pcie sleep properly, outdated nvme firwmare… those are separate issues that most of the time can also be tackled with some dose of tlp, but it’s all for nothing if the usb camera is keeping the soc awake!

100 points
*

Wouldn’t this trigger the webcam indicator? I have Pipewire installed but never noticed the webcam acting up.

Edit: ah, only for UVC webcams it seems, maybe that’s why I haven’t noticed.

permalink
report
reply
32 points

It also might not come on even for affected users. OP’s comment in the reddit post:

From gathering info on their issue tracker, the act of opening the video file but not grab frames is some weird usecase that is acting in weird ways. Additionally, the indicator light is turned on by the uvcvideo driver in a lot of hardware (yes, an attacker can theoretically watch you without you noticing). A possible fix for this is would be in the kernel itself, which should basically ignore the fd being open and only truly act when frames are grabbed.

permalink
report
parent
reply
17 points

This is precisely bloody why webcam indicator lights need to be hardwired.

permalink
report
parent
reply
2 points

That’s still not good enough for me, why is privacy shutters so hard to find in laptops…

permalink
report
parent
reply
59 points
*

The number one thing I noticed after installing Linux on my old macbook was that the battery life was immediately halved.

I totally expected that to happen, though, because my previous experience had always been that power management on Linux was kinda terrible.

Time to try this out and see!

permalink
report
reply
36 points

This is probably an additional halving. 😂

permalink
report
parent
reply
2 points

Quartering ?

permalink
report
parent
reply
14 points

That’s the thing: power managment works correctly. It is pipewire that does not let power managnent to save power.

I use ALSA btw.

permalink
report
parent
reply
45 points

Woo, a benefit to me never getting my webcam drivers working.

permalink
report
reply
23 points

While I also noticed my webcam showing up with 3W in powertop and disabling the uvcvideo module removed that entry, it doesn’t affect the reported battery discharge rate at all.

I can see the files being opened with lsof and not so with the workaround. But again the discharge rate doesn’t change at all …

To me it seems the power consumption is misreported.

permalink
report
reply
17 points

My power usage on idle was 8W but is now just under 4W on idle

permalink
report
reply

Linux

!linux@lemmy.ml

Create post

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

  • Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
  • No misinformation
  • No NSFW content
  • No hate speech, bigotry, etc

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

Community stats

  • 9.6K

    Monthly active users

  • 3.1K

    Posts

  • 35K

    Comments