Attention! For Japanese customers, my Japanese blog might help.

Oct 15, 2017

Homemade V3 AudioUnit did NOT work on macOS 10.13

NOTE: This is the English version of my Japanese article.

My development environment is Xcode 9.0 on macOS 10.13.

Can't instantiate AVAudioUnit

My AU seemed to fail instantiating an AVAudioUnit at +[AVAudioUnit instantiateWithComponentDescription:options:completionHandler:].

An 'error' variable in completionHandler was
Error Domain=NSOSStatusErrorDomain Code=-3000 "invalidComponentID"
After a struggle, I found the error could be removed by turning off Sandboxing of my containing app.
FYI,  Apple's sample code "AudioUnitV3Example" also disables Sandbox for host apps.

Note that, even if Sandbox is enabled, I could make AUAudioUnit instance using +[AUAudioUnit instantiateWithComponentDescription:options:completionHandler].
So, if Sandbox environment is required and AVAudioUnit is not, the method will be better.
And more, I tried AudioComponentInstanceNew(), but failed on Sandbox environment.

Can't make AUViewController

Next to the problem above, there was another problem that an AU view was not displayed.

After a call of -[AUAudioUnit requestViewControllerWithCompletionHandler:],
'viewController' variable in completionHandler was nil.

It seemed that the controller instance was never created.

In the sample code "AudioUnitV3Example",  the controller seems to be created by using a bundle directly in -[ViewController embedPlugInView].
So, I will imitate that implementation. (not started yet)

Remarks

On 10.13, even if an AU containing app is activated, the AU is not shown in the list by a command 'auval -a'.
This means other host apps can't use my AU. So I need to resolve the problem too.

It's a bother!

To be continued...

--
I'm looking for job for macOS/iOS application development by outsourcing.
For details, please visit http://shakeyama.com/about/index_e.php.

No comments:

Post a Comment