AudioUnits compilation tips

Here it is:
http://hoxtonowl.com/forums/topic/trouble-compiling-audiounit/#post-482

OK - I would recommend to try building the project from the introjucer file (OWLSim.jucer) - you’ll have to add the CA files here again, but it does makes life easier.

I added the files you listed and some other ones xcode said were missing. Im now getting the error AUPlugInDispatch.cpp not found, even though it is in the AU wrapper folder. Any ideas on how to fix this? Thanks

You shouldn’t need any more of the CA files other than the ones listed. Try downloading Juce and copying the setup in the Juce Demo Plugin example project.

I have now created the project from the .jucer and added the files from the demo plugin. I get an error saying ‘CAXException.h’ not found, from the ComponentBase.h file. any ideas of what the issue is?

Ok - simplified now. Scrap the old OWLSim project and clone latest version from github, then:

open introjucer file

In Config, enable Build AudioUnit

Under XCode(MacOSX) add extra frameworks - AudioUnit, CoreAudio, CoreAudioKit

Save project and open in Xcode

The files in the juce AU wrapper folder appear red. Do I need to re add them or have I done a previous step incorrectly. Thanks for the swift replies :slight_smile:

If they are appearing red, re-add them in the introjucer

Ok, installed the Introjucer, changed the flag in there to compile AudioUnit, Save and Open in XCode, compiles cleanly straight off the bat! Game on!

amitio - when I just did it, introjucer adds the Juce AU Wrapper folder to point to files at eg. “/Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp”. You may have installed these files in /Library/Developer/CoreAudio, in which case try symlinking from “/Applications/Xcode.app/Contents/Developer/Extras/”

Madwort,

Good news. and feel free to post any patches that you write in the forum - it’s going to be a great place to share ideas about audio coding in C!

Cheers for tips. I had create the symlink incorrectly. Once that was fixed it compiled with no issues.

I am having trouble trying to run the plugin however. I’m taking the component file and putting it in the /Library/Audio/Plug-Ins/Component folder but the plugin isn’t getting recognized.

Is your host (what software are you using?) definitely looking in there for AU plugins?

I’m using garageband and all other plug ins the folder are available. Could the problem be that garageband only allows for stereo tracks and the plugin is mono?

I don’t use it, but I’m fairly certain that Garageband does support mono tracks and plugins. Can you test it in Reaper or other DAW?

I had similar issues. AU lab just refused to recognise it, however when I booted up Logic it told me that the plugin had failed verification and disabled it. With Logic it’s possible to override that and use it anyway (and it worked ok) but maybe you can’t do that with Garageband. I’m out and about but will post the error when possible, something about MIDI input…

P.s. I’m pretty sure the problem isn’t about being mono…

Just tried it in reaper and it works fine in that.

For what it’s worth, the error I get when I try to use the plugin with Logic is as follows:

validating Audio Unit OwlSim by RebelTech:

  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
         AU Validation Tool
         Version: 1.6.1a1 
          Copyright 2003-2011, Apple, Inc. All Rights Reserved.

         Specify -h (-help) for command options
  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

--------------------------------------------------
VALIDATING AUDIO UNIT: 'aumf' - 'OwlS' - 'RBLT'
--------------------------------------------------
Manufacturer String: RebelTech
AudioUnit Name: OwlSim
Component Version: 1.0.0 (0x10000)

* * PASS
--------------------------------------------------
TESTING OPEN TIMES:
COLD:
JUCE v2.0.40
Patch: Gain
Patch: Parametric EQ
Patch: Simple Delay
Patch: Template
Time to open AudioUnit:         9.604 ms
WARM:
Patch: Gain
Patch: Parametric EQ
Patch: Simple Delay
Patch: Template
Time to open AudioUnit:         0.039  ms
FIRST TIME:
Time for initialization:        0.010 ms

* * PASS
--------------------------------------------------
VERIFYING DEFAULT SCOPE FORMATS:
Input Scope Bus Configuration:
 Default Bus Count:1
    Default Format: AudioStreamBasicDescription:  1 ch,  44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved

Output Scope Bus Configuration:
 Default Bus Count:1
    Default Format: AudioStreamBasicDescription:  1 ch,  44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved

* * PASS
--------------------------------------------------
VERIFYING REQUIRED PROPERTIES:
  VERIFYING PROPERTY: Sample Rate
ca_debug_string: AudioUnitGetProperty: *ioDataSize == 0 on entry /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUPlugInDispatch.cpp:118
    PASS
  VERIFYING PROPERTY: Stream Format
ca_debug_string: AudioUnitGetProperty: *ioDataSize == 0 on entry /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUPlugInDispatch.cpp:118
    PASS
  VERIFYING PROPERTY: Maximum Frames Per Slice
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:391
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:391
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:391
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:391
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:391
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:391
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:391
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:391
    PASS
  VERIFYING PROPERTY: Last Render Error
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:397
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:397
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:397
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:397
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:397
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:397
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:397
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:397
    PASS

* * PASS
--------------------------------------------------
VERIFYING RECOMMENDED PROPERTIES:
  VERIFYING PROPERTY: Latency
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:376
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:376
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:376
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:376
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:376
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:376
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:376
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:376
    PASS
  VERIFYING PROPERTY: Tail Time
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:382
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:382
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:382
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:382
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:382
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:382
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:382
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:382
    PASS
  VERIFYING PROPERTY: Bypass Effect
    PASS

* * PASS
--------------------------------------------------
VERIFYING OPTIONAL PROPERTIES:
  VERIFYING PROPERTY Supported Number of Channels
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:404
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:404
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:404
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:404
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:404
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:404
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:404
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:404
    PASS
  VERIFYING PROPERTY Host Callbacks
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:489
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:489
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:489
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:489
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:489
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:489
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:489
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:489
    PASS
  VERIFYING PROPERTY Instrument Count
    PASS
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIBase.cpp:95
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIBase.cpp:95
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIBase.cpp:95
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIBase.cpp:95
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIBase.cpp:95
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIBase.cpp:95
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIBase.cpp:95
ca_require: inScope == kAudioUnitScope_Global InvalidScope /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIBase.cpp:95

* * PASS
--------------------------------------------------
VERIFYING SPECIAL PROPERTIES:

VERIFYING CUSTOM UI
Cocoa Views Available: 1
  JUCE_AUCocoaViewClass_6d19f19c8fbfb5a1
    PASS

HAS FACTORY PRESETS

VERIFYING CLASS INFO
    PASS

TESTING HOST CALLBACKS
    PASS

* * PASS
--------------------------------------------------
PUBLISHED PARAMETER INFO:

# # # 5 Global Scope Parameters:

* * PASS
--------------------------------------------------
FORMAT TESTS:

Reported Channel Capabilities (explicit):
      [1, 1]  

Input/Output Channel Handling:
1-1   1-2   1-4   1-5   1-6   1-7   1-8   2-2   2-4   2-5   2-6   2-7   2-8   4-4   4-5   5-5   6-6   7-7   8-8
X                                                                                                                 
ca_require: IsStreamFormatWritable(inScope, inElement) NotWritable /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:827

* * PASS
--------------------------------------------------
RENDER TESTS:
Input Format: AudioStreamBasicDescription:  1 ch,  44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved
Output Format: AudioStreamBasicDescription:  1 ch,  44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved
Render Test at 512 frames
Slicing Render Test at 64 frames
  PASS

Render Test at 64 frames, sample rate: 22050 Hz
Render Test at 137 frames, sample rate: 96000 Hz
Render Test at 4096 frames, sample rate: 48000 Hz
Render Test at 4096 frames, sample rate: 192000 Hz
Render Test at 4096 frames, sample rate: 11025 Hz
Render Test at 512 frames, sample rate: 44100 Hz
  PASS

1 Channel Test:
Render Test at 512 frames
  PASS

Checking connection semantics:
Connection format:
AudioStreamBasicDescription:  1 ch,  44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved
  PASS

Bad Max Frames - Render should fail
ca_require: inFramesToProcess <= mMaxFramesPerSlice TooManyFrames /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:1360
  from AU (0x8147e052): 'aumf' 'OwlS' 'RBLT', render err: -10874
  PASS

Checking parameter setting
Using AudioUnitSetParameter
Using AudioUnitScheduleParameter
  PASS

Test MIDI
ERROR: -4 IN CALL MusicDeviceSendMIDI

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


validation result: failed validation

updating properties of AU OwlSim by RebelTech...done.

Hi Tom

Can you please clarify this,

"open introjucer file

In Config, enable Build AudioUnit

Under XCode(MacOSX) add extra frameworks – AudioUnit, CoreAudio, CoreAudioKit

Save project and open in Xcode"

What/where is the introjucer file?

Also - “In Config, enable Build AudioUnit”

Do you mean in the AppConfig.h file?

Also - how do you add extra frameworks?

Over all - I can’t tell if your instruction are done in Xcode or not?

Thanks

Paul.