V45.29: fix wobble preview VST2 chord van con sau V45.28 - ring worklet bridgeAudioWorklet 48->80 block (~426ms) phu stall render loop C++ toi ~361ms do tu log (fxrt_bridge loopMax=361ms, fxrt_pump pump_gap 362ms, longtask d=346): ring 48 (256ms) van khong du -> underrun lap lai fade ve 0 = wobble; them worklet_stats log dinh ky moi ~2s vao dbg.log (preview_diag chi fire keybed/vkb, duong preview khac khong log ws= duoc) de xac minh ov/un sau fix. v=202608311832

This commit is contained in:
2026-08-31 18:32:37 +07:00
parent 4ed1de638d
commit a069773d4a
3 changed files with 24 additions and 10 deletions
+14 -2
View File
@@ -17,6 +17,7 @@
var _initialized = false;
var _useWorklet = false;
var _workletStats = null; // stats tu worklet (overrun/underrun) — getDiag
var _statsLogAccum = 0; // dem stats messages — log dbg dinh ky (V45.29)
var _dest = null; // destination gain node da noi (chong connect trung)
function _getCtx() {
@@ -32,7 +33,7 @@
console.warn('[BridgeAudioNode] AudioWorklet unavailable — ScriptProcessor fallback');
return false;
}
var url = '/static/js/services/bridgeAudioWorklet.js?v=202608311820';
var url = '/static/js/services/bridgeAudioWorklet.js?v=202608311832';
_ctx.audioWorklet.addModule(url).then(function () {
if (!_initialized) return; // disconnect() happened while loading
if (_useWorklet) return; // already set up (init retry)
@@ -44,7 +45,18 @@
});
_workletNode.connect(_gainNode);
_workletNode.port.onmessage = function (ev) {
if (ev.data && ev.data.type === 'stats') _workletStats = ev.data;
if (ev.data && ev.data.type === 'stats') {
_workletStats = ev.data;
// V45.29: log dinh ky worklet_stats (moi ~2s) — preview_diag chi
// fire khi bam keybed/vkb, duong preview khac khong log ws= duoc.
try {
_statsLogAccum++;
if (_statsLogAccum >= 4) {
_statsLogAccum = 0;
if (window.__dbgLog) window.__dbgLog('worklet_stats', 'ov=' + ev.data.overruns + ' un=' + ev.data.underruns + ' ring=' + ev.data.ring + ' max=' + ev.data.max);
}
} catch (e) {}
}
};
_useWorklet = true;
// drain pre-buffer into worklet (order preserved)