A AU plugin has error with auval

Hello, i have a AU plugin midi to midi, on Mac OS that works fine with Juce_Host, but I don’t see it proposed with garageband.
The command:

 auvaltool -v aumi Cbcj Manu

gives an error:


--------------------------------------------------
VERIFYING DEFAULT SCOPE FORMATS:
Input Scope Bus Configuration:
 Default Bus Count:0

Output Scope Bus Configuration:
 Default Bus Count:1
    Default Format: AudioStreamBasicDescription:  2 ch,  44100 Hz, Float32, deinterleaved

ERROR: Default Format of unit does not match reported Channel handling capabilities
* * FAIL
AU VALIDATION FAILED: CORRECT THE ERRORS ABOVE.

But I don’t understand this error. Do you have an idea please?

I’m getting the same error. Has anyone else seen this before?

Same thing here, and it’s even happening with a totally default MIDI Plugin:

VERIFYING DEFAULT SCOPE FORMATS:
Input Scope Bus Configuration:
 Default Bus Count:0

Output Scope Bus Configuration:
 Default Bus Count:1
    Default Format: AudioStreamBasicDescription:  2 ch,  44100 Hz, Float32, deinterleaved

ERROR: Default Format of unit does not match reported Channel handling capabilities
* * FAIL

Here’s the settings I used:

This is probably related to another bug I’ve noticed, which is that MIDI Processor effects seem to always have a stereo output bus when loaded in AudioPluginHost.

As a quick workaround, actually setting {0, 2} in “Plugin Channel Configurations” seems to get it to pass auval, but I don’t get why it’s generating this spurious output bus at all. I would think this is some bug with JUCE. Who is the right person to direct this to? @dave96 ?

Figured it out. There’s basically this:

    JuceAU (AudioUnit component)
        : MusicDeviceBase (component,
                           (UInt32) AudioUnitHelpers::getBusCountForWrapper (*juceFilter, true),
                           (UInt32) AudioUnitHelpers::getBusCountForWrapper (*juceFilter, false))
    {
        // ...
    }

Which calls this:

    static int getBusCountForWrapper (const AudioProcessor& juceFilter, bool isInput)
    {
       #if JucePlugin_IsMidiEffect
        const auto numRequiredBuses = isInput ? 0 : 1;
       #else
        const auto numRequiredBuses = 0;
       #endif

        return jmax (numRequiredBuses, getBusCount (juceFilter, isInput));
    }

So we have numRequiredBuses = 1 for the output for MIDI effects. I’m not sure why; maybe AU MIDI processors require this or something. But then later we call this

    static Array<AUChannelInfo> getAUChannelInfo (const AudioProcessor& processor)
    {
        Array<AUChannelInfo> channelInfo;

        auto hasMainInputBus  = (AudioUnitHelpers::getBusCountForWrapper (processor, true)  > 0);
        auto hasMainOutputBus = (AudioUnitHelpers::getBusCountForWrapper (processor, false) > 0);

        if ((! hasMainInputBus) && (! hasMainOutputBus))
        {
            // midi effect plug-in: no audio
            AUChannelInfo info;
            info.inChannels = 0;
            info.outChannels = 0;

            return { &info, 1 };
        }
    // ... all kinds of stuff ...
    }

And it turns out that hasMainOutputBus is always set to 1, even if it is a MIDI effect plugin. So, the if statement which seems intended to run for MIDI effects doesn’t actually run.

Because of a fairly elaborate sequence of things thereafter, JuceAU::channelInfo is then set incorrectly unless {something, 2} is manually specified in Plugin Channel Configurations. Just having isBusesLayoutSupported() always return true; which is what’s happening currently for MIDI effects, doesn’t work.

I would guess that what’s happened is initially it wasn’t required to have an output bus for MIDI effects, and then for some reason that requirement was added - but certain parts of the rest of the library still assume that MIDI effects have no output bus.

Looks like some great investigative work, thanks. I’ll pass this on to the team. We’ll try and take a look at this at some point but I can’t promise when that will be right now.

This isn’t a bug. As far as I’m aware, there’s no way for an AUv2 plugin to determine the current processing samplerate unless it has an output bus. The bus is required in order for the plugin to function correctly.

That’s correct. Originally JUCE AU MIDI FX did not have an output bus, but they also frequently misreported the current sampling rate, leading to incorrect playback. I missed the check in getAUChannelInfo when adding the new bus. I believe this can be fixed just by returning an AUChannelInfo of { 0, -1 } when the plugin is a MIDI effect. We’ll get that merged shortly. In the meantime, it would be helpful if you could test out that change and see whether it resolves the issue for you.

@reuk Thanks, makes sense. Where would this be returned?

Thanks for your patience, a fix for this issue is now available on the develop branch: