High 2nd gen webcam power consumption

With the 2nd gen webcam, I’m seeing power consumption (as reported by powertop) of anywhere between 100mW - 1.2W, despite it being off (privacy switch closed):

Power est.    Usage     Device name
   810 mW    100.0%     USB device: Laptop Webcam Module (2nd Gen) (Framework)

Anyone else seeing similar? I don’t recall reports of this with the 1st gen webcam.

  • Linux 6.10.4 #1-NixOS
  • BIOS 03.05
  • AMD 7640u

I’m wondering if its got something to do with the following:

We’ve made some improvements in the hardware privacy switch circuitry to slightly reduce standby power consumption too. The privacy switch behavior on the camera also uses a new mode where instead of powering off the full camera, it cuts off the image sensor power and generates a placeholder blank image in the camera controller. This results in better behavior in applications and faster privacy mode switching.

1 Like

I’m also wondering if this change in design really responds to a need.
“Privacy mode switching speed” had never been an issue for me.
Meanwhile, the older design meant that when switching it was like we had just unplugged or plugged the camera, which is exactly the same as unplugging or plugging an USB camera, and this is a very simple and easily understandable behavior, I can’t think of any problem with that.
It was also very easily verifiable in Linux systems, because the camera would appear/disappear from the devices list.

Note that powertop measurements are effectively baseless! There isn’t actually a ammeter that measures power on the webcam.

Nearly 1W sounds far higher than I’d expect. Maybe try doing some testing, and see the idle draw with the webcam connected & not connected.

https://www.reddit.com/r/linux/comments/1em8biv/psa_pipewire_has_been_halving_your_battery_life/ Additionally, this may be applicable.

Once again though, the most likely case is that powertop is just reporting your device power consumption wildly incorrectly. If you see a non-negligible drop in battery life (which 1W should cause) that’d certainly be interesting!

2 Likes

It changed for the worse, powering off the full camera definitely reduces power consumption more than generating a blank image.

That was it, thank you!

Per the comments there, to verify if you’re affected:

sudo fuser /dev/video0
# [pid]
ps -ef | grep [pid]
# username 8172 6976 0 09:30 ? 00:00:07 /usr/bin/wireplumber

If there’s output/PID returned (also double check /dev/video1), tell wireplumber to ignore cameras with:

# ~/.config/wireplumber/wireplumber.conf.d/10-disable-camera.conf
wireplumber.profiles = {
  main = {
    monitor.libcamera = disabled
  }
}

Then re-verify via powertop. Idle power consumption dropped by ~1W in my case (albeit bearing in mind powertop’s potentially flawed reporting).

The 1st gen webcam won’t be affected by this as the privacy switch fully detaches the webcam from the USB bus.

Now I’m really curious if the 2nd gen’s behaviour really does reduce power consumption. I’d love if Framework could share more details here. Could the previous behaviour be toggled in firmware/a BIOS option?

5 Likes

Looks like it has been fixed upstream.

If you’re using NixOS, the following applies the above workaround, which does work:

    wireplumber.configPackages = [
      (pkgs.writeTextDir "share/wireplumber/wireplumber.conf.d/10-disable-webcam.conf" ''
        wireplumber.profiles = {
          main = {
            monitor.libcamera = disabled
          }
        }
      '')
    ];
1 Like

The claim was that they optimized the standby power consumption of the camera. What you saw was the camera being kept awake by linux tools communicating with the camera. So exactly not that case.

And according to what FW described, this is also independent of the privacy switch changes.
The benefit there should be that the camera as a USB device does no longer disappear and the OS sees no camera at all when the privacy switch was toggled and hence works more predictably and quicker when just being enabled via switch. But if you did not flip the switch previously the camera should have also slept and that is where it is supposed to have had a higher power draw than the new one according to the blog post.

Also, we know from the various expansion cards that USB devices can easily sleep and consume extremely little power if they were designed for it, play ball and the drivers work out. Even the DP dongle for example includes its billboard USB device that needs to be put to sleep in order to save power (but if done will consume almost nothing). And the last time I checked with a standard Fedora install, even Fedora disabled the selective USB sleeping that was needed for that to work.

The claim was that they optimized the standby power consumption of the camera. What you saw was the camera being kept awake by linux tools communicating with the camera. So exactly not that case.

You need to read that thread a little more closely. Please see the patch email: [PATCH 0/5] Fix uvcvideo pipelinehandler keeping /dev/video# open

It’s this specific issue in libcamera, which is fixed as above noted, that leads to the issue, it isn’t an issue with pipewire/wireplumber.

So it was in a userspace library and not exactly in the codebase of a “tool”? Ok. I can live with being wrong on that…

1 Like