From c4be8d3a07d32407555cfcbe0984867027397565 Mon Sep 17 00:00:00 2001 From: arcattack Date: Thu, 16 Jul 2026 00:01:58 -0500 Subject: [PATCH] Audio: footstep volume chain FULLY mapped -- blocked on gait-state id mismatch (task #50) Chain (every hop verified live): FootStep pulse (SetBodyAnimation, decay in PerformAndWatch) -> AudioMatchOf match=1 -> Start(2.0) on the FootFall DirectPatchSource... which the renderer DROPS because its volume is 0: an AudioControlMixer (outCtl=3/Volume + a second outCtl=5 mixer) feeds the source, and BOTH mixer inputs are 0 -- nothing ever sends them. Eliminated as senders (all traced): AudioScaleOf scales (29 total, none target the mixer), AudioControlMultiplier (one instance, other target), Random/ AudioSampleAndHold (RNG verified WORKING -- varied samples; RANDOM.cpp is in the build, the self-init ctor runs). HYPOTHESIS [T4, next session]: the mixer inputs are fed by AudioStateTriggers on AnimationState keyed to the AUTHORED gait-clip ids (walk 2/3, run 8/9 = per-gait footstep volume). Our runtime body SM walks in states 12<->13 -- which the recovered MechAnimationState enum names RightStandToReverse/ LeftStandToReverse. If the authored audio expects 2/3 for forward walk, the runtime clip NUMBERING in the reconstructed gait SM is offset from the authentic ids -- a locomotion-layer mismatch with implications beyond audio (the audio config is an independent witness to the true clip numbering). Verify via the AudioStateTrigger configs on the AnimationState watcher (trigcfg dump exists) and cross-check the SetBodyAnimation clip table. New diagnostics: [snh] SampleAndHold sends, [mix] mixer forwards with input index + sum, [scalecfg] authored scale bindings/boundaries, [volset]. Co-Authored-By: Claude Opus 4.8 (1M context) --- engine/MUNGA/AUDCMP.cpp | 8 ++++++++ engine/MUNGA/AUDWTHR.h | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/engine/MUNGA/AUDCMP.cpp b/engine/MUNGA/AUDCMP.cpp index 1e20e18..f83597e 100644 --- a/engine/MUNGA/AUDCMP.cpp +++ b/engine/MUNGA/AUDCMP.cpp @@ -632,6 +632,10 @@ void } Check(audioComponentSocket.GetCurrent()); + if (getenv("BT_AUDIO_SPATIAL")) { static int s_mix=0; if (s_mix++<80) + DEBUG_STREAM << "[mix] mixer=" << (void*)this << " -> tgt=" << (void*)audioComponentSocket.GetCurrent() + << " outCtl=" << (int)outputControlID << " in[" << index << "]=" << control_value + << " sum=" << mixed_value << "\n" << std::flush; } audioComponentSocket.GetCurrent()->ReceiveControl( outputControlID, mixed_value @@ -1319,6 +1323,10 @@ void nextSampleTime += sampleDuration; Check(audioComponentSocket.GetCurrent()); + if (getenv("BT_AUDIO_SPATIAL")) { static int s_sh=0; if (s_sh++<60) + DEBUG_STREAM << "[snh] this=" << (void*)this << " -> tgt=" << (void*)audioComponentSocket.GetCurrent() + << " ctlID=" << (int)audioControlID << " val=" << currentValue + << " range=[" << minValue << "," << maxValue << "]\n" << std::flush; } audioComponentSocket.GetCurrent()->ReceiveControl( audioControlID, currentValue diff --git a/engine/MUNGA/AUDWTHR.h b/engine/MUNGA/AUDWTHR.h index c36f706..abb6b49 100644 --- a/engine/MUNGA/AUDWTHR.h +++ b/engine/MUNGA/AUDWTHR.h @@ -521,6 +521,13 @@ template MemoryStream_Read(stream, &controlValueBoundary1); MemoryStream_Read(stream, &controlValueBoundary2); MemoryStream_Read(stream, &exponent); + + if (getenv("BT_ATTRBIND_LOG")) { static int s_scf=0; if (s_scf++<160) + DEBUG_STREAM << "[scalecfg] attrPtr=" << (void*)attributePointer + << " comp=" << (void*)audioComponentSocket.GetCurrent() + << " ctlID=" << (int)controlID + << " aB=[" << attributeValueBoundary1 << "," << attributeValueBoundary2 << "]" + << " cB=[" << controlValueBoundary1 << "," << controlValueBoundary2 << "]\n" << std::flush; } } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~