Sound Stream not stopping on screen time outs

I posted this in the Android specific thread and no one answered so I am posting here in hopes that I can get help:

As the title suggests, the sound is continuing to play when my app / device sleeps via screen time out. 

 

Build 2015.2646

My nexus 5 and 7 with Android 5 will not stop playing audio on sleep only. The power button will stop the audio stream.

My Nexus Galaxy works as intended but is using Android Jelly Bean.

iOS works fine too. (iPhone 5 / iPad Mini )

 

It is a significant issue as Google Play will not promote your app if it break the “lifestyle guide lines”… this sound issue breaks those.

 

Also of note: I tried the suspend feature, it doesn’t work… Suspend isn’t called on a screen timeout.

The power button works correctly w/ sound stopping on the device being manually put to sleep via the button and with no special code required to handle this.

 

How do I fix this? Ideas?

 

Thanks,

 

Gullie

I know you tried the “system” event (type == “applicationSuspend”), but do you get any “system” event at all when the screen ‘times out’?

BTW, when you say ‘times out’ you mean it automatically sleeps right?

My hope here is that there is another “system” event coming in that you can use as a trigger.

Yeah… The system event suspend works fine in the sense that once the device is awoken via the power button it calls both suspend and resume at that time.

If you manually push the power button suspend is immediately called.  Once the device is awoken via the power button it calls resume.

But I digress, all this is known and noted the in the documents.


“BTW, when you say ‘times out’ you mean it automatically sleeps right?”

–The sound is continuing to play when my app / device automatically sleeps via time out.

To the TOP!

Still hoping for a response.

Hi, I’m experiencing this issue too. Did you ever figure out how to fix it?

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