Skip to main content
Douglas McCarroll
Inspiring
December 3, 2019
Question

AIR 33 - iOS audio stops working after "interruption"

  • December 3, 2019
  • 4 replies
  • 1674 views

Hi All,

 

This problem - reported and solved in AIR 26 - has reappeared in AIR 33: https://community.adobe.com/t5/air/audio-stops-working-after-receiving-call-on-ios/m-p/9152207#M48435

 

In my Apache Flex app (Flex 4.16, AIR 33) running on iOS, all audio stops working if/when the user receives a phone call, if the phone just rings once, if a clock alarm goes off, etc.

 

If the user then leaves the app, i.e. presses the phone's home key, then returns, the problem goes away.

 

This is happening any time my app is 'interrupted', to use Apple's terminology. An interruption can consist of a phone call, an iPhone Clock app alarm going off, etc. I'm not a native iOS programmer, but my googling suggests that in the native iOS world apps listen for an AVAudioSessionInterruptionNotification to find out when these interruptions occur.

 

I've created bug reports in both the Adobe and Gamua bug databases ...
https://tracker.adobe.com/#/view/AIR-4198886
https://github.com/Gamua/Adobe-Runtime-Support/issues/161

... and have attached a minimal sample app to the Adobe bug report that demonstrates the problem.

 

At risk of stating the obvious .... this is a BIG problem!

 

If you're experiencing this problem please vote for the Adobe bug, add comments to the bugs, and/or reply to this post.

 

And, of course, if you have thoughts regarding a fix that can be implemented in my code, I'd love to hear about it.  🙂

 

Thanks,

 

Douglas

This topic has been closed for replies.

4 replies

Douglas McCarroll
Inspiring
December 19, 2019

It looks like I may have found a solution, at least for those of us using the Flex framework.

 

This seems to work in my app:

 

NativeApplication.nativeApplication.addEventListener(Event.ACTIVATE,onActivateApp);
NativeApplication.nativeApplication.addEventListener(Event.DEACTIVATE,onDeactivateApp);

private function onActivateApp(event:Event):void {
   SoundMixer.audioPlaybackMode = AudioPlaybackMode.MEDIA;
}

private function onDeactivateApp(event:Event):void { 
   SoundMixer.audioPlaybackMode = AudioPlaybackMode.AMBIENT;
}

 

I'm not sure how one would get app-activate and app-deactivate events if one isn't using the Flex framework, but hopefully, there is some way to do this.

 

 

Inspiring
December 19, 2019

For me, at some stage, the mute button on or off, made no difference, I could only hear audio through the headphones.  By fixed, I mean currently, audio works as expected.  The only issue is that the mute switch does mute the audio.

 

It doesn't seem to make a difference what SoundMixer.audioPlaybackMode I set - a can always hear audio via headphones regardless of the mute switch position - just through the speakers of the phone - the mute switch, mutes the audio.  Phone calls, or minimizing the app pauses our video/audio - and opening Pandora for example, then maximizing our App, the audio continues as expected after clicking play again..  I'm using Feathers SDK 4.0/AIR 33

 

So the Distriq ANE solves this or just gives us access to the state of the mute switch so we can at least alert our users?

Douglas McCarroll
Inspiring
December 19, 2019

> So the Distriq ANE solves this or just gives us access to the state of the mute switch 

 

It just gives us access to the state of the mute switch.

Douglas McCarroll
Inspiring
December 11, 2019

So far, I haven't found any solution for this. I assume that Harmon needs to make a fix. Does anyone know if there is any way to find out whether they've noticed these posts, or the bug reports that I've created?

Douglas McCarroll
Inspiring
December 13, 2019

Ack...  It looks as though all I needed to do was this:

SoundMixer.audioPlaybackMode = AudioPlaybackMode.AMBIENT;

Inspiring
December 16, 2019

Ty Douglas -- good news for us too - the issue appears to have gone away but I'm not seeing mention in any of the release notes since the builld we were using.  Anyway, not going to look a gift horse in the mouth though, just happy playback appears to be normal.

Inspiring
December 5, 2019

We're having issues with Video on iOS -- audio refuses to play via the built in speaker - and only plays via headphones..  Not sure if this is related but interested to know if you get audio via headphones without having to press home and reopen the app?

Douglas McCarroll
Inspiring
December 5, 2019

Hi Dews,

 

interested to know if you get audio via headphones without having to press home and reopen the app?

 

Just checked - I get the same problem whether I'm using headphones of the phone's speaker.

 

Douglas

Lars Laborious
Legend
December 3, 2019

This definitely is a problem, but I don't think AIR 33 is updated for iOS yet (https://airsdk.harman.com/assets/pdfs/Release_Notes_AIR_SDK.pdf). 

I still use AIR 32 for my apps.

Douglas McCarroll
Inspiring
December 3, 2019

Hi Lars_Laborious,

 

The reason I'm using AIR 33 for iOS is that I get the following error when I build with AIR 32 and attempt to upload my app with Application Loader (on Mac):

 

ERROR ITMS-90503: "Invalid Bundle. You've included the "arm64" value for the UIRequiredDeviceCapabilities key in your Xcode project, indicating that your app may only support 64-bit. Your binary, 'com.brightworks.LangMentor.deu', must only contain the 64-bit architecture slice. Learn more , (https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW3)."

 

Using AIR 33 solves this. So it seems that Harmon is doing a bit of work on the iOS side of AIR.

 

Their documentation is contradictory. On the one hand, their FAQ page says "HARMAN have released “version 33” which initially is only for Android platforms". On the other hand, the release notes for AIR 33.0.2.330 say "addresses an issue with packaging for iOS devices that had been present in the previous two releases". And if you read on ...

 

https://airsdk.harman.com/assets/pdfs/Release_Notes_AIR_SDK.pdf

 

... you'll see that the fix seems to relate to the error that I'm getting.

 

So it seems that I have to use AIR 33 for iOS if I'm developing on a Mac...  (?)

 

Douglas

 

 

Lars Laborious
Legend
December 4, 2019

Ah, I missed that part. I'm using PC so the issue haven't occured for me on AIR 32. 

Hopefully they will fix the AIR 33 sound problem soon.