Jump to content
MarkCranness

Emby Server will not sleep if Android app has been used, but is now closed and cleared from recents

Recommended Posts

MarkCranness

I note that my Emby server will not go to sleep if my mobile has used Emby, BUT then the Emby app has been closed and cleared from android recent apps.

 

The server dashboard still show the device in Active Devices: "Emby for Android Mobile 3.0.45"

 

But I have a clue and a way to get the device removed.

Apparently, Android 6.0+ will keep apps Active, even though they are not "open" and even if removed from the list of recent apps.

 

The feature is "App Standby": https://developer.android.com/training/monitoring-device-state/doze-standby

The Emby app shows as "Active" (not in standby) even when closed.

 

You can enable Developer mode, and see which apps are in Standby, and which are Active:

https://www.howtogeek.com/242834/how-androids-app-standby-works-and-how-to-permanently-stop-apps/

(Scroll to "How to See Which Apps Are Currently in Standby")

 

Follow instructions above, scroll to Emby, tap it to toggle from Active to Inactive.

 

Then after a while, the server dashboard drops the device from Active Devices, and will go to sleep.

 

Is there some way to force the Emby app to Inactive/Standby when it is closed?

Edited by MarkCranness

Share this post


Link to post
Share on other sites
Luke

Hi, this is due to the background sync process in the app. It is something we will be looking at improving in an upcoming update. thanks.

Share this post


Link to post
Share on other sites
Luke

This is resolved for the next update to the android app, with Emby Server 4.0+. Thanks !

Share this post


Link to post
Share on other sites
MarkCranness

Hi Luke,

 

Yes, 3.0.51 fixes it.

 

Thank you for the good work you are doing!

 

There is another (unrelated) problem:

I have to be careful of what order I stop Emby playback on the mobile, otherwise the server thinks it is still playing media (shall I create another form issue for this beta problem?)

 

- If I close Emby for mobile with the Back (back loop) button while still playing media, the media stops playing, and the Emby notification disappears, and Emby is still shown in the Android Recents list, but the server thinks that media is still playing back.

If I restart Emby for android, the Emby notification re-appears, but tapping Pause does not do anything (no media is playing anyway).

 

 

- If I pause media playback in Emby for mobile close Emby on android with the Back (back loop) button while still playing media, the media stops playing, the Emby notification stays, and Emby is still shown in the Android Recents list, but the server thinks that media is still playing back, but paused.

If I restart Emby for android, and swipe down the Emby notification, and tap Pause, it does not do anything (no media is playing anyway).

 

- If I pause media playback (either in Emby app, or in the Emby notification), THEN swipe away the Emby notification, then the server sees that the app is no longer playing media (neither playing nor paused). After a while (without browsing media in a the app), the device disappears from Active Devices, as expected.

Share this post


Link to post
Share on other sites
Luke

Thanks for the feedback. To clarify on those, if you close the app in a way that the app isn't able to notify the server, then that's why that happens. You'll just have to wait a few minutes for it to go away from the server dashboard.

Share this post


Link to post
Share on other sites
MarkCranness

I confirm that it does disappear from the server dashboard, so not a problem: Just how it works, thanks.

Share this post


Link to post
Share on other sites
Luke

I confirm that it does disappear from the server dashboard, so not a problem: Just how it works, thanks.

 

Thanks for the feedback. Shouldn't take long. Five minutes for the current release server. The next release will bring that down to three.

Share this post


Link to post
Share on other sites
PontusN

This is resolved for the next update to the android app, with Emby Server 4.0+. Thanks !

Hello, I thought this was the best place to alert you with this issue, the problem has come back again with 3.0.97, I now have 3 phones keeping my server awake at all times.

 

In dev options the Standby State is set to "Active" by default with the lowest possible option being "RARE" and not "NEVER".

Edited by PontusN

Share this post


Link to post
Share on other sites
Luke

Hello, I thought this was the best place to alert you with this issue, the problem has come back again with 3.0.97, I now have 3 phones keeping my server awake at all times.

 

In dev options the Standby State is set to "Active" by default with the lowest possible option being "RARE" and not "NEVER".

Please attach the emby server log from when you thought it should have gone to sleep. Thanks.

Share this post


Link to post
Share on other sites
PontusN

Please attach the emby server log from when you thought it should have gone to sleep. Thanks.

Here is the serverlog from tonight, all phones have changed the standbystate for the app to the lowest possible "RARE" before this.

serverlog.txt

Share this post


Link to post
Share on other sites
Luke

And what time do you think the system should have gone to sleep?

Share this post


Link to post
Share on other sites
PontusN

And what time do you think the system should have gone to sleep?

During the night, but as you can see in the log file a lot of activity is coming from two phones, a Nexus 6 and a OnePlus

Share this post


Link to post
Share on other sites
Luke

At that particular time, yes. Is it consistent?

Share this post


Link to post
Share on other sites
DanielXB

I have the same problem, only with android phones, not problem with fireTV, logout user from app resolve the problem

Share this post


Link to post
Share on other sites
Luke

I have the same problem, only with android phones, not problem with fireTV, logout user from app resolve the problem

Hi, please attach the emby server log. Thanks.

Share this post


Link to post
Share on other sites
DanielXB

embyserver.txtAt 8:40 aprox, using a Moto e5 only login and close the app

Share this post


Link to post
Share on other sites
Luke

What time were you expecting the server to sleep?

Share this post


Link to post
Share on other sites
DanielXB

15 minutes

Share this post


Link to post
Share on other sites
DanielXB

Just for test i lower the sleep time to 5 minutes, only after i logout from emby app, it goes to sleep

Share this post


Link to post
Share on other sites
Luke

15 minutes

 What time of day in the log file I mean? Thanks.

Share this post


Link to post
Share on other sites
DanielXB

In that log i login at 8:40 aprox and inmediatly close the app. if you want i try lowering the sleep time at 1 minute and send you a new log (in that log the sleep time is 15 minutes)

Share this post


Link to post
Share on other sites
Luke

Please keep it at 15, but enable debug logging, then perform the test again and attach the new log. thanks.

Share this post


Link to post
Share on other sites
DanielXB

embyserver.txtAprox at 17:52 i login with android after enabled debug logging

Share this post


Link to post
Share on other sites
Luke

attachicon.gifembyserver.txtAprox at 17:52 i login with android after enabled debug logging

 

And at what time were you expecting the server to sleep?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...