0
0

Version Information:
iOS SDK: 4.1
iOS Version: 4.0.2 & 4.1
Hardware: iPhone 4; Might also happen on 3GS
FMOD: 4.32.02

This can really only be tested on an iPhone 3GS or 4. The issue is while the game is running you hold down the Home Button to bring up the Voice Control Interface (Where you can use your voice to speak commands to the iPhone). Then hit cancel to return to the game. After this SOMETIMES the game audio is muted. It appears to simply be every other time. The interrupts below are all from a single game session and were issued consecutively.

[code:1j042sx3]
//Voice Control Started
FMOD: [245012960 ms delta = 12768] OutputCoreAudio::handleInterruption : Audio has been interrupted by an external event... stopping output.
FMOD: [245012960 ms delta = 0] Thread::callback : * FMOD mixer thread finished
FMOD: [245012960 ms delta = 0] Thread::close : FMOD mixer thread thread destroyed
FMOD: [245013232 ms delta = 272] OutputCoreAudio::handleRouteChange : Audio route has change from ‘Speaker’ to ‘Speaker’ (Reason 3).
FMOD: [245013808 ms delta = 576] OutputCoreAudio::handleRouteChange : Audio route has change from ‘ReceiverAndMicrophone’ to ‘Speaker’ (Reason 4).
//Sound incorrectly restored

//Voice Control Started
FMOD: [245039552 ms delta = 25744] OutputCoreAudio::handleInterruption : Audio has been interrupted by an external event... stopping output.
FMOD: [245039824 ms delta = 272] OutputCoreAudio::handleRouteChange : Audio route has change from ‘SpeakerAndMicrophone’ to ‘Speaker’ (Reason 3).
FMOD: [245040208 ms delta = 384] OutputCoreAudio::handleRouteChange : Audio route has change from ‘ReceiverAndMicrophone’ to ‘Speaker’ (Reason 4).
FMOD: [245045024 ms delta = 4816] OutputCoreAudio::handleInterruption : External audio interruption has been resolved... restarting output.
FMOD: [245045232 ms delta = 208] Thread::initThread : Initializing FMOD mixer thread. priority 1
FMOD: [245045232 ms delta = 0] Thread::initThread : – Stacksize 32768. Stack pointer 0x0 : usesemaphore = 1 : sleeptime = 0
FMOD: [245045232 ms delta = 0] Thread::callback : * FMOD mixer thread started
FMOD: [245045232 ms delta = 0] Thread::initThread : done.
FMOD: [245045456 ms delta = 224] OutputCoreAudio::handleRouteChange : Audio route has change from ‘SpeakerAndMicrophone’ to ‘Speaker’ (Reason 3).
//Sound correctly restored

//Voice Control Started
FMOD: [245066592 ms delta = 21136] OutputCoreAudio::handleInterruption : Audio has been interrupted by an external event... stopping output.
FMOD: [245066752 ms delta = 160] Thread::callback : * FMOD mixer thread finished
FMOD: [245066752 ms delta = 0] Thread::close : FMOD mixer thread thread destroyed
FMOD: [245066848 ms delta = 96] OutputCoreAudio::handleRouteChange : Audio route has change from ‘Speaker’ to ‘Speaker’ (Reason 3).
FMOD: [245067664 ms delta = 816] OutputCoreAudio::handleRouteChange : Audio route has change from ‘ReceiverAndMicrophone’ to ‘Speaker’ (Reason 4).
//Sound incorrectly restored

//Voice Control Started
FMOD: [245081008 ms delta = 13344] OutputCoreAudio::handleInterruption : Audio has been interrupted by an external event... stopping output.
FMOD: [245081072 ms delta = 64] OutputCoreAudio::handleRouteChange : Audio route has change from ‘SpeakerAndMicrophone’ to ‘Speaker’ (Reason 3).
FMOD: [245081904 ms delta = 832] OutputCoreAudio::handleRouteChange : Audio route has change from ‘ReceiverAndMicrophone’ to ‘Speaker’ (Reason 4).
FMOD: [245084976 ms delta = 3072] OutputCoreAudio::handleInterruption : External audio interruption has been resolved... restarting output.
FMOD: [245085168 ms delta = 192] Thread::initThread : Initializing FMOD mixer thread. priority 1
FMOD: [245085168 ms delta = 0] Thread::initThread : – Stacksize 32768. Stack pointer 0x0 : usesemaphore = 1 : sleeptime = 0
FMOD: [245085168 ms delta = 0] Thread::callback : * FMOD mixer thread started
FMOD: [245085168 ms delta = 0] Thread::initThread : done.
FMOD: [245085424 ms delta = 256] OutputCoreAudio::handleRouteChange : Audio route has change from ‘SpeakerAndMicrophone’ to ‘Speaker’ (Reason 3).
//Sound correctly restored
[/code:1j042sx3]

  • You must to post comments
0
0

Hmm, looking at that output it is quite clear that there is no interruptionEnd notification coming from the OS when you experience muted sound. Since there is no interruptionEnd FMOD doesn’t know to re-enable the sound playback.

I’m sure if you called the restore audio function when you are in situations where the sound is muted it would come back. By no means am I suggesting that as the solution though, it would just be a good next step to test.

I will have a look into the issue but it will most likely be an OS issue since we are not getting the system callback. This will probably require contacting Apple to see if they have any advice.

  • You must to post comments
0
0

Putting FMOD_IPhone_RestoreAudioSession in the applicationDidBecomeActive seemed to resolve the issue, however as has been mentioned in other forums this causes other problems. Namely, suspending the device now causes audio to be muted.

Incidentally, this can be easily tested on the new iPod Touches. The ones with the front facing camera and microphone. Because it has a microphone you can now perform voice control events on the iPod Touch.

  • You must to post comments
0
0

Yes putting the restore function in applicationDidBecomeActive is a bad idea, it causes many other undesirable issues. I wouldn’t recommend that as a workaround, it’s too unstable.

  • You must to post comments
0
0

I haven’t been able to reproduce the behavior you are experiencing. With my tests the audio session interruption always ends correctly and FMOD audio is restored.

Are you able to make this problem occur with the FMOD samples?

  • You must to post comments
0
0

I’m not sure if this is related, but I thought it might be. Another way to reproduce this issue is as follows:

1) Have an iPhone 4 with iOS 4.0 or above
2) Install an instant messaging client (Like AIM).
3) Log into AIM
4) Use the multi-tasking to start another application that uses FMOD
5) On another computer, you can send a text message to the AIM account.
6) Once the message is received while the FMOD App is running, hit "VIEW" to see the message, and immediately double tap the home button to switch back to the FMOD App.

The FMOD App should have some music continuously looping (We’re using a 22 Khz Ogg file). You may have to repeat the above steps many times. It usually takes us between 5 and 20 attempts. However eventually, you will receive a momentary lock up (About 5 seconds), and the all audio in the FMOD App stops. I found that switching between the FMOD App music and the iPhone iPod music seems to increase the likely hood. Like play iPod Music while the FMOD App is running then switch back to FMOD App Music, then repeat the above steps. Here is a log of what happened.

[code:3wcyhb4n]
FMOD: [113505584 ms delta = 4024] OutputCoreAudio::restoreAudioSession : Restoring audio session.\
FMOD: [113505608 ms delta = 24] Thread::callback : * FMOD mixer thread finished\
FMOD: [113505616 ms delta = 8] Thread::close : FMOD mixer thread thread destroyed\
FMOD: [113505624 ms delta = 8] Thread::initThread : Initializing FMOD mixer thread. priority 1\
FMOD: [113505624 ms delta = 0] Thread::initThread : – Stacksize 32768. Stack pointer 0x0 : usesemaphore = 1 : sleeptime = 0\
FMOD: [113505624 ms delta = 0] Thread::callback : * FMOD mixer thread started\
FMOD: [113505624 ms delta = 0] Thread::initThread : done.\
FMOD: [113510768 ms delta = 5144] OutputCoreAudio::restoreAudioSession : Restoring audio session.\
FMOD: [113510808 ms delta = 40] Thread::callback : * FMOD mixer thread finished\
FMOD: [113510824 ms delta = 16] Thread::close : FMOD mixer thread thread destroyed\
FMOD: [113510832 ms delta = 8] Thread::initThread : Initializing FMOD mixer thread. priority 1\
FMOD: [113510832 ms delta = 0] Thread::initThread : – Stacksize 32768. Stack pointer 0x0 : usesemaphore = 1 : sleeptime = 0\
FMOD: [113510840 ms delta = 8] Thread::callback : * FMOD mixer thread started\
FMOD: [113510840 ms delta = 0] Thread::initThread : done.\
FMOD: [113529304 ms delta = 18464] OutputCoreAudio::restoreAudioSession : Restoring audio session.\
FMOD: [113529552 ms delta = 248] Thread::callback : * FMOD mixer thread finished\
FMOD: [113529552 ms delta = 0] Thread::close : FMOD mixer thread thread destroyed\
FMOD: [113529776 ms delta = 224] Thread::initThread : Initializing FMOD mixer thread. priority 1\
FMOD: [113529776 ms delta = 0] Thread::initThread : – Stacksize 32768. Stack pointer 0x0 : usesemaphore = 1 : sleeptime = 0\
FMOD: [113529776 ms delta = 0] Thread::callback : * FMOD mixer thread started\
FMOD: [113529776 ms delta = 0] Thread::initThread : done.\
FMOD: [113536088 ms delta = 6312] OutputCoreAudio::restoreAudioSession : Restoring audio session.\
FMOD: [113536200 ms delta = 112] Thread::callback : * FMOD mixer thread finished\
FMOD: [113536200 ms delta = 0] Thread::close : FMOD mixer thread thread destroyed\
FMOD: [113545976 ms delta = 9776] OutputCoreAudio::setupAudioUnit : Cannot initialize audio device. (err: 268435459)\
[/code:3wcyhb4n]

From the Device Console:
[code:3wcyhb4n]
Thu Oct 21 21:04:19 unknown Hunting Free[798] <Error>: 21:04:19.619 <0x3e9097c8> Stop posting message to kill mediaserverd (779)
Thu Oct 21 21:04:19 unknown mediaserverd[779] <Error>: <<<< FIGSERVER >>>> FigPlayerRemoteServer_KillAndForceCrashReport: RPCTimeout message received to terminate [779] with reason ‘Stop’
Thu Oct 21 21:04:20 unknown mediaserverd[779] <Error>: <<<< FIGSERVER >>>> FigPlayerRemoteServer_KillAndForceCrashReport: RPCTimeout message received; crash report generated
Thu Oct 21 21:04:20 unknown mediaserverd[779] <Error>: <<<< FIGSERVER >>>> FigPlayerRemoteServer_KillAndForceCrashReport: TERMINATING our process [779]
Thu Oct 21 21:04:20 unknown com.apple.launchd[1] <Notice>: (com.apple.mediaserverd) Exited: Killed
[/code:3wcyhb4n]

The crash report for mediaserverd:

[code:3wcyhb4n]
Incident Identifier: 257704A8-C987-439A-A886-74C61E0EA05F
CrashReporter Key: d52eb16f3198a83da4fc39b1a14b65716d63aa54
Hardware Model: iPhone3,1
Process: mediaserverd [779]
Path: /usr/sbin/mediaserverd
Identifier: mediaserverd
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]

Date/Time: 2010-10-21 21:04:19.655 -0500
OS Version: iPhone OS 4.0.2 (8A400)
Report Version: 104

Exception Type: 00000020
Exception Codes: 0xbe18d1ee
Highlighted Thread: 18

Application Specific Information:
mediaserverd rpc timeout

Thread 0:
0 libSystem.B.dylib 0x000016b4 semaphore_wait_signal_trap + 8
1 libSystem.B.dylib 0x0002ed92 semaphore_wait_signal + 2
2 libSystem.B.dylib 0x000034a4 pthread_mutex_lock + 248
3 AudioToolbox 0x00002022 CAMutex::Lock() + 26
4 AudioToolbox 0x0007df98 AudioToolboxServerHandleInterruption + 812
5 mediaserverd 0x0000dd2a 0x1000 + 52522
6 CoreMedia 0x0002a7b4 cmsCallInterruptionCallback + 188
7 CoreMedia 0x0002ba8c cmsApplier_PostNotification_ResumeCommand + 44
8 CoreMedia 0x0002693c cmsApplyForEachMatchingSession + 136
9 CoreMedia 0x0002a372 cmsmApplicationStateChangedNotificationCallback + 310
10 CoreFoundation 0x0006960c cfnote_callback + 20
11 CoreFoundation 0x00069e6c __CFXNotificationPost_old + 396
12 CoreFoundation 0x0001a374 _CFXNotificationPostNotification + 112
13 Foundation 0x000040bc -[NSNotificationCenter postNotificationName:object:userInfo:] + 64
14 AppSupport 0x0000af0e -[CPDistributedNotificationCenter deliverNotification:userInfo:] + 38
15 AppSupport 0x0000c32e _CPDNDeliverNotification + 198
16 AppSupport 0x0000ae08 _XDeliverNotification + 116
17 AppSupport 0x0000230c migHelperRecievePortCallout + 132
18 CoreFoundation 0x00071aa4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION
+ 20
19 CoreFoundation 0x00073848 __CFRunLoopDoSource1 + 160
20 CoreFoundation 0x00074626 __CFRunLoopRun + 514
21 CoreFoundation 0x0001d8e4 CFRunLoopRunSpecific + 224
22 CoreFoundation 0x0001d7ec CFRunLoopRunInMode + 52
23 mediaserverd 0x00002aa4 0x1000 + 6820
24 mediaserverd 0x000026bc 0x1000 + 5820
[/code:3wcyhb4n]

  • You must to post comments
0
0

With regards to the original problem (with voice control), we are aware of this issue and it affects almost every app on the app store (FMOD or not). It’s a bug we have reported to Apple and there is no current work around.

This looks like you have managed to crash mediaserver daemon, I’ve seen this a few times before. Often when you get "creative" with changing apps, which causes switching of audio sessions you get issues from the OS.

This is similar to the first issue because it involves audio playing while seemingly in between apps. Unfortunately there isn’t much we can do about things like this, we can only report the cases to Apple.

  • You must to post comments
Showing 6 results
Your Answer

Please first to submit.