I just found one of my game run slower on OS 3.0, do anyone else found the same issue?
Performance drop down in OS3.0
(24 posts) (9 voices)-
Posted 2 years ago #
-
my game is having some 1/2 second random slowdowns since i updated... but i don't know if it is because of OS3.0 or my bad code :P
Posted 2 years ago # -
We have heavy performance issues with Kryzer Prologue atm, and it seems as if it comes not from cocos2d but from the audio part, because without sound it works fine. I am using the aeterius engine wich was part of the v.7x packages (dont know if this changed in v.8 atm).
marc.
Posted 2 years ago # -
@maw - how are you using the sound engine. i.e. what format are your sounds? How many sounds do you have? Do you load them all at start up or are you loading new sounds during game play?
There has been an OpenAL performance issue reported by the developers of Toki Tori but that is related to generating new OpenAL sources and from a quick look through the Aeterius code it shouldn't be impacted.
Posted 2 years ago # -
the sounds are in aiff and are loaded during game play when they are triggered (ie when an enemy explodes or when the player ship fires bullets). I guess I have to preload all sounds when my app launches? how is this achieved?
thank you,
marc.Posted 2 years ago # -
Make sure the audio category is Solo:
UInt32 sessionCategory = kAudioSessionCategory_SoloAmbientSound; AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(sessionCategory), &sessionCategory); AudioSessionSetActive(true);
On OS 3.0, if the audio session category is set to kAudioSessionCategory_AmbientSound, the sound will be decoded using software instead of hardware, and thus the performance will be degraded.
Osama
--
http://www.vimov.comPosted 2 years ago # -
Wierd,
It works fine for me (compressed ima4 as background music), but I'm using the GBMusictrack code.
Posted 2 years ago # -
I am using GBMusictrack for my background music and cocosdenshion for sound effects (i think a previous version, since in the current demo it is done different)
Anyway, i am loading them in my gamelayer init ... is that correct? What i am sure is that my slowdown is not coming from the audio stuff since removing them makes no difference...Posted 2 years ago # -
@coolman - IMA4 is a very simple compression format so can be decoded very quickly.
@pabloruiz - you don't need to worry if, as you say, removing audio makes no difference. I was asking about maw about how he loads his sound because a game that creates and destroys a lot of sounds during game play could run into difficulty with the issue that has been reported by the Toki Tori developers (OpenAL source creation slowing down).
Posted 2 years ago # -
I had slowdowns about once every 2 seconds in Occurro! in 3.0 (I'm using a modified version of Apple's SoundEngine.cpp & AVAudioPlayer for background music). Setting the session category to MediaPlayback before setting it to SoloAmbient solved the slowdowns. This guarantees (per a couple devs & an Apple engineer at WWDC) that you get the hardware to decode your compressed audio.
Here's the code I use:
//set the session to MediaPlayback to take the audio hardware UInt32 sessionCategory = kAudioSessionCategory_MediaPlayback; AudioSessionSetProperty ( kAudioSessionProperty_AudioCategory, sizeof (sessionCategory), &sessionCategory ); AudioSessionSetActive(TRUE); //now set the session to SoloAmbient for game sounds & background music sessionCategory = kAudioSessionCategory_SoloAmbientSound; AudioSessionSetProperty ( kAudioSessionProperty_AudioCategory, sizeof (sessionCategory), &sessionCategory );Hope this helps!
-BryanPosted 2 years ago # -
Great,
Thanks for sharing Bryan.
Posted 2 years ago # -
OK, so we tested last night, the result is weird: sometimes the game is slow right from the start, sometimes not. But it always slows down after some time and has hickups when sounds are played. Anyone has a clue what this might be? I'm stuck...
thanks,
marc.Posted 2 years ago # -
No, on the official os3. Oh, and its compiled with the SDK 2.2, OS requirement is 2.2 also. I will switch to the 3.0 sdk today, maybe this will fix it...?
Posted 2 years ago # -
Oh, this is getting weirder by the minute. Built it with sdk3.0 now (targeted os 2.2), and the result is that half of the time it runs totally smooth, the other times it runs with constant but slow speed (aprox. halft of the original speed).
Posted 2 years ago # -
I'm also having FPS problems in OS 3.0. And I'm just using a single .caf audio as bg sound (using AVAudioPlayer)... I'll make a few more tests and try to narrow the problem.
rolando./Posted 2 years ago # -
I thought my little spikes of slowdowns were caused by the iphone rather than the 3.0 software. Hmm.
I am playing sounds, so I will check that. I'm using the sound engine provided by cocos2d, and I'm pre-loading the sounds. I'm using .wav files. They are small sounds, and don't seem to cause that much of an issue, but I have noticed some memory leaks relating to audio.
Funny thing is, my business partner is testing our game with my ipod touch, which has 2.2.1, and he says he hasn't seen the game skip or slow down at all. Is the ipod 2g processor faster than the iphone 3g?
I'm thinking my issues are probably related to sound. I'm going to test without any sounds at all and see how it goes. I'll post my results later when I get home. It's annoying, cause this is pending the release of the game. Everything else is working perfectly!!!
Anyone have any ideas on how to fix this? I mean, my game still functions the way it should, it just looks a little choppy at times - and those times aren't often. Is that normal for games? I see some games get choppy at times and other don't. I would like to be in the games that don't get choppy at all category for all devices.
Posted 2 years ago # -
I haven't tested on iPod 2g with 3.0 yet. I'm kind of keeping 2.2.1 on that device for testing purposes.
That is strange though.
Are you using the sound engine that comes with cocos2d 7.3? I'm going to test out CocosDenshion to see if it helps.
I'm also going to comment out anything to do with sound and test it on 3.0 iphone to see how it goes.
I'll let you know how it goes.
What type of fps are you getting? Mine goes as low as 45fps for only about 1 second at most. The worst it might do is not detect when two sprites intersect or something.
Has anyone else found any weird stuff to do with 3.0 causing slowdowns in fps? Maybe something to do with particle systems?
Posted 2 years ago # -
Oh, and yeah, the leaks are tiny. That's why I haven't worried about them at all.
Posted 2 years ago # -
I am sticking to system sounds for now and not using OpenAL anymore. The hickups are gone, but I still have this strange bug on the iPhone (not on iPod!) that sometimes the game runs fine, sometimes one third slower (but without hickups).
marc.
Posted 2 years ago #
Reply
You must log in to post.