Commit Graph

31 Commits

Author SHA1 Message Date
admin 351ee56080 fix(bridge): load dung VSTi theo track (V9) - bo early-return mui theo flag, load qua Tauri invoke khi co path, guard path sai (WaveObserver vs Nexus), chi mo GUI khi load OK; sync 6 ban JS + index.html ?v; kem cac fix bridge truoc (bugs 1-4, GUI restore) 2026-08-18 16:56:05 +07:00
admin bbb11f8066 Phase 1: import .vstpreset in offline render (loadSerializedState)
daw_vst_bridge --render now applies a VST3 preset when job has 'preset'
(base64 of a .vstpreset file). Parse the SDK binary chunk format with
PresetFile (vst3sdk), rewrap component/controller state into the bridge
blob [4B BE compLen][comp][4B BE ctrlLen][ctrl] and apply via
loadSerializedState before rendering. SF2/SFZ ignore preset (warning).
Bad base64/magic/chunks fail the job with rc 1 and no partial clip.

Tests: golden Nexus .vstpreset fixture; VST3 with/without preset,
bad preset -> rc 1, non-VST3 preset ignored. 20/20 pass.
2026-08-17 10:44:13 +07:00
admin 0cca84c5f9 feat(bridge): add --render offline CLI (Phase 0 of pedalboard replacement)
daw_vst_bridge --render <job.json> --out <clip.wav> renders MIDI notes
through the same instrument engines as realtime (SF2/SFZ/VST3/VST2) to a
16-bit stereo WAV, headless, no SHM. Mirrors plugins.py/vst_engine.py
note semantics (velocity int(vel*127), bank CC0 + program at t=0, beatSec
60/max(30,bpm), totalNeeded max(1024,endSample), no tail). Chunk clamped
to 256 to match VST3 host prepared buffers. Uses vendored sheredom json.h
(gated on HAVE_VST3SDK); rc: 0 ok, 1 arg/job error, 2 load fail, 3 crash.
Partial output removed on failure. Verified: SF2, SFZ, Nexus VST3 render
non-silent at exact duration; 9/9 tests pass.
2026-08-17 08:04:25 +07:00
admin 4111995a5c Add VST2 hosting to native bridge; fix CC7 data2 routing verified via SHM test
VST2 (Steinberg 2.4 ABI) host via Vst2Instrument: aeffect.h, dispatcher,
process events/replacing, kEffectStartProcess, headless GUI skip.
- create_instrument returns Vst2Instrument for InstrumentType::VST2
- 64B-aligned scratch buffers for SIMD plugins; SEH crash capture module+stack
- plugins.py: VST2 resolves .dll/.so; vst_engine.py reports VST2 type
- app.jsx: derive instrumentType from scan (VST3 vs VST2), not hardcoded
- Install exes refreshed from Release build

SF2 FluidSynth audio verified end-to-end through SHM ring (energy 1.33):
silence was a test-harness bug (CC7 value written to velocity field, bridge
reads data2) — app sends data2 correctly. All temporary diagnostics removed.
2026-08-17 07:55:46 +07:00
admin 98574aa0ea fix: ensure all daw_engine exit on app close (abrupt kill + LAN client open)
- desktop_engine: watchdog parent check via WaitForSingleObject(SYNCHRONIZE)
  instead of OpenProcess — killed parents linger as zombie objects, OpenProcess
  succeeds forever and watchdog never fires; hard-exit after 5s if graceful
  shutdown hangs (open LAN connection)
- lib.rs: Destroyed handler sweeps any orphan daw_engine/daw_vst_bridge by
  image name before exit(0), covering manual-launch and stale engines
2026-08-16 21:18:21 +07:00
admin 7bcaf19c28 feat(vst-gui): open VST3 GUI while playing (level 1)
- main.cpp: drop transportStopped defer in handleOpenGui (G0.1 legacy);
  G0.1b setReloading-before-job + single UiThread (G1.2) block the
  2-thread-1-DLL race. GUI opens immediately during PLAY, short mute
  (~0.1-0.3s first time, hasAttachedOnce_ false so reloadForGUI skips
  reload); notes already sounding are kept. Reopen after close still
  reloads (1-3s mute) - level 2 not feasible.
- app.jsx: remove !isPlayingRef.current guard before openNativeGUI in
  loadTrackInstrumentToBridge.
- rebuild app.precompiled.js + daw_vst_bridge.exe.
2026-08-16 17:27:38 +07:00
admin 56d8c577aa deploy: sonicforge-daw.exe V10 (drag-drop fix build) 2026-08-16 16:23:37 +07:00
admin c29e024372 fix: stale-reload watchdog — force-unmute channel stuck in reloading >20s (60s if close/attach in flight) (V9) 2026-08-16 16:15:41 +07:00
admin b6950d6418 fix: MIDI keyboard preview silent after transport STOP — live flag bypass guard (V8) 2026-08-16 15:43:23 +07:00
admin 2d63774474 rebuild clean from scratch: native bridge + tauri + engine bundle (F6 Cap 2 in deployed engine) 2026-08-16 15:11:10 +07:00
admin 761b48e41f fix 5.2 audit findings on Windows: F-PROC-1 injection, F-MEM-5 UAF, F-PROC-2 restart race, F-PROC-3, F5, F6 2026-08-16 12:29:42 +07:00
admin 6c19f17b61 deploy: plugin_host.exe idle-skip build 2026-08-16 11:45:02 +07:00
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 700f612674 chore: commit G3.2+G3.3 deploy binaries + debug scripts; ignore debug run artifacts 2026-08-16 10:27:36 +07:00
admin d31312e824 G2.2: flush bridge state to disk before kill (control type=5 DUMP + Rust pre-kill) 2026-08-16 07:52:01 +07:00
admin c2ae452844 G2.4: skip redundant LOAD of already-loaded instrument (keep restored preset) 2026-08-16 07:47:53 +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 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 b92c85ec73 G1.3: bo pump gate cu (is_teardown_window/g_ownerTid/g_juceOwnerTids/g_tidToWorker/post_and_wait) — 1 UiThread khong con race teardown-pump; CBT hook chi tren UiThread; destroy_window_on_owner destroy truc tiep 2026-08-15 21:18:49 +07:00
admin 9e6e72ac27 G1.2: 1 UiThread chung thay 16 ChannelWorker (COM STA + message pump + job queue); window+attach job tren UiThread; audio loop bo PeekMessageW; Option B close dong bo qua close_editor_now 2026-08-15 21:02:18 +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 18394807a9 fix GUI VSTi khi PLAY: defer OPEN_GUI + silence same-path truoc attach (G0.1) 2026-08-15 18:44:02 +07:00
admin 2890856d70 deploy exe fix GUI VSTi (9f1dc37c) vao install/ 2026-08-15 17:50:29 +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 90241f626f fix crash daw_vst_bridge 0xc000041d khi mở GUI Nexus rồi switch sang Ample: over-gate JUCE message window (g_juceOwnerTids, chỉ chạy khi close_in_flight) + gỡ VEH tạm và mọi log [dbg] chẩn đoán, giữ [NativeBridge] production; deploy exe FINAL (đã verify 3 run driver) 2026-08-15 11:35:50 +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 a1bbf549b7 build: commit compiled native bridge + libs + app shell into install/ — daw_engine (~1.8GB) built locally via build_install.ps1 2026-08-14 11:30:26 +07:00