V45.27: fix (1) PR tab preview cam khi sub-tab PR khong ARM - ARM MAIN/SECTION cuc bo, khong leak sang PR (3 nhanh: vkbNoteOn prArmedIds + attachMidiHandler bridge bPrArmed + SonicSF arSubs them && isArmed); (2) crackle preview VST2 instrument loop/tremolo - ring worklet bridgeAudioWorklet 16->32 block (~170ms) hap thu stall render loop C++ khi instrument xu li loop/tremolo nang CPU (8->16 truoc da dung tremolo, 16 chua du); them stats overrun/underrun tu worklet -> getDiag/preview_diag (ws=ov/un) de xac minh con crackle khong. v=202608311809
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
var _ctx = null;
|
||||
var _initialized = false;
|
||||
var _useWorklet = false;
|
||||
var _workletStats = null; // stats tu worklet (overrun/underrun) — getDiag
|
||||
var _dest = null; // destination gain node da noi (chong connect trung)
|
||||
|
||||
function _getCtx() {
|
||||
@@ -31,7 +32,7 @@
|
||||
console.warn('[BridgeAudioNode] AudioWorklet unavailable — ScriptProcessor fallback');
|
||||
return false;
|
||||
}
|
||||
var url = '/static/js/services/bridgeAudioWorklet.js?v=202608291200';
|
||||
var url = '/static/js/services/bridgeAudioWorklet.js?v=202608311809';
|
||||
_ctx.audioWorklet.addModule(url).then(function () {
|
||||
if (!_initialized) return; // disconnect() happened while loading
|
||||
if (_useWorklet) return; // already set up (init retry)
|
||||
@@ -42,6 +43,9 @@
|
||||
outputChannelCount: [2]
|
||||
});
|
||||
_workletNode.connect(_gainNode);
|
||||
_workletNode.port.onmessage = function (ev) {
|
||||
if (ev.data && ev.data.type === 'stats') _workletStats = ev.data;
|
||||
};
|
||||
_useWorklet = true;
|
||||
// drain pre-buffer into worklet (order preserved)
|
||||
while (_preBuffer.length) {
|
||||
@@ -168,7 +172,8 @@
|
||||
hasWorkletNode: !!_workletNode,
|
||||
preBufferLen: _preBuffer.length,
|
||||
chunksLen: _chunks.length,
|
||||
gain: _gainNode ? _gainNode.gain.value : -1
|
||||
gain: _gainNode ? _gainNode.gain.value : -1,
|
||||
ws: _workletStats
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user