jellyfin / jellyfin-androidtv

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

AndroidTV App Crashes Randomly on Playback #3563

Open AutoAwesome opened 2 months ago

AutoAwesome commented 2 months ago

Describe the bug

If I just watch some shows, sooner or later the Jellyfin AndroidTV App will crash and close itself.

I tried to update everything and did wait for multiple month before finally reporting it. Sometime it happens once a day. Sometimes multiple times an hour. Its really unpredictable.

It was so unpredictable that I assumed my server has hardware issues. But dmesg looks completely fine! Only the Jellyfin AndroidTV Client makes problems. I can watch on my phone with the Android Phone App or in the browser the whole day without a single crash. Nothing else on my server is that unpredictable.

Is there anything else I can check?

Thanks a lot for your time!

Logs


client: Jellyfin for Android TV client_version: 0.16.10 client_repository: https://github.com/jellyfin/jellyfin-androidtv type: crash_report format: markdown

Logs

Stack Trace:

kotlinx.serialization.json.internal.JsonDecodingException: Unexpected JSON token at offset 26: Expected quotation mark '"', but had '' instead at path: $
JSON input: {"MessageType":"KeepAlivt���4��[u���2�E�ܖ@�@��d��e���#�Z-���
    at kotlinx.serialization.json.internal.JsonExceptionsKt.JsonDecodingException(JsonExceptions.kt:24)
    at kotlinx.serialization.json.internal.JsonExceptionsKt.JsonDecodingException(JsonExceptions.kt:32)
    at kotlinx.serialization.json.internal.AbstractJsonLexer.fail(AbstractJsonLexer.kt:598)
    at kotlinx.serialization.json.internal.AbstractJsonLexer.fail$default(AbstractJsonLexer.kt:596)
    at kotlinx.serialization.json.internal.AbstractJsonLexer.fail$kotlinx_serialization_json(AbstractJsonLexer.kt:233)
    at kotlinx.serialization.json.internal.StringJsonLexer.consumeKeyString(StringJsonLexer.kt:93)
    at kotlinx.serialization.json.internal.AbstractJsonLexer.consumeString(AbstractJsonLexer.kt:383)
    at kotlinx.serialization.json.internal.AbstractJsonLexer.peekString(AbstractJsonLexer.kt:307)
    at kotlinx.serialization.json.internal.StreamingJsonDecoder.coerceInputValue(StreamingJsonDecoder.kt:218)
    at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeObjectIndex(StreamingJsonDecoder.kt:231)
    at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeElementIndex(StreamingJsonDecoder.kt:178)
    at org.jellyfin.sdk.model.socket.RawIncomingSocketMessage$$serializer.deserialize(RawIncomingSocketMessage.kt:13)
    at org.jellyfin.sdk.model.socket.RawIncomingSocketMessage$$serializer.deserialize(RawIncomingSocketMessage.kt:13)
    at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:69)
    at kotlinx.serialization.json.Json.decodeFromString(Json.kt:107)
    at org.jellyfin.sdk.api.client.util.ApiSerializer.decodeSocketMessage(ApiSerializer.kt:114)
    at org.jellyfin.sdk.api.sockets.SocketInstance.forwardMessage(SocketInstance.kt:280)
    at org.jellyfin.sdk.api.sockets.SocketInstance.access$forwardMessage(SocketInstance.kt:35)
    at org.jellyfin.sdk.api.sockets.SocketInstance$connectAndBind$2.invokeSuspend(SocketInstance.kt:220)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
    Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@5062cea, Dispatchers.Default]

Logcat:

05-10 17:42:10.451 I/MediaCodecLogger(13082): 13082.HW.video.avc.bitrateInKbps = 8170
05-10 17:42:11.256 I/jellyfin-apiclient(13082): Response received from: http://192.168.2.100:8096/Sessions/Playing/Progress
05-10 17:42:14.258 I/jellyfin-apiclient(13082): Response received from: http://192.168.2.100:8096/Sessions/Playing/Progress
05-10 17:42:15.493 I/MediaCodecLogger(13082): 13082.HW.video.avc.bitrateInKbps = 7650
05-10 17:42:17.262 I/jellyfin-apiclient(13082): Response received from: http://192.168.2.100:8096/Sessions/Playing/Progress
05-10 17:42:17.401 I/org.jellyfin.sdk.api.sockets.OkHttpWebsocketSession(13082): Sending (raw) message {"MessageType":"KeepAlive","Data":{}}
05-10 17:42:17.407 I/org.jellyfin.sdk.api.sockets.OkHttpWebsocketSession(13082): Receiving (raw) message {"MessageType":"KeepAlive","MessageId":"576298dab4094783a58ba40f69626726"}
05-10 17:42:20.266 I/jellyfin-apiclient(13082): Response received from: http://192.168.2.100:8096/Sessions/Playing/Progress
05-10 17:42:20.576 I/MediaCodecLogger(13082): 13082.HW.video.avc.bitrateInKbps = 8223
05-10 17:42:23.269 I/jellyfin-apiclient(13082): Response received from: http://192.168.2.100:8096/Sessions/Playing/Progress
05-10 17:42:25.619 I/MediaCodecLogger(13082): 13082.HW.video.avc.bitrateInKbps = 7794
05-10 17:42:26.227 I/jellyfin-apiclient(13082): Response received from: http://192.168.2.100:8096/Sessions/Playing/Progress
05-10 17:42:29.273 I/jellyfin-apiclient(13082): Response received from: http://192.168.2.100:8096/Sessions/Playing/Progress
05-10 17:42:30.662 I/MediaCodecLogger(13082): 13082.HW.video.avc.bitrateInKbps = 8320
05-10 17:42:30.842 W/AmazonKeyEventLogging(13082): remote_perf key event latency detected [Source: ViewRootImpl, KeyCode: KEYCODE_XXXX, IsDown: 1, Repeat: 0, EventTime: 2123669, Latency: 217, DeviceId: 5, AppPackage: org.jellyfin.androidtv]
05-10 17:42:30.940 I/jellyfin-apiclient(13082): Response received from: http://192.168.2.100:8096/Sessions/Playing/Progress
05-10 17:42:45.936 I/jellyfin-apiclient(13082): Response received from: http://192.168.2.100:8096/Sessions/Playing/Progress
05-10 17:42:47.405 I/org.jellyfin.sdk.api.sockets.OkHttpWebsocketSession(13082): Sending (raw) message {"MessageType":"KeepAlive","Data":{}}
05-10 17:42:47.414 I/org.jellyfin.sdk.api.sockets.OkHttpWebsocketSession(13082): Receiving (raw) message {"MessageType":"KeepAlive","MessageId":"9ebc6d5144024e59afb6f401477a4c85"}
05-10 17:43:00.972 I/jellyfin-apiclient(13082): Response received from: http://192.168.2.100:8096/Sessions/Playing/Progress
05-10 17:43:15.919 I/jellyfin-apiclient(13082): Response received from: http://192.168.2.100:8096/Sessions/Playing/Progress
05-10 17:43:17.410 I/org.jellyfin.sdk.api.sockets.OkHttpWebsocketSession(13082): Sending (raw) message {"MessageType":"KeepAlive","Data":{}}
05-10 17:43:17.419 I/org.jellyfin.sdk.api.sockets.OkHttpWebsocketSession(13082): Receiving (raw) message {"MessageType":"KeepAlive","MessageId":"baea93731b9c4ccfa93c047511effcca"}
05-10 17:43:30.956 I/jellyfin-apiclient(13082): Response received from: http://192.168.2.100:8096/Sessions/Playing/Progress
05-10 17:43:35.369 I/lyfin.androidt(13082): Background concurrent copying GC freed 153266(6MB) AllocSpace objects, 0(0B) LOS objects, 35% free, 11MB/17MB, paused 233us total 129.495ms
05-10 17:43:45.945 I/jellyfin-apiclient(13082): Response received from: http://192.168.2.100:8096/Sessions/Playing/Progress
05-10 17:43:47.414 I/org.jellyfin.sdk.api.sockets.OkHttpWebsocketSession(13082): Sending (raw) message {"MessageType":"KeepAlive","Data":{}}
05-10 17:43:47.421 I/org.jellyfin.sdk.api.sockets.OkHttpWebsocketSession(13082): Receiving (raw) message {"MessageType":"KeepAlive","MessageId":"9f75977b19cd4feaaa7ba5a7ff329ce0"}
05-10 17:44:00.996 I/jellyfin-apiclient(13082): Response received from: http://192.168.2.100:8096/Sessions/Playing/Progress
05-10 17:44:15.981 I/jellyfin-apiclient(13082): Response received from: http://192.168.2.100:8096/Sessions/Playing/Progress
05-10 17:44:17.460 I/org.jellyfin.sdk.api.sockets.OkHttpWebsocketSession(13082): Sending (raw) message {"MessageType":"KeepAlive","Data":{}}
05-10 17:44:17.471 I/org.jellyfin.sdk.api.sockets.OkHttpWebsocketSession(13082): Receiving (raw) message {"MessageType":"KeepAlive","MessageId":"97aa1bba1d0948a8899d71fb215dabf1"}
05-10 17:44:23.541 I/PlaybackController(13082): Play called from state: PAUSED with pos: 1828317 and sub index: null
05-10 17:44:23.566 I/PlaybackController(13082): Play method: Direct
05-10 17:44:23.610 I/MediaCodecLogger(13082): the latest buffer is 112792 old with packageName org.jellyfin.androidtv. Possible resume detected
05-10 17:44:23.667 I/MediaCodecLogger(13082): 13082.HW.video.avc.bitrateInKbps = 14
05-10 17:44:23.675 I/jellyfin-apiclient(13082): Response received from: http://192.168.2.100:8096/Sessions/Playing/Progress
05-10 17:44:26.657 I/jellyfin-apiclient(13082): Response received from: http://192.168.2.100:8096/Sessions/Playing/Progress
05-10 17:44:28.697 I/MediaCodecLogger(13082): 13082.HW.video.avc.bitrateInKbps = 8346
05-10 17:44:29.673 I/jellyfin-apiclient(13082): Response received from: http://192.168.2.100:8096/Sessions/Playing/Progress
05-10 17:44:32.683 I/jellyfin-apiclient(13082): Response received from: http://192.168.2.100:8096/Sessions/Playing/Progress
05-10 17:44:33.739 I/MediaCodecLogger(13082): 13082.HW.video.avc.bitrateInKbps = 8281
05-10 17:44:35.675 I/jellyfin-apiclient(13082): Response received from: http://192.168.2.100:8096/Sessions/Playing/Progress
05-10 17:44:38.674 I/jellyfin-apiclient(13082): Response received from: http://192.168.2.100:8096/Sessions/Playing/Progress
05-10 17:44:38.781 I/MediaCodecLogger(13082): 13082.HW.video.avc.bitrateInKbps = 8623
05-10 17:44:41.677 I/jellyfin-apiclient(13082): Response received from: http://192.168.2.100:8096/Sessions/Playing/Progress
05-10 17:44:43.822 I/MediaCodecLogger(13082): 13082.HW.video.avc.bitrateInKbps = 8011
05-10 17:44:44.675 I/jellyfin-apiclient(13082): Response received from: http://192.168.2.100:8096/Sessions/Playing/Progress
05-10 17:44:45.681 W/VLC     (13082): [8abf5bb0/3390] libvlc audio output: playback too early (-44794): down-sampling
05-10 17:44:47.472 I/org.jellyfin.sdk.api.sockets.OkHttpWebsocketSession(13082): Sending (raw) message {"MessageType":"KeepAlive","Data":{}}
05-10 17:44:47.483 I/org.jellyfin.sdk.api.sockets.OkHttpWebsocketSession(13082): Receiving (raw) message {"MessageType":"KeepAlive","MessageId":"a335ff2c9b3441a4b615c2fa1b42a10e"}
05-10 17:44:47.676 I/jellyfin-apiclient(13082): Response received from: http://192.168.2.100:8096/Sessions/Playing/Progress
05-10 17:44:48.864 I/MediaCodecLogger(13082): 13082.HW.video.avc.bitrateInKbps = 8183
05-10 17:44:50.696 I/jellyfin-apiclient(13082): Response received from: http://192.168.2.100:8096/Sessions/Playing/Progress
05-10 17:44:53.689 I/jellyfin-apiclient(13082): Response received from: http://192.168.2.100:8096/Sessions/Playing/Progress
05-10 17:44:53.948 I/MediaCodecLogger(13082): 13082.HW.video.avc.bitrateInKbps = 6873
05-10 17:44:56.688 I/jellyfin-apiclient(13082): Response received from: http://192.168.2.100:8096/Sessions/Playing/Progress
05-10 17:44:59.032 I/MediaCodecLogger(13082): 13082.HW.video.avc.bitrateInKbps = 8330
05-10 17:44:59.688 I/jellyfin-apiclient(13082): Response received from: http://192.168.2.100:8096/Sessions/Playing/Progress
05-10 17:45:02.689 I/jellyfin-apiclient(13082): Response received from: http://192.168.2.100:8096/Sessions/Playing/Progress
05-10 17:45:04.114 I/MediaCodecLogger(13082): 13082.HW.video.avc.bitrateInKbps = 6881
05-10 17:45:05.694 I/jellyfin-apiclient(13082): Response received from: http://192.168.2.100:8096/Sessions/Playing/Progress
05-10 17:45:08.697 I/jellyfin-apiclient(13082): Response received from: http://192.168.2.100:8096/Sessions/Playing/Progress
05-10 17:45:09.156 I/MediaCodecLogger(13082): 13082.HW.video.avc.bitrateInKbps = 6909
05-10 17:45:11.691 I/jellyfin-apiclient(13082): Response received from: http://192.168.2.100:8096/Sessions/Playing/Progress
05-10 17:45:14.239 I/MediaCodecLogger(13082): 13082.HW.video.avc.bitrateInKbps = 7259
05-10 17:45:14.697 I/jellyfin-apiclient(13082): Response received from: http://192.168.2.100:8096/Sessions/Playing/Progress
05-10 17:45:17.476 I/org.jellyfin.sdk.api.sockets.OkHttpWebsocketSession(13082): Sending (raw) message {"MessageType":"KeepAlive","Data":{}}
05-10 17:45:17.699 I/org.jellyfin.sdk.api.sockets.OkHttpWebsocketSession(13082): Receiving (raw) message {"MessageType":"KeepAlivt���4��[u�����2��E��ܖ@��@��d��e���#�Z-���
05-10 17:45:17.699 I/jellyfin-apiclient(13082): Response received from: http://192.168.2.100:8096/Sessions/Playing/Progress
05-10 17:45:17.768 E/ACRA    (13082): ACRA caught a JsonDecodingException for org.jellyfin.androidtv
05-10 17:45:17.768 E/ACRA    (13082): kotlinx.serialization.json.internal.JsonDecodingException: Unexpected JSON token at offset 26: Expected quotation mark '"', but had '' instead at path: $
05-10 17:45:17.768 E/ACRA    (13082): JSON input: {"MessageType":"KeepAlivt���4��[u�����2��E��ܖ@��@��d��e���#�Z-���
05-10 17:45:17.768 E/ACRA    (13082):   at kotlinx.serialization.json.internal.JsonExceptionsKt.JsonDecodingException(JsonExceptions.kt:24)
05-10 17:45:17.768 E/ACRA    (13082):   at kotlinx.serialization.json.internal.JsonExceptionsKt.JsonDecodingException(JsonExceptions.kt:32)
05-10 17:45:17.768 E/ACRA    (13082):   at kotlinx.serialization.json.internal.AbstractJsonLexer.fail(AbstractJsonLexer.kt:598)
05-10 17:45:17.768 E/ACRA    (13082):   at kotlinx.serialization.json.internal.AbstractJsonLexer.fail$default(AbstractJsonLexer.kt:596)
05-10 17:45:17.768 E/ACRA    (13082):   at kotlinx.serialization.json.internal.AbstractJsonLexer.fail$kotlinx_serialization_json(AbstractJsonLexer.kt:233)
05-10 17:45:17.768 E/ACRA    (13082):   at kotlinx.serialization.json.internal.StringJsonLexer.consumeKeyString(StringJsonLexer.kt:93)
05-10 17:45:17.768 E/ACRA    (13082):   at kotlinx.serialization.json.internal.AbstractJsonLexer.consumeString(AbstractJsonLexer.kt:383)
05-10 17:45:17.768 E/ACRA    (13082):   at kotlinx.serialization.json.internal.AbstractJsonLexer.peekString(AbstractJsonLexer.kt:307)
05-10 17:45:17.768 E/ACRA    (13082):   at kotlinx.serialization.json.internal.StreamingJsonDecoder.coerceInputValue(StreamingJsonDecoder.kt:218)
05-10 17:45:17.768 E/ACRA    (13082):   at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeObjectIndex(StreamingJsonDecoder.kt:231)
05-10 17:45:17.768 E/ACRA    (13082):   at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeElementIndex(StreamingJsonDecoder.kt:178)
05-10 17:45:17.768 E/ACRA    (13082):   at org.jellyfin.sdk.model.socket.RawIncomingSocketMessage$$serializer.deserialize(RawIncomingSocketMessage.kt:13)
05-10 17:45:17.768 E/ACRA    (13082):   at org.jellyfin.sdk.model.socket.RawIncomingSocketMessage$$serializer.deserialize(RawIncomingSocketMessage.kt:13)
05-10 17:45:17.768 E/ACRA    (13082):   at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:69)
05-10 17:45:17.768 E/ACRA    (13082):   at kotlinx.serialization.json.Json.decodeFromString(Json.kt:107)
05-10 17:45:17.768 E/ACRA    (13082):   at org.jellyfin.sdk.api.client.util.ApiSerializer.decodeSocketMessage(ApiSerializer.kt:114)
05-10 17:45:17.768 E/ACRA    (13082):   at org.jellyfin.sdk.api.sockets.SocketInstance.forwardMessage(SocketInstance.kt:280)
05-10 17:45:17.768 E/ACRA    (13082):   at org.jellyfin.sdk.api.sockets.SocketInstance.access$forwardMessage(SocketInstance.kt:35)
05-10 17:45:17.768 E/ACRA    (13082):   at org.jellyfin.sdk.api.sockets.SocketInstance$connectAndBind$2.invokeSuspend(SocketInstance.kt:220)
05-10 17:45:17.768 E/ACRA    (13082):   at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
05-10 17:45:17.768 E/ACRA    (13082):   at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
05-10 17:45:17.768 E/ACRA    (13082):   at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
05-10 17:45:17.768 E/ACRA    (13082):   at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
05-10 17:45:17.768 E/ACRA    (13082):   at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
05-10 17:45:17.768 E/ACRA    (13082):   at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
05-10 17:45:17.768 E/ACRA    (13082):   Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@5062cea, Dispatchers.Default]

App information

App version: 0.16.10 (161099)
Package name: org.jellyfin.androidtv
Build:

{"BOARD":"sheldonp","BOOTLOADER":"unknown","BRAND":"Amazon","CPU_ABI":"armeabi-v7a","CPU_ABI2":"armeabi","DEVICE":"sheldonp","DISPLAY":"PS7671.4097N","FINGERPRINT":"Amazon\/sheldonp\/sheldonp:9\/PS7671.4097N\/0029965156608:user\/amz-p,release-keys","HARDWARE":"mt8695","HOST":"i3-ri-14-use1a-b-16-04-fos-stk2-8","ID":"PS7671.4097N","IS_DEBUGGABLE":false,"IS_EMULATOR":false,"MANUFACTURER":"Amazon","MODEL":"AFTSSS","PERMISSIONS_REVIEW_REQUIRED":false,"PRODUCT":"sheldonp","RADIO":"unknown","SUPPORTED_32_BIT_ABIS":["armeabi-v7a","armeabi"],"SUPPORTED_64_BIT_ABIS":[],"SUPPORTED_ABIS":["armeabi-v7a","armeabi"],"TAGS":"amz-p,release-keys","TIME":1713224812000,"TYPE":"user","UNKNOWN":"unknown","USER":"build","VERSION":{"ACTIVE_CODENAMES":[],"BASE_OS":"PPR1.180610.009","CODENAME":"REL","FIRST_SDK_INT":28,"INCREMENTAL":"0029965156740","PREVIEW_SDK_INT":0,"RELEASE":"9","RESOURCES_SDK_INT":28,"SDK":"28","SDK_INT":28,"SECURITY_PATCH":"2024-01-01"}}

Build config:

{"APPLICATION_ID":"org.jellyfin.androidtv","BUILD_TYPE":"release","DEBUG":false,"DEVELOPMENT":false,"VERSION_CODE":161099,"VERSION_NAME":"0.16.10"}

Device information

Android version: 9
Device brand: Amazon
Device product: sheldonp
Device model: AFTSSS

Crash information

Start time: 2024-05-10T17:36:14.767+02:00
Crash time: 2024-05-10T17:45:17.884+02:00

Application version

0.16.10

Where did you install the app from?

Amazon Appstore

Device information

Amazon FireTV Stick

Android version

FireOS 7

Jellyfin server version

10.8.13

nielsvanvelzen commented 2 months ago

Somehow you're receiving corrupt data over the WebSocket connection, causing the client to crash. Are you using a reverse proxy?

AutoAwesome commented 2 months ago

Thank you for your response!

Somehow you're receiving corrupt data over the WebSocket connection, causing the client to crash. Are you using a reverse proxy?

While I do have a reverse proxy (Caddy) I do not use it in my home network. You can see in the logs that I connect directly to the Jellyfin server (http://192.168.2.100:8096). If I connect from outside of my home network (through Caddy) the same issue appears. I'm wondering why only the (FireTV Stick-) AndroidTV app has this issue. All other devices (AndroidPhone, Browser) seem to work just fine.

clutwo commented 2 months ago

same problem here