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

**URL:** <https://forum.juce.com/t/logic-pro-decoupling-7-1-4-and-stereo-channel-configurations-juce-6-1-6/55444>\
**Category:** MacOSX and iOS\
**Created:** [March 20, 2023, 7:57pm UTC](https://forum.juce.com/t/logic-pro-decoupling-7-1-4-and-stereo-channel-configurations-juce-6-1-6/55444 "2023-03-20T19:57:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bdawson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/bdawson/32/14755_2.png) [@bdawson](https://forum.juce.com/u/bdawson)\
**Post date:** [March 20, 2023, 7:57pm UTC](https://forum.juce.com/t/logic-pro-decoupling-7-1-4-and-stereo-channel-configurations-juce-6-1-6/55444/1 "2023-03-20T19:57:53Z")

</div>

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:

```auto
    SurroundProcessor()
        : AudioProcessor(BusesProperties().withInput ("Input", AudioChannelSet::create7point1point4())
                                          .withOutput ("Output", AudioChannelSet::create7point1point4()))
    {}

```

```auto
    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.

---

<div class="post-metadata">

**Author:** ![bdawson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/bdawson/32/14755_2.png) [@bdawson](https://forum.juce.com/u/bdawson)\
**Post date:** [March 20, 2023, 11:29pm UTC](https://forum.juce.com/t/logic-pro-decoupling-7-1-4-and-stereo-channel-configurations-juce-6-1-6/55444/2 "2023-03-20T23:29:41Z")

</div>

```auto
// 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!

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [March 21, 2023, 6:39pm UTC](https://forum.juce.com/t/logic-pro-decoupling-7-1-4-and-stereo-channel-configurations-juce-6-1-6/55444/3 "2023-03-21T18:39:04Z")

</div>

> [@bdawson](#):
>
> 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.

> <https://github.com/juce-framework/juce/commit/4fef661a#diff-180086d4d219cef67546527f61eb03c68292f7d533f9c6ad590371224ac63a76R1698>

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.

---

<div class="post-metadata">

**Author:** ![bdawson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/bdawson/32/14755_2.png) [@bdawson](https://forum.juce.com/u/bdawson)\
**Post date:** [March 21, 2023, 7:13pm UTC](https://forum.juce.com/t/logic-pro-decoupling-7-1-4-and-stereo-channel-configurations-juce-6-1-6/55444/4 "2023-03-21T19:13:00Z")

</div>

> [@reuk](#):
>
> 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.

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.

> [@bdawson](#):
>
> 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.

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):

 ![Screen Shot 2023-03-21 at 2.56.58 PM](https://us1.discourse-cdn.com/flex026/uploads/juce/original/2X/d/d7221e24b09b8f4e93c9fa9beb915f2791523924.jpeg)

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]!

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [March 27, 2023, 8:29pm UTC](https://forum.juce.com/t/logic-pro-decoupling-7-1-4-and-stereo-channel-configurations-juce-6-1-6/55444/5 "2023-03-27T20:29:54Z")

</div>

This change is now on develop:

> <https://github.com/juce-framework/JUCE/commit/e1e3697931a2da1613f39beb4503d2503da6478c>
>
> AUs are more likely to have 16 channels on a bus now that the 9.1.6
> Atmos layout… is available.
