Synchronize realtime data with display frames

This commit is contained in:
Mikei386
2026-08-05 20:10:02 +02:00
parent feec2bac56
commit c6a1037611
3 changed files with 55 additions and 75 deletions
+5 -1
View File
@@ -23,7 +23,7 @@ try {
import { CONFIG, applyRtaBpoSelection, loadConfig, saveConfig, loadLayoutPreset } from './core/config.js';
import * as utils from './core/utils.js';
import { meterFacade, registerMeter } from './core/registry.js';
import { initAudio, audioLost, reloadAudio } from './core/audio.js';
import { initAudio, audioLost, reloadAudio, flushPendingPhoenixData } from './core/audio.js';
import { createScreensaver } from './core/screensaver.js';
// Views
@@ -2675,6 +2675,10 @@ async function maybeRecoverAudio(reason) {
async function loop(now){
const elapsed = now - lastFrameTime;
// Apply all newest transport states once, immediately before this display
// frame reads them. WebSocket callbacks only buffer; this is the sole
// presentation pump for metrics, visuals and spectrogram data.
await flushPendingPhoenixData(env, CONFIG);
const audioOk = env.audio.alive && !audioLost(env);
const renderStyle = getRenderableStyle();
if (processingProfileDirty || appliedProcessingProfileView !== renderStyle) {