Audio DSP: compute the convolutions (TVs, phone calls, reverb) #66
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/vktory6--VKtory!66
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-66"
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?
@NotBalkanus on GitHub · 2026-12-01 09:41 UTC · original
NotBalkanus:audio-dsp-world-speakers→main· +892 −41 · 8 files · 3 commits · merged 2026-12-01 09:56 UTCThe title sends the sound of the world's speakers (TVs, phone calls) through the audio DSP alone, and its
reverb sends through it too; the DSP's outputs were zeros, so they were silent and the reverb dry
(fxceless/victory-fork#1470). Commit 1 is trustno1 eca45ac (VIctory-NVIDIA), cherry-picked: the response
layout and the overlap-save algorithm; mono 1024-frame convolutions computed; everything the coprocessor
computes that we leave silent fails loudly at activation, counted (
crate::loud).Commit 2 builds on it for the rules here and for the game:
a late command as an overrun. The title's audio thread copies the input block into the stream's queue and
moves on; a worker thread per stream computes the block and publishes the completion after the output
(a release fence, then the volatile store the title polls). Before this the compute ran on the title's
audio thread: mean 1.2-1.4 ms and up to 4.6 ms per block over ~9-10 streams (~40 % duty), and the audio
broke up.
free or reuse its buffer once activation returns) and the parse plus the ~4·parts·4 KB of allocations run
on the worker's first task, not on the audio thread. Early submits queue behind the build; their
completions are late — the overrun the title already counts.
requires AVX2), with a scalar fallback for other builds. Per-block compute time is logged every ~470
blocks (
audio DSP convolve:) against the 21.3 ms block budget.recorded, and
VICTORY_DSP_GAINstays as the A/B until the schedule block's0xFFFFACE1word settlesthe hardware's scaling.
block is one raw pointer, never borrowed twice.
Verification (rule 27): the crate's tests pass under the Proton wine (
tools/proton-run.shas cargo'srunner; docs/tools.md): 169 passed, the NTFS link-limit test fails as it always does under wine, 2 ignored,
the three integration tests pass. In the game: TVs, a phone call and reverb audible; mean 110-220 µs a block
on the workers, max 2.1 ms (~10 % aggregate duty), no worker failures. The remaining slight breakup is not
this change's: its four F9 marks all landed on 57-237 ms frame stalls (one 655 ms into a frame) while the
convolution compute stayed at or under 2 ms everywhere, and an 85 ms PipeWire buffer (4096/48000) changed
nothing — it belongs to the slow-frame and streaming topics.
Findings: #65 (victory-hle is outside the policy walk; ~40 unlisted
VICTORY_*switches).Note for the squash: commit 1 is Yve's (trustno1-coder) work — please keep the attribution.
@vktory6 on GitHub · 2026-12-01 09:57 UTC · original
Merged, thanks to both of you! Yve's commit keeps the attribution (co-author on the squash). It does exactly what was missing: in phone calls the caller's side was silent, and our task and README had that the wrong way round (corrected now). The approach is right: the layout is checked against a direct convolution, the work runs off the title's audio thread on the status block's own tolerance, and refusing the by-ear 2.0 is what the rules ask.
One commit of mine on top (
ea9f606):Convolver::newnow checks FMA too and is deliberately unhandled without it); the scalar loop stays as the test's reference. The compute-on-the-title's-thread path for a worker that cannot start goes too: that case is loud and silent now.VICTORY_DSP_GAIN(rule 15).is_multiple_ofinConvolver::new(the new CI's-D warnings).Check on the reference system (RX 9070 XT): the PE build and clippy pass, and the house-scene validation run shows no new error. In that run the convolutions took 130 µs a block on average, at most 0.8 ms, against the 21.3 ms budget.