V45.14: diag preview_audio - dem bridge-audio frames 500ms sau note-on (tach engine render vs JS routing) v=202608311112
This commit is contained in:
@@ -2379,6 +2379,17 @@ function getAudioContext() {
|
||||
_dbgLog('play_first_audible', 'delta_ms=' + Math.round(performance.now() - _dbgPlayStartMs));
|
||||
}
|
||||
}
|
||||
try {
|
||||
if (window.__dbgPreviewAudioArmed) {
|
||||
const _p = window.__dbgPreviewAudioArmed;
|
||||
_p.count++;
|
||||
if (l && r) { for (var _j = 0; _j < l.length; _j++) { if (l[_j] !== 0 || r[_j] !== 0) { _p.nz++; break; } } }
|
||||
if (performance.now() - _p.t0 > 500) {
|
||||
_dbgLog('preview_audio', 'frames=' + _p.count + ' nz=' + _p.nz);
|
||||
window.__dbgPreviewAudioArmed = null;
|
||||
}
|
||||
}
|
||||
} catch (e) {}
|
||||
window.BridgeAudioNode.onAudio(l, r);
|
||||
} catch (e) {
|
||||
console.warn('[Bridge] audio callback error:', e && e.message || e);
|
||||
@@ -23821,6 +23832,9 @@ const App = () => {
|
||||
const _pdSub = subTabsRef.current ? (subTabsRef.current.find(s => s.id === _pdTab) || {}).type : null;
|
||||
_dbgLog('preview_diag', 'armed=' + armed.length + ' tab=' + _pdTab + ' sub=' + (_pdSub || 'none') + ' play=' + (isPlayingRef.current ? 1 : 0) + ' br=' + (window.SonicMidiRouter && window.SonicMidiRouter.isBridgeActive() ? 1 : 0) + ' fxRt=' + (fxRt.active ? 1 : 0) + ' dest=' + _pdDest + ' bd=' + (_pdD ? ('i=' + _pdD.initialized + ' wl=' + _pdD.useWorklet + ' nd=' + _pdD.hasWorkletNode + ' pre=' + _pdD.preBufferLen + ' ch=' + _pdD.chunksLen + ' g=' + _pdD.gain) : 'MISSING') + ' mb=' + (!!masterBus));
|
||||
} catch (e) {}
|
||||
// DIAG Bug 3/4: arm bo dem audio frames (500ms sau note-on) de biet
|
||||
// engine co gui audio ve JS khong (tach engine vs JS routing).
|
||||
try { window.__dbgPreviewAudioArmed = { count: 0, nz: 0, t0: performance.now() }; } catch (e) {}
|
||||
activeMidiPitchesRef.current.add(pitch);
|
||||
setActiveMidiPitches(new Set(activeMidiPitchesRef.current));
|
||||
vkbHeldRef.current.add(pitch);
|
||||
|
||||
Reference in New Issue
Block a user