jellyfin / jellyfin-androidtv

Android TV Client for Jellyfin
https://jellyfin.org
GNU General Public License v2.0
2.44k stars 414 forks source link

Stall when going to next episode, often followed by crash #2800

Open AlexKalopsia opened 1 year ago

AlexKalopsia commented 1 year ago

Describe the bug

JF running on a Synology DS918+ 16Gb RAM.

It's been some weeks now that the client goes in some form of total stall when the "Next episode" countdown ends, or when I manually try and make it go to the next episode. Media being played here is 1080p H264 SDR, with audio Dolby Digital+ 5.1

I can see from my desktop dashboard that the client is in Direct Play ("The source file is entirely compatible with this client, and the session is receiving the file without modifications.").

In general, the few times when it works, moving from one episode to the other is also incredibly slow, so I believe there might be something fishy happening.

image

Logs

Client crash: https://hastebin.com/share/kefotoxato.php Server log: https://hastebin.com/share/kaqasasuqi.csharp

Application version

0.15.9

Where did you install the app from?

Sideloaded APK

Device information

Amazon Fire Stick 4K Max

Android version

Fire OS

Jellyfin server version

10.8.10

MattFryer commented 1 year ago

I've been having this same issue for a while now. Both the fire TV app and side loaded android TV apps do the same. But the browser, mobile and webOS versions work perfectly. I've tried on various generations of fire TV stick including the latest 4K Max. If I force stop the app or wait until it crashes and open it again, its back to working perfectly although it normally loses a large portion of my progress through the episode. Happy to provide additional logs from my side if it will help with identifying the issue.

AlexKalopsia commented 1 year ago

That's somewhat comforting to hear, we also got in the habit of doing the clear cache / clear data routine, but it's been really frustrating

nielsvanvelzen commented 1 year ago

From the provided logs it looks like the server becomes unresponsive causing the app to crash. Some of the requests take a minute to respond, this is not good. Not much I can do on the client side for this.

MattFryer commented 1 year ago

As I'm running the server on my NAS it probably is underpowered for sure and so I initially thought this might be causing the issue but it does work perfectly on other clients. Maybe the android/fireTV client has a shorter timeout waiting for a response?

When I get the chance I'll spin Jellyfin up on a more powerful box and see if it improves things.

AlexKalopsia commented 1 year ago

For what is worth this also occurs when the media is in direct play and no transcoding is happening. I do get the feeling that the truth is somewhere in the middle, since I do detect very high drive utilization, but as @MattFryer above says I have no issue on other clients, so it's a bit unclear

nielsvanvelzen commented 1 year ago

The app uses a timeout of 30 seconds. If no response is ready after that it will fail. Most places in the app can safely deal with this (ignore/show warning/go back etc.) but some places will hard-crash the app as we have no way to deal with a bad response.

Other clients behave differently on this matter, for example; the mobile app always safely handles bad responses because it was completely written from scratch, the web client doesn't specify timeouts and will happily wait for minutes.

edit: it might help to use different drives for the Jellyfin data and the actual media. As these problems probably arise from database read/writes.

jellyfin-bot commented 9 months ago

This issue has gone 120 days without comment. To avoid abandoned issues, it will be closed in 21 days if there are no new comments.

If you're the original submitter of this issue, please comment confirming if this issue still affects you in the latest release or master branch, or close the issue if it has been fixed. If you're another user also affected by this bug, please comment confirming so. Either action will remove the stale label.

This bot exists to prevent issues from becoming stale and forgotten. Jellyfin is always moving forward, and bugs are often fixed as side effects of other changes. We therefore ask that bug report authors remain vigilant about their issues to ensure they are closed if fixed, or re-confirmed - perhaps with fresh logs or reproduction examples - regularly. If you have any questions you can reach us on Matrix or Social Media.

AlexKalopsia commented 9 months ago

This is still happening, a bit unclear if @nielsvanvelzen latest reply suggest that it's smething that will be looked at?

MattFryer commented 7 months ago

edit: it might help to use different drives for the Jellyfin data and the actual media. As these problems probably arise from database read/writes.

@nielsvanvelzen I finally got around to moving the Jellyfin config to a USB pen drive I attached to my NAS to test this and it seems to have improved things drastically. Not only is it no longer crashing the android client constantly but the general performance of things like marking shows as complete seems to have improved. A rubbish old USB pen drive being so much better compared to a RAID5 NAS volume makes absolutely no sense to me however. My gut says there has to be something weird going on with Jellyfin for this to be the case as all other apps I have hosted on my NAS run like a dream with their data and media on the same RAID volume/pool.

Edit: It could also be possible that there is something weird going on with Synology Docker I guess.

hundredfire commented 4 months ago

I would like to know if there is any update on this? I have the same issue while running jellyfin on a separate drive than my media folders on a 2-bay synology NAS (they're set up as JBOD, no RAID)

BJ24 commented 2 months ago

Hi, I've been having this issue for more than a year I would guess. I am running docker on a Synology also. Run many other docker's and vms without issue. Wondering if anyone has explored this more.

Zodsmar commented 2 months ago

Hey,

I have also been experiencing the same issue.

https://www.reddit.com/r/jellyfin/comments/10fgzky/jellyfin_for_android_tv_freezes_and_ultimately/

My log is basically identical to this reddit post.

Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from