Introjucer's AU plugin template not working anymore


#1

I upgraded my project pulling the lattest juce version and had the bad surprise that none of my plugins are working anymore in "AU Lab"
Some of them appears in the list (the one which were cached in AU Lab while they were working), the others not at all and prints an error in the console “Error opening component DEBUG: -1”

I then tried to create a plugin “DEBUG” from the just pulled Introjucer, but I had the same problems trying to load the plugin into “AU Lab”

I then tried to force validating is in Logic audio (as the auvaltool did not even saw it) and here is what I got:

[quote]validating Audio Unit DEBUG by xample:


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

     Specify -h (-help) for command options


VALIDATING AUDIO UNIT: ‘aufx’ - ‘DeBg’ - ‘XMPL’

2013-01-09 21:23:44.970 auvaltool[1566:f07] FilterDemo.component – file://localhost/Library/Audio/Plug-Ins/Components/: trouble parsing Info.plist’s AudioComponents; entry: <CFBasicHash 0x7e20c8d0 [0xac981840]>{type = mutable dict, count = 7,
entries =>
0 : <CFString 0xac9714bc [0xac981840]>{contents = “description”} = <CFString 0x7e20ca30 [0xac981840]>{contents = “Filter AU”}
1 : <CFString 0x7e20cce0 [0xac981840]>{contents = “subtype”} = <CFString 0x7e20c980 [0xac981840]>{contents = “FILT”}
2 : <CFString 0x7e20cc00 [0xac981840]>{contents = “manufacturer”} = <CFString 0xac9729dc [0xac981840]>{contents = “Apple”}
3 : <CFString 0xac9756bc [0xac981840]>{contents = “type”} = <CFString 0x7e20ca50 [0xac981840]>{contents = “aufx”}
4 : <CFString 0xac972f4c [0xac981840]>{contents = “name”} = <CFString 0x7e20cc80 [0xac981840]>{contents = “Apple Demo: Filter”}
9 : <CFString 0xac97377c [0xac981840]>{contents = “version”} = <CFNumber 0x7e20c640 [0xac981840]>{value = +65536, type = kCFNumberSInt64Type}
12 : <CFString 0x7e20cb60 [0xac981840]>{contents = "fac
Manufacturer String: DEBUG
AudioUnit Name: DEBUG
Component Version: 1.0.0 (0x10000)

    • PASS

TESTING OPEN TIMES:
COLD:
JUCE v2.0.29
FATAL ERROR: OpenAComponent: result: -1,0xFFFFFFFF

validation result: couldn’t be opened

updating properties of AU DEBUG by xample…done.
[/quote]
(Note that I do not get why the apple filters were involved in this process / report)

Trying to open my upgraded plugin (by chance some of them appears in the “AU Lab Sends” list) give me the same kind of error but in a dialog window (see attached image).

Have you already experienced this problem too ?

[EDIT]
I just took juce from another source here the 7cb3bea on the 9th jan 2013 , created another plugin but got the same result.


#2

Ok the problem seems to come from the Info.plist

Here is the former (juce 2.0.27 ) working one:

[code]<?xml version="1.0" encoding="UTF-8"?>

BuildMachineOSBuild 12C60 CFBundleExecutable Clipper CFBundleIdentifier ch.xample.clipper CFBundleName Clipper CFBundlePackageType BNDL CFBundleShortVersionString 1.0.1 CFBundleSignature PTul CFBundleVersion 1.0.1 DTCompiler com.apple.compilers.llvm.clang.1_0 DTPlatformBuild 4G182 DTPlatformVersion GM DTSDKBuild 12C60 DTSDKName DTXcode 0450 DTXcodeBuild 4G182 NSHighResolutionCapable NSHumanReadableCopyright www.xample.ch [/code]

And the new corrupted one (juce 2.0.29)

[code]<?xml version="1.0" encoding="UTF-8"?>

AudioComponents description Clipper factoryFunction ClipperAUFactory manufacturer UpWa name Clipper subtype Clip type aufx version 65537 BuildMachineOSBuild 12C60 CFBundleExecutable Clipper CFBundleIdentifier ch.xample.clipper CFBundleName Clipper CFBundlePackageType BNDL CFBundleShortVersionString 1.0.1 CFBundleSignature PTul CFBundleVersion 1.0.1 DTCompiler com.apple.compilers.llvm.clang.1_0 DTPlatformBuild 4G2008a DTPlatformVersion GM DTSDKBuild 12C60 DTSDKName DTXcode 0452 DTXcodeBuild 4G2008a NSHighResolutionCapable NSHumanReadableCopyright www.xample.ch [/code]

#3

It’s not “corrupted”! That’s how AU plists are supposed to be done now - there’s a recent thread about this, linking to Apple’s advice on the subject.


#4

Which post ? that one : http://rawmaterialsoftware.com/viewtopic.php?f=8&t=9546&p=56679#p56677 ?
In the fact: the former .plist was working but the new one is not (in AU Lab), This said I will dig a little more trying to apply the post above procedure. (still I do not think I’m very far to what is specified)
[ EDIT ]
I tried to follow the post above, but it is not related in anything with my problem :roll:
Otherwise I found the new .plist format you implemented here :
https://developer.apple.com/library/mac/#technotes/tn2276/_index.html
Now I’m still unable to load the plugin if I’m using this .plist file (still a -1 error)
I doubt it is related to a security rule : http://developer.apple.com/library/mac/#qa/qa1483/_index.html
I really do not get what is wrong, the new factory method AUDIOCOMPONENT_ENTRY(AUBaseFactory, Filter) is not even called.

Do at least someone have been able to run his plugin under AU Lab using this new .plist format ?


#5

Hi Xample,

I believe the post Jules is referring to is my post here
http://www.rawmaterialsoftware.com/viewtopic.php?f=8&t=10597
which links to the same page you found.

Our plugins pass AU validation and have been tested in Logic Pro 9 on OS X 10.7 with the extra AudioComponents key in Info.plist. The only difference is that AudioComponents is at the bottom of the plist, but I doubt that’s the problem.

I think the stuff about Info.plist in your auval output has nothing to do with your Juce plugins. When auval starts it enumerates all of the plugins in /Libraray/Audio/Plug-Ins/Components/ and examines the plist in each one. It’s just warning that the FilterDemo.component plist is corrupt. If you move FilterDemo out of the plugin folder then that should go away. The problem is that it can’t open your plugin (after successfully reading the plist), probably due to inconsistency between the plist and the plugin binary.

AUDIOCOMPONENT_ENTRY is not a method; it’s a preprocessor macro that expands into something that Jules has replicated in the wrapper instead, so its not needed here.

My guess is that your plugins are not exporting the new factory functions for some reason. Open a terminal window and type

nm ~/Library/Audio/Plug-Ins/Components/Clipper.component/Contents/MacOS/Clipper | grep Factory

to check that _ClipperAUFactory is there. If it is then my theory is wrong. If not, check that your project is actually linking with the latest versions of juce_AU_Wrapper.mm and the CoreAudio SDK. This might take a clean and rebuild.

Rupert


#6

Thank you Rubert for your clarification, I will check this asap. What is strange is that the problem happen even with a plugin built out of the Introjucer box ( I took the latest juce from the git as well as the lattest CoreAudio SDK)


#7

I also ran into Audio Units not running on 10.7 due to the new Plist.info.
I’m using XCode 3.2.6 on a 10.6 machine. Form what I understand, if the Plist.info contains the AudioComponents key the AU manager (or whatever loads the AU) looks for an export that is defined with the new Audio Unit SDK. I’m not sure though if this export can be validly generated when using the 10.6 SDK.

Is it possible to generate an Audio Unit using the currently generated Plist.info with the 10.6 SDK on OS X 10.6 and if so, how?
If it isn’t possible, shouldn’t the AudioComponents key only be added when using the 10.7 (or later) SDK?


#8

[quote=“lkjb”]Is it possible to generate an Audio Unit using the currently generated Plist.info with the 10.6 SDK on OS X 10.6 and if so, how?
If it isn’t possible, shouldn’t the AudioComponents key only be added when using the 10.7 (or later) SDK?[/quote]

Here’s a solution for this, basically add this to your xcode post-build script (available in Introjucer):

# Fix info.plist for AUs built with Xcode 3
if [ $copyAU -gt 0 ]; then
  if [ -f "$DEVELOPER_DIR/Library/Developer/CoreAudio/AudioUnits/AUPublic/AUBase/AUPlugInDispatch.cpp" ]; then
    OLD_AU=0
  else
    OLD_AU=1
  fi

  if [ $OLD_AU -gt 0 ]; then
    echo "Removing AudioComponents entry from Info.plist because this is not a new-format AU"
    /usr/libexec/PlistBuddy -c "Delete AudioComponents" "$original/Contents/Info.plist"
  fi
fi

afaik, if you use xcode 3 it also means you use an older AU SDK, which doesn’t have AUPluginDispatch.cpp. In that case the script removes these keys from the plist.
cheers! Yair


#9

Yes, I don’t have AUPluginDispatch.cpp meaning I need to disable it by hand every time I save an Introjucer project. I’m currently removing the key by hand, too as it’s only needed for releases.

But I think it would be better if the Introjucer offers a switch for XCode 3 AUs resulting in not adding AUPluginDispatch.cpp and the AudioComponents key or do this automatically if a pre 10.7 SDK is choosen. I’m not much into this Audio Unit stuff so I can’t say for sure if AUPluginDispatch.cpp can be available when using the 10.6 SDK.


#10

I believe we’ve already solved this issue. If you get the latest juce and rebuild the Introjucer I believe it will not have AUPluginDispatch in the project. Instead, juce_AU_Wrapper.mm includes this file if you have a new AU SDK. (https://github.com/julianstorer/JUCE/blob/master/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm#L1460)

You still need my xcode-post-build-script snippet for the plist key to be gone though.


#11

Thanks - that’s a neat trick in the script, I’ll add it to the tree!


#12

Thanks for the hint, I missed that. I haven’t tried yet but it looks like it should work out of the box now.