fix: SF2 sound (audio sink FIFO underrun) + VST3 native GUI open + GUI load race

- bridgeAudioNode: ScriptProcessor 4096 drained only 1 of 16 blocks -> ~94% silence; now drains all queued blocks per callback, RING_DEPTH 8->24
- app.jsx: openNativeGUI had NO caller; wire after VST3 loadInstrument OK in track Synth dropdown + Plugin Manager Load Bridge
- main.cpp: OPEN_GUI polls up to 10s for LOAD completion (worker thread) before attach - fixes race 'no instrument loaded'
- index.html: bump bridgeAudioNode/app.precompiled cache versions
This commit is contained in:
locpham
2026-08-12 22:32:10 +07:00
parent aac0f03e20
commit 36fb546d58
7 changed files with 94 additions and 194 deletions
+9 -2
View File
@@ -295,9 +295,16 @@ int main(int argc, char* argv[]) {
// cho openGUI lai tao COM apartment moi, con plugin thi song o
// apartment cu da chet (load thread exit) -> Nexus attached()
// hang (gui_probe: bridge_like treo, same_thread OK).
// LOAD va OPEN_GUI duoc drain trong cung vong lap: LOAD post job
// len worker (async, VST3 init co the mat giay) truoc khi type=4
// duoc xu ly — khong doi, instruments.get() con rong -> "no
// instrument loaded". Poll toi da 10s cho LOAD hoan tat.
uint32_t guiCh = 16;
for (uint32_t ch = 0; ch < 16; ++ch) {
if (instruments.get(ch)) { guiCh = ch; break; }
for (int tries = 0; tries < 200 && guiCh == 16; ++tries) {
for (uint32_t ch = 0; ch < 16; ++ch) {
if (instruments.get(ch)) { guiCh = ch; break; }
}
if (guiCh == 16) sleep_ms(50);
}
if (guiCh == 16) {
std::cerr << "[NativeBridge] GUI attach FAILED hwnd=" << c.arg1