summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/AUDIO_WAV_DRIFT_BUG.md17
1 files changed, 14 insertions, 3 deletions
diff --git a/doc/AUDIO_WAV_DRIFT_BUG.md b/doc/AUDIO_WAV_DRIFT_BUG.md
index e22f4fa..050dd49 100644
--- a/doc/AUDIO_WAV_DRIFT_BUG.md
+++ b/doc/AUDIO_WAV_DRIFT_BUG.md
@@ -1,7 +1,8 @@
# Audio WAV Drift Bug Investigation
**Date:** 2026-02-15
-**Status:** ROOT CAUSE IDENTIFIED
+**Status:** ACCEPTABLE (to be continued)
+**Current State:** -150ms drift at beat 64b, no glitches
## Problem Statement
@@ -163,8 +164,18 @@ Eliminates cumulative truncation error.
1. ✅ Measure WAV sample positions directly (Python script)
2. ✅ Add render tracking debug output
3. ✅ Confirm over-rendering (366ms per 10s)
-4. ⏳ Implement fix
-5. ⏳ Verify corrected WAV alignment in viewer
+4. ✅ Implement partial fix (bypass ring buffer, direct render)
+5. ⚠️ Current result: -150ms drift at beat 64b (acceptable, needs further work)
+
+## Current Implementation (main.cc:286-308)
+
+**WAV dump now bypasses ring buffer entirely:**
+1. **Frame accumulator**: Calculates exact frames per update (no truncation)
+2. **Direct render**: Calls `synth_render()` directly with exact frame count
+3. **No ring buffer**: Eliminates buffer management complexity
+4. **Result**: No glitches, but -150ms drift remains
+
+**Remaining issue:** Drift persists despite direct rendering. Likely related to tempo scaling or audio engine state management. Acceptable for now.
## Notes