Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/p1-windows.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Windows Native VST3 Host
on:
push:
branches: [ main, feature/p1-first-sound-windows, feature/p2-native-vst-catalog-fx-rack, feature/p2-daw-workflow-progress, fix/p2-native-output-monitor-diagnostics, fix/p2-realtime-glitch-telemetry-latest-gui, fix/p2-truthful-meter-pan-fx-toggle, feature/p2-native-state-presets ]
branches: [ main, feature/p1-first-sound-windows, feature/p2-native-vst-catalog-fx-rack, feature/p2-daw-workflow-progress, fix/p2-native-output-monitor-diagnostics, fix/p2-realtime-glitch-telemetry-latest-gui, fix/p2-truthful-meter-pan-fx-toggle, feature/p2-native-state-presets, fix/p2-fabfilter-add-workflow ]
pull_request:
workflow_dispatch:

Expand Down Expand Up @@ -35,6 +35,7 @@ jobs:
node --check web/app.js
node --test tests/native_ui_contract_test.mjs
node --test tests/native_preset_contract_test.mjs
node --test tests/fx_add_contract_test.mjs
- name: Configure Windows x64
shell: pwsh
run: >
Expand All @@ -54,13 +55,13 @@ jobs:
Where-Object { $_.Name -like "*AR*Mix*" -and $_.FullName -match 'Release' } |
Select-Object -First 1
if (-not $exe) { throw "ARMixConsole EXE not found" }
Copy-Item $exe.FullName "dist/ArSonMix-P2-Native-Presets.exe"
Copy-Item $exe.FullName "dist/ArSonMix-P2-FX-Compatibility.exe"
Copy-Item README.md "dist/README.md"
"P2 experimental: audio routes automatically; use headphones at low level. Only Channel 1 is native. Other strips are inactive previews." |
Out-File -FilePath dist/FIRST_SOUND_README.txt -Encoding utf8
- uses: actions/upload-artifact@v4
with:
name: ArSonMix-P2-Native-Presets-Windows-x64
name: ArSonMix-P2-FX-Compatibility-Windows-x64
path: dist/
if-no-files-found: error
retention-days: 14
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ juce_add_gui_app(ARMixConsole
juce_add_binary_data(ARMixAssets SOURCES
web/index.html web/styles.css web/app.js web/bridge.js web/monitor.js)

target_sources(ARMixConsole PRIVATE src/Main.cpp src/LiveAudioEngine.h src/PluginCatalog.h src/DiagnosticsRecorder.h src/StereoPan.h src/NativePresetArchive.h)
target_sources(ARMixConsole PRIVATE src/Main.cpp src/LiveAudioEngine.h src/PluginCatalog.h src/DiagnosticsRecorder.h src/StereoPan.h src/NativePresetArchive.h src/VstBusLayout.h)
target_compile_definitions(ARMixConsole PRIVATE
JUCE_WEB_BROWSER=1
JUCE_USE_WIN_WEBVIEW2=1
Expand Down
23 changes: 23 additions & 0 deletions docs/P2_FABFILTER_FX_COMPATIBILITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# P2.4.1 — VST3 Add FX compatibility and failure diagnostics

Hardware report: FabFilter plugins appear in installed VST3 catalog, but pressing ADD has no visible effect.

## Source audit and fixes
- Confirmed UX defect: Native engine previously emits loading errors as a toast obscured by the Add VST3 modal; a failed insert looks like no response.
- Confirmed compatibility restriction: the host always called `setBusesLayout` with exactly one stereo input and one stereo output, potentially rejecting VST3s with an auxiliary sidechain bus or already valid default layout. Now it preserves the plugin's existing compatible main stereo bus layout, or negotiates stereo main with optional auxiliary buses disabled.
- Plugin creation still runs synchronously in the UI message thread; an indeterminate "Loading…" indicator is painted before calling JUCE, but long/blocked third-party VST creation remains possible.
- New native result event `arMixAddResult` sends result/error, elapsed time, request ID and chain size. Failures stay visible **inside** the Add FX dialog, with a diagnostic log event `FX_LOAD_FAIL`.
- Both adding a plugin and restoring a native preset apply the same bus negotiation.

## Trial
1. Use the new Windows artifact in PR; open **MIX → ADD FX**, search FAB.
2. Choose FabFilter Pro-C 2, Pro-Q or Pro-DS. Observe Loading… status, then insert success or visible exact error.
3. On success, the plugin appears in Channel 1 live rack; click its name to open native UI; toggle power to bypass. Test with headphones at low volume.
4. On failure, copy the full text of the red FX NOT LOADED message and open **SIGNAL CHECK → OPEN DIAGNOSTIC LOG**. Attach log for class/bus/plugin-specific diagnosis.
5. Test at least one previously working ArSonKuPik and native preset Save/Recall to prevent regression.

## Remaining risks
- No real FabFilter VST3 binary and license is available to CI. Windows build GREEN does **not** prove vendor-specific runtime compatibility.
- Creating VSTs remains synchronous on the host message thread, so slow initialization may stall even with a Loading state. True off-thread staging plus graph swap is subsequent ARD work.
- Scanner is a worker thread, not a separate crash-isolated process.
- Host processes exactly one native stereo Channel 1 path; other mixer strips remain previews.
17 changes: 7 additions & 10 deletions src/LiveAudioEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <juce_audio_processors/juce_audio_processors.h>
#include "StereoPan.h"
#include "NativePresetArchive.h"
#include "VstBusLayout.h"
#include <array>
#include <atomic>
#include <cmath>
Expand Down Expand Up @@ -142,11 +143,9 @@ class LiveAudioEngine final : private juce::AudioIODeviceCallback
if (! instance)
return "Failed to instantiate VST3: " + error;

juce::AudioProcessor::BusesLayout layout;
layout.inputBuses.add (juce::AudioChannelSet::stereo());
layout.outputBuses.add (juce::AudioChannelSet::stereo());
if (! instance->setBusesLayout (layout))
return "P2 accepts stereo-in/stereo-out effects; plugin bus layout is incompatible";
const auto busError = armix::vst::prepareStereoEffectLayout (*instance);
if (busError.isNotEmpty())
return chosen->name + ": " + busError;

detach();
Slot node;
Expand Down Expand Up @@ -242,11 +241,9 @@ class LiveAudioEngine final : private juce::AudioIODeviceCallback
juce::String error;
auto processor = formats_.createPluginInstance (*match, rate, buffer, error);
if (!processor) return "Cannot open preset plugin " + fx.name + ": " + error;
juce::AudioProcessor::BusesLayout layout;
layout.inputBuses.add (juce::AudioChannelSet::stereo());
layout.outputBuses.add (juce::AudioChannelSet::stereo());
if (!processor->setBusesLayout (layout))
return "Unsupported VST3 stereo bus: " + fx.name;
const auto busError = armix::vst::prepareStereoEffectLayout (*processor);
if (busError.isNotEmpty())
return "Unsupported VST3 bus layout for " + fx.name + ": " + busError;
try
{
// State is restored before insertion; live audio still uses the
Expand Down
63 changes: 56 additions & 7 deletions src/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,22 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr
browser_.emitEventIfBrowserIsVisible ("arMixCatalog", catalog_.snapshot());
}

// Every plugin insert request gets a structured result. A toast behind
// a modal is not an actionable failure report for live performers.
void emitFxAddResult (int requestId, const juce::String& name,
const juce::String& error, unsigned int elapsedMs)
{
auto response = std::make_unique<juce::DynamicObject>();
response->setProperty ("requestId", requestId);
response->setProperty ("name", name);
response->setProperty ("ok", error.isEmpty());
response->setProperty ("error", error);
response->setProperty ("elapsedMs", static_cast<int> (elapsedMs));
response->setProperty ("chainSize", engine_.chainSize());
if (browser_.loaded)
browser_.emitEventIfBrowserIsVisible ("arMixAddResult", juce::var (response.release()));
}

void emitPresets()
{
if (browser_.loaded)
Expand Down Expand Up @@ -369,13 +385,46 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr
}
else if (action == "addCatalog")
{
const auto* plugin = catalog_.find (args.getProperty ("id", {}).toString());
if (!plugin)
return emitNotice ("Plugin not found in catalog. Rescan your VST3 folders.", true);
editorWindow_.reset();
const auto error = engine_.addVst3 (plugin->path, plugin->uid, plugin->key());
if (error.isNotEmpty()) { diagnostics_.record ("FX_LOAD_FAIL", plugin->name + ": " + error); emitNotice (error, true); }
else { diagnostics_.record ("FX_LOAD", plugin->name + " (callback reattached)"); emitChain(); emitNotice (plugin->name + " inserted. Live chain changes may briefly interrupt audio."); }
const auto requestId = static_cast<int> (args.getProperty ("requestId", 0));
const auto requestedId = args.getProperty ("id", {}).toString();
const auto* plugin = catalog_.find (requestedId);
const auto name = plugin != nullptr ? plugin->name : juce::String ("Unknown VST3");
const auto started = juce::Time::getMillisecondCounter();
juce::String error;

if (plugin == nullptr)
error = "Plugin is no longer in the catalog. Rescan in PLUGINS and try again.";
else
{
diagnostics_.record ("FX_ADD_REQUEST", name + " | " + plugin->path);
editorWindow_.reset();
try
{
error = engine_.addVst3 (plugin->path, plugin->uid, plugin->key());
}
catch (const std::exception& ex)
{
error = "VST3 instantiation threw an exception: " + juce::String (ex.what());
}
catch (...)
{
error = "VST3 instantiation failed with an unknown exception";
}
}
const auto elapsed = juce::Time::getMillisecondCounter() - started;
emitFxAddResult (requestId, name, error, elapsed);
if (error.isNotEmpty())
{
diagnostics_.record ("FX_LOAD_FAIL", name + " | " + error +
" | elapsedMs=" + juce::String (elapsed));
emitNotice (name + ": " + error, true);
}
else
{
diagnostics_.record ("FX_LOAD", name + " | elapsedMs=" + juce::String (elapsed));
emitChain();
emitNotice (name + " inserted into Channel 1 FX Rack.");
}
}
else if (action == "fxRemove")
{
Expand Down
64 changes: 64 additions & 0 deletions src/VstBusLayout.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// SPDX-License-Identifier: AGPL-3.0-only
#pragma once
#include <juce_audio_processors/juce_audio_processors.h>

// Non-RT only. The host processes a 2-channel scratch block. Keep the
// plugin's already-compatible main stereo buses unchanged, rather than
// unconditionally forcing a new layout (which can fail for VST3s with
// optional sidechain/auxiliary buses).
namespace armix::vst
{
inline juce::String describeBuses (const juce::AudioProcessor::BusesLayout& layout)
{
juce::String text;
const auto describe = [] (const juce::Array<juce::AudioChannelSet>& buses)
{
juce::StringArray names;
for (const auto& bus : buses)
names.add (juce::String (bus.size()) + "ch");
return names.joinIntoString (",");
};
return "inputs [" + describe (layout.inputBuses) + "], outputs [" +
describe (layout.outputBuses) + "]";
}

inline juce::String prepareStereoEffectLayout (juce::AudioProcessor& processor)
{
if (processor.getBusCount (true) < 1 || processor.getBusCount (false) < 1)
return "VST3 has no main input or output bus";

auto original = processor.getBusesLayout();
if (original.inputBuses.isEmpty() || original.outputBuses.isEmpty())
return "VST3 reports missing main bus layout";
const auto stereo = juce::AudioChannelSet::stereo();
const auto disabled = juce::AudioChannelSet::disabled();
const auto compatible = [&stereo, &disabled] (const juce::AudioProcessor::BusesLayout& l)
{
if (l.inputBuses.isEmpty() || l.outputBuses.isEmpty() ||
l.inputBuses[0] != stereo || l.outputBuses[0] != stereo) return false;
for (int i = 1; i < l.inputBuses.size(); ++i)
if (l.inputBuses[i] != disabled) return false;
for (int i = 1; i < l.outputBuses.size(); ++i)
if (l.outputBuses[i] != disabled) return false;
return true;
};

// Working defaults (common in FabFilter and other commercial VST3s)
// must not be reset just because the host wants stereo.
if (compatible (original)) return {};

auto requested = original;
requested.inputBuses.set (0, stereo);
requested.outputBuses.set (0, stereo);
for (int i = 1; i < requested.inputBuses.size(); ++i)
requested.inputBuses.set (i, disabled);
for (int i = 1; i < requested.outputBuses.size(); ++i)
requested.outputBuses.set (i, disabled);

if (processor.setBusesLayout (requested) &&
compatible (processor.getBusesLayout())) return {};

return "Stereo main bus could not be negotiated (existing " +
describeBuses (original) + "). This host requires stereo in/out with optional sidechains disabled.";
}
} // namespace armix::vst
30 changes: 30 additions & 0 deletions tests/fx_add_contract_test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// SPDX-License-Identifier: AGPL-3.0-only
// Regression guard for nonresponsive ADD FX clicks and VST3 stereo/sidechain.
import test from 'node:test';
import assert from 'node:assert/strict';
import {readFileSync} from 'node:fs';
const js=readFileSync('web/bridge.js','utf8');
const host=readFileSync('src/Main.cpp','utf8');
const dsp=readFileSync('src/LiveAudioEngine.h','utf8');
const layout=readFileSync('src/VstBusLayout.h','utf8');

test('every ADD click identifies request and reports result inside the open selector',()=>{
assert.match(js,/send\("addCatalog",\{id,requestId\}\)/);
assert.match(js,/backend\.addEventListener\("arMixAddResult"/);
assert.match(js,/nativeAddFeedback/);
assert.match(js,/FX NOT LOADED:/);
assert.match(js,/if\(result\.ok\)hideDialog\("nativeFxSelector"\)/);
assert.match(host,/emitFxAddResult \(requestId, name, error, elapsed\)/);
assert.match(host,/FX_LOAD_FAIL/);
});
test('plugin load and preset restore both negotiate existing VST3 bus layouts',()=>{
assert.equal((dsp.match(/prepareStereoEffectLayout/g)||[]).length,2);
assert.match(layout,/if \(compatible \(original\)\) return \{\};/);
assert.match(layout,/requested\.inputBuses\.set \(i, disabled\)/);
assert.match(layout,/processor\.setBusesLayout \(requested\)/);
});
test('GUI paints actual indeterminate feedback before synchronous plugin instantiate',()=>{
assert.match(js,/requestAnimationFrame\(\(\)=>requestAnimationFrame\(\(\)=>send\("addCatalog"/);
assert.match(js,/aria-live="polite"/);
assert.match(js,/state\.adding=true/);
});
Loading
Loading