Audio: a silent playback endpoint when the host has no render device #929
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!929
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-929"
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?
@vladbondarenko97 on GitHub · 2026-11-24 14:17 UTC · original
vladbondarenko97:audio/silent-endpoint→main· +813 −4 · 4 files · 3 commits · openWith no active Windows playback device, the title's audio output setup never allocates its buffers and returns while still holding a lock. The audio thread then never drains the per-thread 96 KiB command streams, and about 20–30 s in the title's audio-thread assert fires (its own
int3). This is the trap in #834, and the Wine/no-sound-driver case #222 warns about. The chain is diagnosed with RVAs in ivall/xcl#695. A console always has an output, so the title has no path for this.What is in it
modules/audio/silent.rsoverrides the title'sCoCreateInstance(ole32.dll,api-ms-win-core-com-l1-*; the retail exe imports it fromapi-ms-win-core-com-l1-1-0.dlland has noCoCreateInstanceEx/CoGetClassObjectimport). The host call always runs first. Only a successfulMMDeviceEnumerator/IMMDeviceEnumeratorcreation without aggregation is looked at.GetDeviceids and notifications go to the host.ISpatialAudioClientaccepts 48 kHz float. ItsISpatialAudioObjectRenderStreamsignals the title's event every 10 ms while started, hands out 480-frame buffers and discards them. Start/Stop/Reset can be repeated, and dynamic objects are counted and capped. One info line is logged when it is used.windows/windows-corebecome plaincfg(windows)dependencies (they were diagnostics-only).Tested
Unknown). RTX 3080 Ti (driver 32.0.16.1060), i7-12700KF, 32 GB, Windows 11 Pro 26300,--profile diag --features diagnostics, this branch merged ontomainffe310e, scripted keys (VICTORY_KEYS) through the first-run menus.no active playback device: the title gets a silent audio endpointat start; 30.0 fps throughout; no audio-thread assert. Captures show the intro key art (frame 1024) and the Rockstar legal terms screen with the Privacy Policy box ticked at frame 5400 (~3 min). Without this change,mainand xclmainboth hit that assert on this PC (~20–30 s).cargo clippy --workspace --all-targets --locked -- -D warningsand with--all-features: clean.cargo test -p victory-hle --locked: 99 passed, 1 failed. The failure ismodules::display::tests::sdr_and_display_deferrals(0x80070032), which fails the same way on cleanmainon this machine. The 6 new tests pass: routing native vs silent, the 48 kHz float format accepted / 44.1 kHz rejected, 20 buffer cycles → Stop (no signal) → Start → 20 more, dynamic object counting, and a realCoCreateInstancecall (skips itself without an audio service).cargo test -p xtask --locked: 4 passed.Not tested
AI use: Claude Code (Claude Sonnet 5.5) implemented the change and tests; Claude Opus 5.5 reviewed it, ran the retail test on my machine and wrote this description. I reviewed it.
Fixes #834. Also covers the case #222 warns about.
🤖 Generated with Claude Code
@MichaelSmithAI on GitHub · 2026-11-24 14:26 UTC · original
Independent Wine 11.22 result for the no-driver case on
d80294f. With audio disabled in an isolated prefix, Wine’s own CoCreateInstance and endpoint enumeration succeeded, returned zero active playback devices, and returned 0x80070490 for the default endpoint. Through the VIctory hook, the same configuration exposed one active silent device. A spatial stream delivered three 480-frame float buffers.Restoring the audio driver in the same prefix restored four active playback devices and a working default. The hook then returned the native endpoint. All six authored tests passed as well. This verifies fallback selection, buffer delivery and return to native routing on Wine. We did not launch the title in this comparison. The title reaching the legal screen is the author’s Windows 11 result.
@dcastell1 on GitHub · 2026-11-24 14:28 UTC · original
Verified on native Windows (no Wine): NVIDIA GeForce RTX 5090 (driver 621.24), Windows 11 10.0.26300, Rust 1.98.1, MSVC 14.44.35207, debug build.
main@ffe310ebaseline on this box: 342 passed, 0 failed, 6 ignored.Six more than the baseline: the silent playback endpoint path ships its tests and every one runs green here.
Tree restored afterwards (full diff against a clean checkout); no game data, the tests are synthetic. AI-assisted (opencode): applied the patch to a built tree, ran
cargo test --workspace, reverted it.@vladbondarenko97 on GitHub · 2026-11-24 14:56 UTC · original
Thanks for the reviews and the Wine and RTX 5090 runs. @mercuryVM: done in
2b8756d. The module doc and this description now say "the title's audio-thread assert" with no offset (a doc-only commit on top, no code change).@Zipettte on GitHub · 2026-11-24 15:40 UTC · original
Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at
2b8756d:cargo test -p victory-hlepasses, 101 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).Tested with AI assistance (Claude).
@Marvisak on GitHub · 2026-11-25 01:29 UTC · original
Automated triage for the maintainers.
Needs work: needs the maintainer's decision. This adds
modules/audio/silent.rs(crates/victory-hle). It overrides the title'sCoCreateInstance, and only when a successfulMMDeviceEnumeratorcreation finds no active render endpoint, it wraps the enumerator to offer one silent device. That device'sISpatialAudioClient/render stream accepts 48 kHz float, signals the title's event every 10 ms from a timer thread and discards buffers. Hosts with an active endpoint get the native enumerator back unchanged. The routing reads sensibly, and the PR gives evidence: a run of the title past the audio-thread assert on a PC with no playback device, plus an independent Wine check.Points for the maintainer:
crates/victory-hle/Cargo.tomlmakeswindows-corea non-optional dependency (it was diagnostics-only) and adds awindowsfeature, so release builds now link it.CI: not run.
Generated by Claude Code
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.