You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
linux-v4l2: camera-busy warning: name every holder, Close it / Ignore / Always allow, detect later opens (follow-up of #799) #3724
Feature, agreed with the maintainer. Follow-up of #799 / #800, which already detect EBUSY on a V4L2 camera, name the holder (plugins/linux-v4l2/v4l2-busy.c.h), emit source_device_busy and show an app-modal "Camera is in use" box with Force Camera (SIGTERM only).
What changes
A general camera-busy warning for v4l2_input, for any camera and any holder:
Detection. EBUSY on open / VIDIOC_REQBUFS / VIDIOC_STREAMON (the existing signal), and another process opening the device while OBS holds it (inotify IN_OPEN on the device node, on a background thread, never the render or UI thread).
Holders. Scan <proc_root>/<pid>/fd for the device, read comm/exe/cmdline for a display name and the PID, skip OBS's own PID. proc_root is caller supplied so tests use a fixture tree.
Dialog naming the device and the holder(s), with:
Close it: SIGTERM, SIGKILL after a short grace if still alive, then the source retries.
Ignore: dismiss this occurrence.
Always allow: persist the app names in OBS's global (user) config; they never warn again.
It waits for a click (no countdown, no automatic action), never stacks duplicates for the same device + holder, and re-warning is rate-limited.
Window. A child of the OBS main window (transient parent), not application-modal, no WindowStaysOnTopHint/Tool. In the background it is shown without activating (WA_ShowWithoutActivating, QApplication::alert), never raised over the user's current app. No desktop notifications.
Log line (blog) every time.
Layout
rust/obs-camera-busy: pure core (holder scan over a root, dedupe / rate limit / allowlist, texts, what an answer does), Tier 1 tests in the frontend's test category (obs-tests-gpu, as obs-fallback-warning); host calls (kill, inotify) in src/platform/; C ABI in src/ffi, linked through rust/obs-frontend.
Frontend: dialog + glue in C++/Qt, replacing OBSBasic::ShowDeviceBusy's blocking exec().
Plugin: announce when a source opens / closes its device, so the frontend knows what to watch.
RED: rust/obs-camera-busy with todo!() cores and its Tier 1 tests (holder scan over a fixture /proc, dedupe / rate limit / allowlist, texts, answers, C ABI) in obs-tests-gpu.
GREEN: the core, src/platform/ (kill, liveness, inotify watcher thread), src/ffi, linked through rust/obs-frontend.
Frontend: OBSCameraBusy dialog (child of the main window) + CameraBusy glue replacing the blocking ShowDeviceBusy; Qt test of the dialog's buttons, parent and window flags. Plugin: source_device_opened / source_device_closed announcements. Ledger line.
Same user only. Processes of another user are named but not signalled (the kill would fail with EPERM anyway); the dialog then offers only Ignore / Always allow.
Holder name. Basename of exe, else comm, else the basename of cmdline's first word, else ?. The allowlist matches that name exactly.
Rate limit. One dialog open per device + holder name at a time; after it is answered the same device + holder does not warn again for 60 s. Every occurrence is still logged, also the suppressed ones.
Allowlist storage. User config, [General] CameraBusyAllowlist, names separated by ;.
Texts. The Rust core produces the holder list and the log line; the sentence around them is a translated string in en-US.ini, as every other frontend text is.
Policy exceptions (testing-policy.md): this is new code with no C original, so Tier 2 (unchanged C tests against a Rust port) and Tier 3 (differential against C) do not apply; existing test_v4l2_busy* C tests stay unchanged and must keep passing. No rust-exports.d / rust-hidden.d fragment: the crate links into the frontend through rust/obs-frontend, not into libobs, exactly like obs-fallback-warning and obs-gpu-status. Tests go into the existing obs-tests-gpu category binary (as obs-fallback-warning's do), so no new test executable.
#3725 merged (ecf1816): rust/obs-camera-busy (holders, allowlist, dedupe/rate limit, Close it SIGTERM->SIGKILL, inotify watcher, C ABI), the OBSCameraBusy window parented to the main window, the CameraBusy glue and the linux-v4l2 opened/closed announcements. Left open (Refs, not Fixes): the real app has not been run against a genuinely busy camera on a KDE/Wayland session; the window's parent, type, non-modality and no-activation were verified on Qt's offscreen platform only. Closing this needs that one real run, with the observed log lines posted here.
Activity
zackees commentedon Nov 6, 2026
/ready
zackees commentedon Nov 6, 2026
Claiming: #3724 (camera-busy warning)
rust/obs-camera-busywithtodo!()cores and its Tier 1 tests (holder scan over a fixture/proc, dedupe / rate limit / allowlist, texts, answers, C ABI) inobs-tests-gpu.src/platform/(kill, liveness, inotify watcher thread),src/ffi, linked throughrust/obs-frontend.OBSCameraBusydialog (child of the main window) +CameraBusyglue replacing the blockingShowDeviceBusy; Qt test of the dialog's buttons, parent and window flags. Plugin:source_device_opened/source_device_closedannouncements. Ledger line.One PR, draft today.
Decisions:
exe, elsecomm, else the basename ofcmdline's first word, else?. The allowlist matches that name exactly.[General] CameraBusyAllowlist, names separated by;.force_camera(that would SIGTERM again).en-US.ini, as every other frontend text is.test_v4l2_busy*C tests stay unchanged and must keep passing. Norust-exports.d/rust-hidden.dfragment: the crate links into the frontend throughrust/obs-frontend, not into libobs, exactly like obs-fallback-warning and obs-gpu-status. Tests go into the existingobs-tests-gpucategory binary (as obs-fallback-warning's do), so no new test executable.obs-camera-busy: RED: the camera-busy warning's core as todo!() stubs (…
obs-camera-busy: GREEN: holders, decisions, Close it and the watcher (#…
frontend, linux-v4l2: the camera-busy window, glue and device announc…
linux-v4l2: announce the device only for a source libobs runs; camera…
zackees commentedon Nov 6, 2026
#3725 merged (ecf1816): rust/obs-camera-busy (holders, allowlist, dedupe/rate limit, Close it SIGTERM->SIGKILL, inotify watcher, C ABI), the OBSCameraBusy window parented to the main window, the CameraBusy glue and the linux-v4l2 opened/closed announcements. Left open (Refs, not Fixes): the real app has not been run against a genuinely busy camera on a KDE/Wayland session; the window's parent, type, non-modality and no-activation were verified on Qt's offscreen platform only. Closing this needs that one real run, with the observed log lines posted here.
linux-v4l2: camera-busy warning: Close it / Ignore / Always allow, ev…