Skip to content

Only offer video capture devices as webcams - #6732

Merged
dhh merged 2 commits into
basecamp:quattrofrom
yashranaway:fix/filter-webcam-capture-devices
Aug 13, 2026
Merged

Only offer video capture devices as webcams#6732
dhh merged 2 commits into
basecamp:quattrofrom
yashranaway:fix/filter-webcam-capture-devices

Conversation

@yashranaway

Copy link
Copy Markdown
Contributor

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 severed instead 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 Capture under Device 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

  • Stubbed IPU6 raw nodes are excluded even when global Capabilities contains Video Capture.
  • A /dev/video42 loopback capture device and ordinary USB capture device remain available.
  • Output-only systems hide the menu entry and the picker reports no webcam.
  • Picker and automatic recorder selection use the filtered devices.
  • Focused screen-recording tests and CLI metadata tests pass.
  • Bash syntax and diff hygiene pass.

Live IPU6 hardware is unavailable in this environment, so reporter validation is still welcome.

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.
Copilot AI balanced review requested due to automatic review settings August 12, 2026 07:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copilot AI review requested due to automatic review settings August 13, 2026 10:19
@dhh

dhh commented Aug 13, 2026

Copy link
Copy Markdown
Member

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-webcam under 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"

@dhh
dhh merged commit 8b9e43d into basecamp:quattro Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

omarchy webcam picker offers unusable IPU6 raw Bayer node alongside real capture device

3 participants