Phone goes to sleep while streaming audio

When I listen to an audio stream (e.g. WPKN radio), my phone goes to sleep and stops streaming after only a few minutes. I have tried running the stream through different apps and I’ve also tried disabling battery optimization in those apps, but nothing seems to help.

My device is a Samsung Galaxy S7 (SM-G930F) running /e/ 0.19 dev Oreo. I’ve tried streaming through a web browser as well as the WebRadio app. Does anyone have any ideas on how to stop my phone from going to sleep? I don’t think this happens when I listen to podcasts.

To optimise battery usage, Android closes background apps. Follow the steps described in this article to exclude your audio apps from that feature to keep them playing during standby.

Thanks @Ludix. As I mentioned, I have tried disabling battery optimization for any apps that are playing the stream, whether a browser or WebRadio. But it doesn’t seem to help. Perhaps there is some other component that needs battery optimization turned off?

It always worked for me (for VLC). So sorry, never had to go beyond what’s described in the manual.

Thanks. That reminds me that I did try streaming over VLC as well, with the same results. @Ludix what version of Android are you using?

Android Q at the moment, but before I had an S7 like you. It’s on Oreo as well.

I just charged it an checked the battery optimisation settings and I noticed that I didn’t even had to add VLC on Oreo to exclude it from battery optimization.
It’s laying beside me in standby in this moment, playing music since a few minutes without a problem.

Do you have App notifications activated for the respective apps? Android Oreo requires apps to display a message to keep them running in the background. Even tho it still worked for me when I deactivated it.

Hi @Ludix. Thanks for checking on your S7. This confirms my theory that the problem is not to do with battery optimization. And I do have notifications turned on for the relevant apps.

Oh well, enjoy your music! :grinning: I’ll keep looking for a solution…

Do you always start the streams via webbrowser?

Edit: just realized you also listed one app.

Similar issue here since months, on FairPhone 3+. The web radio radiometal dot com just cuts after 7–15 minutes, regardless of whether I listen to them via:

  • their own app
  • their HTML player
  • the creepy radio dot net website
  • VLC (I checked debug logs: it basically says “end of stream”).

I think it used to work when I bought my phone, a year or so ago.

Note that listening to local files via VLC or using the Bandcamp app works more or less fine, though.

My experience is similar to @alice_m’s in that I don’t have trouble with local files, only with streams. It makes me wonder if it isn’t the Wi-Fi that’s going to sleep.

@Ludix, for the record, the apps I’ve tried streaming from are

  • Web browser (Brave, but I think it’s the same for the /e/ Bromite browser)
  • VLC
  • WebRadio

In all cases the stream cuts out after only a few minutes, even if battery optimization is disabled.

Yeah, sometimes even Bandcamp fails, and when I unlock my phone I notice that for a fraction of a second the WiFi is gone, and poof, it reconnects automatically, and the next track starts playing.
I can’t try via mobile data to see if anything changes: my mobile subscription is far too crappy to listen to music over the mobile network.

Similarly (or not?) I used to be able to use an external USB sound card on the phone, but now this also cuts after a few minutes. :cry:
These are the only “significant” (whatever that means) issues I currently have with /e/. Lots of things got better with time, but somehow music+sleep went haywire. :woman_shrugging:

I did a little searching on the Internet for anything about Wi-Fi going to sleep, but I didn’t find anything useful.

Another perhaps related issue that I just came across is that a step counting app seems to quickly go to sleep as well. I know this app used to work in the past on my /e/ phone, and I don’t know what’s changed since then.

you can disable the display timeout

Thanks @kisman172, that’s a good hack. Not ideal since leaving the display on drains the battery and you have to remember to re-enable the timeout. And sometimes I want to be able to lock the phone and have it keep doing its thing. Also, the phone should be able to run with the display off! :grinning: One day maybe…

Yeah I tried using the nice pre-installed Caffeine tool to force the display to stay ON forever, but the music cuts all the same. Maybe sleep isn’t actually the issue here.