Strange noise on android

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.

  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.

Here is the noise audio.

The link to the noise file is no longer working, can you please upload it to your FMOD Profile 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.

Thank you very much.
Can you please check this url? I just exported every FMOD API to Lua directly. Bank loading and audio playing logic are all fired from the script.

Can you please try implementing a Debug Callback and set the logging level to FMOD_DEBUG_LEVEL_LOG in 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.

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

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
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

Thank you for sending that through, the “Loading delay exceeded” warnings can be resolved by preloading sample data with EventDescription::loadSampleData on the offending events. You can also preload all the events in a bank using Bank::loadSampleData.
Some other general things to try, ensure you only ever have 1 or 2 streaming assets playing at once, and perhaps increase your buffer size using System::setDSPBufferSize.

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