Hi! I’m working on fixing a few audio bugs in an iPhone application and there’s one that sounds like it’s either in FMod or if not hopefully something you’ve run into before and know how to fix it (I’m surprised I can’t find any references to this in the forums anywhere). But when running the application on the ipod touch only (the iPhone is fine apparently) with no headphones plugged in it crashes with the error:
2010-04-19 00:07:51.778 pedroGreen[5654:207] FMOD ERROR(62) at (/Users/sharan/Documents/Code/pedroGreen/Classes/FMOD/FMODEngine.mm:209): Error initializing output device.
Lines 208 and 209 are:
fmodResult = FMOD_EventSystem_Init(self->eventSystem, max_channels, fmod_initflags, (void*)(&(self->extradriverdata)), fmod_event_initflags);
They told me if you plug in the headphones it works fine, although on mine it doesn’t (which may be because I’m running version 3.1.2 of the os on mine and they said they have 3.1.3 on theirs). I’ve tried updating the FMod version to the latest stable version but it didn’t help. Let me know if you have any suggestions. Thanks!
- Sharan asked 7 years ago
Firstly if you link with the logging version of FMOD you get much more verbose reporting of what went wrong on the TTY. In this case however I think I can guess what your problem is.
Are you setting the session category to RecordAndPlay during FMOD init? Previous to 3.1.3 the iPhone wouldn’t care about that but in 3.1.3 you must not set RecordAndPlay if the device has no ability to record. So for an iPod touch without the headset there is no recording capability.
Also the application shouldn’t crash, FMOD should return FMOD_ERR_OUTPUT_INIT or something like that.
I’ll try that!
Yeah, that definitely sounds like it’s the problem. A big part of this application is being able to record sounds, so it’s definitely set to RecordAndPlay. I guess I’ll either have to detect if it has recording capability before initializing it (is there any easy way to do that?) or find a way to catch that error and prevent it from crashing the entire application. I’ll have to look into why it’s crashing entirely and not just returning an error!
For a future version of FMOD I am planning for the API to return FMOD_ERR_NEEDSHARDWARE in this case, however for now you will get FMOD_ERR_OUTPUT_INIT. It may be sufficient to simply "try again" with a different session category in the case of 1 error.
Internally FMOD will detect if a microphone is plugged in so when you go recordStart it will switch the session category as needed.
That’s good to know for the future! It looks like it is getting FMOD_ERR_OUTPUT_INIT and it’s the FMOD_ERROR_CHECK that’s calling exit for anything that’s not FMOD_OK. I’ll just fix it to check for this case and that should solve the problem. Thanks!
Please login first to submit.