jellyfin-android icon indicating copy to clipboard operation
jellyfin-android copied to clipboard

Playing music stutters when the app is in the background

Open Seil0 opened this issue 5 years ago • 63 comments

When i'm paying a song with jellyfin open in the background the song start to stutter (sounds like the song stops for a few milliseconds). As soon as i bring jellyfin to the foreground the song continues to play without any issues. Changing between background and foreground always results in this behavior.

Device: Pixel 2 OS: Android 10 (QQ3A.200805.001) Jellyfin App: 2.0.0-rc2 Jellyfin Server: 10.6.2

Seil0 avatar Aug 23 '20 16:08 Seil0

Yeah, that's an issue with playing media in WebView. I couldn't reproduce it on my device, but it's definitely a thing. Long-term, we want to switch to a media player integrated into the OS.

Maxr1998 avatar Aug 23 '20 18:08 Maxr1998

This exact issue started happening to me after my phone upgraded to Android 11 today. It was working flawlessly before when I was on Android 10.

Device: OnePlus 8 Pro (IN2025) OS: Oxygen OS 11.IN11AA (Android 11) Jellyfin App: 2.0.1 Jellyfin Server: 10.6.4

LeRaldo avatar Oct 25 '20 08:10 LeRaldo

Same issue here with a Amazon Fire HD 10 tablet. Strange thing as a side note: as soon as I connect a bluetooth speaker to the tablet, no dropouts/stuttering sound happens. On other Android devices (MIUI 12) no issue at all.

aschubert avatar Nov 09 '20 08:11 aschubert

I have the same issues with Nokia 6.2. I have tested to disable the battery optimization but no help there.

jariha avatar Nov 12 '20 18:11 jariha

For now, the suggestion is to use another Jellyfin client that isn't in a web view. At some point music playback will be handled natively at which point these issues should disappear. I suggest either Gelli or Yatse for music playback.

dkanada avatar Nov 12 '20 20:11 dkanada

+1 for Gelli.

The comment I made here applies to this issue as well, that's why I marked it as wontfix.

Maxr1998 avatar Nov 13 '20 16:11 Maxr1998

-1 for Gelli. It has track sorting issues and author has no time to fix it It is useless for albums where order is important, for example for audiobooks.

alexs20 avatar Dec 07 '20 21:12 alexs20

-1 for Gelli. It has track sorting issues and author has no time to fix it It is useless for albums where order is important, for example for audiobooks.

that and it keeps causing my whole Jellyfin server to crash: seems to happen when I'm driving which suggests if there's an unstable connection it just screws everything up. Might go back to emby for music for now until there's a usable android client.

yotoprules avatar Dec 16 '20 02:12 yotoprules

I have yet to see any issue reported for server crashes due to Gelli, so of course the problem isn't fixed yet. That being said, I only know of one other instance in two years of a client crashing the server (Kodi) and it was quickly resolved. Not only that, but obviously a client should never be able to crash the server, so if you opened an issue on the main repository with logs (it wouldn't be a Gelli issue because the server should never crash from clients) I'm sure it would be high priority.

dkanada avatar Dec 16 '20 02:12 dkanada

I have yet to see any issue reported for server crashes due to Gelli, so of course the problem isn't fixed yet. That being said, I only know of one other instance in two years of a client crashing the server (Kodi) and it was quickly resolved. Not only that, but obviously a client should never be able to crash the server, so if you opened an issue on the main repository with logs (it wouldn't be a Gelli issue because the server should never crash from clients) I'm sure it would be high priority.

I'll see if I can reproduce it, the server didn't completely crash though, it was looping through some error and nothing could connect to it, but forgot what the error was. But I'll check this out tomorrow.

yotoprules avatar Dec 16 '20 02:12 yotoprules

Same issue pixel 3a Android 11

e10kstarfire avatar Jan 29 '21 23:01 e10kstarfire

Just want to mention that Yatse doesn't support Jellyfin (audio)books, so yatse is not a good workaround for the stutter/crash problem if you want to listen to audiobooks. It doesn't attempt to look at "Book" media library type.

chrstfer avatar Mar 05 '21 04:03 chrstfer

Same problem here with OnePlus Nord and Android 11.

sevi-kun avatar Apr 20 '21 10:04 sevi-kun

Another music client has shown up recently called Finamp on Android and iOS. As usual, I would suggest Gelli, Yatse, or Finamp for anyone experiencing this issue on mobile. If anyone can think of another mobile app for Jellyfin I will add it to this list.

dkanada avatar Apr 20 '21 10:04 dkanada

Same here, Android 11 on Pixel 5.

outergod avatar Jun 10 '21 17:06 outergod

The standard web client seems (at first attempt) to be OK (I'm using Firefox) for those who don't want to pay or sideload.

StevenEddies avatar Jun 10 '21 19:06 StevenEddies

I did some more digging, and it seems to be an issue in chromium, which powers the Android WebView. We can possibly work around this if I understand some of the comments correctly, but I need to investigate further first.

Still, the best solution would eventually be a fully native music player app.

Maxr1998 avatar Jun 10 '21 21:06 Maxr1998

Same issue here on Android 11 but with Bromite Webview

notarobot63 avatar Sep 02 '21 11:09 notarobot63

Can confirm that the issue is also present on my OP6.

Jellyfin 2.3.2 installed from Google play store. Android 10, Oxygen OS 10.3.12

My current workaround is opening a browser tab (Brave, chromium based) and let that play the music.

dbarenholz avatar Sep 06 '21 23:09 dbarenholz

I have this issue as well Jellyfin 2.3.3 installed from Google play store Redmi Note 6 Pro running Lineage OS 17.1 latest build as of 09/23/2021

Also confirmed that playing music directly from firefox from my server works perfectly.

I really hope this issue gets fixed soon, I love Jellyfin and don't want to go back to Emby :(

snipes040 avatar Sep 23 '21 18:09 snipes040

Having the same issue. When the app is in the foreground and screen is on, music is clear. Anything else and it stutters. Jellyfin 2.3.3 Google Pixel 4a (5g), Android 11 Tried with using phone speakers and bluetooth speakers and had the same result. Same behavior regardless of whether battery use is being optimized for the Jellyfin app.

iPhone client seems to not have the same issue as far as I can tell.

Like @dbarenholz above, opening a browser tab seems to work fine too.

Happy to try out config changes and report back if anyone has suggestions.

eaott avatar Sep 27 '21 19:09 eaott

Same issue with OnePlus 9 Pro. Apps starts to stutter if it gets in the background. Jellyfin Server: 10.7.7 on ARM Jellyfin Client: 2.3.3 on Android 11

Appoxo avatar Oct 27 '21 05:10 Appoxo

same but lineageos 18.1 (android 12) (no gapps) OnePlus 9 Pro here too

ShadwDrgn avatar Dec 18 '21 03:12 ShadwDrgn

Another music client has shown up recently called Finamp on Android and iOS. As usual, I would suggest Gelli, Yatse, or Finamp for anyone experiencing this issue on mobile. If anyone can think of another mobile app for Jellyfin I will add it to this list.

Finamp seems to be very promising and is available in F-Droid. Many thanks for suggesting.

samvde avatar Jan 02 '22 17:01 samvde

Same issue. Stutters a little even in foreground but when in background stutters and clicks constantly. Android seems to kill the app or it just dies after a few minutes in the background.

I'm using the Jellyfin Android Google TV app on my Sony TV and it plays perfectly with no stuttering. The bug seems to only affect the Android phone app.

Tried turning off battery and data restrictions/optimization for the app but no effect.

Pixel 4a 5G, Android 12 (build SQ1A.220105.002, kernel 4.19.202) Jellyfin Server: 10.7.7 Jellyfin Android Client: 2.4.2 (from Play store)

steevithak avatar Jan 17 '22 23:01 steevithak

Same here. Android 11, Oneplus 7 Pro. Stutters almost instantly after minimizing the app. Any news on a fix?

Seb3thehacker avatar Feb 28 '22 09:02 Seb3thehacker

Same here. Android 11, Oneplus 7 Pro. Stutters almost instantly after minimizing the app. Any news on a fix?

It seems they fixed it at some point... Jellyfin server: 10.7.7 with LSIO docker Jellyfin client: 2.4.2 Android: 12 Smartphone: OnePlus 9 Pro Tested file: FLAC Behavior: Typing over the Github App on my smartphone while jellyfin is minimized in the background.

Appoxo avatar Feb 28 '22 18:02 Appoxo

Same here. Android 11, Oneplus 7 Pro. Stutters almost instantly after minimizing the app. Any news on a fix?

It seems they fixed it at some point... Jellyfin server: 10.7.7 with LSIO docker Jellyfin client: 2.4.2 Android: 12 Smartphone: OnePlus 9 Pro Tested file: FLAC Behavior: Typing over the Github App on my smartphone while jellyfin is minimized in the background.

Try with the screen off.

ashanrath avatar Feb 28 '22 20:02 ashanrath

Same here. Android 11, Oneplus 7 Pro. Stutters almost instantly after minimizing the app. Any news on a fix?

It seems they fixed it at some point... Jellyfin server: 10.7.7 with LSIO docker Jellyfin client: 2.4.2 Android: 12 Smartphone: OnePlus 9 Pro Tested file: FLAC Behavior: Typing over the Github App on my smartphone while jellyfin is minimized in the background.

Try with the screen off.

Working. No stutters whatsoever.

Appoxo avatar Feb 28 '22 22:02 Appoxo

The bug is very device and situation specific. I can still reproduce it on my Pixel 5, Android 11. The upstream issue also hasn't changed since I last commented.

Maxr1998 avatar Feb 28 '22 23:02 Maxr1998