VST3 problem with current JUCE on master

VST3 audio plug-in in REAPER (64 bit on Mac).

JucePlugin_PreferredChannelConfigurations set to {1, 1}, {2, 2}

As soon as I start playback, I get a prepareToPlay() callback in which getBusesLayout() returns a layout that has 0 channels for both input and output, instead of 1 or 2.

This can be easily reproduced creating a project from scratch in Projucer:

  1. Create a default audio plug-in project in Projucer

  2. Enable VST3 build (and specify correct VST SDK path)

  3. Set “{1, 1}, {2, 2}” in the box that specifies the supported channels configurations

  4. Enter the following line in prepareToPlay():

    DBG (String::formatted ("In: %d, Out: %d", getBusesLayout().getMainInputChannels(), getBusesLayout().getMainOutputChannels()));
    
  5. Now open Xcode, set REAPER64 as the executable to launch then build and run the project

  6. Create an empty track in REAPER, and insert the plug-in there.

  7. Watch the output emitted on the debug console, it should be as follows:

     JUCE v4.3.0
     In: 1, Out: 1
     In: 2, Out: 2
     In: 2, Out: 2
     In: 2, Out: 2
     In: 2, Out: 2 
    
  8. Now press Play and watch the following line being printed:

     In: 0, Out: 0
    

The expected behavior would instead be to receive another prepareToPlay() with {2, 2} upon playback start, or none at all, since the latest received before that has already set the correct {2, 2} layout

Hmmm tried a while now to re-produce this. Do you know what I’m doing differently?

Are you on master?
I haven’t had time to test it with develop yet, it may be resolved there… in which case, can you point me to the commit which I have to cherry-pick for an hotfix?

Otherwise, the only difference I found is that you are getting the number of channels in main bus a little different than my case (but I guess it is equivalent)

No on develop. We only put out critical hotfixes on master. So you may want to cherry pick some of the VST3 changes I did recently.

I did both. Just couldn’t remember the exact code line you had when I did the video. But before the video I copy&pasted your line of code.

Hmmm just saw the title now… embarrassing. Anyway, we probably won’t push those fixes to master just yet.

You seem to already know which “those fixes” are, while I am seeing that a number of commits have affected the VST3 wrapper since latest master update.
Are you able to tell me, which commit should I cherry-pick for an hotfix to be applied on my private juce repo, which is currently on master?

Not sure really.

It’s probably this one:
63a71ff20dc6643e0636beaa6373eb4ec7e5f826

Might also be this one:
910cab77a19b5ea47357a4ffc3b64135b381ae92

Ok thanks, I will try them

This one seems to have solved the problem completely, thanks.
I haven’t tested the other one because I didn’t seem to need it.

While we are at it regarding channels, etc., regarding VST2 instead, have you had a chance to look at this other topic?