Br: auv3 + midi out doesn't pass auvaltool on macos 12

i’ve tested this on intel and arm64 but only on macos 12. i know for a fact this worked in april of this year but then i was on macos 11 and an intel mac. (edit: j/k, i didn’t have midi out enabled then, i can’t verify if this ever worked). also, the exact same setup works fine as an auv3 on ios.

to reproduce:

  1. make sure juce is on develop and projucer is built from it.
  2. open/export the AUv3SynthPlugin example
  3. make sure plugin AU main type is set to kAudioUnit_MusicDevice
  4. make sure plugin AU is sandbox safe is enabled
  5. make sure Use App Sandbox is enabled
  6. make sure there’s a valid value in Development Team ID
  7. make sure plugin is a synth and plugin midi input are checked.

now build everything and open the standalone executable once. after this, you should be able to successfully run auvaltool (replacing the last two values with whatever projucer filled them in with):

$ auvaltool -v aumu Noyv Manu
...
Test MIDI
  PASS

* * PASS
--------------------------------------------------
AU VALIDATION SUCCEEDED.
--------------------------------------------------

great. now go back to projucer and check plugin midi output. save, re-export, rebuild, and try auvaltool again:

$ auvaltool -v aumu Noyv Manu
...
Test MIDI
ERROR: -66745 IN CALL AudioUnitRender

* * FAIL
--------------------------------------------------
AU VALIDATION FAILED: CORRECT THE ERRORS ABOVE.
--------------------------------------------------

i couldn’t debug with auvaltool on arm64 but i managed to get a stack trace on an intel mac:

What do you mean by “macos 14”, “os14”, and “os13”? The last release of macOS is version 12.0.1.

Since you’re mentioning AUv3, I guess you’re referring to iOS.

lol i’m getting all the different recent os versions mixed up. the post is about macos, i’ve updated it

1 Like

also - i just verified that the above works with an au plugin type so i’m guessing the issue is in the auv3 wrapper code somewhere.

i found this ios bug which seems identical to what i’m seeing, although this would imply that apple’s not doing setup correctly in auvaltool which seems unlikely (or maybe they ported this feature from ios):

I’ve investigated this a bit now, testing on Catalina (Intel) and Monterey (Arm).

When the plugin’s main type is MusicDevice, then validation succeeds on Catalina but fails on Monterey.
When the plugin’s main type is MidiEffect, then the validation succeeds on both platforms.
Finally, if I modify the AUv3 wrapper so that it never calls MIDIOutputEventBlock or tries to send MIDI, but keep everything else the same (i.e. it still declares that it wants MIDI in and out, and has a type of MusicDevice), then validation succeeds on Monterey again.

At the moment, I’m inclined to think this is a bug in auval. To check this hypothesis, I tested a non-JUCE-based plugin, specifically the “IPlugInstrument” plugin from the iPlug2 project. This plugin is also a MusicDevice with a MIDI in and out. When built as an AUv3, it fails auval in exactly the same way as the JUCE plugin:

Test MIDI
ERROR: -66745 IN CALL AudioUnitRender

* * FAIL
--------------------------------------------------
AU VALIDATION FAILED: CORRECT THE ERRORS ABOVE.
--------------------------------------------------

It looks like the MIDI output block is faulty in some way and causes the plugin process to crash during the call, causing auval to timeout.

I’ll create a feedback assistant ticket for this issue tomorrow.

thanks @reuk - i agree it seems like a bug in auvaltool and/or some internal apple framework, especially since the exact same thing happened on ios a few months back.

The fb ticket id is FB9778856. I’ll let you know if I hear back.