FMOD 2.0.0 system->init() crash on iOS14

,

Hi

I’m testing FMOD2.0 core api on iOS14 beta 3 (18A5332e) simulator and facing a crash when trying to init the system.
FMOD::System *system;
FMOD_RESULT result;

result = FMOD::System_Create(&system);
ERRCHECK(result);

result = system->init(32, FMOD_INIT_NORMAL, extradriverdata);
ERRCHECK(result);

Crash info:
Initialize: Mach message timeout. Apparently deadlocked. Aborting now.

CoreSimulator 732.7 - Device: iPhone8_ios14 (C982F92A-B04D-4ED7-AB4D-F8E3BE45E6F9) - Runtime: iOS 14.0 (18A5332e) - DeviceType: iPhone 8

Running same above code on real device iOS14 beta 3 (18A5332f), works fine (no crash).
The only difference we see is the iOS minor version between simulator and real device (‘f’ instead of ‘e’).

Do you familiar with this crash? is something that you need to fix in your library or is it an iOS issue?

Thanks,
Rafael

Have you tried like this?

    FMOD::System     *system;
    FMOD_RESULT       result;
    unsigned int      version;
    /*
        Create a System object and initialize
    */
    result = FMOD::System_Create(&system);
    ERRCHECK(result);

    result = system->getVersion(&version);
    ERRCHECK(result);

    if (version < FMOD_VERSION)
    {
        // FMOD lib version doesn't match header version
    }
    result = system->init(32, FMOD_INIT_NORMAL, NULL);

I just tried to init with NULL, it doesn’t fix.

Hi Rafaelb149,

I can repro the issue. I suspect it’s an issue with the simulator beta, as it doesn’t occur with the last official release. I also was unable to run siri on the simulator.

For the crash, it appears to be reporting that the api cannot connect with a input (ie. microphone). If the issue persists into the full release, please let us know and we will investigate further.

Hi Tristan, I’m getting the exact same issue on iOS13 simulator with latest fmod core api, here’s my output using the libfmodL version :

[LOG] SystemI::init                            : Initialize version=20203 (120077), maxchannels=512, flags=0x00000000
[LOG] SystemI::setOutputInternal               : Setting output to 'FMOD Core Audio Output'
[LOG] OutputCoreAudio::init                    : Hardware buffer size: 256 samples, hardware sample rate: 44100Hz, hardware channels: 2
[LOG] OutputCoreAudio::init                    : Maximum hardware read size: 4096 samples, Software buffer size: 512 samples, Number of software buffers: 8.
[LOG] Thread::initThread                       : Init FMOD stream thread. Affinity: 0x4000000000000003, Priority: 0xFFFF7FFB, Stack Size: 98304, Semaphore: No, Sleep Time: 10, Looping: Yes.
[LOG] Thread::initThread                       : Init FMOD mixer thread. Affinity: 0x4000000000000001, Priority: 0xFFFF7FFA, Stack Size: 81920, Semaphore: Yes, Sleep Time: 0, Looping: Yes.
[39052:7087123]  HALB_IOBufferManager_Client::GetIOBuffer: the stream index is out of range
[39052:7087123]  HALB_IOBufferManager_Client::GetIOBuffer: the stream index is out of range
[39052:7087123] [aqme] AQME.h:254:IOProcFailure: AQDefaultDevice (1): output stream 0: null buffer
[39052:7087123] [aqme] AQMEIO_HAL.cpp:1774:IOProc: EXCEPTION thrown (-50): error != 0
[39052:7086648] Start: Mach message timeout. Apparently deadlocked. Aborting now.
CoreSimulator 776.3 - Device: iPhone 11 (73DBBB55-CEC7-4B17-8F6E-81914046FC66) - Runtime: iOS 13.7 (17H22) - DeviceType: iPhone 11

Hi dZbear,

When we investigated the previous issue, it was due to the simulator, as initializing the audio device would cause the issue and would crash inside the apple api calls. If it’s the same issue, there’s not really anything we can do on our end - the apple apis need to not crash

Having said that, I didn’t encounter any issues testing using up to date simulator releases, and this issue has not shown up on actual devices, so you should be able to work around it by upgrading XCode or testing on device.

Thanks for the reply, there’s actually no issues on simulator for iOS14 and iOS15, can you confirm that you tested this on iOS13 as well? I’m on latest XCode, and some of our devs require the ability to test under iOS13 on Simulator.

It looks like there are other reports of this issue - Simulator crashing with iOS < 1… | Apple Developer Forums - so you will have to get Apple to address the issue.

To workaround it for those developers, you can use the no sound output mode - https://www.fmod.com/resources/documentation-api?version=2.02&page=core-api-system.html#system_setoutput and https://www.fmod.com/resources/documentation-api?version=2.02&page=core-api-system.html#fmod_outputtype

Thanks Tristan, this is helpful.