M19: fix fx PWR OFF->ON crackle/wobble — wake clear_queue play + cho started (het phat audio cu + underrun)

This commit is contained in:
2026-09-07 08:54:47 +07:00
parent 7b27065ed8
commit e4c678aabd
4 changed files with 47 additions and 11 deletions
+6
View File
@@ -184,6 +184,12 @@ class SfFxRealtimeProcessor extends AudioWorkletProcessor {
// engine ramp/jitter dau play); ARM live note giu RESUME_FILL 8 (~43ms) — preview
// nhanh, khong cho FILL 8.
this.resumeFill = (d.mode === 'play') ? this.FILL : this.RESUME_FILL;
// M19 Bug A: wake PWR ON sau warm-bypass — worklet rời graph không process
// nên hasStarted còn true từ lần play trước → không bao giờ gửi 'started'
// lại → main không crossfade đúng lúc. Reset ở clear mode 'play' → resume
// sau FILL gửi 'started' lần nữa (giống cold start). Clear 'play' khác khi
// đã active: main fadedIn=true rồi → 'started' thêm bị bỏ qua, vô hại.
if (d.mode === 'play') this.hasStarted = false;
this.silenced = false;
this.fadeFromL = this.lastOutL;
this.fadeFromR = this.lastOutR;