isBusesLayoutSupported(), AUVAL and mono/mono configuration (SOLVED)

My code:

bool MyAudioProcessor::isBusesLayoutSupported (const BusesLayout& layouts) const
{
    if (layouts.getMainInputChannelSet().size() != 1 && layouts.getMainInputChannelSet().size() != 2 && layouts.getMainInputChannelSet().size() != 4)
        return false;
    
    if (layouts.getMainOutputChannelSet().size() > 2)
        return false;

    return true;
}

Trying to support 1,2 or 4 inputs and max. 2 outputs.

Now the AUVAL result is following:

Reported Channel Capabilities (explicit):
      [1, 2]  [2, 1]  [2, 2]  [4, 2]  

Input/Output Channel Handling:
1-1   1-2   1-4   1-5   1-6   1-7   1-8   2-2   2-4   2-5   2-6   2-7   2-8   4-4   4-5   5-5   6-6   7-7   8-8
      X                                   X                                                                       
WARNING: Can Initialize Unit to un-supported num channels:InputChan:1, OutputChan:1

I don’t understand what am i doing wrong? Why 1in/1out is not supported? Also in Logic X, mono - mono version of plugin is not available.

JUCE 4.3.1

Edit: further debugging reveals that i am not even being asked if 1/1 is supported - any idea why ?? Also tried with JUCE Plugin Host - the same story.

My default layout is:

	static BusesProperties getDefaultLayout()
	{
		BusesProperties buses;
		buses.addBus (true, "input", AudioChannelSet::stereo());
		buses.addBus (false, "Output", AudioChannelSet::stereo());
		buses.addBus (true, "Sidechain", AudioChannelSet::mono());
		return buses;
	}

And presumably you have nothing specified in the Projucer field “Plugin Channel Configurations”…

The AudioPluginHost is not suited for that test afaik, since it does no channel negotiation, but plays the default from the constructor.

Another thought, some hosts might play as multiple mono instances without telling you, for the user’s convenience?

The code looks correct to me, but for readability I would write:

bool MyAudioProcessor::isBusesLayoutSupported (const BusesLayout& layouts) const
{
    const auto numInput = layouts.getMainInputChannelSet().size();
    const auto numOutput = layouts.getMainInputChannelSet().size();

    if (numOutput > 2)
        return false;

    if (numInput == 1 || numInput == 2 || numInput == 4)
        return true;

    return false;
}

No “Plugin Channel Configurations” here.

Code is a quick example, full code is actually a bit more complex, but i did some experimenting so it is not really an example of effective & pretty programming, hehe.

Not sure what is going on here - why AUVAL is not asking me for 1/1 layout? The consequence is that mono-mono plugin is not available in Logic.

I found something else: if i change output bus of my default layout to AudioChannelSet::mono(), then i am being asked about 1/1 config. But then same problem occured with 1/2 config !?!

Could it be something wrong in 4.3.1 which has been fixed later Have to try it with version 5.

Another observation: if i don’t limit outputs in any way, am i being asked properly about 1/1 layout every time.

Any idea would be greatly appreciated!

OK here is the latest test - macOS 10.13.6, Xcode 9, the latest JUCE5 commit from development branch.

Using JUCE AudioPluginDemo project and your code:

bool isBusesLayoutSupported (const BusesLayout& layouts) const override
{
    const auto numInput = layouts.getMainInputChannelSet().size();
    const auto numOutput = layouts.getMainInputChannelSet().size();
    
    if (numOutput > 2)
        return false;
    
    if (numInput == 1 || numInput == 2 || numInput == 4)
        return true;

    return false;
}

AUVAL result:

Reported Channel Capabilities (explicit):
      [1, -1]  [2, -1]  

Input/Output Channel Handling:
1-1   1-2   1-4   1-5   1-6   1-7   1-8   2-2   2-4   2-5   2-6   2-7   2-8   4-4   4-5   5-5   6-6   7-7   8-8
X     X     X     X     X     X     X     X     X     X     X     X     X                                         

WARNING: Source AU supports multi-channel output but does not provide a channel layout

Obviously something is not right here ?!? Can you please look at it …

I have to deflect to the JUCE team, I left Roli a while ago :wink:

I hope they find something, good luck!

Ah, sorry … thank you, Daniel !!!

In this code you are setting numOutput using getMainInputChannelSize(), instead of getMainOutputChannelSize(). Is that the problem?

Big thank you for spotting this!!! Obviously a “BAD” typo :confused:

Anyway, things are now working as expected with JUCE 5, but not with JUCE4.3.1 !!!

Looks like there must be a post 4.3.1 patch which fixes this behaviour - i will check it again, to be 100% sure. If anyone have a slightest idea, which commit this could be, please let me know. Looks like i will have to dig into this deeper - maybe somebody from Roli could chime in …

So actually had kind of a similar thing happen to me the other day, as outlined in this post:

Although in looking into it further, it seems that this may not be the correct fix, as described here:

I’m not sure which one is the correct answer. In my experience over the last few days you have to do BOTH JucePlugin_PreferredChannelConfigurations AND isBusesLayoutSupported for VST/AU to work correctly in all cases, but this post seems to indicate otherwise?

1 Like

Ouch, sorry, seems I introduced that typo… your original didn’t have that…
Thanks @HowardAntares for spotting that

1 Like

I’ve checked things again to be 100% sure.

The same code from above works with the latest JUCE5 commit. It doesn’t work with JUCE 4.3.1 (mono/mono layout is missing with AU).

Now i just have to find when and how this was fixed.

Found it - this is the commit, which fixes 1/1 layout with AU plugins.

2 Likes

Worth looking into this one as well …