State of audio playback on Android

I was hoping to get a bit of clarification regarding the audio playback in cocos2dx for Android. As I understand it, there are 2 audio systems used in cocos2dx for Android. One of them is specifically to facilitate playback on the Samsung Galaxy S2 range of the devices. Upon testing on this specific device (using the OpenSL implementation), we’ve run into the problem where there is a limit to the number of audio samples that can be loaded.

What I’m unsure of is why there is a completely separate audio implementation for the Galaxy S2. I found this document here: http://www.cocos2d-x.org/wiki/Use_OpenSL_ES_to_play_effect_on_Android however it doesn’t explain the nature of the crashes that people experienced. We tried forcing our Android port to use the default Android audio playback engine in cocos2dx (not the OpenSL) and found it to work absolutely fine without any crashes - perhaps it only affects devices with a certain firmware?

Could somebody please clarify:
# How come there is 2 audio implementations for Android?
# Is there any solution for overcoming the 30 sample limit in the OpenSL implementation?

Any chance I could get some info on this?

  1. there are two audio implementation for android it’s because the soundpool implementation use to crashes on Galaxy S2 or the phones with the same sound chip, I think.
    thus, it will auto switch to the openSL implementation, it’s possible that this bug has been fix on Galaxy S2,It’s been a year now :slight_smile: , so if it works, then I would just go with the SoundPool

  2. If you want, you can try search I9100_MODEL and comment out that code, and you’ll be using the soundpool implementation.

Thanks for the clarification. Although SoundPool appears to work on S2, we haven’t done any extended testing so we’re unlikely to roll this out with a live build for the time being.