I’ve got a early version of a game that has been happily working with FMod for a year or so. As verified by the log output, I’m using:
[LOG] System::create : Header version = 1.10.02. Current version = 1.10.02.
In recent builds of iOS (repros on 11.0.3 for sure) calling mixerSuspend() will stop sound as always, but mixerResume() has stopped resuming sound. It just plays a .25 sec blip of sound and then shuts off.
I have tried just calling suspend and resume while the app is running (i.e. not when it is going into the background as I normally do) to make sure this isn’t a lifecycle thing, same result.
When the sound is off (but supposed to be resumed) I can still successfully play sounds using the iOS AudioToolbox library like this:
SystemSoundID audioEffect;
OSStatus error = AudioServicesCreateSystemSoundID((__bridge CFURLRef)pathURL, &audioEffect);
AudioServicesPlaySystemSoundWithCompletion(audioEffect, nullptr);
So I don’t think it is a AVAudioSession misconfiguration or something. As I said, exact same code I’ve had for a long time.
If I run with the debug libraries all I get is (my traces intermixed with the FMOD traces which have [LOG]):
2018-01-18 17:47:41.634479-0800 Exospecies[6192:2223615] 0118 17:47:41 ^0.0237 AudioDevice::Update m_lowLevelSystem->mixerSuspend()
[LOG] SystemI::mixerSuspend : Suspending output.
…Go do some stuff…
2018-01-18 17:47:47.771253-0800 Exospecies[6192:2223615] 0118 17:47:47 ^0.0000 AudioDevice::Update m_lowLevelSystem->mixerResume()
[LOG] SystemI::mixerResume : Resuming output.
But no sound and no error traces or anything.
I noticed that if I call flushCommands() while in this state, I get a little burst of sound.
If I play a sound after resume here are the logs I see:
[LOG] SystemI::createSound : filename = /var/mobile/Containers/Data/Application/0DE55183-119A-46E1-B905-2B7B977F3C4F/Library/Application Support/com.inductorsoftware.mantis/_ManifestSegments/Waspid24.dat/sounds.bank : mode 02012082
[LOG] SystemI::createSound : FMOD_NONBLOCKING specified. Putting into queue to be opened asynchronously!
[LOG] SystemI::createSound : setdata soundi = 0x104ff65d8 : node = 0x10e536260
[LOG] SystemI::createSound : add node to async list : head = 0x104ffb4f8. list count = 0
[LOG] AsyncThread::threadFunc : Starting Asynchronous operation on sound 0x104ff65d8
[LOG] SystemI::createSoundInternal : filename = /var/mobile/Containers/Data/Application/0DE55183-119A-46E1-B905-2B7B977F3C4F/Library/Application Support/com.inductorsoftware.mantis/_ManifestSegments/Waspid24.dat/sounds.bank : mode 02012082[LOG] SystemI::createSoundInternal : exinfo->cbsize = 232
[LOG] SystemI::createSoundInternal : exinfo->length = 1635168
[LOG] SystemI::createSoundInternal : exinfo->fileoffset = 65952
[LOG] SystemI::createSoundInternal : exinfo->numsubsounds = 1
[LOG] SystemI::createSoundInternal : exinfo->inclusionlist = 0x10e536378
[LOG] SystemI::createSoundInternal : exinfo->inclusionlistnum = 1
[LOG] SystemI::createSoundInternal : exinfo->suggestedsoundtype = 5
[LOG] SystemI::createSoundInternal : Format has 1 subsounds.
[LOG] SystemI::createSoundInternal : Create as FMOD_CREATESTREAM
[LOG] System::createSoundInternal : decode buffersize = 9472 : blocksize = 256 : format = 2
[LOG] SystemI::createSample : mode 02012082 length 9472 samples, lengthbytes 787648
[LOG] SystemI::createSample : channels = 2
[LOG] SystemI::createSample : output = 0x107045cf8
[LOG] OutputSoftware::createSample : lengthpcm 9472, lengthbytes 787648, channels 2, format 2, freq 24000, mode 0201208a
[LOG] System::createSoundInternal : 1 subsounds detected.
[LOG] System::createSoundInternal : Seek stream to start
[LOG] System::createSoundInternal : switch file handle from small blocking single buffered to large nonblocking doublebuffered.
[LOG] SystemI::createSoundInternal : done. OpenState now = FMOD_OPENSTATE_READY.
[LOG] AsyncThread::threadFunc : Finished Asynchronous operation on sound 0x104ff65d8
[LOG] SoundI::getSubSound : sound 0x104ff65d8. Subsound index 0 / 1
[LOG] SoundI::getSubSound : starting non blocking seek and setting sound to not ready state
[LOG] SoundI::getSubSound : finished preparing nonblocking getSubSound seek
[LOG] AsyncThread::threadFunc : Starting Asynchronous operation on sound 0x107034fa8
[LOG] AsyncThread::threadFunc : done setposition
[LOG] AsyncThread::threadFunc : done flush
[LOG] AsyncThread::threadFunc : Finished Asynchronous operation on sound 0x107034fa8
[LOG] AsyncThread::threadFunc : Starting Asynchronous operation on sound 0x107034fa8
[LOG] AsyncThread::threadFunc : Finished Asynchronous operation on sound 0x107034fa8
[LOG] SoundI::release : 205966__kangaroovindaloo__medium-wind (0x10707dd98)
[LOG] SoundI::release : remove stream samples. (0x10707dd98)
[LOG] SoundI::release : 205966__kangaroovindaloo__medium-wind (0x10e535798)
[LOG] SoundI::release : done
[LOG] SoundI::release : release subsounds. (0x10707dd98)
[LOG] SoundI::release : 205966__kangaroovindaloo__medium-wind (0x10e535928)
[LOG] SoundI::release : done
[LOG] SoundI::release : release codec. (0x10707dd98)
[LOG] Codec::release : Free PCM Buffer
[LOG] SoundI::release : done
Any ideas?