Jump to content

Emby for android struggles to change network connections smoothly


darkassassin07

Recommended Posts

darkassassin07

I have noticed quite a bit lately that emby for android has a difficult time reconnecting to my server when my android device changes its network connection.

 

It's primarily when changing from lan to wan or vise versa, but I have also noticed it when going from a wifi connection thats on wan to mobile data (also wan ofc).

 

 

What I mean by this is I'll be browsing a library for example, the network will change maybe because I left/entered range of wifi, then the next thing I click on will just give me a never ending loading wheel until I close the app by removing it from recent apps then reopen it and reconnect to my server.

Anytime the network changes while emby is sitting in recent apps (whether I'm actively using it or not), when I come back to it I have to close and re-open it to make it useable again.

 

 

Android v8.0.0

Emby for android v3.0.51

  • Like 1
Link to comment
Share on other sites

Hi, it will reconnect just fine, but you may have to be patient and wait for it to time out while trying to connect to your local address first, and then try your remote address.

Link to comment
Share on other sites

darkassassin07

Hmm, guess I wasn't being patient enough. I feel like there is still a bit of room for improvement there, but it does eventually get there so it's not like it doesn't work at all.

 

Thanks luke :)

Link to comment
Share on other sites

  • 4 months later...
darkassassin07

Hey @@Luke, have you guys had anymore development into improving the re-connection time of the android (and I'd assume ios) app when changing networks?

 

A scenario I run into constantly:

 

Im connected to wifi, but external to my home network. The android app is open and connected to my server via the wan address, not actively playing but maybe looking at the details page of some bit of media or the server dash (whether the app is in the background or foreground doesn't seem to matter). I then lose wifi connection and automatically switch to mobile data. (I can also reconnect to the same wifi after the disconnect, the following results are the same)

 

From there the next response from the server (changing pages or trying to start playback for example) takes a minimum of 30sec. I assume this is the app first trying the lan address, waiting 30sec for it to timeout, then trying the wan address. When I know the network has changed it is almost always faster to close the app and start fresh.

 

 

 

If possible could this maybe be improved by trying both the lan and wan addresses simultaneously when a network change has been detected, using whichever one responds first, then if the lan address does endup responding after the wan address have it take priority?

 

Or possibly a way to have the apps use the external address exclusively (server-side setting). With my particular setup, the wan address always reaches my server whether the client is lan/wan. Using/waiting for the lan address is unnecessary. (in my case at least)

 

Just trying to throw out an idea or two. It's really annoying to deal with when you are regularly moving in/out of wifi range and frequently using the emby app while on wan access.

  • Like 1
Link to comment
Share on other sites

darkassassin07

Hmm, maybe there is a bug with the way that's implemented then?

 

I've sat and timed it a few times now; the app always takes a full 30sec+ to load the next page after a network change. That seems like a consistent timeout period before trying the next address.

 

The web app however doesn't have this issue. It's able to recover as if nothing changed as it's consistently using the same address.

Link to comment
Share on other sites

  • 2 months later...
dominicp

Just wanted to chime in here. This is my number 1 frustration with the app right now. In general it works great. But, I can't get it to reconnect after a network change. My scenario typically goes like this:

 

1. Get in the car and pick music to listen to (still connected to wifi)

2. Drive away and loose wifi

3. Phone switches to cellular data and emby app stops playing (it will never reconnect in my experience)

4. Close emby app, reopen, and select music while trying not to die ;)

  • Like 2
Link to comment
Share on other sites

We don't have the automatic re-connection during playback at this stage, but it's something we can look to add. Thanks for the feedback.

Link to comment
Share on other sites

  • 1 year later...
MonKaiju

For me it does reconnect, not while playing media but otherwise, but it takes an incredibly long time, like the 30 seconds aforementioned. Not unusable but the fact that it's slower than closing and relaunching the app is annoying.

 

Emby overall is amazing and thanks for all the hard work! 🙏

Edited by MonKaiju
Link to comment
Share on other sites

  • 2 years later...
PaperPlayn

I have had this same issue since I started using Emby about 3 years ago.  I have had to learn the habit of getting in the car and driving out of range of the house before launching Emby (Android).  Otherwise it will fail as described above by others.  Sometimes it reconnects after "a long time"--at least 30 seconds, maybe longer--but most often it just spins for longer than I'm willing to wait, and I relaunch.  It's very frustrating (and not as safe for the driver as I would like) and no other streaming app has this issue.  Would be grateful if the team can get to the bottom of it.  :)

It has happened across several phones.  I suppose it could be an incapability with my server or implementation/configuration, but I kind of feel this is the sort of thing that should be smooth right out of the box.

Thanks.

  • Agree 1
Link to comment
Share on other sites

tmurphy2792
On 1/20/2020 at 11:26 PM, dominicp said:

Just wanted to chime in here. This is my number 1 frustration with the app right now. In general it works great. But, I can't get it to reconnect after a network change. My scenario typically goes like this:

 

1. Get in the car and pick music to listen to (still connected to wifi)

2. Drive away and loose wifi

3. Phone switches to cellular data and emby app stops playing (it will never reconnect in my experience)

4. Close emby app, reopen, and select music while trying not to die ;)

This is exactly the issue I have, I have to remember to either turn off the wifi on my phone or move out of range of my wifi, which puts me in the street in my neighborhood, so no bueno.

 

I've been loving emby and have used it to basically replace all of my paid streaming services with media I already own on DVD/CD. But this has definitely been a pain point for me as I've started using it for my music.
That and I've noticed the emby app tends to crash/shutdown at random when you're running it with google maps while navigating.

 

  • Like 1
Link to comment
Share on other sites

Just for others reading, the user interface can recover automatically from network changes, but currently there are times when media playback cannot. This is what we need to look at improving, meaning switching from the LAN to remote address automatically. Thanks.

  • Thanks 1
Link to comment
Share on other sites

PaperPlayn
On 2/11/2024 at 10:01 PM, tmurphy2792 said:

... and I've noticed the emby app tends to crash/shutdown at random when you're running it with google maps while navigating.

Had exactly the same issue on my LG G7 but not on a Galaxy S9+ or S10+.  Emby would crash at some (seemingly random) point after loading up Maps.  I am pretty sure the key factor is RAM: 4GB RAM on the old LG vs. 6 or 8 GB on the newer phones.  It could have involved memory/power-saving settings on my phone (either baked in or set up by me) but I could never get to the bottom of it, so as of now I think it's just the extra RAM.  Would love to hear any additional data/testing/confirmation from tmurphy2792.

My guess is Emby could improve in how it interacts with device memory-management protocols or whatever.  (Probably this discussion belongs in another thread but I did want to echo the issue briefly.)

 

On 2/12/2024 at 10:49 PM, Luke said:

... the user interface can recover automatically from network changes, but currently there are times when media playback cannot. This is what we need to look at improving, meaning switching from the LAN to remote address automatically. Thanks.

Question about this.  I can click buttons on the UI (Music, Audios, etc.) when the network switches to cellular, but nothing appears at all: no item titles or dates, no placeholders for thumbnails, just black pages.  (Then after 30 seconds or so it sorts itself out and repopulates, as others mention above.)  Does the loading of this text/graphic content fall under the definition of "media playback"?  I just want to ensure we're all talking about the same issue.

image.thumb.jpeg.52c7155119775dd8096da5a9e47605c5.jpeg

Perhaps of note, I do noseem to have the same delay when switching back from LTE to wi-fi.  

Link to comment
Share on other sites

Tremas
On 2/12/2024 at 10:49 PM, Luke said:

Just for others reading, the user interface can recover automatically from network changes, but currently there are times when media playback cannot. This is what we need to look at improving, meaning switching from the LAN to remote address automatically. Thanks.

Understood. Please understand that the issue results in a poor user experience that does not seem to happen with other home server streaming solutions. I think we are all glad to know it is being looked. Thank you for acknowledging that this needs attention.

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

tmurphy2792
On 2/14/2024 at 7:44 AM, PaperPlayn said:

Had exactly the same issue on my LG G7 but not on a Galaxy S9+ or S10+.  Emby would crash at some (seemingly random) point after loading up Maps.  I am pretty sure the key factor is RAM: 4GB RAM on the old LG vs. 6 or 8 GB on the newer phones.  It could have involved memory/power-saving settings on my phone (either baked in or set up by me) but I could never get to the bottom of it, so as of now I think it's just the extra RAM.  Would love to hear any additional data/testing/confirmation from tmurphy2792.

My wife and I are both running Motorola Moto G Stylus 5g with 6GB of RAM on Android 12, though they're not identical as they both seem to have different carrier flavors of android (hers is unlocked tmobile, mine is unlocked AT&T). 
My guess is it's definitely something related to the system trying to preserve memory. My phone seems to only do it when running maps with emby running in the background, whereas my wife's phone tends to just stop playing at random if you don't have emby actively open and in focus.

After going down a google rabbit hole, this is a common complaint in android killing "background apps" that it deems unnecessary. Unfortunately most solutions seem to be above my skillset to edit the android system setting.
I have disabled "Adaptive Battery" under settings >> battery on my phone to see if that makes a measurable difference, will report back here in a week or so.

  • Like 1
Link to comment
Share on other sites

tmurphy2792

@PaperPlaynFollow-up post to update those of you who were curious.


I've had Adaptive Battery disabled for just shy of a week now and have had the opportunity to use Emby and maps together on a 6hr road trip.
Out of that timeframe, here are the only issues I had.

  • 2x instances of the music controls disappearing on google maps, despite the music continuing to play. (Probably a google maps issue, I've had it do that with spotify as well)
  • 1x instance of emby crashing when skipping a couple songs
  • 1x instance of emby shutting off unexpectedly. This one was after a stop and I remember being amazed the music started right back up without opening emby... Don't believe I finished that song

In all, for a 6hr session that is a very acceptable amount of issues and probably less than I had back when I used spotify.

If anyone is wondering, yes I did notice some degradation of my phone's battery life. But I'm generally in the habit of closing anything I'm not actively using, so it wasn't extreme. On an average day of my normal usage before this change I'd end the day with 30-40% battery life, now I'm ending with 20-30% for roughly the same usage habits.

  • Like 1
  • Thanks 1
Link to comment
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...