What should the Audio Unit host do in order to use non-Apple Audio Units?

I am writing an Objective-C ++ framework that needs to host audio devices. Everything works fine if I try to use Apple by default, such as DLS Synth and various effects. However, my application does not seem to be able to find third-party audio devices (in / Library / Audio / Plugins / Components).

For example, the following code fragment ...

CAComponentDescription tInstrumentDesc = CAComponentDescription('aumu','dls ','appl'); AUGraphAddNode(mGraph, &tInstrumentDesc, &mInstrumentNode); AUGraphOpen(mGraph); 

... works just fine. However, if instead of initializing tInstrumentDesc with 'aumu', 'NiMa', '-Ni-' I initialize 'aumu', 'NiMa', '-Ni-' (description of Massive Synth), then AUGraphOpen() will return an OSStatus badComponentType error, and AUGraph will not open. This is true for all third-party audio devices.

The following code, modified from the Audacity source, sheds a little light on the problem. It iterates over all available audio devices of a certain type and prints their name.

 ComponentDescription d; d.componentType = 'aumu'; d.componentSubType = 0; d.componentManufacturer = 0; d.componentFlags = 0; d.componentFlagsMask = 0; Component c = FindNextComponent(NULL, &d); while(c != NULL) { ComponentDescription found; Handle nameHandle = NewHandle(0); GetComponentInfo(c, &found, nameHandle, 0, 0); printf((*nameHandle)+1); printf("\n"); c = FindNextComponent(c, &d); } 

After running this code, the only way out is Apple: DLSMusicDevice (which is an audio device that matches the description of 'aumu', 'dls ', 'appl' above).

This doesn't seem to be a problem with the units themselves, as the Apple auval lists my third-party units (they are also checked).

I tried running a test application with sudo , and the custom environment I'm working on is in / Library / Frameworks.

+4
source share
2 answers

It turns out the problem was compilation for the 64-bit version. After switching to 32-bit, everything began to work as advertised. I think there is not much solution, but you have one.

To clarify, I mean changing the XCode ARCHS build ARCHS to β€œ32-bit Intel” as opposed to the default 32/64-bit Intel by default.

+3
source

First of all, I assume that you initialized mGraph by calling NewAUGraph(&mGraph) , and not just declaring it, and then trying to open it. Also, I suspect the problem here is with your AU schedule, not with AudioUnits themselves. But, of course, you should probably try downloading AudioUnit manually (i.e., off-schedule) and see if you have any errors.

0
source

Source: https://habr.com/ru/post/1347780/


All Articles