I am loading about 70 mp3 files on initial load that are generally all under 2 or 3 seconds. I am not attached to mp3 format if there's a better choice. They play when things happen in an action game, and there can be a lot going on at once. All sounds need to be available. Sometimes it works fine, other times the sounds cut in and out and make the music from the media player cut in and out too.
I have limited polyphony to 4 sounds at once in an attempt to limit cpu, I don't think that's unreasonable. And I still get problems.
The sound pool is running off it's own thread playing sounds from a que of sfx, not being allowed to try to start more than 2 per frame.
I utilize priorities on the sounds so that it should cut lower priority sfx and keep some order on its own.
My internal profiling tool shows the main thread using less than half the time between frames for Cpu and gpu combined, so there should be overhead.
The GPU watch developer tool for Android usually shows a CPU spike of around 50-60% when it's happening, otherwise it sits around 20-30% utilization.
My test device is an S10, it can play Minecraft and stuff fine, so I don't think it should be a hardware issue, I think it's a problem with the way sound pool works.
From what I understand, the sound files are already switched to an internally used format on load, but if changing them will somehow help I'm all for it. I just want it to work and I don't think 4 note polyphony should be that hard. I honestly would use more if it weren't struggling as is.
I can't run sound pool off the main thread or it stutters frame draw.
Does the thread it's on need some kind of priority boost? Is there a better api? Or will changing formats and quality make a difference?
I'm open to suggestions and just figuring someone knows better than me cause games exist on Android that run fine. I don't think I can give you more details? If sound file sample rate matters I can look, but I think sound pool would automatically truncate sounds that would be over the 1mb limit from what the Android web page says. Thanks for any help!