AudioComponentInstanceNew takes up to five seconds to complete

We are using a VoiceProcessingIO audio unit in our VoIP application on Mac. In certain scenarios, the AudioComponentInstanceNew call blocks for up to five seconds (at least two). We are using the following code to initialize the audio unit:

OSStatus status;
AudioComponentDescription desc;
AudioComponent inputComponent;
desc.componentType = kAudioUnitType_Output;
desc.componentSubType = kAudioUnitSubType_VoiceProcessingIO;
desc.componentFlags = 0;
desc.componentFlagsMask = 0;
desc.componentManufacturer = kAudioUnitManufacturer_Apple;
inputComponent = AudioComponentFindNext(NULL, &desc);
status = AudioComponentInstanceNew(inputComponent, &unit);

We are having the issue with current MacOS versions on a host of different Macs (x86 and x64 alike). It takes two to three seconds until AudioComponentInstanceNew returns.

We also see the following errors in the log multiple times:

AUVPAggregate.cpp:2560 AggInpStreamsChanged wait failed

and those right after (which I don't know if they matter to this issue):

KeystrokeSuppressorCore.cpp:44 ERROR: KeystrokeSuppressor initialization was unsuccessful. Invalid or no plist was provided. AU will be bypassed. vpStrategyManager.mm:486 Error code 2003332927 reported at GetPropertyInfo
Answered by Engineer in 790464022

Thank you for sharing a code snippet. I don't see anything wrong with your code. Please use Feedback Assistant to submit a bug report, and please post here the ID generated by Feedback Assistant. If possible, please capture a sysdiagnose with the exact time you were able to reproduce the issue and attach it to your bug report.

Thank you for sharing a code snippet. I don't see anything wrong with your code. Please use Feedback Assistant to submit a bug report, and please post here the ID generated by Feedback Assistant. If possible, please capture a sysdiagnose with the exact time you were able to reproduce the issue and attach it to your bug report.

Thank you. The ID generated by Feedback Assistant is FB13879429

AudioComponentInstanceNew takes up to five seconds to complete
 
 
Q