fix(fx-rt): het crackle master FX - engine gui block ASAP + worklet FILL buffer 8
_pump_output bo pace realtime (truoc: moi block send cach nhau block_sec lam client queue ~1 -> jitter bridge/WS/GC -> queue can -> zero-fill crackle). Gio gui het burst ASAP; worklet sf-fx-realtime them FILL=8: chi phat khi outQueue >= 8 block, underrun -> re-buffer (im lang cho du FILL) thay vi zero-fill lien tuc. Cap 32 giu nguyen. PDC: FX_RT_ROUNDTRIP_SAMPLES 1792->3840 (RTT ~7 block + FILL 8 block = 15 block @48k) de dry-bypass path khong lech pha voi mastered. Cache-buster v=202608212401 (precompiled + worklet). Rebuild PyInstaller + copy 3 noi deploy. Verify: probe crackle3 25s Ozone rebuffer_events=0 (zero_fill 12 block = startup fill), picker UI PASS (59 VST).
This commit is contained in:
@@ -1711,7 +1711,7 @@ async function fxRtStart() {
|
||||
fxRt.sessionId = st.session_id;
|
||||
fxRtGuiPushShm();
|
||||
try {
|
||||
await ctx.audioWorklet.addModule(`${API_BASE_URL}/static/js/sf-fx-realtime.js?v=202608212400`);
|
||||
await ctx.audioWorklet.addModule(`${API_BASE_URL}/static/js/sf-fx-realtime.js?v=202608212401`);
|
||||
fxRt.node = new AudioWorkletNode(ctx, 'sf-fx-realtime', { numberOfInputs: 1, numberOfOutputs: 1, outputChannelCount: [2] });
|
||||
const u = new URL(API_BASE_URL);
|
||||
const wsProto = u.protocol === 'https:' ? 'wss://' : 'ws://';
|
||||
@@ -1819,10 +1819,11 @@ function fxRtStop(silent) {
|
||||
// Master chain (worklet → bridge VST3) trễ ~2 block round-trip + latency
|
||||
// plugin. Track bypass mastering đi dry path (dryInput→dryOutput→output) KHÔNG
|
||||
// qua worklet → lệch pha với mastered. fxRtApplyPdc trễ dry path đúng lượng
|
||||
// để align. FX_RT_ROUNDTRIP_SAMPLES là ước lượng (~2 block 256 @44.1k) —
|
||||
// ponytail: đo RTT thật (tag seq trên block) khi cần sample-accurate.
|
||||
// Batching 4 block làm RTT ~7 block (~40ms @48k) → 1792.
|
||||
const FX_RT_ROUNDTRIP_SAMPLES = 1792;
|
||||
// để align. FX_RT_ROUNDTRIP_SAMPLES là ước lượng — ponytail: đo RTT thật
|
||||
// (tag seq trên block) khi cần sample-accurate.
|
||||
// RTT = batching 4 block (~7 block @48k ≈ 1792) + FILL buffer 8 block (2048)
|
||||
// — worklet chỉ phát khi queue ≥ FILL → latency tĩnh thêm FILL → 15 block.
|
||||
const FX_RT_ROUNDTRIP_SAMPLES = 3840;
|
||||
function fxRtApplyPdc() {
|
||||
const ctx = getAudioContext();
|
||||
const bus = masterBus;
|
||||
@@ -23679,7 +23680,7 @@ const App = () => {
|
||||
fxRtTracks[key] = entry;
|
||||
fxRtGuiPushShm();
|
||||
try {
|
||||
await ctx.audioWorklet.addModule(`${API_BASE_URL}/static/js/sf-fx-realtime.js?v=202608212400`);
|
||||
await ctx.audioWorklet.addModule(`${API_BASE_URL}/static/js/sf-fx-realtime.js?v=202608212401`);
|
||||
const node = new AudioWorkletNode(ctx, 'sf-fx-realtime', { numberOfInputs: 1, numberOfOutputs: 1, outputChannelCount: [2] });
|
||||
entry.node = node;
|
||||
const u = new URL(API_BASE_URL);
|
||||
|
||||
Reference in New Issue
Block a user