KB: audio backend was STUB DLLs (not just gated) -- now real OpenAL + in-tree WAV loader (task #50)

Correct the audio digest in wintesla-port.md + project-overview.md: the "no
sound ever" root cause was that BOTH engine/lib backend DLLs were no-op stubs
(libsndfile ordinal-only sf_open->NULL; OpenAL32 imports only KERNEL32). Now
real OpenAL Soft + LoadWavPCM; soundbank cracked (241 samples). Only remaining
gap = game triggering (AudioEntities).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
arcattack
2026-07-15 18:56:24 -05:00
co-authored by Claude Opus 4.8
parent 5b46655b82
commit c75abca857
2 changed files with 25 additions and 16 deletions
+5 -3
View File
@@ -42,9 +42,11 @@ fire → damage → destroy → respawn** single-player loop (task #52). **2-nod
end-to-end** — replication, cross-pod targeting/damage/kill, beam visuals, replicant gait (tasks end-to-end** — replication, cross-pod targeting/damage/kill, beam visuals, replicant gait (tasks
#46-#51, [[multiplayer]]). All 8 cockpit canopies are authentic + the horizontal-FOV fix (task #55, #46-#51, [[multiplayer]]). All 8 cockpit canopies are authentic + the horizontal-FOV fix (task #55,
[[cockpit-view]]); the Gyroscope is live byte-exact with hit-bounce (task #56); the **gauge system [[cockpit-view]]); the Gyroscope is live byte-exact with hit-bounce (task #56); the **gauge system
is complete** ([[gauges-hud]]). The engine/renderer/HAL are done (WinTesla); AUDIO is the exception — is complete** ([[gauges-hud]]). The engine/renderer/HAL are done (WinTesla); AUDIO backend is now REAL
the OpenAL engine is ported + now on by default (2026-07-15) but the soundbank + game triggering are (the repo's OpenAL32.dll + libsndfile-1.dll were both no-op STUBS — replaced with real OpenAL Soft +
unbuilt, so it's still SILENT (see [[wintesla-port]] Audio). The active work an in-tree WAV loader, 2026-07-15) and the 241-sample soundbank is cracked from AUDIO1/2.RES + loading;
the ONLY remaining audio gap is game-triggering (no AudioEntities fire PlayNote yet), so gameplay is
still silent apart from a proof-of-life hook (see [[wintesla-port]] Audio). The active work
is reconstructing each BT subsystem's authentic behavior from the binary. Remaining: pod-LAN is reconstructing each BT subsystem's authentic behavior from the binary. Remaining: pod-LAN
config, Mech-level update records, per-subsystem waves. [T2] config, Mech-level update records, per-subsystem waves. [T2]
+20 -13
View File
@@ -16,19 +16,26 @@ on top of it. Full detail: `docs/PROGRESS_LOG.md §5b, §8`.
## What WinTesla already did (do NOT rebuild) ## What WinTesla already did (do NOT rebuild)
- **Renderer bypass: DONE** — `MUNGA_L4/L4D3D.cpp` + `DXUtils` replace libDPL / the IG board with - **Renderer bypass: DONE** — `MUNGA_L4/L4D3D.cpp` + `DXUtils` replace libDPL / the IG board with
Direct3D9. No `libdpl.lib` in the tree. (The early from-scratch D3D9 viewer was retired and removed.) [T1] Direct3D9. No `libdpl.lib` in the tree. (The early from-scratch D3D9 viewer was retired and removed.) [T1]
- **Audio: ENGINE ported but NOT wired end-to-end** [T2, corrected 2026-07-15 — the old "DONE" - **Audio: BACKEND now REAL + soundbank loaded; only game-triggering remains** [T2, updated
was wrong]. OpenAL + libsndfile replace the HMI "SOS" engine, and the renderer→device→buffer→ 2026-07-15]. OpenAL replaces the HMI "SOS" engine and the renderer→device→buffer→source→play chain
source→play chain IS all implemented (`L4AUDRND`/`L4AUDRES`/`L4AUDLVL`; `PatchLevelOfDetail::PlayNote` IS all implemented (`L4AUDRND`/`L4AUDRES`/`L4AUDLVL`; `PatchLevelOfDetail::PlayNote` really calls
really calls `alSourcePlay`). But there were THREE gaps, so the game is SILENT: (1) it was gated `alSourcePlay`). The "no sound, ever" root cause was DEEPER than a gate — **both audio backend DLLs
OFF — `BTL4Application::MakeAudioRenderer` returned NULL unless the pod's `AWE_FRONT`/`AWE_REAR` shipped in `engine/lib/` were no-op STUBS**: (a) `libsndfile-1.dll` exports 15 funcs BY ORDINAL
sound-card env vars were set (dead on modern HW; the real "no sound" root cause). **RELAXED ONLY (no names), `sf_open()` always returns NULL; (b) `OpenAL32.dll` (72KB) imported **only
2026-07-15 to default-on** (`BT_NO_AUDIO=1` disables); the OpenAL device now opens. (2) The KERNEL32** — no dsound/wasapi/winmm — so it returned fake handles (`ctx=0x00000001`,
soundbank preset table `allPresets[2][100]` (btstubs.cpp) is a zero-init **STUB** — no `alGenSources→0`) and never touched the hardware. So the chain ran clean and silent. FIXES (commit
sound-event→sample mapping, so 0 buffers load. The sample DATA exists in `AUDIO1/2.RES` 5b46655): **OpenAL32.dll → real OpenAL Soft 1.25.2 Win32** (drop-in: the exe imports the 25 AL funcs
(`EnginePower01`, `LaserAFire01-03`, `LaserASustain`, …) but the map is gone (not in the decomp). by NAME; `alSourcePlay` now reaches `AL_PLAYING`). **libsndfile DROPPED** — replaced by `LoadWavPCM()`
(3) The reconstructed game **never creates AudioEntities** — no triggering on weapon fire / steps / in `L4AUDRES` (a tiny in-tree RIFF/WAVE fmt+data reader, no external dep). Gates fixed earlier: the
engine. So enabling real audio = reconstruct the soundbank + wire the game triggers (a proper audio `AWE_FRONT`/`AWE_REAR` env-var gate in `MakeAudioRenderer` was **relaxed to default-on** (`BT_NO_AUDIO=1`
wave). Diagnostic harness: `BT_AUDIO_LOG` traces the chain (Initialize → device → buffers → play). disables). **Soundbank recovered**: 241 samples cracked from `AUDIO1/2.RES` (SF2 v1.0) by
`tools/sf2extract.py``content/AUDIO/*.wav` + the `allPresets[2][128]` table (`audiopresets.cpp`,
replacing the zero-init btstubs stub); all 241 load (`alErr=0`). **The ONLY remaining gap**: the
reconstructed game **never creates AudioEntities** — nothing triggers `PlayNote` on weapon fire /
footsteps / engine / explosion during play, so gameplay is still silent (a `BT_AUDIO_TEST` hook plays
buffer0 as proof-of-life). Diagnostic harness: `BT_AUDIO_LOG` traces the chain; `BT_AUDIO_TEST` plays
a sample. NOTE: the `AUDIO1/2.RES` were SF2 v1.0 (16-byte shdr records; sample rate assumed 22050 Hz
— may need tuning if pitch is off).
- **L4 HAL on Windows + the VS build system: DONE.** [T1] - **L4 HAL on Windows + the VS build system: DONE.** [T1]
- **Red Planet game logic: COMPLETE & buildable** — `VTV/VTVMPPR/WEAPSYS/...`. RP is at/near playable. [T1] - **Red Planet game logic: COMPLETE & buildable** — `VTV/VTVMPPR/WEAPSYS/...`. RP is at/near playable. [T1]
- **Multiplayer: the DOS `NETNUB` driver is already replaced by a ~3.5k-line WinSock2 TCP - **Multiplayer: the DOS `NETNUB` driver is already replaced by a ~3.5k-line WinSock2 TCP