Before each tick, check whether another process already has the real camera open (fuser, which sees same-user holders without root — every camera app runs as us). If so, skip the read entirely for that tick: attempting would be pointless (we'd get EBUSY) and a simultaneous open could make the other app fail. A camera in use is proof the user is present, so mark presence and wait it out, touching the camera zero times for the whole duration another app holds it — instead of poking it every tick and racing the app for access. V4L2 has no way to be notified that another app wants the device, so this can't preempt an in-progress read; it just guarantees we never contend while another app is already streaming. Falls through to a normal read (and the Python helper's exit-3 busy path) if fuser isn't installed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| hyprland | ||
| hyprlua | ||
| niri | ||
| sway | ||
| migrate-hyprland-to-hyprlua.sh | ||