Pop noise when starting

I’m currently working on an Android project with FMOD.
When it plays an mp3 file for the first time, there’s no problem.
But after that, I can hear a pop noise when I start playing ANY FILE again.

I tried :
-Open SL ES
-The latest version (2.01.05)

I’m using Galaxy S10 Plus, by the way. (Android 10)

To me, it seemed like FMOD kept a little bit of the former audio in the buffer and that part was shortly played right before starting.
That’s why there’s no noise when starting for the first time or when the former audio ends/stops with low volume.

I think this issue can be fixed if there’s any way for me to free the buffer manually before calling FMOD_System_PlaySound().

All I did was this :

FMOD_System_CreateSound(g_System, filePath, FMOD_CREATESAMPLE, NULL, &g_Sound);
FMOD_System_PlaySound(g_System, g_Sound, g_ChannelGroup, TRUE, &g_SoundChannel);
FMOD_Channel_SetPosition(g_SoundChannel, newPos, FMOD_TIMEUNIT_MS);
FMOD_Channel_SetPaused(g_SoundChannel, FALSE);

What can I do to solve this problem?

One more question.

I know I need to add a little bit of ramp manually before muting/pausing/stopping in the middle of the loud sound to avoid a pop noise.

But what about unmuting and unpausing?
Do I need to implement a small fade-in for these features myself too?
Do other audio players do this internally to prevent such a noise?

Have you tried our examples? Do you hear this issue in them?
If not perhaps there is something different about your code compared to ours?
Also try using your sounds in our examples, does that show the issue?

FMOD will perform volume ramping for setVolume and setMute to avoid pops, using setPause will be abrupt though.

OK, I’ll test again and let you know about this when I get back home.

Btw, I found the AAudio related bugs I reported the other day still exist in the latest version 2.01.05.

When I read this part, “Core API - Android - Fixed issues with headphone detection with AAudio.”, in the revision history, I was really happy to try it, but sadly, still there.

I’m not sure if this only happens with my device Samsung Galaxy S10 Plus(Android 10), but I can say it’s definitely a problem because FMOD runs smoothly when Open SL ES is chosen.

  1. I can hear click/pop noises when playing with AAudio. This is very intermittent and occurs just a few times so you really need to listen carefully to notice. The reason why I want AAudio on the recent Android devices over Open SL ES is better user experience, but this minor but annoying issue is ruining it.
  2. Now it seems FMOD with AAudio knows if I plug/unplug, but all the audio is gone whenever that happens. (The old version wasn’t like this. It just kept playing with the first output.) When I unplug my headphones, I can hear nothing, so I plug in back again, still no sound until I restart the app. The opposite is also true.

Update :

I opened the “play_sound” example project, replaced one of the original sound files with mine, tested.

Below are my findings :

  1. No noise when starting, unlike my project.
  2. No AAudio headphone issue, unlike mine.
  3. The same AAudio click/pop noise issue like my project.

As for the number one and two, I need more time to check myself. I put all the same code into the example project, but it’s working fine there, so really don’t get it.

But as for number three, please test it yourself with a long sound/music file. Noise may be very subtle, but it’s definitely there.

I deeply apologize.
Headphone detection with AAudio works really well! Thank you for the fix.
I forgot to add an AttachCurrentThread() call to my worker thread. I didn’t know this at all until now, because the OpenSL ES mode had been working like a charm without it so far.
For the starting noise issue, I’m still investigating.

Hello again!

My assumption was right. Well, kind of.
One DSP added to a channel group was causing the issue.
Calling FMOD_DSP_Reset() after FMOD_Channel_Stop() or before another FMOD_System_PlaySound() call prevented the noise.

As for intermittent and subtle noises, I’m confused.
Yesterday, I could hear them even with your example projects, but now, I can’t tell it’s still there.
I think I heard once or twice today, and that’s all.
So for now, I don’t really have any complaints about AAudio.

Thank you.

Update : I can hear AAudio noise… OpenSL ES works better. sad…