jellyfin / jellyfin-androidtv

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

Recurring IllegalStateException crashes on Android TV #3403

Closed Ifiht closed 7 months ago

Ifiht commented 7 months ago

Describe the bug

Once a day, when attempting playback of a TV show, the client on my android TV will crash and also lose authentication with the Jellyfin Server. Logging in takes multiple attempts, using the same password, before finally succeeding after 3-4 tries (jellyfin server stays online this whole time, and docker shows healthy). After re-logging in, playback is fine for the rest of the day until roughly 12-24 hours later, process repeats.

Logs

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

Logs

Stack Trace:

java.lang.IllegalStateException: can't get VLCObject instance
        at org.videolan.libvlc.MediaPlayer.nativeSetAudioOutputDevice(Native Method)
        at org.videolan.libvlc.MediaPlayer.setAudioOutputDeviceInternal(MediaPlayer.java:995)
        at org.videolan.libvlc.MediaPlayer.updateAudioOutputDevice(MediaPlayer.java:485)
        at org.videolan.libvlc.MediaPlayer.access$600(MediaPlayer.java:58)
        at org.videolan.libvlc.MediaPlayer$3.onAudioDevicesChanged(MediaPlayer.java:561)
        at org.videolan.libvlc.MediaPlayer$3.onAudioDevicesRemoved(MediaPlayer.java:585)
        at android.media.AudioManager$NativeEventHandlerDelegate$1.handleMessage(AudioManager.java:5208)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:6718)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

Logcat:

02-23 19:33:38.325 D/jellyfin-apiclient(12914): Adding request to queue: http://10.0.1.67:8096/Sessions/Playing/Progress
02-23 19:33:38.502 I/jellyfin-apiclient(12914): Response received from: http://10.0.1.67:8096/Sessions/Playing/Progress
02-23 19:33:39.951 I/org.jellyfin.sdk.api.sockets.OkHttpWebsocketSession(12914): Sending (raw) message {"MessageType":"KeepAlive","Data":{}}
02-23 19:33:39.987 I/org.jellyfin.sdk.api.sockets.OkHttpWebsocketSession(12914): Receiving (raw) message {"MessageType":"KeepAlive","MessageId":"b15274ef731647a2be957bf692936120"}
02-23 19:33:41.326 D/jellyfin-apiclient(12914): Adding request to queue: http://10.0.1.67:8096/Sessions/Playing/Progress
02-23 19:33:41.570 I/jellyfin-apiclient(12914): Response received from: http://10.0.1.67:8096/Sessions/Playing/Progress
02-23 19:33:44.347 D/jellyfin-apiclient(12914): Adding request to queue: http://10.0.1.67:8096/Sessions/Playing/Progress
02-23 19:33:44.667 I/jellyfin-apiclient(12914): Response received from: http://10.0.1.67:8096/Sessions/Playing/Progress
02-23 19:33:47.366 D/jellyfin-apiclient(12914): Adding request to queue: http://10.0.1.67:8096/Sessions/Playing/Progress
02-23 19:33:47.514 I/jellyfin-apiclient(12914): Response received from: http://10.0.1.67:8096/Sessions/Playing/Progress
02-23 19:33:50.367 D/jellyfin-apiclient(12914): Adding request to queue: http://10.0.1.67:8096/Sessions/Playing/Progress
02-23 19:33:50.719 I/jellyfin-apiclient(12914): Response received from: http://10.0.1.67:8096/Sessions/Playing/Progress
02-23 19:33:53.368 D/jellyfin-apiclient(12914): Adding request to queue: http://10.0.1.67:8096/Sessions/Playing/Progress
02-23 19:33:53.518 I/jellyfin-apiclient(12914): Response received from: http://10.0.1.67:8096/Sessions/Playing/Progress
02-23 19:33:56.369 D/jellyfin-apiclient(12914): Adding request to queue: http://10.0.1.67:8096/Sessions/Playing/Progress
02-23 19:33:59.370 D/jellyfin-apiclient(12914): Adding request to queue: http://10.0.1.67:8096/Sessions/Playing/Progress
02-23 19:34:01.504 D/Volley  (12914): [8130] NetworkUtility.logSlowRequests: HTTP response for request=<[ ] http://10.0.1.67:8096/Sessions/Playing/Progress 0xb1381f4b NORMAL 557> [lifetime=5134], [size=0], [rc=204], [retryCount=0]
02-23 19:34:01.504 I/jellyfin-apiclient(12914): Response received from: http://10.0.1.67:8096/Sessions/Playing/Progress
02-23 19:34:02.388 D/jellyfin-apiclient(12914): Adding request to queue: http://10.0.1.67:8096/Sessions/Playing/Progress
02-23 19:34:05.389 D/jellyfin-apiclient(12914): Adding request to queue: http://10.0.1.67:8096/Sessions/Playing/Progress
02-23 19:34:05.599 D/ACRA    (12914): onActivityPaused class org.jellyfin.androidtv.ui.browsing.MainActivity
02-23 19:34:05.963 D/Volley  (12914): [8131] NetworkUtility.logSlowRequests: HTTP response for request=<[ ] http://10.0.1.67:8096/Sessions/Playing/Progress 0xb1381f4b NORMAL 558> [lifetime=6592], [size=0], [rc=204], [retryCount=0]
02-23 19:34:06.066 D/Volley  (12914): [8133] NetworkUtility.logSlowRequests: HTTP response for request=<[ ] http://10.0.1.67:8096/Sessions/Playing/Progress 0xb1381f4b NORMAL 559> [lifetime=3677], [size=0], [rc=204], [retryCount=0]
02-23 19:34:06.168 D/SurfaceUtils(12914): connecting to surface 0x89632008, reason connectToSurface
02-23 19:34:06.168 I/MediaCodec(12914): [OMX.MTK.VIDEO.DECODER.AVC] setting surface generation to 13223939
02-23 19:34:06.168 D/SurfaceUtils(12914): disconnecting from surface 0x89632008, reason connectToSurface(reconnect)
02-23 19:34:06.168 D/SurfaceUtils(12914): connecting to surface 0x89632008, reason connectToSurface(reconnect)
02-23 19:34:06.220 D/MtkACodecPlugin(12914): add usage GRALLOC_USAGE_PATH_VDP0
02-23 19:34:06.221 D/SurfaceUtils(12914): disconnecting from surface 0x89632008, reason setNativeWindowSizeFormatAndUsage
02-23 19:34:06.221 D/SurfaceUtils(12914): connecting to surface 0x89632008, reason setNativeWindowSizeFormatAndUsage
02-23 19:34:06.232 D/SurfaceUtils(12914): set up nativeWindow 0x89632008 for 1920x1088, color 0x7f000103, rotation 0, usage 0x30002900
02-23 19:34:06.235 D/SurfaceUtils(12914): disconnecting from surface 0x8e1c5808, reason disconnectFromSurface
02-23 19:34:06.327 D/ACRA    (12914): onActivityStopped class org.jellyfin.androidtv.ui.browsing.MainActivity
02-23 19:34:06.352 D/CustomPlaybackOverlayFragment(12914): Stopping!
02-23 19:34:06.361 D/CustomPlaybackOverlayFragment(12914): this fragment belongs to the current session, ending it
02-23 19:34:06.366 D/PlaybackController(12914): stop called at 750476
02-23 19:34:06.409 I/ReportingHelper(12914): ReportingHelper.reportStopped called for 0142c413-0274-b59f-f0ea-86e150e4288f at position 7504760000
02-23 19:34:06.447 I/jellyfin-apiclient(12914): ReportPlaybackStopped: Item 0142c413-0274-b59f-f0ea-86e150e4288f, Ticks: 7504760000
02-23 19:34:06.448 D/jellyfin-apiclient(12914): Adding request to queue: http://10.0.1.67:8096/Sessions/Playing/Stopped
02-23 19:34:06.551 I/ExoPlayerImpl(12914): Release be57d1f [AndroidXMedia3/1.2.1] [BRAVIA_ATV2, BRAVIA 4K GB, Sony, 28] [media3.common, media3.session, media3.exoplayer, media3.decoder, media3.ui, media3.datasource, media3.extractor, media3.decoder.ffmpeg]
02-23 19:34:06.618 D/SurfaceUtils(12914): disconnecting from surface 0x89632008, reason disconnectFromSurface
02-23 19:34:06.618 D/gralloc (12914): unregister FBM buffer
02-23 19:34:06.618 D/gralloc (12914): unregister FBM buffer
02-23 19:34:06.619 I/chatty  (12914): uid=10068(org.jellyfin.androidtv) identical 12 lines
02-23 19:34:06.619 D/gralloc (12914): unregister FBM buffer
02-23 19:34:06.621 D/gralloc (12914): unregister FBM buffer
02-23 19:34:06.621 I/chatty  (12914): uid=10068(org.jellyfin.androidtv) identical 3 lines
02-23 19:34:06.621 D/gralloc (12914): unregister FBM buffer
02-23 19:34:06.631 D/MediaCodec(12914): mState = 0, mHaveKick = 0, L(703)
02-23 19:34:06.633 D/MtkACodecPlugin(12914): MtkACodecPlugin destoryAPlugin
02-23 19:34:06.678 D/MediaCodec(12914): mState = 0, mHaveKick = 0, L(703)
02-23 19:34:06.679 D/MtkACodecPlugin(12914): MtkACodecPlugin destoryAPlugin
02-23 19:34:06.777 D/MainActivity$onStop(12914): MainActivity stopped
02-23 19:34:06.810 I/SessionRepositoryImpl$restoreSession(12914): Restoring session
02-23 19:34:06.833 D/ACRA    (12914): onActivitySaveInstanceState class org.jellyfin.androidtv.ui.browsing.MainActivity
02-23 19:34:06.974 I/jellyfin-apiclient(12914): Response received from: http://10.0.1.67:8096/Sessions/Playing/Progress
02-23 19:34:06.974 I/jellyfin-apiclient(12914): Response received from: http://10.0.1.67:8096/Sessions/Playing/Progress
02-23 19:34:06.978 D/AndroidRuntime(12914): Shutting down VM
--------- beginning of crash
02-23 19:34:06.979 E/AndroidRuntime(12914): FATAL EXCEPTION: main
02-23 19:34:06.979 E/AndroidRuntime(12914): Process: org.jellyfin.androidtv, PID: 12914
02-23 19:34:06.979 E/AndroidRuntime(12914): java.lang.IllegalStateException: can't get VLCObject instance
02-23 19:34:06.979 E/AndroidRuntime(12914):     at org.videolan.libvlc.MediaPlayer.nativeSetAudioOutputDevice(Native Method)
02-23 19:34:06.979 E/AndroidRuntime(12914):     at org.videolan.libvlc.MediaPlayer.setAudioOutputDeviceInternal(MediaPlayer.java:995)
02-23 19:34:06.979 E/AndroidRuntime(12914):     at org.videolan.libvlc.MediaPlayer.updateAudioOutputDevice(MediaPlayer.java:485)
02-23 19:34:06.979 E/AndroidRuntime(12914):     at org.videolan.libvlc.MediaPlayer.access$600(MediaPlayer.java:58)
02-23 19:34:06.979 E/AndroidRuntime(12914):     at org.videolan.libvlc.MediaPlayer$3.onAudioDevicesChanged(MediaPlayer.java:561)
02-23 19:34:06.979 E/AndroidRuntime(12914):     at org.videolan.libvlc.MediaPlayer$3.onAudioDevicesRemoved(MediaPlayer.java:585)
02-23 19:34:06.979 E/AndroidRuntime(12914):     at android.media.AudioManager$NativeEventHandlerDelegate$1.handleMessage(AudioManager.java:5208)
02-23 19:34:06.979 E/AndroidRuntime(12914):     at android.os.Handler.dispatchMessage(Handler.java:106)
02-23 19:34:06.979 E/AndroidRuntime(12914):     at android.os.Looper.loop(Looper.java:193)
02-23 19:34:06.979 E/AndroidRuntime(12914):     at android.app.ActivityThread.main(ActivityThread.java:6718)
02-23 19:34:06.979 E/AndroidRuntime(12914):     at java.lang.reflect.Method.invoke(Native Method)
02-23 19:34:06.979 E/AndroidRuntime(12914):     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
02-23 19:34:06.979 E/AndroidRuntime(12914):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
02-23 19:34:06.981 E/ACRA    (12914): ACRA caught a IllegalStateException for org.jellyfin.androidtv
02-23 19:34:06.981 E/ACRA    (12914): java.lang.IllegalStateException: can't get VLCObject instance
02-23 19:34:06.981 E/ACRA    (12914):   at org.videolan.libvlc.MediaPlayer.nativeSetAudioOutputDevice(Native Method)
02-23 19:34:06.981 E/ACRA    (12914):   at org.videolan.libvlc.MediaPlayer.setAudioOutputDeviceInternal(MediaPlayer.java:995)
02-23 19:34:06.981 E/ACRA    (12914):   at org.videolan.libvlc.MediaPlayer.updateAudioOutputDevice(MediaPlayer.java:485)
02-23 19:34:06.981 E/ACRA    (12914):   at org.videolan.libvlc.MediaPlayer.access$600(MediaPlayer.java:58)
02-23 19:34:06.981 E/ACRA    (12914):   at org.videolan.libvlc.MediaPlayer$3.onAudioDevicesChanged(MediaPlayer.java:561)
02-23 19:34:06.981 E/ACRA    (12914):   at org.videolan.libvlc.MediaPlayer$3.onAudioDevicesRemoved(MediaPlayer.java:585)
02-23 19:34:06.981 E/ACRA    (12914):   at android.media.AudioManager$NativeEventHandlerDelegate$1.handleMessage(AudioManager.java:5208)
02-23 19:34:06.981 E/ACRA    (12914):   at android.os.Handler.dispatchMessage(Handler.java:106)
02-23 19:34:06.981 E/ACRA    (12914):   at android.os.Looper.loop(Looper.java:193)
02-23 19:34:06.981 E/ACRA    (12914):   at android.app.ActivityThread.main(ActivityThread.java:6718)
02-23 19:34:06.981 E/ACRA    (12914):   at java.lang.reflect.Method.invoke(Native Method)
02-23 19:34:06.981 E/ACRA    (12914):   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
02-23 19:34:06.981 E/ACRA    (12914):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
02-23 19:34:06.981 D/ACRA    (12914): Building report
02-23 19:34:07.030 D/ACRA    (12914): Starting collectors with priority FIRST
02-23 19:34:07.039 D/ACRA    (12914): Calling collector org.acra.collector.LogCatCollector
02-23 19:34:07.040 D/ACRA    (12914): Calling collector org.acra.collector.DropBoxCollector
02-23 19:34:07.040 D/ACRA    (12914): Calling collector org.acra.collector.StacktraceCollector
02-23 19:34:07.063 D/ACRA    (12914): Collector org.acra.collector.DropBoxCollector completed
02-23 19:34:07.067 D/ACRA    (12914): Collector org.acra.collector.StacktraceCollector completed
02-23 19:34:07.083 D/ACRA    (12914): Retrieving logcat output (buffer:default)...
02-23 19:34:07.192 E/libc    (14509): Access denied finding property "persist.svp.dbg.loglevel"

App information

App version: 0.16.5 (160599) Package name: org.jellyfin.androidtv Build:

{"BOARD":"BRAVIA_ATV2","BOOTLOADER":"unknown","BRAND":"Sony","CPU_ABI":"armeabi-v7a","CPU_ABI2":"armeabi","DEVICE":"BRAVIA_ATV2","DISPLAY":"BRAVIA_ATV2_UC-user 9 PTT1.190515.001.S43 671651 release-keys","FINGERPRINT":"Sony\/BRAVIA_ATV2_UC\/BRAVIA_ATV2:9\/PTT1.190515.001.S43\/671651:user\/release-keys","HARDWARE":"mt5891","HOST":"BuildHost591","ID":"PTT1.190515.001.S43","IS_DEBUGGABLE":false,"IS_EMULATOR":false,"MANUFACTURER":"Sony","MODEL":"BRAVIA 4K GB","PERMISSIONS_REVIEW_REQUIRED":false,"PRODUCT":"BRAVIA_ATV2_UC","RADIO":"unknown","SUPPORTED_32_BIT_ABIS":["armeabi-v7a","armeabi"],"SUPPORTED_64_BIT_ABIS":[],"SUPPORTED_ABIS":["armeabi-v7a","armeabi"],"TAGS":"release-keys","TIME":1619066443000,"TYPE":"user","UNKNOWN":"unknown","USER":"root","VERSION":{"ACTIVE_CODENAMES":[],"BASE_OS":"","CODENAME":"REL","FIRST_SDK_INT":24,"INCREMENTAL":"671651","PREVIEW_SDK_INT":0,"RELEASE":"9","RESOURCES_SDK_INT":28,"SDK":"28","SDK_INT":28,"SECURITY_PATCH":"2021-03-05"}}

Build config:

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

Device information

Android version: 9 Device brand: Sony Device product: BRAVIA_ATV2_UC Device model: BRAVIA 4K GB

Crash information

Start time: 2024-02-23T19:03:19.071-05:00 Crash time: 2024-02-23T19:34:07.397-05:00

Application version

10.8.13

Where did you install the app from?

Google Play

Device information

Sony Bravia TV

Android version

Android 9

Jellyfin server version

10.8.13

nielsvanvelzen commented 7 months ago

Is your preferred video player set to ExoPlayer in the app preferences?

Ifiht commented 7 months ago

It was - thanks for pointing that setting out! Changing it to LibVLC finally allowed me to play some of my files that weren't working.

nielsvanvelzen commented 7 months ago

Well that was not my intention. You should not use LibVLC as it is unstable and causes crashes, the crash logs you shared indicate the app tried to play a video with the LibVLC implementation and it failed.

Ifiht commented 7 months ago

I understand, and apologize I know this isn't the way to pin errors down, but I needed to get the TV working again. End result was I updated Android OS on the TV, changed to LibVLC, and have not had any issues since.