Repository navigation
fix(capture): copy PipeWire frames into system memory to stop the green picture - #54
Open
Developer1010x wants to merge 2 commits into
Open
Developer1010x wants to merge 2 commits into
Developer1010x wants to merge 2 commits into
Conversation
…en picture Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The issue
After #50, an OpenPlay cast connects, negotiates and decodes end to end, but the receiver shows a uniformly green picture instead of the sender's screen (the "Known remaining defect" in #50).
Root cause (hypothesis — not yet confirmed)
Solid green is what an all-zero YUV frame decodes to, so the encoder is being fed empty frames. The decode side is not the suspect:
crates/openplay-pipeline/tests/webrtc_loopback.rscarries real decoded frames through the same receiver chain using avideotestsrcsource.The capture source is built in
build_capture_element(crates/openplay-pipeline/src/encoder.rs) withpipewiresrc always-copy=false. In that mode PipeWire can pass the portal's DMABuf / shared-memory buffers straight through, and the CPU-sidevideoconvertthat #50 added downstream reads them as zeros.Duplicates
None found. No open PRs; searching closed PRs for "green", "always-copy" and "dmabuf" turns up only #50, which reported this defect and left it for a follow-up.
The fix
Set
always-copy=trueonpipewiresrc, so every frame is copied into system memory beforevideoconvertsees it. That costs one memcpy per frame, which is small next to an H.264 encode. One line plus a comment explaining why.Verification
NOT VERIFIED on a real cast yet. PipeWire capture is Linux-only and needs a desktop portal plus a human at the consent prompt, so CI cannot exercise it. Do not merge until someone has run, on Linux:
and confirmed a real picture. If it is still green, the
Captured buffer contentslog lines say which way to go:pct_nonzeronear 0: the portal is delivering empty frames, and this change is not the fix.pct_nonzerohigh: the frames are fine and the conversion is mangling them, so pin an explicit raw format next.Why it matters
The green picture is the last known blocker between "a cast connects" and "a cast shows your screen". Until it is fixed, OpenPlay's native protocol does not do its one job, and a cross-machine test or a call for community testers is premature.
🤖 Generated with Claude Code