- cross-posted to:
- linuxfurs@pawb.social
(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!
- tiramichu ( @tiramichu@lemm.ee ) 40•1 month ago
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!
- Avid Amoeba ( @avidamoeba@lemmy.ca ) 26•1 month ago
This is probably an additional halving. 😂
- uis ( @uis@lemm.ee ) 11•1 month ago
That’s the thing: power managment works correctly. It is pipewire that does not let power managnent to save power.
I use ALSA btw.
- treadful ( @treadful@lemmy.zip ) English34•1 month ago
Woo, a benefit to me never getting my webcam drivers working.
- Mike1576218 ( @Mike1576218@lemmy.ml ) 18•1 month ago
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.
- theshatterstone54 ( @theshatterstone54@feddit.uk ) 11•1 month ago
My power usage on idle was 8W but is now just under 4W on idle
- cygnus ( @cygnus@lemmy.ca ) 10•1 month ago
Hmm the process doesn’t seem to be running at all on my X1 Carbon Gen 9 running EndeavourOS.
- CalcProgrammer1 ( @CalcProgrammer1@lemmy.ml ) 10•1 month ago
Maybe this explains why my webcam indicator is on when no applications are using it. It’s been confusing me for a while now. I’ve double checked anything that I expect to access it is not, and it doesn’t seem to be locked because opening it works, but it sometimes boots up woth the light on. I am using Arch with pipewire so I’ll check and see if this is what’s going on.
- timestatic ( @timestatic@feddit.org ) 7•1 month ago
I hope this will help lenghten the battery life of my laptop. I use it for school and when I put it in Idle it still drains in like 8 hours or something really bad. I’ll try it out later and edit the comment to see what happened
- ReversalHatchery ( @ReversalHatchery@beehaw.org ) English5•1 month ago
I don’t think this should have an effect when the laptop is put to sleep. Maybe you want to try out hibernation, though.
- driving_crooner ( @driving_crooner@lemmy.eco.br ) 5•1 month ago
How can I know that this is affecting me?
- Ransack ( @Ransack@lemmy.dbzer0.com ) 5•1 month ago
Has your battery life been about half of what it used to be after installing pipe wire?
[Yes] [No]
- dino ( @dino@discuss.tchncs.de ) English18•1 month ago
that is such a bad response, mindboggling.
- Ransack ( @Ransack@lemmy.dbzer0.com ) 1•1 month ago
Hey not a problem dino, I get it your post is quite helpful.
Now jog my memory, how did you help the person asking if they’re affected by this bug or not?
The 13 others that have a problem with my question also chose to not offer anything useful for ops question.
- dino ( @dino@discuss.tchncs.de ) English3•1 month ago
First problem is, how would you know if your battery life has been halved? Are you keeping track of how long your battery lasts on a daily basis?
- driving_crooner ( @driving_crooner@lemmy.eco.br ) 4•1 month ago
systemctl --user status pipewire
- Ransack ( @Ransack@lemmy.dbzer0.com ) 1•1 month ago
Nice okay, alright so just wondering what distro you running with and what hardware do you have?
We can break it down from there to see if you are being affected or not.
- KaRunChiy ( @KaRunChiy@kbin.run ) 4•1 month ago
Meanwhile, I turned idle sleep off manually for both the webcam and audio chipset because they would either crash or flip out or pop when in use
- EddoWagt ( @EddoWagt@feddit.nl ) 2•1 month ago
Same in case of the audio chipset, the popping is so annoying
- Norah - She/They ( @princessnorah@lemmy.blahaj.zone ) English2•1 month ago
Does this affect desktops as well? At least it doesn’t affect my legion go. Side note, linux (specifically bazzite) runs better on this than Windows ever could.
- TroubledClef ( @mylesw@mastodon.sdf.org ) 1•1 month ago
@princessnorah @Interstellar_1 Facts. Linux is da bomb.
- Norah - She/They ( @princessnorah@lemmy.blahaj.zone ) English2•1 month ago
I got it with that in mind as an alternate to a Steam Deck. I like the higher-res display a lot. All the reviews I read rated it highly on hardware and terrible for software because of Windows. It told me I needed internet to finish setting up, so I didn’t even bother seeing for myself, just shut it down and formatted the drive!
I can’t believe Lenovo are handing customers to Valve just to back Windows. Like, I’m not an elitist about this usually but Linux just trounces on handhelds. Bazzite is as polished as an OEM experience should be, they could jump on this. They’ve already said they want to make a gen two at some point in future.
- Possibly linux ( @possiblylinux127@lemmy.zip ) English1•1 month ago
It doesn’t seem to effect me