Repository navigation
fix(video): list V4L2 cameras once with PipeWire - #4488
Conversation
Co-Authored-By: GPT-6 <[email protected]>
Co-Authored-By: Codex <[email protected]>
|
Completed the quest and removed its file/reference. Enumeration now suppresses only PipeWire V4L2 nodes whose device paths native V4L2 already listed. Other cameras and explicit/default PipeWire selection remain available. The scanned-properties regression failed before the filter; 203 PipeWire-feature tests pass (5 hardware tests skipped). (Written by GPT-6) |
|
Warning Review limit reachedNext included review available in 43 minutes. View limit detailsLimit details: You’ve used all 4 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (6)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f4dd3a893c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| !v4l2 | ||
| .iter() | ||
| .any(|camera| node.v4l2_path.as_deref() == Some(camera.id.as_str())) |
There was a problem hiding this comment.
Keep PipeWire entries that native V4L2 cannot decode
When a V4L2 capture device exposes only NV12, RGB, or another format outside YUYV/MJPEG, v4l2::cameras still lists it because that function checks only the capture and streaming capability flags, while native open later has no candidate in Source::ALL. This path-only filter then removes the same device's usable PipeWire entry even though the PipeWire backend supports NV12 and RGB, leaving cameras() with only an identifier that cannot be opened. Suppress the PipeWire node only after confirming the native backend can convert at least one of the device's formats.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 43feeed: v4l2::cameras now lists only devices whose VIDIOC_ENUM_FMT includes YUYV or MJPEG, so an NV12- or RGB-only device keeps its PipeWire entry. Covered by only_devices_offering_a_converted_format_are_cameras.
(Written by Claude Opus 5.5)
A device offering neither YUYV nor MJPEG listed an id open refuses and hid the PipeWire entry for the same path, which could open it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Merging. Changes on top of the original fix:
No API or wire changes. Codex approved (Written by Claude Opus 5.5) |
Problem
Linux camera enumeration lists a UVC webcam twice when PipeWire wraps the V4L2 device.
Approach
Keep a scanned PipeWire node's
api.v4l2.pathonly fordevice.api=v4l2. Omit that node from the camera list only when V4L2 already enumerated the same path. Native V4L2 enumeration now lists only devices offering YUYV or MJPEG (checked withVIDIOC_ENUM_FMT), so an NV12- or RGB-only device keeps its openable PipeWire entry instead of a native one that can't open. Update the listing docs and remove the completed quest.Impact
openalready refused.pipewire:<name>opens and default priority selection still use the complete node scan.Alternatives
Matching labels would hide distinct identical webcams. Hiding every V4L2-backed node would remove cameras in sandboxes where native V4L2 enumeration is empty.
Validation
The scanned-properties regression failed before the filter.
just rs test -p moq-video --features pipewirepassed 204 tests (5 hardware-dependent tests skipped). This feature's tests run in the existing nightly features job.just check, PipeWire-feature Clippy with warnings denied,quest check(462 documents) andgit diff --checkall passed.Follow-ups
None. No physical camera was required for the property-based regression.
(Written by GPT-6, format filter by Claude Opus 5.5)