Skip to content

The Forest Android 0.2.3

Latest

Choose a tag to compare

@zwaetschge zwaetschge released this 01 Dec 22:04

0.2.3 – Multi-Client WASAPI Audio Mixer Fix (Eliminates Choppy Audio)

  • Root Cause Found & Fixed — Dual WASAPI Clients Interleaving Silence (runtime/src/wasapi.c, android/native/android_main.c):
    • The Forest opens two concurrent WASAPI render clients inside the same process: Unity 5.6's built-in FMOD (TheForest.exe, 2 ch 16-bit pcm, outputting pure silence) and FMOD Studio (fmod.dll, 2 ch 32-bit float, outputting the entire game soundtrack and SFX).
    • Previously, each IAudioClient spawned its own pump_thread and called w64_audio_sink_open, overwriting the single global SDL_AudioStream *g_astream so both threads pushed alternating 5–10 ms chunks of silence and real game audio sequentially into the same stream (concatenating instead of mixing!).
    • Replaced per-client pump threads with a single shared WASAPI master mixer engine (master_pump_thread, nice -16) that opens g_astream once (guarded by g_audio_mu), sample-accurately sums all active started clients with clamping, keeps each client's WASAPI ring at FMOD's requested 1920 frames (40 ms <= 2 FMOD mixer blocks so FMOD's feeder never overruns into an unmixed block), paces output at 1:1 real-time (240 frames / 5 ms, gentle 480-frame fill up to a 70–100 ms SDL3 cushion), and reports per-client peaks and fill levels every 10 s.

Source-only release — build the APK from your own PC copy via ./build.sh "/path/to/The Forest".