Jellyfin Forum
Jellyfin Android App Disconnecting - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+--- Thread: Jellyfin Android App Disconnecting (/t-jellyfin-android-app-disconnecting)



Jellyfin Android App Disconnecting - EXSuun - 2024-04-18

Hi all,

I'm new at this so sorry in advance if I've missed anything that is needed to troubleshoot this issue - please let me know and I'll include it.

I have set up Jellyfin with docker compose. I can access it through my browser with no issues. 
I'm having an issue with the android app where if I minimise the app to play in the background (while using other apps) or lock my phone the music will cut out in about 30-60 seconds. I am using a Google Pixel 6 pro, I've tried to disable the battery optimisation stuff as per the advice I've seen in different reddit threads but I fear that Google have removed or obfiscated the ability to do so in their resent OS updates.

So far the Jellyfin app has unrestricted data and background operations permissions but there's no specific option to disable optimisation for apps anymore. I have also disabled it phone-wide. 

If I leave the app open on my phone then it won't disconnect so I am assuming that the issue is being caused by the phone. The other option I tried was to download the findroid app but that doesn't show any media after connecting to the server, completely blank. 

After checking the logs, this is what it reports when the Jellyfind app on my Pixel 6 Pro disconnects...

2024-04-18 10:39:56 [00:39:56] [INF] [45] Jellyfin.Api.Helpers.MediaInfoHelper: User policy for jorummedia. EnableAudioPlaybackTranscoding: True
2024-04-18 10:43:23 [00:43:23] [WRN] [106] Emby.Server.Implementations.HttpServer.WebSocketConnection: WS 172.17.0.1 error receiving data: The remote party closed the WebSocket connection without completing the close handshake.
2024-04-18 10:43:23 [00:43:23] [INF] [106] Emby.Server.Implementations.HttpServer.WebSocketManager: WS 172.17.0.1 closed

Windows Version 10: build 19045.4291
Docker Desktop: v4.29
Docker compose: v2.26.1
Jellyfin app: v2.6.0
Pixel 6 Pro: running android v14

Like I said please let me know if you need any other info, thanks!


RE: Jellyfin Android App Disconnecting - TheDreadPirate - 2024-04-18

A couple things you need to ensure on your phone.

Data saver is disabled and you need to ensure that the Jellyfin app is allowed unrestricted power and data.


RE: Jellyfin Android App Disconnecting - EXSuun - 2024-04-22

Thanks for the suggestion, I have checked all this prior to making the post. It seems that the pixel settings have been changed in an OS update, you can give apps permission to run in the background and use unlimited data but the setting that strictly allows apps to not be affected by battery management is removed. I assume that it's analogous to allowing apps to operate in the background and use unrestricted data.


RE: Jellyfin Android App Disconnecting - TheDreadPirate - 2024-04-22

I'm going to list out what I checked for my phone (Pixel 6a on Android 14). You're right. The last time I checked these settings they were somewhere else (probably when the phone was running Android 13).

This is both for me to keep track of what I've checked and try to mesh up with what you checked.

Network > Data Saver - Off
Network > VPN - None (when on, Jellyfin is allowed to bypass VPN)
Apps > Special app access > Unrestricted Data > Jellyfin - on
Apps > See All > Jellyfin > App battery usage > Allow background usage - on
Apps > See All > Jellyfin > Mobile data usage > Background data - on
Apps > See All > Jellyfin > Mobile data usage > Unrestricted data usage - on
Apps > See All > Jellyfin > App battery usage > Allow background usage - on


RE: Jellyfin Android App Disconnecting - EXSuun - 2024-04-30

I managed to get it mostly working.

For some reason, Google decided to dubiously hide away the optimisation app settings in Android 14. The setting to change an app's battery management between optimised and unrestricted is still there. You need to tap on the part where it says 'Allow background useage' and then it brings you to the optimisation settings. When I changed it to unrestricted I was able to play music uninterrupted while my phone was locked, whereas previously it would disconnect.

In order to stop the connection from disconnecting while multi-tasking on the phone with Jellyfin streaming in the background, you need to change the following setting:

Network and internet > Adaptive connectivity - OFF.

Turning this off mostly solved the issue with some exceptions. I noticed that if I had certain apps open, it would cause the connection to drop out after around 10-15 seconds. The two main offenders are the official apps from ChatGPT and Reddit. On my phone, if these are open and running in the background, it will still cause connection drop outs.

I had no issues using Chrome, native phone apps, YouTube, Spotify, ClaudeAI and utility apps like calendar and sleep timers.