JuceDemoPlugin AU fails validation-OS X 10.8.2 - Xcode 4.5.1


#1

Hi Guys,

I have built the JuceDemoPlugin audio unit on OS X after fixing things up from here http://rawmaterialsoftware.com/viewtopic.php?f=8&t=9546&p=56679#p56677

But if I try to instantiate this plugin in a host it goes bang.

It also seg faults auval:

MacPro:~:auval -v aufx Jcdm RawM


     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’ - ‘Jcdm’ - ‘RawM’

Manufacturer String: Raw Material Software
AudioUnit Name: Juce Demo Plugin
Component Version: 1.0.0 (0x10000)
Component’s Bundle Version: 1.0.0

    • PASS

TESTING OPEN TIMES:
COLD:
JUCE v2.0.27
Time to open AudioUnit: 56.445 ms
WARM:
Time to open AudioUnit: 0.033 ms
FIRST TIME:
Time for initialization: 0.017 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
PASS
VERIFYING PROPERTY: Stream Format
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
Carbon View Components Available: 1
auvw Jcdm RawM - Raw Material Software: Juce Demo Plugin View
PASS

Cocoa Views Available: 1
JuceDemoProjectAU_V1
PASS

HAS FACTORY PRESETS

VERIFYING CLASS INFO
PASS

TESTING HOST CALLBACKS
PASS

    • PASS

PUBLISHED PARAMETER INFO:

# # 2 Global Scope Parameters:

Parameter ID:0
Name: /usr/bin/auval: line 11: 3672 Segmentation fault: 11 arch -i386 /usr/bin/auvaltool "$@"
MacPro:~:

Is this a known problem?

Cheers

Andy


#2

Ok, some more info.

It seems to be an issue with setting kAudioUnitParameterFlag_HasCFNameString in the AudioUnitParameterInfo, for instance if I change juice_AU_Wrapper.mm->GetParameterInfo(0 to the following then everything is ok:

    //==============================================================================
    ComponentResult GetParameterInfo (AudioUnitScope inScope,
                                      AudioUnitParameterID inParameterID,
                                      AudioUnitParameterInfo& outParameterInfo)
    {
        const int index = (int) inParameterID;

        if (inScope == kAudioUnitScope_Global
             && juceFilter != nullptr
             && index < juceFilter->getNumParameters())
        {
            outParameterInfo.flags =    kAudioUnitParameterFlag_IsWritable
                                      | kAudioUnitParameterFlag_IsReadable
                                      ; // Disable Name - | kAudioUnitParameterFlag_HasCFNameString;

            const String name (juceFilter->getParameterName (index));

            // set whether the param is automatable (unnamed parameters aren't allowed to be automated)
            if (name.isEmpty() || ! juceFilter->isParameterAutomatable (index))
                outParameterInfo.flags |= kAudioUnitParameterFlag_NonRealTime;

            if (juceFilter->isMetaParameter (index))
                outParameterInfo.flags |= kAudioUnitParameterFlag_IsGlobalMeta;

//          Disable Name
//            CFStringRef cfName (name.toCFString());
//            AUBase::FillInParameterName (outParameterInfo, cfName, false);
//            CFRelease (cfName);

            outParameterInfo.minValue = 0.0f;
            outParameterInfo.maxValue = 1.0f;
            outParameterInfo.defaultValue = 0.0f;
            outParameterInfo.unit = kAudioUnitParameterUnit_Generic;

            return noErr;
        }
        else
        {
            return kAudioUnitErr_InvalidParameter;
        }
    }

Anyone any ideas it seems a bit strange!

Here is the back trace when it all goes wrong:

* thread #1: tid = 0x2503, 0x918dba87 libobjc.A.dylib`objc_msgSend + 23, stop reason = EXC_BAD_ACCESS (code=1, address=0x80000020)
    frame #0: 0x918dba87 libobjc.A.dylib`objc_msgSend + 23
    frame #1: 0x93124654 CoreFoundation`CFGetTypeID + 68
    frame #2: 0x00010b4d auvaltool`___lldb_unnamed_function99$$auvaltool + 29
    frame #3: 0x00010798 auvaltool`___lldb_unnamed_function89$$auvaltool + 26
    frame #4: 0x00007810 auvaltool`___lldb_unnamed_function34$$auvaltool + 88
    frame #5: 0x000075cf auvaltool`___lldb_unnamed_function31$$auvaltool + 1585
    frame #6: 0x00006cb1 auvaltool`___lldb_unnamed_function30$$auvaltool + 323
    frame #7: 0x00010463 auvaltool`___lldb_unnamed_function82$$auvaltool + 1181
    frame #8: 0x000036ad auvaltool`___lldb_unnamed_function2$$auvaltool + 4469
    frame #9: 0x0000251b auvaltool`___lldb_unnamed_function1$$auvaltool + 495

#3

OK, if you don’t release the CFStringRef it works!

            CFStringRef cfName (name.toCFString());
            AUBase::FillInParameterName (outParameterInfo, cfName, false);
            //CFRelease (cfName);

#4

Grrr… Adding that CFRelease was suggested by someone else a few days ago. Sorry, I should have checked more closely before assuming it was correct.

Looking at the FillInParameterName parameters, I think the correct code should just be:

            AUBase::FillInParameterName (outParameterInfo, name.toCFString(), true);

Thanks for tracking that down!


#5

Hi Jules,

Thanks for the answer, after reading some of the AU docs I think it should maybe be true as well, this then leaves it to the host to handle it as far as I can see. I tried it with true and nothing goes bang!

Cheers

Andy