Audio Suite multichannel crash


#1

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;

#2

Just keep in mind PT side-chain is always mono.

It would be useful to see your channel layout code.

You can easily disable AudioSuite by adding :
‘JucePlugin_AAXDisableAudioSuite’


#3

We just have a blank Channel Configuration in the Jucer in order to do it the programmatic way. Is that what you’re referring to? I was under the impression that if the Jucer configuration is blank then everything is determined by the constructor and isBusesLayoutSupported. It’s also not crashing because of what we’re doing in the processing callback because it still crashes on the memory zero thing in the wrapper if we disable all processing. I’ll try to reproduce it with a blank demo project and post it here. Thanks.


#4

Here’s a blank demo project version which recreates the crash. If you build an AAX version then open it with audio suite and click the preview in the bottom left (or process) then it will crash in the AAX wrapper at this location:

                for (int i = numIns; i < numOuts; ++i)
                    zeromem (channels[i], (size_t) bufferSize * sizeof (float));

This is the repo link:

And here is a signed AAX:

https://drive.google.com/open?id=1VAQR7aDkAgNn5T0d_gh1Ft1WMThDO_Y_