Only offer video capture devices as webcams - #6732
Conversation
V4L2 exposes raw processing and output-only nodes beside usable cameras. The webcam picker and automatic recorder selection treated the first /dev/video node as a camera, so IPU6 laptops opened a black overlay instead of their loopback capture device.\n\nShare one device lister across detection, selection, and recording, and keep only groups whose first video node advertises Video Capture in Device Caps. Cover raw IPU nodes, ordinary capture devices, and capture-less systems.
There was a problem hiding this comment.
Pull request overview
Filters webcam discovery to V4L2 capture-capable devices.
Changes:
- Adds a shared webcam-listing helper.
- Reuses filtered discovery across recording paths.
- Adds IPU6-focused regression tests.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 1 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
bin/omarchy-capture-webcam-list |
Lists capture-capable webcam nodes. |
bin/omarchy-hw-webcam |
Detects usable webcams through the helper. |
bin/omarchy-capture-screenrecording |
Uses filtered webcam auto-detection. |
bin/omarchy-capture-screenrecording-with-webcam |
Uses filtered devices in the picker. |
test/shell.d/screenrecording-test.sh |
Adds IPU6 and capability-filtering tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
A group whose first video node is not capture-capable vanished entirely, even when a later node in the same group could capture. Probe each node until one qualifies, still emitting at most one device per group. Also exit zero explicitly: a trailing filtered device used to leak the failed capability check as the script's exit status. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Reviewed. The Device Caps parsing is right (the test proving global Capabilities can't fool it is a nice touch), every caller degrades correctly with zero surviving devices, and v4l-utils arrives transitively via gpu-screen-recorder → ffmpeg, so there's no new dependency concern. I pushed one hardening commit to the branch: a group whose first video node wasn't capture-capable vanished entirely even when a later node in the group could capture, so the helper now probes each node until one qualifies (still one device per group). It also exits zero explicitly — a trailing filtered device used to leak the failed capability check as the script's exit status. Both are pinned by new test cases. — 🤖 Claude, posting on behalf of @dhh |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 5 changed files in this pull request and generated no new comments.
Suppressed comments (1)
test/shell.d/screenrecording-test.sh:167
- This checks only that a source-code string exists; it never executes the recorder's auto-detection path. Add a behavioral test that invokes the real recorder with
--with-webcamunder the raw-only stub and verifies that no recording starts, then invoke it with capture devices and assert the overlay receives/dev/video42. That would also catch failure-propagation regressions.
first_webcam=$(omarchy-capture-webcam-list | sed -n '1s/[[:space:]].*//p')
[[ $first_webcam == "/dev/video42" ]] || fail "screenrecording auto-detection selects the first capture device"
grep -F 'WEBCAM_DEVICE=$(omarchy-capture-webcam-list' "$ROOT/bin/omarchy-capture-screenrecording" >/dev/null || \
fail "screenrecording auto-detection uses capture-capable webcams"
Stops raw IPU6 processing nodes from appearing as webcams and sends screen recording to the usable capture device instead.
<<<< AI wording below >>>>
Problem
V4L2 exposes raw processing, metadata, and output-only nodes alongside usable cameras. The webcam picker selected the first
/dev/video*node in each group without checking its device capability, while recorder auto-detection selected the first video node globally.On IPU6/IPU7 laptops this chooses the raw sensor node, producing a black overlay or
STREAMON: Link severedinstead of using the loopback capture device.Fix
Add one shared webcam lister that preserves the existing one-device-per-group behavior but only returns a group when its video node advertises
Video CaptureunderDevice Caps.Use the filtered list for menu availability, webcam selection, and recorder auto-detection so all three paths agree on what counts as a webcam.
Fixes #5722.
Verification
CapabilitiescontainsVideo Capture./dev/video42loopback capture device and ordinary USB capture device remain available.Live IPU6 hardware is unavailable in this environment, so reporter validation is still welcome.