0
0

I can get crashes in a couple different ways. Dealing with getting phone calls while my game is playing. I’m using version 4.32.00; If I updated to 4.32.01 I get crashes evertime I put the app into the background. And the crash happens when I try and call the FMOD Restore function in the on Enter Foreground event. They all crash with the same call stack. So heres a call stack and log.

Call Stack:
[code:16i12ss8]

0 0x001beae8 in FMOD::CodecAudioQueue::fileGetSize

1 0x001beb60 in FMOD::CodecAudioQueue::fileGetSizeCallback

2 0x32e02fc6 in Seekable_DataSource::GetSize

3 0x32e509ce in MPEGAudioFile::ScanForPackets

4 0x32e57784 in AudioFileObject::ReadPacketDataVBR

5 0x32e55c22 in AudioFileObject::ReadPacketData

6 0x32e52a58 in AudioFileObjectHandle::AFAPI_ReadPacketData

7 0x32e54cbe in AudioFileReadPacketData

8 0x001bed00 in FMOD::CodecAudioQueue::processAudioQueue

9 0x001bf3b8 in FMOD::CodecAudioQueue::setPositionInternal

10 0x001c008c in FMOD::CodecAudioQueue::resetAll

11 0x0017c8e0 in FMOD::OutputCoreAudio::reset

12 0x32edc48a in SSServer_AudioSessionInterruptionListenerMessage

13 0x32e8eaa2 in _XAudioSessionInterruptionListenerMessage

14 0x32e2a8ca in mshMIGPerform

15 0x3293daaa in CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION

16 0x3293f84e in __CFRunLoopDoSource1

17 0x3294062c in __CFRunLoopRun

18 0x328e98ea in CFRunLoopRunSpecific

19 0x328e97f2 in CFRunLoopRunInMode

20 0x332396ee in GSEventRunModal

21 0x3323979a in GSEventRun

22 0x305be2a6 in -[UIApplication _run]

23 0x305bce16 in UIApplicationMain

24 0x00037848 in main at main.mm:126

[/code:16i12ss8]

Log:
[code:16i12ss8]
../src/fmod_file.cpp(663): [THREADID 1046206408] [280081344 ms delta = 32] File::close : handle 0x9cce270
../src/fmod_file_user.cpp(239): [THREADID 1046206408] [280081344 ms delta = 0] UserFile::reallyCancel : FAILED
../src/fmod_file.cpp(712): [THREADID 1046206408] [280081344 ms delta = 0] File::close : free mBuffer (mBuffer = 0x1375e10, mBufferMemory = 0x1375e10)
../src/fmod_file.cpp(713): [THREADID 1046206408] [280081344 ms delta = 0] MemPool::free : 2048 bytes (0x1375e10)
../src/fmod_file.cpp(717): [THREADID 1046206408] [280081344 ms delta = 0] File::close : handle 0x9cce270 done
../src/fmod_systemi.cpp(3500): [THREADID 1046206408] [280081344 ms delta = 0] MemPool::free : 480 bytes (0x9cce270)
../src/fmod_systemi.cpp(3550): [THREADID 1046206408] [280081344 ms delta = 0] SystemI::createSoundInternal : No name found in file, use filename.
../src/fmod_systemi.cpp(3630): [THREADID 1046206408] [280081344 ms delta = 0] SystemI::createSoundInternal : done. OpenState now = FMOD_OPENSTATE_READY.
src/fmod_output_coreaudio.cpp(1063): [THREADID 1046206408] [280108416 ms delta = 27072] OutputCoreAudio::restoreAudioSession : Restoring audio session.
src/fmod_output_coreaudio.cpp(842): [THREADID 1046206408] [280120192 ms delta = 11776] OutputCoreAudio::handleInterruption : Audio has been interrupted by an external event... stopping output.
../src/fmod_thread.cpp(67): [THREADID 91811840] [280120384 ms delta = 192] Thread::callback : * FMOD mixer thread finished
src/fmod_os_misc.cpp(727): [THREADID 1046206408] [280120384 ms delta = 0] MemPool::free : 8 bytes (0x513afc0)
src/fmod_os_misc.cpp(727): [THREADID 1046206408] [280120384 ms delta = 0] MemPool::free : 8 bytes (0x513afa0)
../src/fmod_thread.cpp(331): [THREADID 1046206408] [280120384 ms delta = 0] Thread::close : FMOD mixer thread thread destroyed
src/fmod_output_coreaudio.cpp(849): [THREADID 1046206408] [280126240 ms delta = 5856] OutputCoreAudio::handleInterruption : External audio interruption has been resolved... restarting output.

[/code:16i12ss8]

  • You must to post comments
0
0

Which OS version are you using?

Are you able to reproduce this crash using the examples? If you can show us how to reproduce the crash we can investigate.

Also does the same problem occur if the interruption is an alarm (instead of a phone call)?

  • You must to post comments
0
0

Device OS: iOS 4.0
Device Version: iPod Touch equivalent to 3GS iPhone.
Xcode SDK: iOS 4.1
FMOD: 4.32.01

On that version I get a crash in applicationWillEnterForeground when I try to call FMOD_IPhone_RestoreAudioSession. Now interestingly enough this doesn’t happen on the main menu, but it does happen when a level is loaded. Also, I can get it to crash on a calendar event, but again only ingame not on the main menu.

Some general thoughts:

1) I don’t think its an issue of memory as the game also runs on a first generation iPhone so the 3GS touch should have plenty
2) I also don’t think its performance related because of the above
3) Could have something to do with a specific audio file (I have both ogg and mp3).
4) I don’t think any audio files are streaming in either case. All should be loaded (But I need to verify).

If possible, I’d like some more information about the context of the specific function its crashing in. Why is fileGetSize being called, shouldn’t that already be known at this point? We do override the file system call backs (But its not crashing in our callback code); could this be related?

Callstack:
[code:3o7gwe25]

0 0x001c2ac8 in FMOD::CodecAudioQueue::fileGetSize

1 0x001c2b40 in FMOD::CodecAudioQueue::fileGetSizeCallback

2 0x32e02fc6 in Seekable_DataSource::GetSize

3 0x32e509ce in MPEGAudioFile::ScanForPackets

4 0x32e57784 in AudioFileObject::ReadPacketDataVBR

5 0x32e55c22 in AudioFileObject::ReadPacketData

6 0x32e52a58 in AudioFileObjectHandle::AFAPI_ReadPacketData

7 0x32e54cbe in AudioFileReadPacketData

8 0x001c2ce0 in FMOD::CodecAudioQueue::processAudioQueue

9 0x001c3398 in FMOD::CodecAudioQueue::setPositionInternal

10 0x001c406c in FMOD::CodecAudioQueue::resetAll

11 0x00180978 in FMOD::OutputCoreAudio::reset

12 0x001ecb2c in -[FusionAppDelegate applicationWillEnterForeground:] at iphone_appdelegate.mm:363

13 0x3070ab62 in -[UIApplication _handleApplicationResumeEvent:]

14 0x30615a86 in -[UIApplication handleEvent:withNewEvent:]

15 0x30614a5c in -[UIApplication sendEvent:]

16 0x30614506 in _UIApplicationHandleEvent

17 0x3323a146 in PurpleEventCallback

18 0x3323a1d0 in PurpleEventSignalCallback

19 0x3293da8c in CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION

20 0x3293f76e in __CFRunLoopDoSources0

21 0x3294050a in __CFRunLoopRun

22 0x328e98ea in CFRunLoopRunSpecific

23 0x328e97f2 in CFRunLoopRunInMode

24 0x332396ee in GSEventRunModal

25 0x3323979a in GSEventRun

26 0x305be2a6 in -[UIApplication _run]

27 0x305bce16 in UIApplicationMain

28 0x00037b0c in main at main.mm:126

[/code:3o7gwe25]

Log:
[code:3o7gwe25]
FMOD: OutputCoreAudio::restoreAudioSession : Restoring audio session.
FMOD: Thread::callback : * FMOD mixer thread finished
FMOD: Thread::close : FMOD mixer thread thread destroyed
[Switching to thread 11523]
Current language: auto; currently c++
Program received signal: “EXC_BAD_ACCESS”.
[/code:3o7gwe25]

  • You must to post comments
0
0

I haven’t been able to reproduce your crash, would it be possible for you to demonstrate how to recreate it using one of our examples?

The callstack you are seeing is mostly inside Apple SDK functions, their code quite frequently requests the file size while decoding (not sure why). Regardless the size is cached inside our file system interface so it isn’t constantly hitting the disk for that operation.

  • You must to post comments
0
0

I’m currently approaching this from the opposite side. I’m taking my code and simplifying it until it works, and I’ve made some progress. I managed to remove a bunch of the sounds that were being loaded and got it to start working (Both a normal suspend and calendar events). Incidentally it appears that its the handful of mp3s that are loaded thats causing the issue. I’m still doing further testing, but I have most of the ogg files loading without problems. I’m going to try and get all the ogg files loaded, and then see if its a specific mp3 or any mp3s.

Additional thought, I know that mp3s can have special behavior where they use the hardware decoder. How does it decide on whether to use the hardware decoder? Is it based on size. My mp3s are typically mono and several seconds long.

  • You must to post comments
0
0

It appears to be any mp3 in my circumstance, and it doesn’t matter how many I have loaded. Operating under the assumption it has something to do with the hardware decoder is there a quick way to ensure that I don’t use that when loading mp3s.

As to why the mp3s are causing it, I’m not sure. I’ll try and make a test app, but that may be a while.

Some outstanding thoughts:
1) I’m not actually playing any of the mp3s I’ve just cached them, but some of the ogg files are playing. So maybe the mp3 is allocating the hardware decoder, but since its never been played its not fully initialized when it tries to restore.

2) Might be something with the mp3 encoder we’re using, I’d like to just throw in a couple from your examples to make sure its not that.

2.1) Our mp3s are mono, which is somewhat uncommon.

  • You must to post comments
0
0

Thanks for the info, I have tracked down the problem.

The issue is with AudioQueue decoded samples (not streams). I will have this fixed for our next release.

  • You must to post comments
0
0

The next build, is that days, weeks, or months away?

  • You must to post comments
0
0

We are planning for the release to go live later today, providing there are no issues.

  • You must to post comments
Showing 8 results
Your Answer

Please first to submit.