OS X deprecated warning about deprecated Carbon Audio units

When I start our app Exult, I get the warning:

WARNING: 140: This application, or a library it uses, is using the deprecated Carbon Component Manager for hosting Audio Units. Support for this will be removed in a future release. Also, this makes the host incompatible with version 3 audio units. Please transition to the API’s in AudioComponent.h.

Since we got rid of this, I think this comes from your code.

From what I understand your CoreAudio code kept things compatible to OS X version <=10.5. Since you support only 10.7 and above you can discard some of that code and use the same code as the iOS one.

I made these changes that I need to confirm yet but from what we did in Exult and ScummVM did, this looks mostly correct.
I’m posting this first here before I do it in bugzilla, since I first need to test this. Most importantly, do you think I’m right or totally wrong?

diff --git a/src/audio/coreaudio/SDL_coreaudio.c b/src/audio/coreaudio/SDL_coreaudio.c
— a/src/audio/coreaudio/SDL_coreaudio.c
+++ b/src/audio/coreaudio/SDL_coreaudio.c
@@ -406,13 +406,7 @@
scope, bus, &callback, sizeof(callback));-

  •        #if MACOSX_COREAUDIO
  •        CloseComponent(this->hidden->audioUnit);
  •        #else
  •        #endif
  •        this->hidden->audioUnitOpened = 0;

@@ -482,13 +476,8 @@
OSStatus result = noErr;
AURenderCallbackStruct callback;

  • ComponentDescription desc;
  • Component comp = NULL;
    AudioComponentDescription desc;
    AudioComponent comp = NULL;
    const AudioUnitElement output_bus = 0;
    const AudioUnitElement input_bus = 1;
    const AudioUnitElement bus = ((iscapture) ? input_bus : output_bus);
    @@ -507,11 +496,10 @@

desc.componentSubType = kAudioUnitSubType_DefaultOutput;

  • comp = FindNextComponent(NULL, &desc);
    desc.componentSubType = kAudioUnitSubType_RemoteIO;
    comp = AudioComponentFindNext(NULL, &desc);

    if (comp == NULL) {
    SDL_SetError(“Couldn’t find requested CoreAudio component”);
    @@ -519,17 +507,12 @@

    /* Open & initialize the audio unit */

  • result = OpenAComponent(comp, &this->hidden->audioUnit);

  • CHECK_RESULT(“OpenAComponent”);
    AudioComponentInstanceNew only available on iPhone OS 2.0 and Mac OS X 10.6
    We can’t use OpenAComponent on iPhone because it is not present
    result = AudioComponentInstanceNew(comp, &this->hidden->audioUnit);

    this->hidden->audioUnitOpened = 1;

diff --git a/src/audio/coreaudio/SDL_coreaudio.h b/src/audio/coreaudio/SDL_coreaudio.h
— a/src/audio/coreaudio/SDL_coreaudio.h
+++ b/src/audio/coreaudio/SDL_coreaudio.h
@@ -32,9 +32,9 @@
#include <CoreAudio/CoreAudio.h>
#include <CoreServices/CoreServices.h>
#include <AudioToolbox/AudioToolbox.h>

#include <AudioUnit/AudioUnit.h>

With my little test of Exult, CoreAudio does still work with these changes and the deprecated warning is gone.

SDL for OS X must be built using the 10.7 or newer SDK, however it still deploys down to Mac OS 10.5 at runtime.

That said, I?m very much in favor of dropping runtime support for OS X 10.5 ? even Steam hasn?t supported 10.5 for a while now. I?d still expect 10.6 to be supported though.

There is also an existing bugzilla report for removing the remaining Carbon code inside SDL: https://bugzilla.libsdl.org/show_bug.cgi?id=1756 https://bugzilla.libsdl.org/show_bug.cgi?id=1756
The warning you got hasn?t been posted there yet though.> On Sep 21, 2015, at 5:21 PM, Dominus wrote:

From what I understand your CoreAudio code kept things compatible to OS X version <=10.5. Since you support only 10.7 and above you can discard some of that code and use the same code as the iOS one.

Right, I see about 10.5 deployment. This can be fixed by additional

(which will make it that much uglier… :))

I’ll add an updated patch.

My bug report about this is https://bugzilla.libsdl.org/show_bug.cgi?id=3127

Added three patches to my bug report https://bugzilla.libsdl.org/show_bug.cgi?id=3127

  • for SDL2, removing 10.5 compatibility
  • for SDL2, keeping 10.5 compatibility
  • for SDL1.2x :slight_smile:

On the keeping OS X 10.5 as deployment system…
How does one even compile an app with anything other than SDK 10.5 (or smaller) so that it works on an actual 10.5 machine?
I’m always stumbling over the /usr/lib/libstdc++.6.dylib problem (http://stackoverflow.com/questions/16358957/os-x-10-6sdk-compatible-with-10-5-leopard-system-znkst13bad-exception4whatev) and the app always crashes on 10.5…