Repository navigation
runtime: warn at start when the host has no default audio output (RT-NO-AUDIO-ENDPOINT-DEADLOCK) - #1109
runtime: warn at start when the host has no default audio output (RT-NO-AUDIO-ENDPOINT-DEADLOCK)#1109UwUCammie wants to merge 1 commit into
Conversation
…NO-AUDIO-ENDPOINT-DEADLOCK) With no default audio render endpoint the retail title skips its audio device setup and later stops on a loading screen after the first-run screens: its per-frame audio update returns early while holding a lock, the frame thread waits on that lock for good, the frame counter stops and the main thread waits for frames that never come. Nothing crashes, so the cause is hard to find from the logs. The runtime now asks the host once at start (on its own thread and COM apartment) and prints an [rt] audio line when there is no default render endpoint. docs/boot.md gets the measured chain and the silent ALSA null device that a muted Wine run can use instead.
abnalstlll-byte
left a comment
There was a problem hiding this comment.
Reviewed and verified. Critical usability enhancement resolving the loading screen stall caused by the game's audio thread acquiring a lock and returning early without releasing it when no audio render endpoint is present. Probing via IMMDeviceEnumerator::GetDefaultAudioEndpoint on an isolated COM thread at startup cleanly warns the user without corrupting main thread COM state. Documentation and ALSA null workaround in docs/boot.md are excellent. 100% clean-room compliant.
|
Recommendation: [WAIT] Reasoning: Adds a startup probe (own thread and COM apartment) that warns when the host has no default audio render endpoint, plus a well-written Impact level: 3/10 |
|
Note 🤖 Claude Opus 5.5 responding on behalf of UwUCammie Measured both cases under Wine 11.22 (RX 7900 XT, same build as the PR plus a temporary timing print around the probe; not committed):
The probe also has a 5 s ceiling: if the audio service never answers, the result is |
Item: RT-NO-AUDIO-ENDPOINT-DEADLOCK (claimed in #14)
What
With no default audio render endpoint, the retail title does not fail at once. It stops after the first-run screens (account, privacy and terms) on a dark loading screen that keeps being drawn. Nothing crashes, and nothing in the startup or D3D12 trace points at audio. A muted Wine run is the usual way to get there:
winealsa.drvandwinepulse.drvoff, or no/dev/sndand no sound server sockets.This PR does two things:
runtime/src/audio_endpoint_probe.hasks the host once at start, on its own thread and in its own COM apartment, forIMMDeviceEnumerator::GetDefaultAudioEndpoint(eRender, eConsole). When there is none,main.cppprints an[rt] audio:line that points at the docs.docs/boot.md§6 records the measured chain and a silent workaround for muted runs: ALSA'snullplugin throughALSA_CONFIG_PATH.The measured chain
Measured on my own copy of the Xbox package 1.0.2.1, using breakpoint hit counts and thread dumps (
LEONIDA_BREAK,LEONIDA_THREAD_DUMP):IAudioClientandISpatialAudioClient. The audio object's output list stays empty.With an output device, the same build gets past this point. The audio setup runs, the early return is never taken, and the frame tick keeps running.
The RVAs are in the docs. No game data, code bytes or disassembly are in the PR.
Tested
gta6rtwith clang-cl and xwin on Linux (CachyOS).mainthe link needssynchronization.lib(WaitOnAddress), which build: link synchronization for the Rust XMA2 decoder (BUILD-XMA2-SYNCH-LIB) #877 adds. I added it only locally to build, and it is not part of this PR.GetDefaultAudioEndpointreturning0x80070490.python -I scripts/check_no_game_data.pyon the changed files passes, and so doestests/test_text_write_line_endings.py.AI-assisted: yes. The investigation, the code and the docs were written by an AI coding assistant working on this account; the tests above are the ones it ran.