Skip to content

fix: preserve async audio timing after video queue overflow - #3653

Merged
zackees merged 2 commits into
masterfrom
fix/3368-async-audio-anchor
Nov 5, 2026
Merged

zackees merged 2 commits into
masterfrom
fix/3368-async-audio-anchor

Conversation

@zackees

@zackees zackees commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

A graphics stall can fill the 30-frame async video queue. The overflow path also reset the running source clock, so the next tick anchored delayed audio to the oldest leftover picture instead of catching up on the original timeline. First-texture shader compilation reproduced a 166.7 ms anchor jump and two tone breaks.

Preserve the clock on capacity overflow. Queue bounds and ownership, explicit stops, and genuine source timestamp-jump handling are unchanged. Remove the now-resolved audio sanitizer exemption and record the user-visible fix in the features ledger.

Fixes #3368.

Validation:

  • RED 4d7a88c48: actual libobs cache overflow changes last_frame_ts to zero; the new preservation assertion fails. The explicit-stop reset guard passes.
  • GREEN 662b14821: the three deterministic regression cases pass via the repository's sanitize.run_one_test, including overflow before the first tick and explicit-stop guards; ASan/UBSan with leak detection, exit 0.
  • The unchanged six-case audio integration test also passes through sanitize.run_one_test with its standard unwinder and leak detection, exit 0. Tones at 1/3/5-second video delay have zero breaks. Observed audio delays: 1093 ms / 3083 ms / 0 ms for 1-second / 3-second / no filter.
  • Ten additional cold-Mesa, four-CPU, three-competing-process stress runs with the slow ASan unwinder all have zero tone breaks. Leak detection was disabled only for these repetitions: the separate baseline and first GREEN slow-unwinder runs both reported the same 368-byte unloaded-driver allocation, so these are audio-stability evidence, not leak-clean claims.
  • Full local lint passed (196.4 s), including formatting, Python policy tests, Rust feature-set Clippy and workspace Dylints. The 14 focused sanitizer-triage tests pass. One local clud-review reviewer found no blockers.

Existing C tests and public headers are unchanged. This changes the shared C caller used by hybrid and reference libobs; Rust pacing helpers and Tier 3 parity logic are unchanged. Native coverage uses the routine gate: no platform implementation changed. Hosted PR CI remains the merge gate.

@zackees
zackees marked this pull request as ready for review November 5, 2026 06:03
@zackees
zackees added this pull request to the merge queue Nov 5, 2026
@zackees

zackees commented Nov 5, 2026

Copy link
Copy Markdown
Member Author

Queue acceptance verified at 2026-11-05 06:03:53 UTC: position 2, QUEUED, pinned head 662b148212683bdaac0108d6e70afa0bfbc6af2c.

Required CI Gate and fresh Pull run 41976425743 passed on that exact head. All six Tier 2 partitions passed; both parallel modes ran 718 tests with zero failures, including the new overflow-clock regression and unchanged audio integration test. ASan passed: the new regression and unchanged audio integration exited 0, the app exited cleanly, and 697/697 counted tests were clean. The existing external unloaded-driver allocations remain listed separately; no OBS failure was waived.

Local evidence: full lint and review clean; official sanitizer harness passes all three new cases and all six unchanged audio cases with leak detection. Ten additional loaded, cold-shader, slow-unwinder runs had zero tone breaks. Existing C tests and public headers remain unchanged.

Merged via the queue into master with commit 75a8dd7 Nov 5, 2026
44 checks passed
@zackees
zackees deleted the fix/3368-async-audio-anchor branch November 5, 2026 06:13
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.

test: test_async_delay_audio's tone breaks under load in the asan job

1 participant