0
0

With iOS 4 and FMOD, audio playback works fine in the background during a multitasking session until another app interrupts the audio. When my app returns to the foreground, the audio session is no longer valid and no sound is generated. Although, FMOD continues to function as if it had a valid audio session.

I don’t see any callbacks inside FMOD to inform me when the audio session has been interrupted so I know to reinitialize the next time I become active. I do see a system callback for when system audio devices have changed. Is this the callback I’m looking for? Am I missing something or do I have to do this through the iOS apis? If so, is there a way for me to get the audio session handle from FMOD?

I appreciate any help you can provide on this.

Thanks,
Tim

  • You must to post comments
0
0

I believe there is an OS bug involved here that is causing the 560161140 error you are receiving however unfortunately I have not been able to reproduce it. Discussion on the Apple developer forums seems to indicate the problem may not be FMOD specific.

With our next release there will be function introduced that restores audio playback. While it isn’t intended as a solution for your problem, I would be interested to know if it works, it would help isolate the problem.

  • You must to post comments
0
0

Thanks for that.

I have taken a look into the code and I have implemented an improvement to FMOD_IPhone_RestoreAudioSession() which should ensure the everything is reset properly.

This change will be in our next release.

  • You must to post comments
0
0

I highly recommend you don’t call native AudioSession functions behind FMODs back as we maintain internal state that could be confused by this.

Rejecting a phone call should behave correctly already, you should receive an interruption notification at the start of the call and an interruption end notification and the end. Can you confirm this behavior and/or observe any errors by linking with the logging version of FMOD and posting the TTY output?

  • You must to post comments
0
0

@Dreamknight

Are you calling FMOD_IPhone_RestoreAudioSession in applicationDidBecomeActive? I believe phone calls are now backgrounding the app temporarily which requires intervention to revive.

@Ringo

Is this happening with 4.32.01? Can you provide TTY output showing what happens when you lock / unlock the device?

  • You must to post comments
0
0

Yes. In the next version I hope it goes away’m the problem.

please, Tell me when the next version will come out.

  • You must to post comments
0
0

[quote="mathew":1ujnb3lx]Thanks for that.

I have taken a look into the code and I have implemented an improvement to FMOD_IPhone_RestoreAudioSession() which should ensure the everything is reset properly.

This change will be in our next release.[/quote:1ujnb3lx]

thanks. but the problem occurs when I lock/unlock the iPhone too, should we use this function in applicationDidBecomeActive too?

  • You must to post comments
0
0

This is FMOD LOG .. is this What you wan’t.. :) ?
I can’t find any error..

<————————————–LOG ————————->
2010-07-15 10:14:20.926 iPhoneTest[662:307] kAudioSessionBeginInterruption
FMOD: EventI::stopInternal : 0x606b6b0 1
FMOD: EventGroupI::freeEventDataInternal : eventgroup [SE] 0x440001
FMOD: EventI::release : [Hit_Wall]
FMOD: EventI::stopInternal : 0x606b2e0 1
FMOD: EventI::release : done
FMOD: SoundI::release : Hit_Wall.wav (0x607fbb8)
FMOD: SoundI::release : free this. (0x607fbb8)
FMOD: SoundI::release : done (0x607fbb8)
FMOD: SoundI::release : Probaseball_bank01.fsb (0x607f938)
FMOD: SoundI::release : release codec. (0x607f938)
FMOD: Codec::release :
FMOD: CodecFSB::closeInternal :
FMOD: Codec::release :
FMOD: Plugin::release : (0x606d720)
FMOD: Plugin::release : done
FMOD: Codec::release : done
FMOD: CodecFSB::closeInternal : done
FMOD: Plugin::release : (0x606bf98)
FMOD: Plugin::release : done
FMOD: Codec::release : done
FMOD: SoundI::release : free this. (0x607f938)
FMOD: SoundI::release : done (0x607f938)
FMOD: EventGroupI::freeEventDataInternal : done

2010-07-15 10:14:22.498 iPhoneTest[662:307] kAudioSessionEndInterruption
FMOD: EventI::stopInternal : 0x606b2e0 1
FMOD: EventGroupI::loadEventDataInternal : m_flags: 00000000
FMOD: SystemI::createSoundInternal : filename = /var/mobile/Applications/A7243D0C-0755-4BB5-AE94-78B6DAE5874F/iPhoneTest.app/Probaseball_bank01.fsb : mode 00000202
FMOD: SystemI::createSoundInternal : exinfo->cbsize = 124
FMOD: SystemI::createSoundInternal : exinfo->inclusionlist = 0x2fffd320
FMOD: SystemI::createSoundInternal : exinfo->inclusionlistnum = 1
FMOD: SystemI::createSoundInternal : exinfo->suggestedsoundtype = 8
FMOD: SystemI::createSoundInternal : 17 codecs found. Scan all until one succeeds
FMOD: CodecFSB::openInternal : attempting to open as FSB..
FMOD: CodecFSB::openInternal : found FSB4
FMOD: CodecFSB::openInternal : FSB contains 51 sounds
FMOD: CodecFSB::openInternal : done.
FMOD: SystemI::createSoundInternal : Format has 51 subsounds.
FMOD: SystemI::createSoundInternal : Create as FMOD_CREATESAMPLE
FMOD: SystemI::createSoundInternal : Multi-sample sound (51 subsounds), create a sample container.
FMOD: SystemI::createSoundInternal : creating subsound 2/51
FMOD: SystemI::createSample : mode 00000202 length 20672 samples, lengthbytes 11648
FMOD: SystemI::createSample : subsamples = 1, channels = 1
FMOD: SystemI::createSample : subsample 0. output = 0x6014678
FMOD: SystemI::createSample : mSoftware = 0x6014678
FMOD: OutputSoftware::createSample : lengthpcm 20672, lengthbytes 11648, channels 1, format 7, mode 0000024a
FMOD: OutputSoftware::createSample : done
FMOD: SystemI::createSample : done
FMOD: CodecFSB::setPositionInternal : subsound 2 position 0 postype 8
FMOD: CodecFSB::setPositionInternal : done
FMOD: SystemI::createSoundInternal : No name found in file, use filename.
FMOD: SystemI::createSoundInternal : done. OpenState now = FMOD_OPENSTATE_READY.

FMOD: EventI::stopInternal : 0x606b6b0 1
FMOD: EventGroupI::loadEventDataInternal : m_flags: 00000000
FMOD: EventI::start : 0x606b6b0
FMOD: SoundI::getSubSound : sound 0x60831d0. Subsound index 13 / 14
FMOD: SoundI::getSubSound : sound 0x60831d0. Subsound index 13 / 14
FMOD: CodecFSB::setPositionInternal : subsound 13 position 0 postype 2
FMOD: CodecFSB::setPositionInternal : done
<————————————–LOG ————————->

but…. no sound output.

  • You must to post comments
0
0

of cause :)

I tried "FMOD_IPhone_RestoreAudioSession" like your advise yesterday.

but I met Link error. only one ๐Ÿ˜•
[i:1d1fmtz4] "_FMOD_IPhone_RestoreAudioSession", referenced from:
-[TemplateAppDelegate applicationDidBecomeActive:] in CocoonTemplate_NBCAppDelegate.o
ld: symbol(s) not found
collect2: ld returned 1 exit status[/i:1d1fmtz4]

error is only 1.

How can I solve this problem.

  • You must to post comments
0
0

Yes, it would be great to know when the next dev build is going to be released. The update of our game is only waiting for this, so I’m a little bit eager to get it ๐Ÿ˜€

  • You must to post comments
0
0

When the phone is locked we get no notification from the audio APIs, so yes you would need to use the restore function when coming back from a lock in the case of using the AudioQueue codecs. If you are not using AudioQueue codecs everything should be restored correctly by the OS.

  • You must to post comments
0
0

That log didn’t contain an interruptions from FMOD, only your interruption prints. Does that log snippit represent declining a phone call?

Also do you have the same problem when an alarm triggers while the app is running?

  • You must to post comments
0
0

That is odd indeed, I have just installed a clean 4.32.01, opened the playsound example and added the following to ExampleAppDelegate.mm. This compiles correctly.

[code:36d530im]#import "fmodiphone.h"

  • (void)applicationDidBecomeActive:(UIApplication *)application
    {
    FMOD_IPhone_RestoreAudioSession();
    }[/code:36d530im]

You can also verify the lib has the symbol with:

[code:36d530im]nm libfmodex_iphoneos.a | c++filt | grep RestoreAudioSession[/code:36d530im]

  • You must to post comments
0
0

The version has been released now.

  • You must to post comments
0
0

Thanks Mathew.

any idea when the updated version will be available in the dev branche?

  • You must to post comments
0
0

yes I can see same error on alarm triggers.

On
i remove all AudioSessionSetActive funcion from code and test .

Same problem remained yet.

:(

  • You must to post comments
0
0

Mathew, yes – this was happening with 4.32.01. As for logs – i’ve sent you text file by email.

  • You must to post comments
0
0

Thank you.

I am using the 4.31.05 version has been deployed.
App pause / restore times, I have not seen any error.

However, it still is a developer version.
Does it change when the stable version?
To be able to help stabilize this version do it?

  • You must to post comments
0
0

We are aiming for either today or tomorrow for the next release.

  • You must to post comments
0
0

Okay, do you experience this problem with the playstream example we ship with the FMOD SDK?

  • You must to post comments
0
0

It looks like applicationDidBecomeActive is too unstable at the moment, in my tests the mediaserver process is occasionally crashing. Did become active is not a good fit for this issue anyway since it is triggered in other conditions like overlay text.

We will need to talk to Apple about this, I would recommend using the reset only in the foreground callback for now.

  • You must to post comments
Showing 1 - 20 of 48 results
Your Answer

Please first to submit.