greshake / i3status-rust

Very resourcefriendly and feature-rich replacement for i3status, written in pure Rust
GNU General Public License v3.0
2.81k stars 472 forks source link

privacy block ignores webcam #2007

Closed freswa closed 3 months ago

freswa commented 4 months ago

Expected behavior: The webcam logo is displayed in the privacy block upon webcam usage.

Actual behavior: Webcam is used, but only the microphone logo appears in the privacy block.

Further information:

❯ ls /dev/v4l/by-id 
usb-Chicony_Electronics_Co._Ltd._Integrated_Camera_0001-video-index0  usb-Chicony_Electronics_Co._Ltd._Integrated_Camera_0001-video-index1
[[block]]
block = "privacy"
[[block.driver]]
name = "v4l"
[[block.driver]]
name = "pipewire"
display = "name"

What's the best way to debug this issue?

bim9262 commented 4 months ago

Can you share the output of ls -lA /dev/v4l/by-id /dev/video*? The next step would be to get the output of ls -lA /proc/$PID_OF_CONSUMER(like firefox)/fd

freswa commented 4 months ago
> ls -lA /dev/v4l/by-id /dev/video*
crw-rw----+ root video  0 B Thu Feb 22 09:54:28 2024  /dev/video0
crw-rw----+ root video  0 B Thu Feb 22 09:54:28 2024  /dev/video1
crw-rw----+ root video  0 B Thu Feb 22 09:54:28 2024  /dev/video2
crw-rw----+ root video  0 B Thu Feb 22 09:54:28 2024  /dev/video3

/dev/v4l/by-id:
lrwxrwxrwx root root 12 B Thu Feb 22 09:54:28 2024  usb-Chicony_Electronics_Co._Ltd._Integrated_Camera_0001-video-index0 ⇒ ../../video2
lrwxrwxrwx root root 12 B Thu Feb 22 09:54:28 2024  usb-Chicony_Electronics_Co._Ltd._Integrated_Camera_0001-video-index1 ⇒ ../../video1
> ls -lA /proc/1994/fd | grep video                                                                                                          
lrwx------ user user 64 B Thu Feb 22 09:57:35 2024 208 ⇒ /dev/video0

Hmmmm....

> lsof /dev/video*                                                 
COMMAND    PID     USER  FD   TYPE DEVICE SIZE/OFF NODE NAME
firefox   1994 user mem    CHR   81,0           922 /dev/video0
firefox   1994 user 208u   CHR   81,0      0t0  922 /dev/video0
pipewire  2181 user  83u   CHR   81,0      0t0  922 /dev/video0
pipewire  2181 user  85u   CHR   81,2      0t0  925 /dev/video2
wireplumb 2182 user  40u   CHR   81,0      0t0  922 /dev/video0
wireplumb 2182 user  42u   CHR   81,2      0t0  925 /dev/video2
bim9262 commented 4 months ago

Looks like in /dev/v4l/by-id: there's nothing pointing to /dev/video0 (unless it just got missed in the copy/paste). I'm going to take a look at just scanning for /dev/video* as mentioned in #2006

freswa commented 4 months ago

2009 fixes this issue