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

"v4l" driver for Privacy block needs more documentation or a new function to update webcam devices #2006

Closed tkapias closed 3 months ago

tkapias commented 4 months ago

Issue

I use the new Privacy block, which is a really nice addition, but at first I got an error from the v4l driver saying that the path /dev/v4l/by-id did not exist.

I found out that it's because I don't use a usb webcam, but virtual devices created with v4l2loopback connecting to android devices or a software. By default, there is no udev rules to create a symlink in /dev/v4l/by-id for virtual devices and so the driver will not find them.

Solution

But I followed this issue from v4l2loopback to create a custom one, and then it works fine.

I suggest to add this information in the documentation.

On another hand, I didn't have issues to discover those webcams with most other software, so I think that reading /dev/v4l/by-id is not the most common technique for listing devices. Perhaps another method should be written for update_devices() function in v4l.rs.

Extra

As I use Scrcpy to connect my main webcam, I opened an issue with them for documentation.

bim9262 commented 4 months ago

Perhaps it would be better to just scan for /dev/video*... I'll have to play around with that.

bim9262 commented 4 months ago

@tkapias can you test out the linked pr?