Skip to content

Fix audio buffer handling to reduce playback stalls and desync - #13

Merged
datagutt merged 1 commit into
masterfrom
fix/buffer-reach-real-stalls
Aug 16, 2026
Merged

Fix audio buffer handling to reduce playback stalls and desync#13
datagutt merged 1 commit into
masterfrom
fix/buffer-reach-real-stalls

Conversation

@datagutt

Copy link
Copy Markdown
Member

No description provided.

A 2.5 hour field log at the 120ms default: 287 underruns, max_gap 1711ms,
and repeated cycles of buffer runs dry -> concealment -> backlog burst ->
drain. Each cycle inflated the audio->OBS offset by about a second, which
holds video back by the same amount to keep lip sync: paced went from its
usual 2-3 frames to 29 (86MB, ~1s of video) at the spike, then unwound over
~17s at +5%. So a 1.7s uplink stall turned into roughly twenty seconds of
disturbed playback, on top of the frames the sender's ABR had already
dropped.

Riding the stall out instead of concealing it is the only thing that stops
that chain, and the cushion could not be set high enough to do it: the
setting stopped at 500ms.

Raising it alone would have broken the source outright. The read loop's
bleed ceiling is min(buffer_max*3, 1000ms) and priming waits for target plus
the OBS output lead, so above a ~920ms target the ceiling sits below the
prime threshold: the read loop stops before the buffer can ever reach it and
playback never starts. Nothing hit it because the setting stopped at 500ms.
Floor the ceiling at buffer_max + 100 so it always clears priming, which
changes nothing at any target up to ~700ms and makes the rest reachable.

Also raise the pacing byte ceiling to 512MB. Pacing holds one buffer's worth
of decoded video, so the two settings are coupled: a 2s target at 1080p60 is
120 frames, ~372MB. Past the ceiling frames go out early, which is the
desync this branch spent its time removing. Default settings are unaffected
— the same log shows 8MB steady.

None of this fixes the sender dropping frames under ABR, which is where the
freezes in that log start: video arrivals fell to 711 frames per 30s against
900 nominal. It stops the plugin from adding a second of held video and
twenty seconds of catch-up on top of every one of them.
@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@datagutt, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 24 minutes

Limit details: You’ve used all 1 included review currently available under your plan.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8949be7e-0333-45b8-80da-e07e12ac89f2

📥 Commits

Reviewing files that changed from the base of the PR and between 453a94b and 4a9082a.

📒 Files selected for processing (4)
  • README.md
  • include/irl-source.h
  • src/receiver.c
  • src/settings.c

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@datagutt
datagutt merged commit 7af6ae4 into master Aug 16, 2026
4 checks passed
@datagutt
datagutt deleted the fix/buffer-reach-real-stalls branch August 16, 2026 14:42
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.

1 participant