Preserve capture timing when WASAPI flags an unreliable timestamp #4825
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!4825
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4824"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@andrewpozdnakov7-jpg on GitHub · 2026-12-01 10:18 UTC · original
andrewpozdnakov7-jpg:fix/audio-capture-packet-clock→main· +16 −2 · 1 files · 1 commits · draftMain at
5fabb46has five Clippy errors covered by #4708.What it changes
Audio capture estimates missed playback from WASAPI packet timestamps. The current code uses the timestamp even when WASAPI marks its timing as uncertain. As a result the estimate can insert silence that the audio source did not play. WASAPI buffer flags
Continue writing that packet at the current output position. Anchor the first reliable timestamp to the number of frames already written and keep using reliable timestamps to account for later gaps.
How it was tested
5fabb46and6ee5ad4gave 4,320 extra silence frames before and zero after. A later reliable 480-frame gap was preserved. The fixture also covered an unreliable packet in the middle of a capture and a continuous stream.cargo check --locked -p victory-hle --features diagnostics --jobs 2and the staged policy check passed.Checked for overlap
capture.rsagainst its unchanged base.Please retain the Git author on cherry-pick or rebase, or add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>if folding the change into another commit.@gut0to on GitHub · 2026-12-01 15:18 UTC · original · reviewed
AI-assisted review: I traced the new timestamp helper and its caller. I used AI assistance and verified that this diff adds no tests for the timing policy.
@ -116,2 +116,4 @@}/// Align the first reliable timestamp (100 ns units) with the current WAV position.fn packet_frame(anchor: &mut Option<(u64, u64)>, timestamp: Option<u64>, written: u64) -> u64 {@gut0to on GitHub · 2026-12-01 15:18 UTC · original
Could packet_frame get pure unit tests for an unreliable first packet, the first later reliable anchor, and a regressing timestamp? This helper is the new timing policy, but the diff adds no regression test for it. In particular, after an invalid timestamp it should continue from written, then anchor the first reliable timestamp at that current frame; a backward timestamp should fall back without moving the anchor.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.