I’ve included my profile results for my game on iPhone 4, it’s a 3D racer with dynamic music (although turning off the stitching doesn’t change the performance) and many sound fx so I think it’s quite representative off a normal high-ish budget iPhone game.
Most sfx are pretty high quality although all are mono, 16bit and 22050Hz and the music are mp3 files encoded at stereo, 44 KHz at 160bit.
The question I have is there a reason for the peaks and troughs of the stream and is that something to worry about. I thought it might have been the stitching but I tried it with and without and no difference.
It’s a little bit much with 3GS so if you think this looks fine I’ll just have to start cutting or decreasing the quality.
- Adversus asked 8 years ago
Firstly as a quick note, if some of your sound effects do not adjust their pitch at runtime you can get a performance boost by resampling them to 24KHz offline, this is so FMOD doesn’t have to do it.
For your music, it should be using the hardware decoder, so the usage you are seeing probably isn’t ‘true’ CPU usage. The hardware decoder runs on it’s own chip, our code will wait for it to decode (sleep, yielding to other threads), so it looks worse than it is. It operates in blocks so that might explain the sawtooth graph. Also note using AAC for music is more efficient.
Finally if you want more accurate overall performance numbers, try disabling profiler and using getCPUUsage. The functions that profile each node add some cost on iPhone (unfortunately) due to expensive iPhone timing code.
Just to clarify…
[quote:3sgkenyu]I didn’t realise AAC was supported (it wasn’t last time I tried) so I’ll move over to that.[/quote:3sgkenyu]
AAC is supported on iPhone only, we make use of the AudioQueue API to allow decoding of MP3, AAC and ALAC via the Apple hardware / software codecs, for which AAC is quite efficient. The restriction with this is the iPhone only has 1 hardware decoder, once it has been used software codecs are used.
Oh that’s good news, I’ve locked it to only use the hardware using FMOD_AUDIOQUEUE_EXTRACODECDATA so it’s probably fine then.
I didn’t realise AAC was supported (it wasn’t last time I tried) so I’ll move over to that.
I’ve just set the internal software format to 22050, missed that in the doc:-). I read this is a better internal format for the iPhone, honestly though I think the differences are probably neglible. I do however change the pitch for the engines but most will be using this frequency.
I think that’s good news, 5%to10% for sfx isn’t too bad for 100 virtual voices and 16 channels in 3D. The main thing was really the spiking but it makes sense that this perhaps isn’t the true result.
- Adversus answered 8 years ago
Please login first to submit.