Sound popping/crashing Android

Home / Forums / Marmalade Archive / Deployment, devices and platforms / Sound popping/crashing Android
4 replies [Last post]
by: Mstr Tea
Status: Offline
Joined: 2011-01-01

Hi,

Having some show stopping issues using the sound extensions on android (playbook/ios works fine).

I`m getting a lot of popping/cracking and if more than a few sounds play it crashes.

As I said iOS/playbook/simulator works fine? I've not ran a debug build yet just wondering if anyone has had these issues on android in the past?

Cheers
Steve

by: Andrei Petrovici
Status: Offline
Joined: 2011-12-22
I've experienced popping

I've experienced popping/cracking with Android.
On a low spec. device mixing many sounds or using complex(to many instructions) generation callbacks can cause popping/cracking.
My most common popping problems where caused by mixing sound samples.
I've had crashes only by thread race conditions.
Do you use generation callbacks?
Do you use end sample callbacks?

by: Mstr Tea
Status: Offline
Joined: 2011-01-01
Hi,

Hi,

All the devices are pretty much med-hi spec ( Nexus 7 included ). I'm using the soundengine extensions that ship with the SDK.

The problem is in the mixing, the crackling/popping is much loader than the samples. Changing the Volume does help to a point, it effects looping samples more it Seems - though it's hard to tell.

Lowing the maxPolyphony helps a little but as killoldest (setting to true) does not work anything under 12 channels sounds pants.

But I've lowered it to 6 channels but still pop/crackling can be heard.

Honna have to spend time looking at it....

Cheers
Steve

by: Andrei Petrovici
Status: Offline
Joined: 2011-12-22
SoundEngine is an example so

SoundEngine is an example so don't rely to much on it... :)
Popping can be achieved when mixing only 2 sounds... or even when generating one sound...
Imagine a simple sin wave sampled. Lets assume that samples are from -1.0f to 1.0f in amplitude (not PCM S16 :) ).
Let's assume I'm playing a sin wave at some freq. and that current sample has amplitude 1.0f. If I want to switch to another sin wave at another frequency starting from amplitude 0.0f, I will probably hear popping. (http://en.wikipedia.org/wiki/Sine_wave).
That's why the more you will lower volume (amplitude) for samples the diff between samples will be less disturbing. Throwing sound after sound to quickly to test the engine it's not a great idea because it's not practical and mixing to many sounds you will get funky results using device limited processing power.
You can choose to let an old explosion continue if your next explosion is at 0.1 sec after the old one and discard the new one.
Try using simple sin waves samples at different frequencies and different amplitudes to see the effect of mixing (my best advice so far).
(http://www.audiocheck.net/audiofrequencysignalgenerator_sinetone.php)

by: Mstr Tea
Status: Offline
Joined: 2011-01-01
thanks andrei

thanks andrei

SoundEngine seems a bit more than example code, or at the least does pretty much what I need ( or I would have done) :)

As it turns out it was the number of the samples being started at the same time and pause/resume.

But the biggest problem was using pause and resume on looping samples - just calling them on android causes popping and if this happened with a few other effects fired out I thought the speakers where about the blow. Setting the vol to 0 instead of a pause worked much better - and the rest was taken care of by just reducing a few less samples.

Cheers for the replies.

Cheers

Latest Posts

Latest Comments

Top Contributors

  • amanda
  • riaan
  • alexand3
  • alexand4
  • alexand7
  • alexand889
  • alexand12191
  • remote9991
  • remote9992
  • test