diff --git a/app/static/js/app.jsx b/app/static/js/app.jsx index ceabb79..35dabe8 100644 --- a/app/static/js/app.jsx +++ b/app/static/js/app.jsx @@ -1827,6 +1827,8 @@ async function fxRtStart() { }; const fxRtInPump = () => { if (!fxRt.inQueue.length) return; + // Không còn dùng (gửi ngay theo đồng hồ audio — xem onmessage 'in'). + // Giữ tham chiếu phòng khi track path còn dùng pattern cũ. const now = Date.now(); while (fxRt.inQueue.length && now - fxRt.lastInSent >= FXRT_BURST_MS) { fxRt.lastInSent = now; @@ -1868,8 +1870,12 @@ async function fxRtStart() { return; } if (d.type !== 'in') return; - fxRt.inQueue.push(d); - fxRtInPump(); + // Gửi NGAY, không pace setTimeout: input pacing = đồng hồ audio worklet + // (1 frame/21.33ms), không phải timer main-thread. Timer bận/trễ → input + // gửi trễ → engine/bridge chỉ sản xuất output khi có input → cushion cạn + // dần → crackle sau 3-4s (đã xác nhận với chain RỖNG). Burst sau stall: + // engine hấp thụ (in ring 4 slot, bridge drain ~1ms, drop-oldest an toàn). + fxRtSendFrames(d); }; // Pace input: tối đa 1 block/kỳ (~5.8ms). Gửi dồn theo burst (main thread bị // rAF renderFrame block khi mở MASTERING PANEL) → SHM ring 4-slot tràn → mất diff --git a/app/static/js/app.precompiled.js b/app/static/js/app.precompiled.js index 683eeff..a3fa88c 100644 --- a/app/static/js/app.precompiled.js +++ b/app/static/js/app.precompiled.js @@ -318,7 +318,7 @@ const fxRtSendFrames=d=>{if(!fxRt.ws||fxRt.ws.readyState!==1)return;try{const f= // chong race: neu stop/restart xay ra trong luc cho, bo qua. if(fxRt.fadedIn)return;setTimeout(()=>{if(token!==fxRt.startToken)return;fxRt.fadedIn=true;fxRtCrossfade(true,token);// Dry gan silent (tc 0.025) roi moi tre pdcDelay — tranh gap khi delay // dang lon dan. -setTimeout(()=>fxRtApplyPdc(),250);},30);return;}if(d.type==='set_param'){try{fxRt.ws.send(JSON.stringify({cmd:'set_param',slot:d.slot,key:d.key,value:d.value}));}catch(e){}return;}if(d.type==='stats'){fxRt.stats=d;console.debug('[FX RT stats]',d);return;}if(d.type!=='in')return;fxRt.inQueue.push(d);fxRtInPump();};// Pace input: tối đa 1 block/kỳ (~5.8ms). Gửi dồn theo burst (main thread bị +setTimeout(()=>fxRtApplyPdc(),250);},30);return;}if(d.type==='set_param'){try{fxRt.ws.send(JSON.stringify({cmd:'set_param',slot:d.slot,key:d.key,value:d.value}));}catch(e){}return;}if(d.type==='stats'){fxRt.stats=d;console.debug('[FX RT stats]',d);return;}if(d.type!=='in')return;fxRtSendFrames(d);};// Pace input: tối đa 1 block/kỳ (~5.8ms). Gửi dồn theo burst (main thread bị // rAF renderFrame block khi mở MASTERING PANEL) → SHM ring 4-slot tràn → mất // block → ngắt quãng. // Phase 4.2: fader SAU worklet — worklet chèn giữa outputAnalyser (chain diff --git a/app/templates/index.html b/app/templates/index.html index 0b3bf9e..78502db 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -51,7 +51,7 @@ - +