Sounds still stops randomly on iOS

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]

Wow, that is great ingemar. Do they post a change log of what bugs they’ve fixed in the betas? Would be interesting if the bug was listed as fixed anywhere. [import]uid: 84258 topic_id: 29055 reply_id: 134581[/import]

I couldn’t find anything in their release notes for beta 3.
They may have reported something in the beta 1 or beta 2 notes, but I can’t find them in the Dev Center.

Anyway, it would be great if others who read this also could test their apps with 6.1 beta 3 to confirm that it’s fixed. I only have 1 device dedicated for iOS betas (iPod Touch 4th gen), and I can confirm that I still haven’t been able to reproduce the audio issues with the beta 3 release yet… yay! [import]uid: 70847 topic_id: 29055 reply_id: 134594[/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]

Wow, that is great ingemar. Do they post a change log of what bugs they’ve fixed in the betas? Would be interesting if the bug was listed as fixed anywhere. [import]uid: 84258 topic_id: 29055 reply_id: 134581[/import]

I couldn’t find anything in their release notes for beta 3.
They may have reported something in the beta 1 or beta 2 notes, but I can’t find them in the Dev Center.

Anyway, it would be great if others who read this also could test their apps with 6.1 beta 3 to confirm that it’s fixed. I only have 1 device dedicated for iOS betas (iPod Touch 4th gen), and I can confirm that I still haven’t been able to reproduce the audio issues with the beta 3 release yet… yay! [import]uid: 70847 topic_id: 29055 reply_id: 134594[/import]

I’m not sure this is Appl’s fault since I can easily reproduce this in simulator on my Mac and also on my iPhone and iPad. You can take any simple application load 2-3 sounds and assign these sounds to few images which will play them as soon as you tap them. Now press the images without stop for 40-60 seconds and application will suddenly go mute and no sound will come out from it untill you shut it down and restart the app.

As said it can even be reproduced on Coronas Simulator on Mac, have little harder time reproducing it on Windows not sure why. This thing is driving me crazy as I can’t find workaround it and its been arround for few months if I remember correctly- I hope they fix this.

I will test with preview for ios6.1 3 but I do not wish my application to target iOS6.1, I want it to support everything from 4.3 and up. [import]uid: 13099 topic_id: 29055 reply_id: 135795[/import]

and retested on iOS 6.1 beta 3 and still app went mute in 20 seconds constatly tapping on an image which had audio attached to it. I’ll create sample app that all can test and easily see for them self the problem. [import]uid: 13099 topic_id: 29055 reply_id: 135798[/import]

Here is the code that will 100% recreate the problem even in Corona Simulator on the Mac and ofcourse bug is allways present on devices. Just press the button for 40-60 seconds or till the sound stops.

My testing results:
first run: 99 taps app goes mute
second run: 90 taps app goes mute

It seems to me there is a limited number of times corona application can play sounds before its sound engine dies from overheating and everything goes mute.

Hope this can help corona team replicate and fix this wonderful bug.

local text1  
count = 0  
function playSound()  
 count = count + 1  
 local click = audio.loadStream("any\_short\_1sec\_sound\_here.mp3")  
 audio.play(click, {loops=0, channel=1 })  
 text1.text = "count: "..count  
end  
  
local myRectangle = display.newRect(display.contentWidth \* 0.5-180, display.contentHeight \* 0.5-80, 360, 160)  
myRectangle:setFillColor(140, 140, 140)  
myRectangle:addEventListener( "tap", playSound )  
text1 = display.newText( "count: 0", 0, 0, native.systemFontBold, 34 )  
text1:setTextColor( 255 )  
text1:setReferencePoint( display.CenterReferencePoint )  
text1.x, text1.y = display.contentWidth \* 0.5, display.contentHeight \* 0.5  

My Corona build is 986 and I’ve been aware of this problem for few months. [import]uid: 13099 topic_id: 29055 reply_id: 135800[/import]