From 01584f50daf381cd6dafb41e65c479e02562c7f3 Mon Sep 17 00:00:00 2001 From: Shawn Date: Sat, 20 Jun 2026 16:15:12 -0400 Subject: [PATCH] Initialize MixerEngine on startup (BB-6) Add MixerEngine creation and wiring after model.Load() in main.cpp. The mixer engine now gets created with current audio settings (sample rate, buffer size from JackServerSettings), activated, and attached to the model. This enables WebSocket mixer commands (mixerGetState, mixerAddChannel, mixerAddBus, etc.) to work through /pipedal endpoint. Missing initialization was the root cause of 'Invalid format' errors when sending mixer commands via WebSocket. --- src/main.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 7027685..5ef7288 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -29,6 +29,7 @@ #include "WebServerConfig.hpp" #include #include "PiPedalSocket.hpp" +#include "MixerEngine.hpp" #include "PluginHost.hpp" #include #include @@ -451,6 +452,18 @@ int main(int argc, char *argv[]) model.Load(); + // Initialize Band-in-a-Box mixer engine + { + auto mixerEngine = std::make_shared(); + // Configure with current audio settings + auto jackSettings = model.GetJackServerSettings(); + mixerEngine->setSampleRate((uint32_t)jackSettings.GetSampleRate()); + mixerEngine->setMaxBufferSize((size_t)jackSettings.GetBufferSize()); + mixerEngine->Activate(); + model.SetMixerEngine(mixerEngine); + Lv2Log::info("MixerEngine initialized (BB-6)"); + } + auto pipedalSocketFactory = MakePiPedalSocketFactory(model); server->AddSocketFactory(pipedalSocketFactory);