Logic Pro: Decoupling 7.1.4 and Stereo Channel Configurations? (JUCE 6.1.6+)

Hi JUCE team and community,

I have noticed that when explicitly disabling the stereo plugin format, the 7.1.4 version of the plugin binary becomes unavailable in Logic Pro 10.7.4. It doesn’t appear that these channel configurations are intended to be coupled, but that’s what seems to happen.

This issue can be reproduced using the “SurroundPlugin,” demo project that ships with JUCE 6.1.6. I’d like my binary to offer 7.1.2 formats and 7.1.4 formats, but not stereo format.

Here’s how to easily reproduce the issue using the “SurroundPlugin,” demo project:

    SurroundProcessor()
        : AudioProcessor(BusesProperties().withInput  ("Input",  AudioChannelSet::create7point1point4())
                                          .withOutput ("Output", AudioChannelSet::create7point1point4()))
    {}
    bool isBusesLayoutSupported (const BusesLayout& layouts) const override
    {
        if ((layouts.getMainInputChannelSet() == juce::AudioChannelSet::stereo())
         && (layouts.getMainOutputChannelSet() == juce::AudioChannelSet::stereo()))
            return false;
        
        return ((! layouts.getMainInputChannelSet() .isDiscreteLayout())
             && (! layouts.getMainOutputChannelSet().isDiscreteLayout())
             && (layouts.getMainInputChannelSet() == layouts.getMainOutputChannelSet())
             && (! layouts.getMainInputChannelSet().isDisabled()));
    }

If anyone has insights they’d be willing to share, or experiencing decoupling these channel configurations, I’d greatly appreciate your input. I’m also aware of the auval cache clearing requirements when debugging channel configurations, just to rule that out. Thanks!

EDIT: I’ve tested out this SurroundPlugin demo on the latest tip of the JUCE 7 master branch and the issue persists there as well.

// AudioUnitHelpers::getAUChannelInfo() - juce_AU_Shared.h - line 362
static Array<AUChannelInfo> getAUChannelInfo (const AudioProcessor& processor)
{
    // [...]
    auto maxNumChanToCheckFor = 9;
    // [...]
}

this variable is hardcoded to 9 in the JUCE source code, which causes the channel probing to stop short of the number of cases needed to check when probing for 7.1.4 channel configurations (which can be validated by inspecting the switch case in Array<AudioChannelSet> AudioChannelSet::channelSetsWithNumberOfChannels (int numChannels) in juce_AudioChannelSet.cpp).

When updating maxNumChanToCheckFor = 12, channel configurations beyond 7.0.2 become available when probing the binary, exposing 7.1.2 and 7.1.4 as valid channel configurations while allowing me to explicitly set stereo configurations as unavailable.

Does anybody have any insights regarding this hardcoded limit and what its value correlates to? Thanks again!

That value has been with us since the original ‘multibus support’ commit in JUCE 4.1.0. In juce_mac_CoreAudiolayouts.h, the vast majority of AU channel layouts supported by JUCE have 9 or fewer channels. The Atmos layouts (including 7.1.2 and 7.1.4) were only added to macOS in 10.15 and 11.0 - before that, the only channel layout with more than 9 channels was ‘kAudioChannelLayoutTag_TMH_10_2_std’, which presumably doesn’t get that much use. So, my guess is that there hasn’t been much need to check for layouts with more than 9 channels until recently.

That said, I’m not seeing the same behaviour as you here. I updated the JUCE 7.0.5 SurroundPlugin using the snippets you provided, then tried running it as an AUv2 in Logic 10.7.7 on macOS 13.2.1 Arm. If I try to add the plugin to a 7.1.4 track, I’m given options to add it as 7.1.4 or multi-mono. If I try to add it to a stereo track, I’m not given any stereo option; just dual-mono. This sounds like the expected behaviour.


Edit: I was testing with a default layout of 7.1.4 on input and output, so I was always seeing explicit reported channel capabilities that included [12, 12]. If I set the default layout to be smaller, then the explicit reported channel capabilities only go up to [9, 9]. Setting it to 16 allows the reported layouts to go all the way up to [16, 16], which feels sensible now that AUs may want to support 9.1.6 layouts. I’ll add that change shortly.

1 Like

Thanks so much for the reply and the history around the logic @reuk. This is certainly a step in the right direction, however, there’s one more corner case: I’d like to offer 7.1.2 format alongside 7.1.4 from the same binary, excluding stereo.

Attached is a screenshot showing the same binary opened as a 7.1.2 binary (before the “atmos” plugin) and a 7.1.4 binary (after the “atmos” plugin):

I’ve found this is only achievable by updating auto maxNumChanToCheckFor = 12 which then allows the AudioUnitHelpers::getAUChannelInfo() function to probe for channel configurations beyond 7.0.2 (9 channels total), adding those implicitly excluded formats to the internal supportedChannels sorted set.

Prior to updating maxNumChanToCheckFor, when I would disable stereo configurations, the plugin would no longer provide both 7.1.2 and 7.1.4 as valid channel configurations from the same binary.

I believe this may be working with the original isBusesLayoutSupported() code in the Surround plugin because we’re telling Logic that all channel configs with equal inputs and outputs would be considered valid configurations. Once we get a bit more specific, the implicit accepted channel configurations change according to the host and we lose the ability to open both 7.1.2 and 7.1.4 formats from the same binary.

Updating our maxNumChanToCheckFor variable to 12 allows for these desired behaviors to exist from the same binary while disabling stereo configurations as desired.

Hopefully this is helpful and leads to being able to reproduce the results I’m experiencing here. Thanks again for the attention to this issue.

EDIT: I didn’t see your edit. I now see your edit. Thank you for updating the max channel count to [16,16]!

This change is now on develop:

1 Like