OpenAL initialization worsens the performance of my iPhone game

I have a bad OpenAL performance issue in my iPhone game. My game runs smoothly at 60 frames per second, but when I initialize OpenAL, the game starts in a jerk. This is my initialization code:

  ALCdevice* device = alcOpenDevice(NULL); ALCcontext *context; if(device) { context = alcCreateContext(device, NULL); alcMakeContextCurrent(context); } 

I do not create any OpenAL sources and do not download / play any sounds. The jitter (the game jerks all the time) is caused by the initialization of OpenAL . Xcode tools say that the game works with stable 60fps, but it clearly trembles (when I do not run the code above the game, it runs smoothly).

This also does not happen on the old iPod Touch 2G with iOS 3.1.3. All my other iOS 4 devices are shaking, which is crazy too. I also tried putting the OpenAL stuff in a separate thread, but that doesn't help.

Has anyone noticed this behavior?

+4
source share
1 answer

Try calling alcGetError() after setting the context to make sure it succeeded.

Does it really not work on the simulator or on the phone itself?

Are you doing anything with sound after the code you posted? In the code you submitted, if alcOpenDevice fails, you will not have context, but you will not return either.

0
source

All Articles