Repository navigation
RT-SILENT-AUDIO-ENDPOINT: serve a silent output endpoint when the host has none (the boot's audio-lock stop) - #1598
Merged
Conversation
The title creates its MMDeviceEnumerator through CoCreateInstance. On a host with no render endpoint, GetDefaultAudioEndpoint(eRender) is 0x80070490, the title's audio device start leaves its own output-device lock held, the audio engine never mixes, and the boot stops on an int3 about 47 s in. A console always has an output. com_shim's CoCreateInstance now hands that class to shims/silent_audio.cpp. A host enumerator with a default render endpoint is returned unchanged. Otherwise (no endpoint, no enumerator, or LEONIDA_AUDIO=silent) render questions get an in-process endpoint: IMMDevice with a read-only property store, IAudioClient/2/3 at 48 kHz float 7.1, and IAudioRenderClient, IAudioClock, ISimpleAudioVolume and IAudioStreamVolume. A clock drains the padding in real time and an event-driven stream's event is signalled every 10 ms. Every sample is discarded; no host audio device is opened. Capture keeps the host's answer. One [rt] line names the reason when the silent device is first served. silent_audio_test covers stand-in hosts with and without an endpoint, no host, a render stream over a few periods, and the CoCreateInstance hook with LEONIDA_AUDIO=silent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The title activates ISpatialAudioClient on the render device, not IAudioClient (the first game run with the silent endpoint logged that IID and stopped as before). The silent device now answers ISpatialAudioClient and ISpatialAudioClient2: a 7.1 static bed, no dynamic objects, mono 48 kHz float objects, 480 frames a pass. Its ISpatialAudioObjectRenderStream signals the stream's event every 10 ms while it runs, and its objects write into a scratch buffer. The periodic event thread is shared with IAudioClient. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Merged as a boot-blocker fix: on a host with no audio output, the retail boot now runs past the audio-lock stop at about 47 s (counts in the description).
AI-assisted (Claude Code, Claude Opus 5.5). |
aslan2142
added a commit
that referenced
this pull request
Nov 25, 2026
scripts/build_runtime.ps1 conflicted in the $files list of the build without CMake: main added shims\silent_audio.cpp there (#1598) after this branch had merged main, and this branch adds shims\lifecycle.cpp. Both entries are kept, lifecycle.cpp where this branch had it. The branch's other change in that file (user32.lib on the link line) merged cleanly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Item:
RT-SILENT-AUDIO-ENDPOINT. The claim could not be posted: coordination issue #14 is at GitHub's 2,500-comment limit and has no successor yet. The claim text, to be copied there once there is one:Searched first: no claim or open pull request covers this.
What and why
On a host with no audio output, the title's
GetDefaultAudioEndpoint(eRender)returns0x80070490. Its audio device start then takes an error path that leaves its output-device lock held, and the audio engine never mixes. A main-thread command buffer fills up, and the boot stops on anint3about 47 s in. Refusing the enumerator altogether gives the same stop. A console always has an output.Measured on the retail boot first, without code:
CoCreateInstance(MMDeviceEnumerator)now goes toshims/silent_audio.cpp(hooked inshims/com_shim.cpp).LEONIDA_AUDIO=silent, render questions get an in-process endpoint that never opens a host device and throws every sample away. It serves:ISpatialAudioClient/2, which is what the title activates: a 7.1 static bed, mono 48 kHz float objects, and an event every 10 ms;IAudioClient/2/3with render client, clock and volume services.[rt]line names the reason.runtime/README.md, and the behaviour indocs/runtime_imports.md("Audio output off the console (WASAPI)").Tests
silent_audio_test: 129 checks, using stand-in hosts, so no host audio is touched. It covers the enumerator with no endpoint, with one and with none at all; forced mode; event-driven, polled and spatial streams running on their clock; and the hook withLEONIDA_AUDIO=silent.main'scom_shim.cpp, the hook checks fail.silent_audiois new and passes on both.test_docs_env_vars,test_docs_links,test_docs_repo_paths,test_ci_registrationandtest_ctest_registrationpass.Measured on the retail boot
Wine, no audio driver at all, RDNA2 iGPU; counts only. Measured with #1539 merged locally, since RADV loses the device without it. It is not needed to build or merge this.
mainint3LEONIDA_AUDIO=silentAI-assisted (Claude Code, Claude Opus 5.5).