coreaudio: mid-run spatial/WASAPI stream re-activations open new AudioQueues and fall back to silence under load #336
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Sheffy007 on 2026-11-27T12:35:39Z.
What happens
In world runs on current
main(with #288 merged), sound still cuts out when the title repeatedly re-activates its spatial audio stream under world-load pressure:#issuecomment-7217386312): "The log lines of that stretch are the fence waits above and the title activating its spatial audio stream again. Sound: the audio output fell back to silence (AudioQueueStart failed with OSStatus 2003329396) on 4 of 14 stream activations in the default run and 6 of 32 in the heap run, the first at +188 s and +207 s."@alicans): "Sound went silent soon after the world began; the audio device kept running."Why
XAudio2engine, WASAPIIAudioClient::Initialize, andISpatialAudioClient::ActivateSpatialAudioStreamcallscoreaudio::open_default(48_000, 2, render), andCoreAudio::opencreates and starts a brand-new AudioToolboxAudioQueue(AudioQueueNewOutput+AudioQueueStart) for each one. When the title re-activates its spatial stream 14–32 times during a heavy world load (0–17%free memory),coreaudiodIPC failsAudioQueueStartwith'what'(2003329396), stalling the caller for500 msof retries and then permanently binding the new spatial stream toSilent("no audio device: sound is mixed and dropped") — even while the process's initial48_000 HzstereoAudioQueueis still open and running.CoreAudio::opendoes open a hardwareAudioQueueandAudioQueueStartfails with'what', #288 retriesAudioQueueStarton the same failedAudioQueueRefinstead of disposing it and creating a fresh queue.Plan
CoreAudioAudioQueueper(rate, channels)across activeOutputhandles, mixing attachedRendercallbacks in userspace (f32sum, outputting silence when zero streams are attached) so mid-run spatial/WASAPI/XAudio2 stream activations attach withoutAudioQueueNewOutput/AudioQueueStartround-trips (reopening only ifAudioQueueEnqueueBufferreports a runtime device error).AudioQueueRefacrossAudioQueueStartretry attempts when opening the hardware queue for the first time (or after a runtime device failure).Outputdrop from inside aRendercallback, andAudioQueueStartretry recreating the queue handle.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Sheffy007 on 2026-11-27T12:35:41Z.
/claim
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-27T12:35:55Z.
Claimed by @Sheffy007. Open a draft pull request with
Refs #336in its description within 24 hours, or the claim expires.