# Strange noise on android

**URL:** <https://qa.fmod.com/t/strange-noise-on-android/18638>\
**Category:** FMOD Engine\
**Tags:** android, cpp\
**Created:** [April 10, 2022, 5:20am UTC](https://qa.fmod.com/t/strange-noise-on-android/18638 "2022-04-10T05:20:37Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![longjun](https://avatars.discourse-cdn.com/v4/letter/l/3ec8ea/32.png) [@longjun](https://qa.fmod.com/u/longjun)\
**Post date:** [April 10, 2022, 5:20am UTC](https://qa.fmod.com/t/strange-noise-on-android/18638/1 "2022-04-10T05:20:37Z")

</div>

There were a few instances where our game made strange noises after running for a while. It happened on both real android device and simulator. We cannot reproduce it now, and do not know where to start investigate.

Following is the initialization snippet.

```auto
  local system = check_fmod1(fmod.studio.System:create())
  if system == nil then return false end

  local s = check_fmod1(system:getCoreSystem())
  if s == nil then
    system:release()
    return false
  end

  local r = check_fmod2(s:setSoftwareFormat(0, fmod.FMOD_SPEAKERMODE_5POINT1, 0))
  if r ~= fmod.FMOD_OK then
    system:release()
    return false
  end

  local settings
  r, settings = check_fmod2(s:getAdvancedSettings())
  settings.randomSeed = math.floor(os.time())
  check_fmod2(s:setAdvancedSettings(settings))

  local flags_studio = bit.bor(fmod.FMOD_STUDIO_INIT_NORMAL)
  local flags_core = bit.bor(fmod.FMOD_INIT_NORMAL, fmod.FMOD_INIT_3D_RIGHTHANDED)
  if not utils.is_mobile() then
    local profile = false
    flags_studio = bit.bor(flags_studio, fmod.FMOD_STUDIO_INIT_LIVEUPDATE)
    if profile then
      flags_studio = bit.bor(flags_studio, fmod.FMOD_STUDIO_INIT_MEMORY_TRACKING)
    end
  end

  r = check_fmod2(system:initialize(512, flags_studio, flags_core))
  if r ~= fmod.FMOD_OK then
    system:release()
    return false
  end

```

System:mixerSuspend is called when main activity enters background and the mixer is resumed after it enters foreground. However, everything is ok on desktop and ios platform.

I have the noise audio, but it seems I cannot upload it. Can you please help? FMOD Engine version is 2.02.

---

<div class="post-metadata">

**Author:** ![longjun](https://avatars.discourse-cdn.com/v4/letter/l/3ec8ea/32.png) [@longjun](https://qa.fmod.com/u/longjun)\
**Post date:** [April 10, 2022, 5:34am UTC](https://qa.fmod.com/t/strange-noise-on-android/18638/2 "2022-04-10T05:34:47Z")

</div>

Here is the [noise](http://106.15.139.153:8009/and/noise.m4a) audio.

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [April 13, 2022, 4:34am UTC](https://qa.fmod.com/t/strange-noise-on-android/18638/3 "2022-04-13T04:34:57Z")

</div>

The link to the noise file is no longer working, can you please upload it to your [FMOD Profile](https://www.fmod.com/profile#uploads) so I can listen to it?  
We do not mantain a Lua wrapper, are you using a 3rd party FMOD integration? If so then you might want to ask the developers maintaining the Lua wrapper to see if this an issue they are aware of.

---

<div class="post-metadata">

**Author:** ![longjun](https://avatars.discourse-cdn.com/v4/letter/l/3ec8ea/32.png) [@longjun](https://qa.fmod.com/u/longjun)\
**Post date:** [April 22, 2022, 7:46am UTC](https://qa.fmod.com/t/strange-noise-on-android/18638/4 "2022-04-22T07:46:26Z")

</div>

Thank you very much.  
Can you please check this [url](https://www.dropbox.com/s/o3wb2ljnppn2hhl/noise.m4a?dl=0)? I just exported every FMOD API to Lua directly. Bank loading and audio playing logic are all fired from the script.

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [April 28, 2022, 3:26am UTC](https://qa.fmod.com/t/strange-noise-on-android/18638/5 "2022-04-28T03:26:17Z")

</div>

Can you please try implementing a [Debug Callback](https://fmod.com/resources/documentation-api?version=2.02&page=core-api-common.html#fmod_debug_callback) and set the logging level to [`FMOD_DEBUG_LEVEL_LOG`](https://fmod.com/resources/documentation-api?version=2.02&page=core-api-common.html#fmod_debug_flags) in [`Debug_Initialize`](https://fmod.com/resources/documentation-api?version=2.02&page=core-api-common.html#debug_initialize), then see if you are getting any errors or warnings when the issue occurs? With this kind of audible stuttering I would expect there to be warnings about buffer delay being exceeded or sounds being delayed.

---

<div class="post-metadata">

**Author:** ![longjun](https://avatars.discourse-cdn.com/v4/letter/l/3ec8ea/32.png) [@longjun](https://qa.fmod.com/u/longjun)\
**Post date:** [April 29, 2022, 2:10am UTC](https://qa.fmod.com/t/strange-noise-on-android/18638/6 "2022-04-29T02:10:45Z")

</div>

Thank you jeff. I will try to catch the debug log.

---

<div class="post-metadata">

**Author:** ![longjun](https://avatars.discourse-cdn.com/v4/letter/l/3ec8ea/32.png) [@longjun](https://qa.fmod.com/u/longjun)\
**Post date:** [May 3, 2022, 7:02am UTC](https://qa.fmod.com/t/strange-noise-on-android/18638/7 "2022-05-03T07:02:31Z")

</div>

Hi Jeff,  
I’ve caught the logs while this issue occurs. There are some warnings about sample loading. However, there isn’t any errors. The audible stuttering was disappeared about 10 minutes later.  
Any suggestions? I will fix the warnings firstly to check the problem again.

```
                                                                     Thanks,
                                                                     LJ

```

```auto
TID -1268254432 : 94 ms +1 : [WRN] OutputOpenSL::init : Only mono and stereo supported, defaulting to stereo.
TID -1347127008 : 4609 ms +11 : [WRN] SoundSourceInstrumentInstance::startChannelIfReady : Loading delay exceeded, sound may play at incorrect time
TID -1347127008 : 222194 ms +189 : [WRN] EventInstance::update : Event {a12310bb-b5d8-41e6-ad6d-24eba6f41517} waited 191 milliseconds for sample data to load. Preload sample data to avoid this delay.
TID -1347127008 : 233418 ms +79 : [WRN] PlaybackSystem::onDestroyEvent : Destroying event instance '205700' due to event description {a12310bb-b5d8-41e6-ad6d-24eba6f41517} unload
TID -1347127008 : 285001 ms +67 : [WRN] PlaybackSystem::onDestroyEvent : Destroying event instance '205b00' due to event description {a12310bb-b5d8-41e6-ad6d-24eba6f41517} unload
TID -1347127008 : 292126 ms +1 : [WRN] SoundSourceInstrumentInstance::startChannelIfReady : Loading delay exceeded, sound may play at incorrect time
TID -1347127008 : 389324 ms +79 : [WRN] PlaybackSystem::onDestroyEvent : Destroying event instance '208c00' due to event description {a12310bb-b5d8-41e6-ad6d-24eba6f41517} unload
TID -1347127008 : 432186 ms +56 : [WRN] PlaybackSystem::onDestroyEvent : Destroying event instance '209000' due to event description {a12310bb-b5d8-41e6-ad6d-24eba6f41517} unload
TID -1347127008 : 439355 ms +14 : [WRN] SoundSourceInstrumentInstance::startChannelIfReady : Loading delay exceeded, sound may play at incorrect time
TID -1347127008 : 491046 ms +64 : [WRN] PlaybackSystem::onDestroyEvent : Destroying event instance '209f00' due to event description {a12310bb-b5d8-41e6-ad6d-24eba6f41517} unload
TID -1347127008 : 554473 ms +64 : [WRN] PlaybackSystem::onDestroyEvent : Destroying event instance '20a300' due to event description {a12310bb-b5d8-41e6-ad6d-24eba6f41517} unload
TID -1347127008 : 759895 ms +57 : [WRN] PlaybackSystem::onDestroyEvent : Destroying event instance '20a700' due to event description {a12310bb-b5d8-41e6-ad6d-24eba6f41517} unload
TID -1347127008 : 785668 ms +60 : [WRN] PlaybackSystem::onDestroyEvent : Destroying event instance '20ab00' due to event description {a12310bb-b5d8-41e6-ad6d-24eba6f41517} unload
TID -1347127008 : 892957 ms +8 : [WRN] PlaybackSystem::onDestroyEvent : Destroying event instance '20af00' due to event description {d77b97a8-34f0-41b3-bd8d-58f76f39f756} unload
TID -1347127008 : 898397 ms +159 : [WRN] PlaybackSystem::onDestroyEvent : Destroying event instance '20b300' due to event description {d77b97a8-34f0-41b3-bd8d-58f76f39f756} unload
TID -1347127008 : 903283 ms +160 : [WRN] PlaybackSystem::onDestroyEvent : Destroying event instance '20b700' due to event description {d77b97a8-34f0-41b3-bd8d-58f76f39f756} unload
TID -1347127008 : 912435 ms +139 : [WRN] PlaybackSystem::onDestroyEvent : Destroying event instance '20bb00' due to event description {d77b97a8-34f0-41b3-bd8d-58f76f39f756} unload
TID -1347127008 : 922036 ms +252 : [WRN] PlaybackSystem::onDestroyEvent : Destroying event instance '20bf00' due to event description {d77b97a8-34f0-41b3-bd8d-58f76f39f756} unload
TID -1347127008 : 1082148 ms +12 : [WRN] PlaybackSystem::onDestroyEvent : Destroying event instance '20c300' due to event description {d77b97a8-34f0-41b3-bd8d-58f76f39f756} unload
TID -1347127008 : 1082148 ms +0 : [WRN] PlaybackSystem::onDestroyEvent : Destroying event instance '20c500' due to event description {d77b97a8-34f0-41b3-bd8d-58f76f39f756} unload
TID -1347127008 : 2327006 ms +18 : [WRN] SoundSourceInstrumentInstance::startChannelIfReady : Loading delay exceeded, sound may play at incorrect time
TID -1347127008 : 2329119 ms +63 : [WRN] EventInstance::update : Event {9961922b-a61a-44b0-90c2-ecb8ddd498aa} waited 64 milliseconds for sample data to load. Preload sample data to avoid this delay.
TID -1347127008 : 2348703 ms +277 : [WRN] PlaybackSystem::onDestroyEvent : Destroying event instance '20cf00' due to event description {35733288-b0af-4875-961e-db966ccf5725} unload
TID -1347127008 : 2360312 ms +1 : [WRN] PlaybackSystem::onDestroyEvent : Destroying event instance '20c900' due to event description {92c32f03-4cc8-40c2-9cff-9ac07db10b24} unload

```

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [May 4, 2022, 12:49am UTC](https://qa.fmod.com/t/strange-noise-on-android/18638/8 "2022-05-04T00:49:41Z")

</div>

Thank you for sending that through, the “Loading delay exceeded” warnings can be resolved by preloading sample data with [`EventDescription::loadSampleData`](https://fmod.com/resources/documentation-api?version=2.02&page=studio-api-eventdescription.html#studio_eventdescription_loadsampledata) on the offending events. You can also preload all the events in a bank using [`Bank::loadSampleData`](https://fmod.com/resources/documentation-api?version=2.02&page=studio-api-bank.html#studio_bank_loadsampledata).  
Some other general things to try, ensure you only ever have 1 or 2 [streaming assets](https://fmod.com/resources/documentation-studio?version=2.02&page=managing-assets.html#loading-modes) playing at once, and perhaps increase your buffer size using [`System::setDSPBufferSize`](https://fmod.com/resources/documentation-api?version=2.02&page=core-api-system.html#system_setdspbuffersize).

---

<div class="post-metadata">

**Author:** ![longjun](https://avatars.discourse-cdn.com/v4/letter/l/3ec8ea/32.png) [@longjun](https://qa.fmod.com/u/longjun)\
**Post date:** [May 7, 2022, 11:48am UTC](https://qa.fmod.com/t/strange-noise-on-android/18638/9 "2022-05-07T11:48:08Z")

</div>

Thank you Jeff. I’m sure the error does not occur any more after the loading issue was fixed.
