mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-18 12:08:38 +00:00
TOTK_AUDIO_DEVICE names the device as SDL lists it; unset, empty or default keeps the system default and the same open as before. audio_mixer.c output_open opens the named device, or the default with one log line when it is not connected. Once a device is chosen, an output worker thread (output_worker) owns the SDL stream: on a cfg change and once a second it resolves the name again and output_switch opens the new device with the same spec, destroys the old stream (which waits for its callback), restarts the prefill and resumes. The render thread only wakes or starts the worker (output_watch), so the game's audio never waits for a device open. A chosen device that disappears falls back to the system default and comes back within a second of being plugged in again. TOTK_AUDIO_CHANNELS=auto reads the channels of the device chosen at start. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>