Repository navigation
Conversation
…o into concealment pw-cat drains its stdin pipe only in real time, so anything queued past the 40 ms lead stays as permanent latency. In a live session the pipe sat at its 160 ms limit even while audio sounded fine, so every write blocked. A burst then overflowed the 12-packet audio queue, and each dropped packet came back as Opus concealment of equal length. The backlog never shrank, and for 14 minutes 140-170 of every 200 packets per second were replaced by concealment (robotic audio). Drop new audio once more than twice the lead is queued, until the pipe is back at the lead. Writes no longer block on a full pipe, so the worker keeps up and the trap cannot form. A pipe that stays above the lead for the full write timeout is still reported as a stalled pw-cat. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
This branch has not been deployed
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.
Problem
On Linux the pw-cat stdin pipe filled to its 160 ms limit and stayed there. A sample taken while audio still sounded fine showed a median of 154 ms. pw-cat drains the pipe only in real time, so every write blocked.
A burst of packets then overflowed the 12-packet audio queue, and
conceal_beforerefilled each dropped packet with Opus concealment of the same length. A drop therefore never shortened the backlog, and the worker stayed behind.In one session this lasted 14 minutes. For that whole time, 140–170 of about 200 audio packets per second were dropped and replaced by concealment. The audio sounded robotic while video stayed fine.
Fix
Once more than twice the 40 ms lead is queued, drop new audio until the pipe is back at the lead.
DeviceLost), as before.Evidence
This is one session before and one after, on the same machine (PipeWire 1.6).
Tests
pipewire_backlog_is_dropped_back_down_to_the_lead.cargo test --workspacewithlinux-ffmpeg-bundled,linux-vaapi: 1534 passed, 0 failed, 27 ignored.🤖 Generated with Claude Code