Commit Graph

23 Commits

Author SHA1 Message Date
admin 9436e66835 G4.3: double-buffer sandbox SHM - SandboxHostIPC writeSlot+2x256 double audio, latency 15.6ms, multi-instance no-xrun verified 2026-08-16 11:35:31 +07:00
admin 462a5104d2 G4.2: bridge-side plugin process pool — SandboxVst3Host spawns/respawns plugin_host.exe per channel, MIDI forward + audio snapshot + watchdog mute/respawn, crash isolation verified 2026-08-16 10:52:04 +07:00
admin 7de00955d8 G4.1: sandbox plugin host (plugin_host.exe) PoC — Nexus runs in child process, GUI + audio via SHM, crash isolation verified 2026-08-16 10:36:01 +07:00
admin 0b8e80fe2c G3.2+G3.3: classify hang/crash vs audio stall + SEH per-channel plugin crash isolation (mute channel) 2026-08-16 10:23:08 +07:00
admin 30fa98a441 G3.1: dedicated bridge heartbeat — watchdog liveness independent of audio loop 2026-08-16 10:04:16 +07:00
admin 4faa5a3504 G2.3: auto-reload instruments from state file after bridge respawn 2026-08-16 07:33:14 +07:00
admin 28441566c2 G2.1: save full instrument state to disk (path/type/preset/transport) 2026-08-16 07:28:17 +07:00
admin 1fe2d261fd G2.0: StateStore (JSON state file + atomic write) 2026-08-16 07:08:37 +07:00
admin 7629783298 G1.4: bo mute-when-editor-open - channelQuiet chi con reloading; xoa editorOpen machinery (g_editorOpen/g_editorPathCount/clear_editor_open/setEditorOpenPredicate); audio loop process() binh thuong khi editor mo 2026-08-15 21:28:16 +07:00
admin eac7f2feb8 G0.4: save/restore preset quanh reload khi close GUI (captureState/restoreState, memorystream link truc tiep) 2026-08-15 20:04:56 +07:00
admin 5313d85926 G0.3: watchdog giu 15s khi attach-in-flight (SHM flag) + RAII guard trong attach job (fix kill nham khi GUI mo) 2026-08-15 19:00:32 +07:00
admin f94b2fa757 wip walkthrough 2 bridge: jobEvent_/MsgWaitForMultipleObjects pump, SetThreadPriority + PowerThrottling, isBypassed silence quanh assign/unload, closeGUI view->removed(), reloadForGUI reuse instance, bo mute khi GUI mo, CoInitializeEx MTA — CHƯA verified: driver test 1/3 PASS (AV c0000005 Nexus!GetPluginFactory luc attachView ch5, nghi MTA/bo mute), exe deploy giu ban 0cec3d3 (28104a47) 2026-08-15 17:11:47 +07:00
admin 0cec3d3cce fix GUI VSTi trắng/không load: DPI per-monitor v2 + WS_CLIPCHILDREN + view->onSize() sau attached; restore API manager header/cpp (2596372 xoá nhầm) và deploy exe mới 2026-08-15 16:12:29 +07:00
admin af59aaf257 fix crash daw_vst_bridge khi đóng editor Nexus đang play: reload instance trong close job + silence same-plugin quanh createInstance/createView 2026-08-14 16:52:53 +07:00
admin 0696545ae9 fix: bridge crash/stall when opening native VST GUI while playing
- Fix A (USER32 crash): WM_CLOSE no longer destroys the native VST
  window from the main thread (plugin editor children live on the
  channel worker thread). WM_CLOSE -> hide + closeGUI on worker;
  WM_DESTROY erases registry. LOAD_INSTRUMENT close uses closeGUI +
  SW_HIDE, waits on hasAttachedView() instead of registry erase.
- Fix B: per-process SHM name SonicForge_DAW_IPC_{pid} so stale
  bridges from old builds can never attach to a new app's ring buffer.
- Fix C (stall): opening editor for a plugin whose other channel still
  has a live instance of the same DLL (Nexus) deadlocked the audio
  loop (reload+createView on worker while audio thread processed the
  other instance). Silence same-path channels via setReloading during
  reload/attach, restore afterwards; audio resumes.
- Rebuild bridge + update install/ portable package.
2026-08-14 14:36:34 +07:00
admin 35499b614c fix(bridge): VSTi GUI crash on instrument switch — PostMessage WM_CLOSE instead of cross-thread DestroyWindow
- LOAD job posts WM_CLOSE to window created on main thread (DestroyWindow from worker crashed 0xc000041d, muting all tracks)
- handleOpenGui + attach jobs skip when Vst3Instrument::hasAttachedView() (state_ && guiAttached_)
- attach failure posts WM_CLOSE; post_close_gui erases entry only when it points at the same hwnd
- cap openVstGuiRetry at 5 to stop frontend retry spam
2026-08-14 10:18:22 +07:00
admin f7f20e3a0a fix(bridge): stop leaves sound looping — EventList maxSize=50 drops STOP sweep note-offs
Root cause: Steinberg EventList defaults to maxSize=50 events. The STOP
all-notes-off sweep queues 128 note-offs per channel (16ch x 128 pitch),
so addEvent beyond 50 fails silently and the plugin never receives the
remaining note-offs — voices keep sustaining and the transport loops
forever until the bridge process is killed.

Fix: raise eventList.setMaxSize(4096) in loadPlugin. Also assign unique
noteIds per overlapping note-on (stack per pitch) so note-off releases
every voice at that pitch, and log addEvent result + channel in debug
output for verification.
2026-08-14 09:45:50 +07:00
admin 2c890aef54 fix(bridge): noteId match noteOn (0) for noteOff; create VST GUI window on main thread, attach on worker 2026-08-13 16:33:46 +07:00
admin 05e4244cc8 fix(bridge): one editor at a time + guard reload race
- Close other channels' editor windows before attaching a new one (Option B)
- needsReload()/setReloading() guard: skip processAudioBlock during
  terminate+reload teardown to avoid UAF/hang when reopening GUI
- Wait for editor registry cleanup (5s timeout) before creating window
2026-08-13 15:32:35 +07:00
admin c3eb0c9d16 fix: VST3 teardown under lock + re-attach hang + editor window on replace
- InstrumentEngineManager::assign: destroy replaced instrument OUTSIDE mu_
  (VST3 terminate/removed can block -> audio loop stall -> bridge Not
  Responding, transport stop hangs, notes never off)
- main.cpp LOAD job: DestroyWindow any open editor window of the channel
  before assign (replace VSTi -> SF2 with editor alive hung in removed())
- Vst3Instrument: reload() fresh plugin instance on second openGUI after
  close (Nexus etc. hang at view->attached() twice on same component)
2026-08-13 12:48:30 +07:00
admin 3f59c2c4c2 fix: SF2 bank select, midi multi-key cut, VSTi reopen hang, multi-track stuck
- NativeInstrumentEngine: track GM bank per channel (CC0/CC32), use bank in programChange
- app.jsx: send CC0/CC32+PROGRAM before notes via __ensureBridgeProgram, dedupe, clear dedupe after async LOAD
- audioRoutingEngine/bridgeAudioNode: idempotent connect (no disconnect-flush on re-connect), fixes note cut & multi-track stuck
- main.cpp: remove 10s poll in OPEN_GUI control job (blocked realtime loop, watchdog race), VstWindowProc stores channel not inst pointer, cleanup gui maps on WM_DESTROY
2026-08-13 12:19:34 +07:00
admin d8f8506077 fix: GUI VST native window qua bridge + audio path bridge (SF2 preview/play câm)
- open_vst_gui: bo WebviewWindowBuilder/thread, chi push_control type=4 (hwnd=0 -> bridge tao window)
- main.cpp: create_native_vst_window (class SonicForge_Native_VST3_Class, 800x600, khong TOPMOST),
  tao trong ChannelWorker job, map guiWindows, capture arg2 by value (fix dangling)
- app.jsx: guard isBridgeActive() 8 cho -> bridge active thi moi note di router -> pushEvent -> bridge
  (truoc day SF2 cam vi HAS_PYFLUIDSYNTH=FALSE -> /soundfont-render 501; VST3 path cu dung nativeSf/Carla)
- E2E: SF2 NOTE_ON qua dispatchMidiEvent -> SHM peak 0.029745; Nexus GUI native hwnd OK (license/preset)
- docs: TASKS.md + TEST_NOTES.md ghi batch fix + ket qua; gitignore vendor/junk
2026-08-12 22:12:43 +07:00
locpham c3368d0a91 feat: native host bridge integration — C++ bridge, Rust SHM, JS routing, build scripts, docs
- native_bridge/: InstrumentEngineManager multi-channel, sample-accurate, CC/program/pitchbend, transport, Vst3Instrument stub (HAVE_VST3SDK)
- src-tauri: shm.rs, bridge spawn + audio pump + health monitor, open_vst_gui, externalBin, commands
- app: UnifiedMidiRouter, NativeBridgeService, bridgeAudioNode, audioRoutingEngine, Plugin Manager UI, Bridge/WASM indicator, set_position sync
- build: 3 ps1 (force-added, build/ ignored), verify_bundle --check-bridge, CI workflow
- docs: TASKS.md, TEST_NOTES.md (Windows verify checklist), install/report updates
2026-08-11 23:37:29 +07:00