G3 deploy: mac dinh dung JUCE bridge + bundle juce_fx_bridge vao engine

This commit is contained in:
2026-08-28 16:21:12 +07:00
parent 6cbdbd8e9c
commit bf74a0be4f
5 changed files with 44 additions and 16 deletions
+6 -4
View File
@@ -26,7 +26,7 @@ import uuid
import numpy as np
from app.config import settings
from app.core.native_render import find_fx_bridge_exe
from app.core.native_render import find_fx_bridge_exe, find_juce_fx_bridge_exe
FXRT_MAGIC = 0x46585254
FXRT_BLOCK = 256
@@ -164,9 +164,11 @@ class FxRealtimeSession:
def _spawn(self):
juce_exe = os.getenv("SF_JUCE_FX_BRIDGE_PATH", "").strip()
exe = juce_exe or find_fx_bridge_exe()
# G3: mặc định dùng JUCE bridge (latency graph thật + processed samples);
# fallback bridge cũ khi không có exe JUCE (regression an toàn).
exe = juce_exe or find_juce_fx_bridge_exe() or find_fx_bridge_exe()
if not exe:
raise RuntimeError("Không tìm thấy fx_vst_bridge.exe")
raise RuntimeError("Không tìm thấy bridge exe (juce_fx_bridge / fx_vst_bridge)")
job = {
"sample_rate": self.sample_rate,
"block_size": self.block_size,
@@ -176,7 +178,7 @@ class FxRealtimeSession:
fd, self._job_path = tempfile.mkstemp(suffix=".json", prefix="fxrt_")
with os.fdopen(fd, "w", encoding="utf-8") as f:
json.dump(job, f)
if juce_exe:
if os.path.basename(exe).lower().startswith("juce_fx_bridge"):
cmd = [exe, "--juce-fx", self._job_path, "--shm", self.name,
"--parent", str(os.getpid())]
else: