wluma: [Bug]: ALS.webcam makes webcam hang

Steps for reproducing the issue

  • install a distro using gnome
  • run wluma as a user systemd service file
  • put computer to sleep

What is the buggy behavior?

upon waking up webcam starts behaving weirdly, very.

  • Before sleep the webcam light was blinking for a couple of milliseconds every second, now it’s constantly on.
  • Wluma thinks it’s really bright, and enables outdoors brightness mode, even if I cover the camera with my finger.
  • Accessing the webcam from any other app (including ffplay /dev/video0 shows nothing but a 720p black screen.
  • Stopping wluma does not fix the webcam, the light is still on and the video is still a malevich square.
  • if I reboot, nothing changes, the issue persists. Light doesn’t even go off.
  • If I shutdown the laptop completely, and boot back up the light is off, BUT;
  • After a shutdown, as soon as I try using the webcam is gets back to showing nothing but a black screen with the light constantly on, even if I’m not using the webcam. ffplay returns NaN instead of a video stream.

What is the expected behavior?

Well perhaps wluma should not murder my webcam.

Logs

vega@dart ~/s/w/t/release [SIGINT]> RUST_LOG=debug ./wluma
[2022-02-01T06:03:12Z DEBUG wluma] Using Config {
        als: Webcam {
            video: 0,
            thresholds: {
                45: "normal",
                15: "dark",
                75: "outdoors",
                60: "bright",
                30: "dim",
                0: "night",
            },
        },
        output: [
            Backlight(
                BacklightOutput {
                    name: "eDP-1",
                    path: "/sys/class/backlight/intel_backlight",
                    capturer: None,
                    min_brightness: 1,
                },
            ),
        ],
    }
[2022-02-01T06:03:12Z INFO  wluma] Continue adjusting brightness and wluma will learn your preference over time.
MESA-INTEL: warning: Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0

libv4l2: error setting pixformat: Input/output error
libv4l2: error setting pixformat: Input/output error

Version

version 4.1.0, from the built artifact in releases folder

Environment

default command doesn't work, so here's information from neofetch, I guess.

             .',;::::;,'.                vega@dart 
         .';:cccccccccccc:;,.            --------- 
      .;cccccccccccccccccccccc;.         OS: Fedora Linux 35.20220125.0 (Silverblue) x86_64 
    .:cccccccccccccccccccccccccc:.       Host: Notebook NS50MU 
  .;ccccccccccccc;.:dddl:.;ccccccc;.     Kernel: 5.15.16-200.fc35.x86_64 
 .:ccccccccccccc;OWMKOOXMWd;ccccccc:.    Uptime: 1 day, 7 hours, 3 mins 
.:ccccccccccccc;KMMc;cc;xMMc;ccccccc:.   Packages: 1432 (rpm), 101 (flatpak) 
,cccccccccccccc;MMM.;cc;;WW:;cccccccc,   Shell: fish 3.3.1 
:cccccccccccccc;MMM.;cccccccccccccccc:   Resolution: 1920x1080 
:ccccccc;oxOOOo;MMM0OOk.;cccccccccccc:   DE: GNOME 41.3 (Wayland) 
cccccc;0MMKxdd:;MMMkddc.;cccccccccccc;   Theme: Adwaita-dark [GTK2/3] 
ccccc;XM0';cccc;MMM.;cccccccccccccccc'   Icons: Adwaita [GTK2/3] 
ccccc;MMo;ccccc;MMW.;ccccccccccccccc;    Terminal: gnome-terminal 
ccccc;0MNc.ccc.xMMd;ccccccccccccccc;     CPU: 11th Gen Intel i7-1165G7 (8) @ 4.700GHz 
cccccc;dNMWXXXWM0:;cccccccccccccc:,      GPU: Intel TigerLake-LP GT2 [Iris Xe Graphics] 
cccccccc;.:odl:.;cccccccccccccc:,.       Memory: 6620MiB / 31889MiB 
:cccccccccccccccccccccccccccc:'.
.:cccccccccccccccccccccc:;,..                                    
  '::cccccccccccccc::;,.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 16 (8 by maintainers)

Most upvoted comments

It dawned on me to check dmesg, and I found this being outputted when anything tries to access webcam when it’s glitched:

Feb 03 00:45:17 dart kernel: uvcvideo 3-7:1.1: Failed to set UVC probe control : -110 (exp. 26).

This theory is easy to test, simply run watch -n 0.1 lsof /dev/video0 on a side and see if wluma shows up there. In my tests it’s not there, meaning that we release webcam resources as soon as frame is captured, so there isn’t much we can do, I would guess it’s up to the driver to power-off a device that is not used by anyone.