diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-15 16:41:08 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-15 16:41:08 +0100 |
| commit | 3a3eca975f15d1e025d6c46c6de253d2abaa7170 (patch) | |
| tree | 766b9684a4075681c571b06caae1262f30910381 /doc/AUDIO_WAV_DRIFT_BUG.md | |
| parent | 6e7aa374b6e0e5ebda2f3525c130ce0cc1cd72cb (diff) | |
fix(audio): WAV dump drift improvements, acceptable state
WAV dump changes:
- Bypass ring buffer, render directly with synth_render()
- Frame accumulator eliminates truncation errors
- Skip pre-fill and fix seek for WAV dump mode
- Result: No glitches, -150ms drift at 64b (acceptable)
Timeline editor:
- Fix waveform tooltip position calculation
- Increase beat bar visibility (0.5 opacity)
Cleanup:
- Remove all drift debugging code from audio.cc and tracker.cc
Status: Acceptable for now, further investigation needed.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Diffstat (limited to 'doc/AUDIO_WAV_DRIFT_BUG.md')
| -rw-r--r-- | doc/AUDIO_WAV_DRIFT_BUG.md | 17 |
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 |
