Possible bug in VST3 channel order mapping

I’ve encountered this issue while attempting to debug flipped sides/rears in REAPER with my VST3 plugins. Unclear if its actually related to my issue, but seems a bit suspect:

It seems related to some similar issue reported in the past:

In my isBusesLayoutSupported(), I have been comparing against AudioChannelSet::create7point1().

It creates an AudioChannelSet with left, right, centre, LFE, leftSurroundSide, rightSurroundSide, leftSurroundRear, rightSurroundRear.

The comment in the header mentions this is equivalent to VST’s k71CineSideFill, which is defined as follows in vstspeaker.h:

/** L R C   Ls  Rs Sl Sr */								// (ITU 0+7+0.0 Sound System I)
const SpeakerArrangement k70Music		 = kSpeakerL  | kSpeakerR | kSpeakerC   | kSpeakerLs  | kSpeakerRs | kSpeakerSl | kSpeakerSr;
/** L R C Lfe Ls Rs Sl Sr */							// (ITU 0+7+0.1 Sound System I)
const SpeakerArrangement k71Music		 = k70Music | kSpeakerLfe;
/** L R C Lfe Ls Rs Lcs Rcs */
const SpeakerArrangement k71CineFullRear = kSpeakerL  | kSpeakerR | kSpeakerC   | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerLcs | kSpeakerRcs;
const SpeakerArrangement k71CineSideFill = k71Music;

Notice that the k71CineSideFill arrangement uses kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr. It does NOT use kSpeakerLcs | kSpeakerRcs as in the k71CineFullRear case or as the preceding comment would leave you to assume.

However, this is the mapping between VST3 speaker and JUCE channel type:

case Steinberg::Vst::kSpeakerLs:    return AudioChannelSet::leftSurround;
case Steinberg::Vst::kSpeakerRs:    return AudioChannelSet::rightSurround;
case Steinberg::Vst::kSpeakerSl:    return AudioChannelSet::leftSurroundSide;
case Steinberg::Vst::kSpeakerSr:    return AudioChannelSet::rightSurroundSide;
case Steinberg::Vst::kSpeakerLcs:   return AudioChannelSet::leftSurroundRear;
case Steinberg::Vst::kSpeakerRcs:   return AudioChannelSet::rightSurroundRear;

It doesn’t appear that AudioChannelSet::create7point1() corresponds to any of these arrangements? The channel set created by this function maps to VST3 equivalent SpeakerArrangement of: L R C Lfe Sl Sr Lcs Rcs, which doesn’t exist in VST3.

Is this a bug?

Further down in VST3Common.h there’s a layoutTable array that defines some special-case mappings between full VST3 layouts and full JUCE layouts, as a workaround for JUCE layouts that can’t be converted channel-by-channel to VST3 layouts and vice versa. When converting between layouts, the layoutTable is checked first, to see whether there’s a hard-coded conversion. If there isn’t, then JUCE falls back to a channel-by-channel conversion.