Sound Stream not stopping on screen time outs

I can’t even get an acknowledgement that it is a problem. Posted in two places and no response. 

I other news, Game of Loot is Available today WITH the bug! Uh! 

iOS App Store: https://itunes.apple.com/app/id1016781837

Google Play: https://play.google.com/store/apps/details?id=com.superultrahyper.gameofloot

Kenny Thompson

www.gameofloot.com

Congrats on the release! I just posted this question to the Corona Indie Developer Facebook page. Hopefully it gets some visibility.

Have you submitted a bug report? I would do it myself but I’m under a bit of a time crunch trying to get my beta launched. You can submit it here http://developer.coronalabs.com/content/bug-submission.

If you can’t do it let me know and I’ll try to get to it some time next week.

@Vince_ did you ever submit a bug report on this? We are working on a feature opportunity with Google and they are rejecting us because of this issue. But we haven’t been able to duplicate the issue internally with the devices we have… 

Hi, no I haven’t submitted a bug report. I just haven’t had the time. Would you be able to submit one yourself?

In any case, don’t hold your breath on a getting a quick fix. I submitted a couple unrelated bug reports like 6 weeks ago and as far as I know the engineering team hasn’t even looked at them. I was told that I would get an email but so far I haven’t.

I haven’t tested this yet, but one thing that might work is disabling the idle timer to prevent the device from sleeping in the first place:

https://docs.coronalabs.com/api/library/system/setIdleTimer.html

Although I don’t know how this fits in with Google/Apple’s usability guidelines.

Please keep us updated if you find a solution.

@Vince_ Have you been able to duplicate this issue consistently? The challenge for us is, we *seemed* to have seen this issue in the past, and in working with Google on a possible feature, they’ve caught this issue as well. But we simply haven’t been able to duplicate it ourselves… Hence making it hard for us to submit a bug report. 

If you can share what you have to duplicate the issue, that would be super helpful. That way we are not trying to find a needle in a haystack. 

Sure thing.

The device is a Samsung Galaxy S6 running Android 5.1.1

Corona SDK 2015.2646

Here’s what I have noticed:

  • My game starts streaming background music after the app has loaded
  • I let it sit idle for however long until the screen shuts off
  • The first time it shuts off, the music also stops
  • I turn the screen back on
  • Let it sit idle until the screen shuts off again
  • When it does shut off, the music continues to play

The music only stops playing if I hit the power button to turn off the screen. Gullie667 above noted that he doesn’t seem to have the issue on a device running Android JellyBean, so maybe it’s OS specific?

Unfortunately my other Android test devices died on me so I’m not able to test the issue there. If you need other details just let me know.

On an unrelated note, would you mind if I PMed you regarding getting featured? I’m working towards releasing my first game and getting a feature would preeetty great :slight_smile: .

I just did a bunch of testing on this on my Nexus 7 which was running an older version of Android OS. I wasn’t able to duplicate the issues as I successively updated my copy of the OS to 4.4, to 5.02, then to 5.1. It wasn’t until I got to 5.1 that I was able to duplicate the issue. Basically for me (using the AudioPlayer test app from Corona):

  • launch the app

  • play music in loop

  • let the device fall asleep.

The music keeps playing, whether streaming or normal audio.play. 

Will Submit a bug

Bug Submitted: 

http://developer.coronalabs.com/node/843/done?sid=17841

Case 42340

Awesome! I’m glad you were able to narrow it down. Hopefully they fix it soon as I’m sure we’re not the only ones affected by this.

@RobMiracle -  Want to see if you guys received the bug report, and any feedbacks on your end? As I mentioned, this is unfortunately a requirement from Google for featuring.

So, it’s quite important for the commercial success of not just us, but other app makers using Corona.

Thanks!
Andrew

It’s assigned to an engineer. I’ve emailed to to get a status. There is quite a bit of things in the queue.

Rob

@Rob Please keep us posted.

Unfortunately Google is requiring this, and we have no realistic work-arounds, so it’s pretty important…

Thanks!

Andrew 

Engineering has identified the bug and it belongs to Google. They have already fixed it in 6.0. They have a non-practical work around and are working on something more practical.

Rob

So… I’ve been thinking about this one alot… You could do something really ugly like checking user activity and fade music based on that after x time. Totally sucky but might get you by their requirements. Especially since it appears to be on Googles behalf.

Cheers,

Kenny

@Rob - if you can point me to some information about the bug, then I can point that out to Google and push back on them on their requirement and see how far that gets us.

@kenny - yeah, we thought about it. Something like do audio.stop() on suspend. But it doesn’t work because when the app resumes, we would need to restart the music where we left off. And there is simply no way for us to do that recovery properly given the complexity of our app.

many thx!

@akao Have you considered audio.pause and audio.resume? Also did you tinker with system.setidletimer to prevent the screen from timing out in the first place? I’ve played plenty of games that won’t let the screen timeout; Candy Crush is an example.

Of course these would only be temporary solutions until this bug gets fixed.

Good question, is preventing the screen from timing out an acceptable solution from Google’s perspective?

Also, can you swap this “no screen time outs” flag on the go, ie never allow timeouts when a game level is being played but allow it on the menus? Then only music could be played during an actual play session. I’m guessing no.

@akao - Even if using a system event for suspend to stop the audio was suitable, suspend will not work. Tried it already.

If I where in your shoes, I might consider removing music entirely from my game. It’s only a polish thing for my game anyway.

It’s not a “bug” exactly. In 5.1 Google changed how the Android lifecycle works and it’s works differently than it’s documented. In the pre-release of 6.0, they’ve gone back to the 5.0 way of doing things. Corona uses it the way it’s documented. Engineering is working on a work around. I doubt Google would go back in to the 5.1 branch and change how it works. They fix things like this in 6.0

@Rob Got it. Please do keep us posted on the progress on this issue then, it is something that we would need to rely on Corona for a fix.

@gullie667 @Vince_ Negative on keeping the app awake. While I don’t have Google’s developer guideline in front of me, I am pretty sure it’s something that won’t pass muster - even if not Google, then Apple/Amazon/Samsung for sure. We’ve accidentally done something like this in the past due to bugs in our code, and have had our app rejected. Plus it creates a horrible user experience that could cause our app to be uninstalled (which is another big problem on Google).

And our app does use a ton of SFXs (100+), making work-arounds that would involve us keeping track of what audio is playing where not very practical. 

@akao: We have a fix that should be out in the next daily build (2703+).