Recently we have changed the DSP buffer size in an iOS application in order to reduce audio latency, but have found that the FMOD error ‘Error initializing output device.’ seems to be occurring at a much higher rate than before.
The only change we have made was to add
fmodSystem->setDSPBufferSize(256, 4);
whereas this was previously not stated (I presume therefore using the default of 1024, 4)
Is there any reason that decreasing the buffer size would cause this issue to occur at a much higher rate? (~5000% increase in rate of the issue/crash) or anything I could do to investigate further?
I’ve confirmed on all known hardware that this isn’t related to a specific device or iOS version.
Additionally is there any solution to this or steps that should be taken if the output device can’t be initialized on iOS?
Unfortunately not, these are just coming in logged via analytics and not something we’ve ever reproduced.
Is there anything I could log from FMOD that could further diagnose this?
Sorry to resurrect this topic, but I’ve FINALLY got a log from a reproduction (by chance, it isn’t consistently reproduceable)
It may or may not be related to the issue at hand however it presents the same crash and result.
Is this of any use? I presume not without logging libraries…
Sorry I could have been clearer, ‘correctly’ meaning the required configuration for your specific app.
If the default is all you require then that should not be an issue.
We aren’t however in need of anything beyond default AudioSession and this working fine for us in most cases. (There is no code to get a session or to set it active). However the issue in the OP is still happening.
Based on the linked question, do we need to always create an AudioSession even if the default one is sufficient and to handle error cases for it? This seems somewhat strange as this requirement is not documented. (We have no plans to change any audiosession parameters or configuration and therefore do not need to manually set one active)
… cases where the phone has transitioned to the foreground but as far as the audio system is concerned it is still backgrounded causing the AudioSession errors.
iOS will not allow FMOD to run in the background.
To avoid this you will either need to change the AudioSession category or, as mentioned in the linked post, close and retry initializing the FMOD System.