Sounds still stops randomly on iOS

I am still having an issue with iOS versions of my app stopping audio playing at random times. I was originally told it was a bug with Apple, and to use the newest available Corona to build and that should fix the problem. Unfortunately I am still getting daily emails and reviews about the audio not working.

I am using build 840. I have also confirmed with people who are running into this error that they are using my newest version built with that build number.

Another note, I use this function when transitioning between scenes:

stopSFX = function ()
local result = audio.totalChannels
for i = 2, result do
audio.stop(i)
end
end

Basically I have channel 1 reserved for music, so this should stop all other actively playing sound effects. I do this because I have some semi-long sounds (5-10 seconds) that I do not want still playing when they transition to a new scene. Could this function be causing the issues? [import]uid: 84258 topic_id: 29055 reply_id: 329055[/import]

This happens to me too. Did you file a bug report? [import]uid: 135394 topic_id: 29055 reply_id: 134305[/import]

The latest stable build is 971 (well 972). There have been many fixes between 840 and 971.

I would advise upgrading and trying again.
[import]uid: 199310 topic_id: 29055 reply_id: 134322[/import]

I built and released using the most recent version, and it still happens. You can DL Eagle Screech! Free which demonstrates the bug. However, it works as coded on Android. Sounds like a bug hasn’t been filed so I’ll set one up shortly. [import]uid: 135394 topic_id: 29055 reply_id: 134323[/import]

Yes, I still get reports of the error occurring even with builds using the most recent public release of Corona. I posted a new topic here about the issue:

http://developer.coronalabs.com/forum/2012/10/31/no-sound-issue-still-occuring-ios

Basically Corona says it’s not their fault, and to file a bug with Apple. To be honest I have no idea how to do that, Apple does not make it easy. And I haven’t been able to replicate the error myself anyway.

I still get an email or a bad review every other day about the sound stopping. This is a huge issue that I don’t think is getting the attention it deserves. [import]uid: 84258 topic_id: 29055 reply_id: 134325[/import]

See this blog post:

http://www.coronalabs.com/blog/2012/06/06/a-complete-guide-to-filing-bugs-with-apple/

[import]uid: 199310 topic_id: 29055 reply_id: 134330[/import]

Thanks Rob. The problem is I still can’t replicate the error on my iPad. Based on results from my customers it seems to occur frequently on the in-app purchase, but I can’t replicate.

Anyone else filed a bug about this and can help replicate it? [import]uid: 84258 topic_id: 29055 reply_id: 134371[/import]

I had this problem waaaay back when iOS 5.0 was first released. There was a rather nasty regression bug in the initial release on iOS5 that CoronaLabs found some workarounds for.
As far as I remember Apple fixed this issue in one of the later iOS5 updates.

I haven’t noticed any such audio problems with my apps since then. My iOS5 test devices are currently running 5.1.1. And I’ve never noticed this with iOS6.

I’m curious. Could it be that some of your users are still running iOS 5.0 and not the latest version? [import]uid: 70847 topic_id: 29055 reply_id: 134375[/import]

Looks like this thread is getting some heat so I’ll drop the details of my problem here; if this sounds insane, I agree, and I don’t really know how to resolve it.

my app Eagle Screech! is out on the app store right now, so you can test the below. I have music and sound effects loaded with the loadStream function. I set a simple toggle in the options screen to set the volume in-code for the channels I used for music, and for sound effects. Toggle on, the level is set to a certain volume; toggle off, and it sets it to zero. It works perfectly on an Android which is my main device (it really shouldn’t be, but whatever) but as soon as I started testing on iOS, the volume would not change via the in-game toggle.

I tested it with both loadSteam and loadSound, and the problem persists. Does this resemble a problem that other folks are encountering? Let me know if I can provide any additional details, and there is a free version of Eagle Screech! on iOS with the issue at present. I’m assuming from Rob Miracle that this is Apple-related and therefore the error report Apple is tracking is where my focus should lie, but I’m hoping someone has a workaround. [import]uid: 135394 topic_id: 29055 reply_id: 134376[/import]

ajaxzon, I do a mute on my music in a similar way. I load it via a loadstream and always assign it to channel one. When they want to mute it, I simply set the volume on that channel to zero.

I’ve personally had zero problems with this on Android or iOS, so I don’t think this is causing the issue. I can toggle it on and off constantly on my iPad and it will continue to work.

I also do something that maybe isn’t the best, but I have a function called stopSFX:

stopSFX = function ()
local result = audio.totalChannels
for i = 2, result do
audio.stop(i)
end
end

I call this anytime I exit a scene, and the idea is to stop all audio playing except for channel 1 (because the music is always on channel 1). It’s worked great in many of my games, so I don’t think that could be causing the audio issues, but it’s always possible. [import]uid: 84258 topic_id: 29055 reply_id: 134379[/import]

Asking the user to update to the latest iOS is always the first thing I ask them, and nearly every time they are running iOS 6.0. If you look in my more recent post ewing (a Corona staff member) acknowledges there are 2 known bugs in iOS 6 that can cause the audio to stop:

http://developer.coronalabs.com/forum/2012/10/31/no-sound-issue-still-occuring-ios

He states the bug numbers and info are in the forums somewhere, but I’ve had no luck finding them. Can anyone post the bug numbers, or a link on Open Radar so I can submit a similar bug? [import]uid: 84258 topic_id: 29055 reply_id: 134377[/import]

Shucks :frowning:

I can confirm that with iOS 6.0.1 I can replicate lost audio by invoking Siri and power-off-while-in-the-game. With Siri it happens about 1 time out of 5, and with power-off around 1 in 10.

Killing the app from background and restarting it brings audio back though.

I’ll have to dig for those 2 radar numbers myself now… [import]uid: 70847 topic_id: 29055 reply_id: 134380[/import]

What do you mean “power-off”? Just simply locking the screen while in game, or does it take fully attempting to shut down the device?
[import]uid: 84258 topic_id: 29055 reply_id: 134381[/import]

iOS must be rebelling against my rugged yet dignified handsomeness. I’ll go back to the drawing board. Thanks for the tips and assistance! [import]uid: 135394 topic_id: 29055 reply_id: 134382[/import]

No problem ajaxzon, if you don’t have any luck shoot me an email at support@kevinbradford.org and I can send you my mute code I use for music. [import]uid: 84258 topic_id: 29055 reply_id: 134383[/import]

Sorry for being a bit vague and misleading… (it’s 3.28 AM here and I think my bed is calling…)
I meant locking the screen while in the game. [import]uid: 70847 topic_id: 29055 reply_id: 134384[/import]

After a lot of searching I only found 1 reference to this audio bug in iOS6 which is filed under rdar://12373227 by Eric at CoronaLabs.
More info in a thread here: http://tinyurl.com/cehspgd

I’ve done some more testing, and there’s some good news.

I took an app that was compiled with 2012.972 for iOS 6.0 and ran it on my beta device running iOS 6.1 beta 3.
The audio issues appear to be fixed. I was not able to reproduce either of the issues (Siri activation and lock-screen issue) when running the app on iOS 6.1 beta 3.
I tried each of the issues at least a dozen times without losing audio upon return to the app. I would recommend others to try the same with their apps using 6.1 beta 3.

To be on the safe side I also compiled a new bundle using 2012.978 and complied specifically with the 6.1 preview 3 setting. When running this on 6.1 beta 3, no audio issues are found.

[import]uid: 70847 topic_id: 29055 reply_id: 134451[/import]

This happens to me too. Did you file a bug report? [import]uid: 135394 topic_id: 29055 reply_id: 134305[/import]

The latest stable build is 971 (well 972). There have been many fixes between 840 and 971.

I would advise upgrading and trying again.
[import]uid: 199310 topic_id: 29055 reply_id: 134322[/import]

I built and released using the most recent version, and it still happens. You can DL Eagle Screech! Free which demonstrates the bug. However, it works as coded on Android. Sounds like a bug hasn’t been filed so I’ll set one up shortly. [import]uid: 135394 topic_id: 29055 reply_id: 134323[/import]