Audio Unit Extension - LoadInProcess - OS X

Dear audio developers,


I am currently evaluating Audio Unit Extension support on OS X from a plugin vendor perspective.

I would like to experiment the LoadInProcess feature of audio unit extension announced in WWDC 2015 Audio Unit Extension presentation.


According to Sierra AudioToolbox's AudioComponent.h header file:


        Most component instances are loaded into the calling process.
        A version 3 audio unit, however, can be loaded into a separate extension service process,
        and this is the default behavior for these components. To be able to load one in-process
        requires that the developer package the audio unit in a bundle separate from the application
        extension, since an extension's main binary cannot be dynamically loaded into another
        process.

        An OS X host may request in-process loading of such audio units using
        kAudioComponentInstantiation_LoadInProcess.


Moreover:

     @constant kAudioComponentFlag_CanLoadInProcess

     The system sets this flag automatically when registering components which can be loaded into
     the current process. This is always true for V2 audio units; it depends on the packaging
     in the case of a V3 audio unit.


So I started to tweak AudioUnitV3Demo OS X host in order to run FilterDemo app extension within OSX AUv3Host process:

I verified AUv3 FilterDemo app extension reports CanLoadInProcess flag from its description.

I passed loadInProcess option accordingly when AU v3 host calls AVAudioUnit. instantiate to instantiatethe AUv3 component.


But I can see that AudioUnit Extension is still running in a dedicated process...

Hence my question is:

What else should I do to be able to run FilterDemo AU extension within OS X AUv3 host process ?

Is the default packing of FilterDemo App extension compatible with LoadInProcess instantiation ?

Thank you for your help,

Best regards,

Joris GIGNOUX

Replies

It is an option of packaging and the instantiation API option -- in that the audio unit is in a bundle separate from the application extension and the .appx .plist has an AudioComponentBundle entry specifying the identifier of the bundle in the .appex or container app where the factory function and/or principal class are implemented. That should be all that is needed.


The sample was re-orgranized sometime ago where it's not ideally set up for this anymore. That said, I did a quick test by modifying the packaging in the sample effect, moving code from the .appx into the framework and making sure the AudioComponentBundle identifier was correct (essentially making sure I was following the packaging instructions from the header file) and it still didn't work in multiple test hosts, so if you could please write up a bug we can investigate this one further. Just post the bug number and I can attach my test case and follow up.

Hi,


Can you provide any details on a fix for this? The Example Project is about the only piece of code I can find showing how to do Audio Unit V3 and I have not been able to get it to work. Could you possibly provide an older version of FilterDemo that has been verified to work in Logic/Garageband?


Just want to also say thanks for all your responses on this forum. I look forward to seeing your comments in a thread!

In the sample FilterDemo, you need to move the AU factory method from the Extension source file to the framework (FilterDemoViewController.m) so there is no code in the .appx. Then, ensure the Frameworks bundle ID is entered in the extensions .plist for the "Audio Component" key - they have to be the same or it won't work. Then you can select the AUv3 Mode checkbox in the Logic plug-in manager depending on your preference. The sample will get an update soon I expect.

This appears to be fixed in 10.13 Beta (17A360a). It is not fixed in 10.12.6.