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

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
0
0

The main difference between development branch and stable branch is API lock down. Once a branch becomes stable we don’t modify the public API so you can safely take new versions.

The other difference is simply time, we except that the development branch will get bugs from the new features being added, so we like to keep the "dev" label on it until we are satisfied that bugs have stabilized.

  • You must to post comments
0
0

I have the same problem. After getting a phone call and answering it on iOS4 the sounds are lost.

This same problem exists (or at least existed before) when coming back from video playback. In my app I worked around it by reinitializing the whole sound system and loading sounds again after video was played.

Hope that this gets fixed. I don’t want to re-initialize every time my application enters background and becomes active again. At least we need a callback so we can re-initialize only after the system gets overtaken by another audio session.

  • You must to post comments
0
0

[quote="mathew":23m5hn6p]We are aiming for either today or tomorrow for the next release.[/quote:23m5hn6p]

great, thanks a lot!

  • You must to post comments
0
0

I did playstream example on iOS4 3GS device.

startup is done well but..

follow situation device break down ..
– Lock key press. return application. and "Tic" sound you can hear endless.
– Home Key Press return application. and "Tic" sound you can hear endless.
– Phone Called -> Iphone hold . i do device reset manually
– Alram event -> Iphone hold . i do device reset manually and "Tic" sound you can hear endless.

I use FMOD SDK 4.31.04.

  • You must to post comments
0
0

Our next release should solve the problem with AudioQueue codec sounds not coming back after a device lock / unlock or background / foreground cycle.

FMOD_IPhone_RestoreAudioSession should only be called from applicationWillEnterForeground at this stage. The iPhone getting started guide will be updated to reflect proper usage.

  • You must to post comments
0
0

How can I make solution on stable version 4.30.06?

I found ‘mixer’s restarting’ &’ waitting on 1sec’ in log of interrupt of version 4.31.05

I want make like it.

  • You must to post comments
0
0

Hi guys,

Our iPhone guy is out of the office until the 12th of July, he should be able to help you out when he returns.

-Pete

  • You must to post comments
0
0

mathew, i don’t like another hack in my multiplatform FMOD wrapper, it’s already full of "#ifdef PSP" and "#ifdef APPLE" etc.

please remove this FMOD_IPhone_RestoreAudioSession!
AFAIK you can use NSNotificationCenter to observe application events.

and by the way your solution doesn’t work for me with hardware mp3 streaming. I’m calling this function in applicationWillEnterForeground and applicationDidBecomeActive, but no luck – i can’t hear music after resume.

I’m using v4.32.00

  • You must to post comments
0
0

And ..

Add Log on Phone call interruption

FMOD: OutputCoreAudio::handleInterruption : Audio has been interrupted by an external event… stopping output.
FMOD: Thread::callback : * FMOD mixer thread finished
FMOD: Thread::close : FMOD mixer thread thread destroyed
Current language: auto; currently objective-c
(gdb) continue
FMOD: EventI::stopInternal : 0x60760f8 1
> *Network Disconnected
FMOD: OutputCoreAudio::handleInterruption : External audio interruption has been resolved… restarting output.
FMOD: Thread::initThread : Initializing FMOD mixer thread. priority 1
FMOD: Thread::initThread : – Stacksize 0. Stack pointer 0x0 : usesemaphore = 1 : sleeptime = 0
FMOD: Thread::callback : * FMOD mixer thread started
FMOD: Thread::initThread : done.
FMOD: OutputCoreAudio::start : Cannot activate audio session. (err: 560161140)
FMOD: EventI::stopInternal : 0x60760f8 1
FMOD: EventGroupI::loadEventDataInternal : m_flags: 00000000
FMOD: EventI::start : 0x60760f8
FMOD: SoundI::getSubSound : sound 0x608cfe0. Subsound index 5 / 14
FMOD: CodecFSB::setPositionInternal : subsound 5 position 0 postype 2
FMOD: CodecFSB::setPositionInternal : done

  • You must to post comments
0
0

Matthew, in some case the FMOD_IPhone_RestoreAudioSession does not work in applicationWillEnterForeground

for example, if I press the home button, and if I start the game "topple 1" (a NON multitasking game), and then if I switch back to my game, it hangs for 3 seconds and I have no more sounds. here is the log:

FMOD: OutputCoreAudio::restoreAudioSession : Restoring audio session.
FMOD: Thread::callback : * FMOD mixer thread finished
FMOD: Thread::close : FMOD mixer thread thread destroyed
2010-12-18 22:39:56.424 Perfect Cell[4339:307] 22:39:56.423 <0x3e088868> Stop posting message to kill mediaserverd (4300)
FMOD: OutputCoreAudio::setupAudioUnit : Cannot initialize audio device. (err: 268435459)

I tried to add AudioSessionSetActive (false) in applicationDidEnterBackground. I know it is not recommended, in some cases it is better (it can restore the audio session when it comes back in foreground), but in some cases it crashes.

I am using FMOD 4.32.06, with the SDK 4.2 and I cannot get it to work in 100% of the case, there is always an interruption case where I lose the sounds, or the mp3, or the app simply crash. Also I cannot find a single game on the App Store that always works with multitasking and sounds… it seems that Apple did something wrong.

edit: I saw the other post about v4.33.07. we really need it here, it may fix the bug. Please release it asap :)

  • You must to post comments
0
0

The implementation of CoreAudio that is in the development branch is considerably different from the implementation in the stable branch so it is currently not possible to move that change to the stable branch.

At this time I would recommend using the development branch or waiting for the currently development branch to become stable (which should be within the next week or two).

  • You must to post comments
0
0

Just posting to join the conversation. I am having the same issue, and in my application it is non-trivial to reinitialize the entire sound system, so I am hoping we can come up with a better solution.

Thanks,
Luke

  • You must to post comments
0
0

Firstly thank you for your input, I understand it isn’t desirable to have another function and behavior you need to maintain for only one platform. I will see if I can remove the requirement for a future release making internal use of the notification center.

As for the issue with hardware MP3s, this is already fixed in the next version of FMOD, it just hasn’t been released yet. It should be out this week.

  • You must to post comments
0
0

That is quite strange, I have tested here using the same FMOD version, same phone, same OS version using the playstream example and I cannot reproduce the issues you are having.

Have you tried testing on another device?

  • You must to post comments
0
0

Yeah there are many niche cases where the OS fails to report interruptions correctly and falls over. The latest fix catches a few different notifications from the OS in hopes to try and recover as best as possible. I believe we are planning to release either today or tomorrow so I’m looking forward to seeing if the new fixes solve your issue.

  • You must to post comments
0
0

I still have issues with iOS4 on iPhone 4. (I tried with 4.31.04, 4.31.05 before)

What I did:

  • I downloaded the last stable version (4.32.00).
  • I build and start the example "playstream" on the iPhone 4 (OS 4.0).
  • I hear the music, then I click the home button to "quit"
  • I click on the icon to bring playstream in foreground
  • I hear a little glitch (coming from the music), and then no more sound!
  • I wait a few seconds, sound came back when a loop is completed

The same happen in my game. The only difference is that "playstream" use software decoder, and I want to use hardware decoder, but none worked

I tried to use FMOD_Iphone_RestoreAudioSession() in ApplicationWillEnterForeground with no success. Any help is welcome

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

Please first to submit.