Skip to content

Fix PipeWire camera device filtering - #3047

Merged
zackees merged 2 commits into
masterfrom
agent/obs11
Oct 30, 2026
Merged

zackees merged 2 commits into
masterfrom
agent/obs11

Conversation

@zackees

@zackees zackees commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Fixes #3041

RED: b6d2338 adds camera_list_excludes_non_video_and_unnamed_nodes. It failed before the fix after a private PipeWire daemon advertised an Audio/Source node and a Video/Source node without node.description.

GREEN: this change admits only nodes with a non-empty name and description whose media.class is exactly Video/Source. The rebuilt test_pipewire_camera_registry_race passed all four cases under its private PipeWire daemon.

Validation:

  • Targeted Tier 2 test: passed all 4 cases.
  • ./lint: formatting and all change-related checks passed, but the repository self-test ci/test_check_changes.py fails in this session because it clears PATH while git is available only through the session shim (not /usr/bin); reproduced directly and unrelated to this change.

@zackees
zackees marked this pull request as ready for review October 30, 2026 10:20

@zackees zackees left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Coordinator review. Thanks, this is a real usability fix for #3041. The change is small, RED → GREEN against a private PipeWire daemon is the right kind of proof, and the ledger line is there. Points, roughly most important first:

  1. The exact Video/Source match may drop real cameras. Some PipeWire setups advertise virtual or loopback video as Video/Source/Virtual (pw-loopback, some virtual-camera tools). An exact strcmp hides those, which is a regression for anyone who uses one through the portal today. Accepting Video/Source and the Video/Source/ prefix would keep them while still dropping audio, MIDI and Bluetooth nodes. A one-line test case for Video/Source/Virtual would pin the choice.
  2. Dropping nodes without node.description matches the existing code, since the list label already comes from PW_KEY_NODE_DESCRIPTION at camera-portal.c.h:1143. Still, a camera that sets only node.nick would vanish rather than show blank. Falling back to node.nick, then node.name, before dropping would be kinder. Not blocking.
  3. Duplicates, the third symptom in #3041, are not addressed. That is fine for this PR, but say so in the description, so #3041 does not close on "Fixes" with one symptom still open. Change it to Refs #3041, or file the duplicates as a follow-up.
  4. The shared test setup changed. camera_plug() now also plugs the audio node and the unnamed node for every existing case in test_pipewire_camera_registry_race. That is a C plugin test, not a port, so the no-edit rule for ported C tests does not apply. But the existing cases now run with extra nodes. They passed (4/4), so no action needed; just noting it for reviewers.
  5. Test cost: wait_for_unexpected_device() waits its full 250 × 20 ms ≈ 5 s on the passing path. Please add a "Test cost" line (testing-policy "Test time"). Waiting until the real camera is found and then draining one more loop iteration would cut it to well under a second.

CI is still running (4 passed, 4 running). I will queue once it is green and 1 is either addressed or answered.

@zackees
zackees enabled auto-merge October 30, 2026 10:47
@zackees
zackees merged commit b292d32 into master Oct 30, 2026
35 checks passed
@zackees
zackees deleted the agent/obs11 branch October 30, 2026 11:03
@alerque

alerque commented Oct 30, 2026

Copy link
Copy Markdown

This fix is totally bogus. See issue.

MCPVOT pushed a commit to MCPVOT/obs-studio that referenced this pull request Oct 30, 2026
…3065) (obs-rust#3066)

* test(pipewire): require a video node without a description to stay listed (obs-rust#3065)

The camera registry test already advertises a Video/Source node that carries
only node.name. obs-rust#3047 asserted that node never reaches the camera portal;
that is the regression obs-rust#3065 reports: a camera whose description lives on the
device, not the node, disappears from the device list. The test now requires
the node to be admitted while the Audio/Source node stays out.

* fix(pipewire): list video nodes without a node description (obs-rust#3065)

The obs-rust#3047 filter required PW_KEY_NODE_DESCRIPTION on the registry global, so a
Video/Source node whose description lives on its device (or in node.nickname)
was dropped from the camera list. Only the media class decides whether a node
is a camera; the label now falls back node.description -> node.nickname ->
device.description -> node.name, so no row is blank either.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bug: <sources>: Linux pipewire video lists non-video and blank devices

2 participants