Skip to content

Audio: provide a silent spatial endpoint without a playback device - #887

Open
broccolize wants to merge 1 commit into
xcl-dev:mainfrom
broccolize:audio/silent-spatial-endpoint
Open

broccolize wants to merge 1 commit into
xcl-dev:mainfrom
broccolize:audio/silent-spatial-endpoint

Conversation

@broccolize

@broccolize broccolize commented Nov 24, 2026 •

Copy link
Copy Markdown

Fixes #695. With no active Windows playback device, the issue reporter found that the title stopped draining its audio commands at the account prompt and eventually crashed. This change gives the title a silent spatial audio endpoint when Windows reports zero active playback devices. Reporter’s diagnosis

What is in it

  • Provide a silent endpoint through the title’s Windows audio device discovery. Prefer a real default playback device if one becomes available.
  • Request 48 kHz mono float buffers on a timer and discard the samples.
  • Test COM routing, endpoint selection, and repeated buffer updates, including stopping and restarting the stream.

This PR includes the COM routing and renderer together so a volunteer can test the full startup path with one build.

Tested

Clean head a3b0ea0479e683e34bb10a439cb6668e1eff0e34, based on upstream main at 1ec4c98cda119432a4b3f205e146fba2d6f8379a. Windows 11 build 26300, Intel Core i5-10300H, NVIDIA GeForce GTX 1650 driver 32.0.16.1714, Rust 1.100.0 MSVC, debug profile.

  • cargo build --locked --workspace passed.
  • cargo test --locked --workspace -- --test-threads=4 --show-output reported 718 passed, 0 failed, 41 ignored. All three new spatial audio tests passed.
  • The reported passes include five runtime skips. Two tests require wave64, one requires reserved cube textures with mips, and two require the D3D12 debug layer. A VFS junction subcase also skipped because mklink /J was unavailable.

Regression run

eizispark’s retail title smoke reports were run for 60 seconds on Windows 11 with an AMD Radeon RX 9070 XT and an active playback device. Both runs finished with zero crashes and zero device removals.

Upstream main

xcl-smoke v1
commit: beaa245ca04e212f064efc7cafcdce104bc5c0a2
gpu: AMD Radeon RX 9070 XT
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1660 (PresentX 1660)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14862 MB

PR head

xcl-smoke v1
commit: a3b0ea0479e683e34bb10a439cb6668e1eff0e34
gpu: AMD Radeon RX 9070 XT
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1663 (PresentX 1663)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14730 MB

Targeted no-playback-device startup

Not tested

Sustained in-world gameplay with the silent endpoint.

AI use

Codex (GPT-6) implemented the fallback and synthetic tests and ran the Windows validation.

When Windows confirms that no render device is active, offer the title a silent spatial endpoint with timed buffer requests. This lets the title keep submitting audio instead of waiting on a playback device.

Synthetic Windows tests cover COM routing, device selection and streaming, including stopping and restarting the buffer clock.

Assisted-by: Codex (GPT-6)
@eizispark

Copy link
Copy Markdown

Hardware check of a3b0ea0479e683e34bb10a439cb6668e1eff0e34 (verified clean merge with main 1ec4c98): pass.

Tested

  • Hardware: AMD Radeon RX 9070 XT (RDNA4, driver 32.0.32015.16001), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11, rustc 1.100.0 (0ef1bc386 2026-11-09), release + test profile
  • cargo test --workspace --no-fail-fast -- --test-threads=4: 715 passed, 3 failed, 41 ignored (GPU tests skipped on this adapter: none); the 3 failures were the known concurrent --test-threads=4 VRAM contention flake in hle::d3d12x::title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels plus two downstream mutex PoisonError cascades (transitions_apply_when_their_list_is_submitted and d32s8_targets_take_their_own_size_of_video_memory)
  • cargo test -p xcl --lib hle::d3d12x -- --test-threads=1: 114 passed, 0 failed, 1 ignored (GPU tests skipped on this adapter: none)
  • Verified hle::spatial_audio::tests::routes_guest_com_activation_through_the_fallback, hle::spatial_audio::tests::exposes_the_silent_endpoint_only_when_windows_reports_no_render_device, and hle::spatial_audio::tests::renders_repeated_silent_buffers_and_stops_signaling (ok)

Regression run
main (beaa245):

xcl-smoke v1
commit: beaa245ca04e212f064efc7cafcdce104bc5c0a2
gpu: AMD Radeon RX 9070 XT
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1660 (PresentX 1660)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14862 MB

PR (a3b0ea0):

xcl-smoke v1
commit: a3b0ea0479e683e34bb10a439cb6668e1eff0e34
gpu: AMD Radeon RX 9070 XT
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1663 (PresentX 1663)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14730 MB

Not tested

  • wave32-only GPUs (NVIDIA / Intel); retail title startup with zero active Windows playback devices (this host has an active playback device); gameplay past the menus

AI use

  • Antigravity (Gemini 4 Carbon) ran the build, test suite, and scripts/smoke.ps1 harness on this machine and formatted this report.

@SlopTart

Copy link
Copy Markdown

Linux / AMD RDNA3 datapoint.

Merged state: head a3b0ea0 onto main 077ce40, clean merge.

Full suite, cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4: 708 passed, 11 failed, 41 ignored; failures are the known Wine-lane set from my #42 rows plus this rig's title-textures flake family (see #718). silent spatial endpoint green; mirror-upload flake hit.

Not tested: retail titles (none here), Windows, RDNA4.
Counts only, no game data.

Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross x86_64-pc-windows-gnu, XCL_NETWORK=0, release profile, --test-threads=4. My Linux rows: #42 / #718.

AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.

@vladbondarenko97

Copy link
Copy Markdown
Contributor

Retail check on a PC with no active playback device: #887 removes the +0x4dcbc9d trap.

Setup: RTX 3080 Ti 12 GB (driver 32.0.16.1060, 32-lane waves), i7-12700KF, 32 GB RAM, Windows 11 Pro 26300, rustc 1.100.0, release. Retail 1.0.2.1 (package hashes verified). This PC has no active render endpoint: speakers and HDMI audio are all Unknown in Get-PnpDevice -Class AudioEndpoint, which is the #695 case. Runs are scripts/smoke.ps1 -Seconds 600 with XCL_PSO_WAIT_MS=50 and XCL_PRESS_AT walking the first-run menus.

build audio end
main 47efa2e (none) 0x80000003 at game_scarlett_master.exe+0x4dcbc9d, 27.6 s (rax=0x17fb0 rbx=0x50 rsi=0x6c0 — the same registers as #695)
#887 head a3b0ea0 spatial audio: using XCL's silent renderer (5.1 s, again at 67.5 s) no trap; menus at 30 fps (60 presents / 2 s), DirectStorage loads at 66 s, then D3D12 device removed: 0x887a0006 at 105.3 s

main's block:

xcl-smoke v1
commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3
gpu: NVIDIA GeForce RTX 3080 Ti
title: GTA6.Xbox.v1.0.2.1
seconds: 600
exit: 0x80000003
frames shown: none logged (the run did not reach its end)
presents per 2 s (last 3): 60 60 47
device removals: 0
crashes: 2
peak commit: 14725 MB

The 0x887a0006 later in the #887 run is the NVIDIA world-path hang tracked in #505/#846. I don't read it as coming from this PR: the head is based on 1ec4c98, which predates the BCPack unpack (#905), and the log shows BCPack … unsupported before it. Our earlier runs on this machine with a VEH workaround for the trap reached the same stage.

Not tested: the head's own xcl-smoke block (my runner died after the run, before smoke.ps1 printed it; the numbers above are from that run's xcl.log). A PC with a playback device, AMD. I'm now running main + #887 merged and will add both blocks.

For anyone with the same trap: our #723 is this issue. The "game thread stream" I named there is the per-thread audio command stream that #695 explains.

AI use: Claude Code (Claude Opus 5.5) built and ran the test on my machine, read the logs and drafted this comment; I reviewed it.

@iggyvilla

Copy link
Copy Markdown
Collaborator

Test report for a3b0ea0479e683e34bb10a439cb6668e1eff0e34 on an AMD RDNA2 card that has an active playback device: the 90 s smoke.ps1 pair the draft asks for, plus a check of what the title does after its sign-in screen. The smoke blocks were generated by scripts/smoke.ps1 and pasted unedited; the runs were measured by an agent (omp, DeepSeek V4.1 Flash), the text below was verified against the raw logs and written by Claude Code (Claude Sonnet 5.5).

Tested

  • AMD Radeon RX 6650 XT (RDNA2, 8 GB), driver 32.0.21045.29003; Ryzen 7 5700X, 32 GB; Windows 11 build 26300; rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC, release.
  • a3b0ea0 is one commit on 1ec4c98cda119432a4b3f205e146fba2d6f8379a (git merge-base confirms it), so the base below is the PR's own merge base, built in a separate clean worktree. cargo build --locked --release -p xcl in both.
  • The retail title, XCL_NETWORK=0. A 30 s warm-up on the base (672 frames, exit 0x0), then head and base at -Seconds 90, in that order.
  • This host has active playback devices (Digital Audio (S/PDIF) and 1 - Mi Monitor (AMD High Definition Audio Device)), so the silent endpoint is not selected: none of the head or base logs contains spatial audio: using XCL's silent renderer. The pair therefore only shows that routing the guest's CoCreateInstance through the new shim changes nothing on a host that has a device.
  • cargo test --release -p xcl --lib spatial_audio -- --test-threads=4 on the head: 3 passed, 0 failed, 695 filtered out (the three new tests).

main (1ec4c98):

xcl-smoke v1
commit: 1ec4c98cda119432a4b3f205e146fba2d6f8379a
gpu: AMD Radeon RX 6650 XT
title: retail
seconds: 90
exit: 0x0
frames shown: 2466 (PresentX 2466)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15156 MB

PR (a3b0ea0):

xcl-smoke v1
commit: a3b0ea0479e683e34bb10a439cb6668e1eff0e34
gpu: AMD Radeon RX 6650 XT
title: retail
seconds: 90
exit: 0x0
frames shown: 2469 (PresentX 2469)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15287 MB

Both: exit 0x0, no device removal, no crash; the PR shows 100.1 % of main's frames and 100.9 % of its peak commit. The standard harness sends no input, so both runs stop at the title's sign-in screen (a blank screen with the hints PLAYER1 (A), ACCOUNT PICKER (Y), SCREEN NARRATION (X)) at about 30 fps; the log shows XUserAddAsync(options=0x1) → local offline user 'Player1' at 6.9 s.

Past the sign-in screen. A further 90 s head run with XCL's scripted press XCL_PRESS_A_AT=45 (log: GameInput: gamepad buttons 0x4 pressed for the first time at 45.003 s) leaves the sign-in screen and shows the game's onboarding screen (NAVIGATION EXPERIENCE, CONTINUE (A), 29.5 FPS) at 85 s, with no crash and no device removal:

xcl-smoke v1
commit: a3b0ea0479e683e34bb10a439cb6668e1eff0e34
gpu: AMD Radeon RX 6650 XT
title: retail
seconds: 90
exit: 0x0
frames shown: 2468 (PresentX 2469)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15692 MB

Two earlier attempts at sending input from outside the process (a window-level key press and a held press) were not used as evidence; both ran 90 s with exit 0x0 and no crash.

Not tested

  • The path the PR adds: zero active playback devices. This machine has playback devices and none was disabled, so the silent endpoint, the timer-driven stream and the stop/drop path were not exercised by a retail run, only by the three synthetic tests above. The author reports 718 passed / 0 failed / 41 ignored; another report on this PR ran 715 / 3 / 41 with three failures it attributes to a VRAM-contention flake.
  • No full cargo test --workspace on this card; no base run with the scripted A press (the PR does not touch input); nothing past onboarding; no wave32-only host; no other title.
  • main has moved since; it was not merged into this head or run.

AI use
Claude Code, Claude Sonnet 5.5: checked the numbers above against the raw smoke files, logs and screenshots and wrote this text. The builds and runs were done by an agent (omp with DeepSeek V4.1 Flash); no code was changed.

@deepdev237

Copy link
Copy Markdown

Retail startup check with no active Windows playback endpoint

Tested

Not tested — Active playback, 3D world rendering and in-world input.

AI use — OpenAI Codex (gpt-6.2-sol) ran the tests, checked the local receipts and wrote this report.

@Placebola

Copy link
Copy Markdown

Test on the PC #695 was found on (Windows 10, no active playback device): #887 removes the trap, on today's main too.

All render endpoints of this PC are Unknown in Get-PnpDevice -Class AudioEndpoint, as in #695. It is the first Windows 10 run in this thread.

Tested

  • RTX 4060 Ti 8 GB (driver 32.0.16.1664), i7-7700, 32 GB RAM, Windows 10 Home 22H2 (19045.6466) with the Agility SDK 1.620.2 (XCL_D3D12_DIR), rustc 1.100.0, release. Retail 1.0.2.1.
  • Head a3b0ea0 merged onto main c160d86: no conflicts. 4f4fe32 is that local merge commit, the one in the second block.
  • cargo test --release --workspace -- --test-threads=4 on 4f4fe32: 861 passed, 0 failed, 42 ignored, the three spatial_audio tests among them. SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • scripts/smoke.ps1 -Game <title> -Seconds 120, no input:

main:

xcl-smoke v1
commit: c160d86ef2efe3a07e4dfb473e4fa72eafb413c0
gpu: NVIDIA GeForce RTX 4060 Ti
title: Game
seconds: 120
exit: 0x80000003
frames shown: none logged (the run did not reach its end)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 2
peak commit: 14709 MB

a3b0ea0 on main:

xcl-smoke v1
commit: 4f4fe3211eb5b2d30220556e78629625702634a1
gpu: NVIDIA GeForce RTX 4060 Ti
title: Game
seconds: 120
exit: 0x0
frames shown: 3204 (PresentX 3204)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14701 MB

Not tested

  • Past the first-run menus (no input was sent).
  • This PC with an active playback device (the reports above cover that case), and a debug build.

AI use
Claude Code (Claude Opus 5.5) did the builds, the test run and the two runs, and wrote this report.

@broccolize

Copy link
Copy Markdown
Author

Thanks for running the original smoke pair, @eizispark. I’ve rebased the silent-audio fix onto cbc296ab65a2661a61e3e2da109134bcd5319f60 and published the candidate at 635f76463f9c27942849c7f7216ad24c04264dd7.

If you have time, could you rerun scripts/smoke.ps1 -Seconds 60 on clean builds of those two commits with the same title and active playback device as before, then paste both unedited xcl-smoke blocks here? That gives me the reports for the exact commit I plan to push to #887.

@JJAutoCompare

Copy link
Copy Markdown

Empirical test report (a3b0ea0)

Hardware / environment

  • STOR-WINLAB, Windows x64 build 26200, AMD64 Family 23 Model 113 Stepping 0 (12 logical processors).
  • Rust 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc), DXC 1.9.2609.5 (01b62ad47). The test profile was unoptimized, with debug info and incremental compilation disabled.
  • The focused run used XCL_ADAPTER=NONE_CPU_ONLY and RUST_TEST_NOCAPTURE=1. Both commands ran outside Invoke-ArcTest.ps1 without holding the Arc GPU mutex.

Commands and results

  • cargo test --workspace --no-run exited 0 and built the workspace test binaries.
  • cargo test -p xcl --lib hle::spatial_audio::tests:: -- --nocapture exited 0. The log contains 3 passed, 0 failed, 0 ignored, and 0 SKIPPED lines. The filter excluded 695 tests.
  • Both commands emitted a deprecation warning for AtomicU32::fetch_update in the XGameRuntime module.

Observed behavior

  • The routing test resolved guest CoCreateInstance through the spatial-audio hook for the Windows COM libraries and preserved the native CoUninitialize lookup.
  • With a synthetic Windows endpoint enumerator, the fallback supplied an active render endpoint when the render count was zero and preserved the capture endpoint. The mock host render endpoint took precedence when the test marked it active, and a failed render query kept the original enumerator.
  • The synthetic spatial client acquired and wrote four 480-frame buffers and logged that it was using XCL's silent renderer. After stopping the stream, the test observed no buffer event during a 35 ms wait. A buffer event arrived after reset and restart.

Not tested

The full GPU workspace suite and game smoke runs were omitted. The endpoint-selection test used a synthetic enumerator, so the run did not exercise native Windows endpoint discovery or physical playback.

AI use

Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr887-focused.log and published.

@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11): merge conflict with current main — needs a rebase before it can be tested.

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.

Retail title 1.0.2.1: assert 0x80000003 at +0x4dcbc9d on the account prompt – a 96 KiB stream full (RTX 4060 Ti 8 GB, Windows 10)

9 participants