fix(fxrt): mo GUI VST khong gay crackle - GUI spawn BELOW_NORMAL, mien watchdog khi mo native GUI, realtime loop ABOVE_NORMAL

This commit is contained in:
2026-08-24 16:38:52 +07:00
parent 9137e7e276
commit 3a3f46b7d3
7 changed files with 52 additions and 13 deletions
+5
View File
@@ -162,6 +162,11 @@ int run_realtime_fx_loop(const std::string& jobPath, const std::string& shmName,
// cuối. (winmm đã link sẵn — CMakeLists fx_vst_bridge.)
#ifdef _WIN32
timeBeginPeriod(1);
// Thread audio realtime ABOVE_NORMAL: khong bi tien trinh NORMAL khac
// (fx-gui spawn + VST load instance thu 2, native VSTi GUI open...) preempt
// -> underrun -> am bi "bop nghet"/ngat quan. ChannelWorker (main.cpp)
// da dung THREAD_PRIORITY_ABOVE_NORMAL.
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL);
#endif
// Chờ chain ĐẦU TIÊN được worker build xong (gen>=1) trước khi READY.
// setChain() là ASYNC — worker thread load VST3 + preset mất 1-4s; nếu set