We have an upcoming plugin that uses multiple output buses. The ideal layout is a stereo input, a stereo sidechain input, a stereo output, and then a low/mid/high stereo output. In total 2 buses in, 4 buses out. In a situation where a host doesn’t allow for multiple outputs/inputs we revert to stereo (or mono) in, stereo (or mono) out.
This seems to all be working correctly except in Pro Tool when a user uses the plugin in Audio Suite. We then get a hard crash in the juce AAX wrapper where it’s trying to clear output busses 2/3/4. I assume there’s an issue where Audio Suite instances of a plugin can’t use multiple output buses. We’d be fine not allowing this in Audio Suite but I can’t figure out a way to disable it without also disabling it for normal PT situations.
Additionally, what is the relationship between specifying desired bus configurations in the plugin processor constructor vs. saying explicitly what is/isn’t allowable in the overridden isBusesLayoutSupported function? We currently both suggest the optimal layout AND use the isBusesLayoutSupported function, however I’m seeing that some hosts don’t seem to use isBusesLayoutSupported at all (juce plugin host for instance).
What is the preferred method to specify something like this (i.e. use stereo+sidechain in, stereo + low + mid + high out preferably, however if that’s not available then use stereo+sidechain in, stereo out OR if that’s not available just use stereo in, stereo out)? And of course the same would go for mono, just with less inputs/outputs.
The relevant crash is here where the AAX wrapper is trying to clear bus 1 and gets a bad access:
Here is a copy of what our constructor suggested bus layout looks like:
UAPluginProcessor(BusesProperties().withInput (“Input”, AudioChannelSet::stereo())
.withOutput (“Output”, AudioChannelSet::stereo())
.withOutput (“Low”, AudioChannelSet::stereo())
.withOutput (“Mid”, AudioChannelSet::stereo())
.withOutput (“High”, AudioChannelSet::stereo())
.withInput (“Sidechain”, AudioChannelSet::stereo()))
Here is a copy of what our isBusesLayoutSupported function looks like:
int input = layouts.getMainInputChannelSet().size();
int sidechain = layouts.getChannelSet(true, 1).size();
int output = layouts.getChannelSet(false, 0).size();
int outputBusses = layouts.outputBuses.size();
//AudioChannelSet::stereo()
if (layouts.getMainInputChannelSet() == AudioChannelSet::disabled()
|| layouts.getMainOutputChannelSet() == AudioChannelSet::disabled())
{
return false;
}
if(layouts.inputBuses.size() > 2 || (outputBusses != 1 && outputBusses != 4))
{
return false;
}
if(outputBusses != 1)
{
return false;
}
if(input > 2 || sidechain > 2 || output > 2)
{
return false;
}
if(input == 2 && output == 1)
{
//don't allow stereo->mono track in PT
return false;
}
if(outputBusses == 4)
{
//first make sure they're all the same size
int matchSize = layouts.getChannelSet(false, 1).size();
if(layouts.getChannelSet(false, 2).size() != matchSize)
{
return false;
}
if(layouts.getChannelSet(false, 3).size() != matchSize)
{
return false;
}
for(int i = 1;i<4;i++)
{
//ok we allow mono main and stereo aux for Logic but not stereo main and mono aux
int auxSize = layouts.getChannelSet(false, i).size();
if(output == 1)
{
if(auxSize != 1 && auxSize != 2)
{
return false;
}
}
else
{
if(auxSize != 2)
{
return false;
}
}
}
}
return true;