SDL 1.3, OpenAL, and iOS = crash

Is anyone having trouble getting SDL 1.3 and OpenAL to work in the iPhone simulator? alcCreateDevice() always returns 0x18, alcCreateContext() always returns 0x19, and alcMakeContextCurrent() always crashes. The same code works on other platforms. I don’t have an actual device yet to see if it works or not there.

Any ideas?

Just off the top of my head…

Are you initializing sound with SDL?
Have you checked the return values against the OpanAL header file to find
out what the return values mean (and/or use alGetString)?

In my experience openAL is insanely flakey and it’s important to check the
error state before AND after each openAL call (seriously).

Once you get your hands on an actual openAL error value (ie.
AL_INVALID_SOURCE) then you can get moving.

Good luck,On Sat, Jan 7, 2012 at 1:58 AM, braddabug2 wrote:

**
Is anyone having trouble getting SDL 1.3 and OpenAL to work in the iPhone
simulator? alcCreateDevice() always returns 0x18, alcCreateContext() always
returns 0x19, and alcMakeContextCurrent() always crashes. The same code
works on other platforms. I don’t have an actual device yet to see if it
works or not there.

Any ideas?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

When you init SDL, do you make sure to omit initing audio? I remember
a long time ago (like a decade ago), there were some problems having
SDL’s audio initialized with certain OpenAL implementations.

Also, I remember a secondary problem I had was some SDL based
libraries I was using automatically initialized SDL on their own so I
had to figure that out and immediately shutdown SDL audio after they
did that.On 1/6/12, Jeremy Jurksztowicz wrote:

Just off the top of my head…

Are you initializing sound with SDL?
Have you checked the return values against the OpanAL header file to find
out what the return values mean (and/or use alGetString)?

In my experience openAL is insanely flakey and it’s important to check the
error state before AND after each openAL call (seriously).

Once you get your hands on an actual openAL error value (ie.
AL_INVALID_SOURCE) then you can get moving.

Good luck,

On Sat, Jan 7, 2012 at 1:58 AM, braddabug2 wrote:

**
Is anyone having trouble getting SDL 1.3 and OpenAL to work in the iPhone
simulator? alcCreateDevice() always returns 0x18, alcCreateContext()
always
returns 0x19, and alcMakeContextCurrent() always crashes. The same code
works on other platforms. I don’t have an actual device yet to see if it
works or not there.

Any ideas?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/

This will initialize SDL with just video and no sound, right?

Code:
SDL_Init(SDL_INIT_VIDEO);

I tried throwing in a lot of alGetError()s in my OpenAL init code, but it always returns 0. So I still don’t know what’s going on.

Do you have a stack trace?

I’ve had some tough times with OpenAL, and only found the source of a few
errors when checking alGetError (and the alc version) before and
after
each call. There were errors generated between calls to openAL.
So try to
be methodical with error checking.

By the way, I have SDL 1.3 running with OpenAL on iOS, so it can be done.

Good luck,On Sun, Jan 8, 2012 at 11:27 AM, braddabug2 wrote:

**
This will initialize SDL with just video and no sound, right?

Code:

SDL_Init(SDL_INIT_VIDEO);

I tried throwing in a lot of alGetError()s in my OpenAL init code, but it
always returns 0. So I still don’t know what’s going on.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I added some calls to alcGetError() too, and all those return 0 too.

The stack trace just has alcMakeContextCurrent(), and then the next thing is __cxa_throw, so I don’t see any useful info in there.

I do get this output when I call alcMakeContextCurrent(), if it means anything:

AudioStreamBasicDescription: 2 ch, 44100 Hz, ‘lpcm’ (0x00000C2C) 8.24-bit little-endian signed integer, deinterleaved
2012-01-08 09:33:32.438 cnk[87307:fb03] Error loading /System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn: dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
in /System/Library/Frameworks/Security.framework/Versions/A/Security
2012-01-08 09:33:32.453 cnk[87307:fb03] Error loading /System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn: dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
in /System/Library/Frameworks/Security.framework/Versions/A/Security

Catchpoint 3 (exception thrown).(gdb)

That looks like an Apple bug. Please file a bug report with Apple on that.
If you have Xcode set to break on exceptions, you might disable it and
see if your app continues to run.On 1/8/12, braddabug2 wrote:

I added some calls to alcGetError() too, and all those return 0 too.

The stack trace just has alcMakeContextCurrent(), and then the next thing is
__cxa_throw, so I don’t see any useful info in there.

I do get this output when I call alcMakeContextCurrent(), if it means
anything:

AudioStreamBasicDescription: 2 ch, 44100 Hz, ‘lpcm’ (0x00000C2C) 8.24-bit
little-endian signed integer, deinterleaved
2012-01-08 09:33:32.438 cnk[87307:fb03] Error loading
/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn:
dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn,
262): Symbol not found: ___CFObjCIsCollectable
Referenced from:
/System/Library/Frameworks/Security.framework/Versions/A/Security
Expected in:
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
in /System/Library/Frameworks/Security.framework/Versions/A/Security
2012-01-08 09:33:32.453 cnk[87307:fb03] Error loading
/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn:
dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn,
262): Symbol not found: ___CFObjCIsCollectable
Referenced from:
/System/Library/Frameworks/Security.framework/Versions/A/Security
Expected in:
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
in /System/Library/Frameworks/Security.framework/Versions/A/Security

Catchpoint 3 (exception thrown).(gdb)


Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/

Well, after continuing past several exceptions, my game works, including sound!