I’m writing a multibus plugin that will have a strict 8in - 8out bus layout. Everything works fine under VST, but AU has issues.
Here’s the relevant code snippets.
// PluginProcessor.cpp
#define JucePlugin_MaxNumInputChannels 8
#define JucePlugin_MaxNumOutputChannels 8
#define JucePlugin_PreferredChannelConfigurations {8, 8}
#define MAX_OUTS 8
// PluginProcessor.cpp
AudioPluginAudioProcessor::AudioPluginAudioProcessor()
: AudioProcessor(
BusesProperties()
.withInput("Input #1", juce::AudioChannelSet::stereo(), true)
.withInput("Input #2", juce::AudioChannelSet::stereo(), true)
.withInput("Input #3", juce::AudioChannelSet::stereo(), true)
.withInput("Input #4", juce::AudioChannelSet::stereo(), true)
.withInput("Input #5", juce::AudioChannelSet::stereo(), true)
.withInput("Input #6", juce::AudioChannelSet::stereo(), true)
.withInput("Input #7", juce::AudioChannelSet::stereo(), true)
.withInput("Input #8", juce::AudioChannelSet::stereo(), true)
.withOutput("Output #1", juce::AudioChannelSet::stereo(), true)
.withOutput("Output #2", juce::AudioChannelSet::stereo(), true)
.withOutput("Output #3", juce::AudioChannelSet::stereo(), true)
.withOutput("Output #4", juce::AudioChannelSet::stereo(), true)
.withOutput("Output #5", juce::AudioChannelSet::stereo(), true)
.withOutput("Output #6", juce::AudioChannelSet::stereo(), true)
.withOutput("Output #7", juce::AudioChannelSet::stereo(), true)
.withOutput("Output #8", juce::AudioChannelSet::stereo(), true)
)
{
// constructor stuff
}
bool AudioPluginAudioProcessor::isBusesLayoutSupported(
const BusesLayout& layouts) const
{
const int numInputs = layouts.getMainInputChannels();
const int numOutputs = layouts.getMainOutputChannels();
return numInputs == MAX_OUTS && numOutputs == MAX_OUTS;
}
With the code as above, auval reports
Reported Channel Capabilities (explicit):
[2, 2] [8, 8]
.....
ERROR: -10868 IN CALL Cannot Set Input Num Channels:2 when unit says it can
ca_require: ValidFormat(inScope, inElement, newDesc) InvalidFormat /Users/beserge/Development/plugin/lib/JUCE/modules/juce_audio_plugin_client/AU/CoreAudioUtilityClasses/AUBase.cpp:871
ERROR: Cannot verify Audio Channel Layouts as Format handling has problems
(Where does it get the idea that [2,2] should work?)
If I always return true in isBusesLayoutSupported
, then we pass validation, but crash during the Render Tests
.
If I get rid of isBusesLayoutSupported
entirely, we pass auval with [0,-1] as the supposed configuration, but then Logic only allows the plugin to start as Stereo or Dual Mono, both of which a.) are not what I want, and b.) cause the plugin to crash.
I’ve tried the canAddBus canRemoveBus overrides as well, but I don’t want dynamic busses, so I just had them return false. Doesn’t seem to help.
Lmk if you have any suggestions or questions, and thanks for the help!
Edit: As I understand it I want 8 IO busses, with 2 channels each (i.e. Stereo Layout, which is what I configured above). Should I check layouts.inputBuses.size() == MAX_OUTS
? I tried that as well but it doesn’t work.
auval reports [-1,-2] and crashes on the Render Test.