Performance issue caused by SimpleAudioEngine on Android 5.0

SimpleAudioEngine will cause performance issue on Android 5.0.

Reason

SimpleAudioEngine uses SoundPool to play effects. But the implementation of SoundPool has performance issue on Android 5.0. Detail information please refer to this thread.

How to fix

Cocos2d-x added new audio engine since v3.3. It uses OpenSL ES to play effects and background musics. But it is not easy to port it to v2.x, so we made a patch for developers using v2.x.

Steps to use new audio engine in v2.x

  • download this patch
  • upzip the patch and  replace corresponding files
  • compile and run your game

If you want to know the detail modification, you can refer to this commit.

Please let us know if you find any problem.

Thanks.

Posted in programming

Categories