App crash when playing video to the end with vlc-unity on Pico 4
Summary
I was migrating a Unity3D project to the Pico 4 VR headset.
When I finished playing the videos to the end, most of them crashed.
Minimal project and steps to reproduce
-
Download and import the latest vlc-unity package.
-
Open the VLC minimal playback scene.
-
Change the VLC minimal playback script. Modify the media URL to a local one as follows (this is just a test file ):
_mediaPlayer.Media = new Media(new Uri("/sdcard/Movies/multitrack.mkv")); -
Compile and install the app to a Pico 4 device.
-
Run the app and wait until the video finish.
What is the current bug behavior?
When most of the videos end, the app crashes.
What is the expected correct behavior?
The app should not crash when videos end.
Does it work on other plaforms? Does it work with the official VLC apps?
Other platforms and the official VLC app didn't crash.
Relevant logs and/or screenshots
03-08 15:51:59.760 15878 8710 I VLCUnity: [VLC-Unity] get Video Frame 300
03-08 15:51:59.767 1296 8832 I SWVDEC : >>> swvdec_fillthisbuffer(): 0xdc067000 fd 30
03-08 15:51:59.767 1296 8831 I SWVDEC : <<< thread_eventd(): event_notification(): 'release reference' for 0xdb79a000, timestamp 62880001
03-08 15:51:59.771 15878 8710 I VLCUnity: [VLC-Unity] get Video Frame 301
03-08 15:51:59.776 1296 8831 I SWVDEC : <<< thread_eventd(): fill_buffer_done(): 0xdc067000, filled length 4718592, timestamp 62960001, READONLY
03-08 15:51:59.782 15878 8710 I VLCUnity: [VLC-Unity] get Video Frame 301
03-08 15:51:59.804 15878 8710 I VLCUnity: [VLC-Unity] get Video Frame 301
03-08 15:51:59.807 1296 8832 I SWVDEC : >>> swvdec_fillthisbuffer(): 0xdb79a000 fd 40
03-08 15:51:59.807 1296 8831 I SWVDEC : <<< thread_eventd(): event_notification(): 'release reference' for 0xdc4e7000, timestamp 62920001
03-08 15:51:59.807 1296 8831 I SWVDEC : <<< thread_eventd(): event_notification(): 'release reference' for 0xdc067000, timestamp 62960001
03-08 15:51:59.808 1296 8831 I SWVDEC : <<< thread_eventd(): fill_buffer_done(): 0xdb79a000, filled length 0, timestamp 0, EOS
03-08 15:51:59.809 15878 8837 W VLC : [0000006e36348000/2285] libvlc decoder: EOS received
03-08 15:51:59.815 15878 8710 I VLCUnity: [VLC-Unity] get Video Frame 299
03-08 15:51:59.838 15878 8710 I VLCUnity: [VLC-Unity] get Video Frame 299
03-08 15:51:59.849 15878 8710 I VLCUnity: [VLC-Unity] get Video Frame 300
03-08 15:51:59.882 15878 8710 I VLCUnity: [VLC-Unity] get Video Frame 300
03-08 15:51:59.893 15878 8710 I VLCUnity: [VLC-Unity] get Video Frame 301
03-08 15:51:59.895 953 17452 E PvrTrackingService: keyDataAnalyze right qtimer=16630964063, touch.a_x:0, touch.b_y:0, touch.rocker:0, touch.trigger:1, touch.thumbrest:0, key.home:0, key.app:0, key.a_x:0, key.b_y:0
03-08 15:51:59.895 953 17452 E PvrTrackingService: keyDataAnalyze right key.grip:0, key.rocker:0, key.trigger:0, trigger:0, grip:0, rocker_x:128, rocker_y:128, battery:5, mControllerStillFlag_left:0, mControllerStillFlag_right:0, mRadioType:2
03-08 15:51:59.895 972 1091 E Stationservice: KEYLOG:keyDataAnalyze right qtimer=16630964063, touch.a_x:0, touch.b_y:0, touch.rocker:0, touch.trigger:1, touch.thumbrest:0, key.home:0, key.app:0, key.a_x:0, key.b_y:0
03-08 15:51:59.895 953 17452 I PvrTrackingService: setKeyLog, SetKeyLog ret 0
03-08 15:51:59.895 972 28998 E Stationservice: KEYLOG:keyDataAnalyze right key.grip:0, key.rocker:0, key.trigger:0, trigger:0, grip:0, rocker_x:128, rocker_y:128, battery:5, mRadioType:2
03-08 15:51:59.895 953 17452 I PvrTrackingService: setKeyLog, SetKeyLog ret 0
03-08 15:51:59.904 15878 8710 I VLCUnity: [VLC-Unity] get Video Frame 301
03-08 15:51:59.915 15878 8710 I VLCUnity: [VLC-Unity] get Video Frame 301
03-08 15:51:59.918 943 1714 I PxrNotificationClient: sendPxrNotification,action:teatracker_event_action id:0,value1:audio_output_end value2:0,ext:{"channel_mask":3,"content_type":2,"duration":3579,"flags":2,"foreground_package_name_far":"","foreground_package_name_near":"","format":5,"output_type":"speaker","package_name":"com.rockvr.moonplayer","sample_rate":0,"stream_type":3,"usage":1,"volume_ui":0}
03-08 15:51:59.918 2091 7163 W PxrNotificationService: sendPxrMessage callingUid:1041 has no permission,check permission with action
03-08 15:51:59.918 2091 7163 E PxrNotificationUtils: non system uid checkSendPxrMessagePermissionWithAction:teatracker_event_action permission granted.
03-08 15:51:59.919 2091 7163 I PxrNotificationService: sendPxrMessage callingPid:943 action teatracker_event_action ,value1:audio_output_end ,value2:0 ,ext:{"channel_mask":3,"content_type":2,"duration":3579,"flags":2,"foreground_package_name_far":"","foreground_package_name_near":"","format":5,"output_type":"speaker","package_name":"com.rockvr.moonplayer","sample_rate":0,"stream_type":3,"usage":1,"volume_ui":0}
03-08 15:51:59.919 2091 7163 I PxrNotificationService: ,mPvrCallbacks.size():16
03-08 15:51:59.926 15878 8710 I VLCUnity: [VLC-Unity] get Video Frame 299
03-08 15:51:59.937 15878 8824 I VLCUnity: [VLC-Unity] output callback cleanup
03-08 15:51:59.937 15878 8824 I VLCUnity: [VLC-Unity] destroy_fbo
03-08 15:51:59.937 15878 8824 E libEGL : call to OpenGL ES API with no current context (logged once per thread)
03-08 15:51:59.937 15878 8837 E NdkMediaCodec: sf error code: -38
03-08 15:51:59.937 1296 8832 I OMX_SWVDEC: --- async_process_event_cmd_flush(): flush port index -1 requested
03-08 15:51:59.937 1296 8832 I SWVDEC : >>> swvdec_flush(): flush all
03-08 15:51:59.937 1296 8832 I SWVDEC : --- set_state(): SWVDEC_STATE_READY -> SWVDEC_STATE_FLUSH_ALL
03-08 15:51:59.938 1296 8829 I SWVDEC : --- thread_parser(): SWVDEC_THREAD_SIGNAL_FLUSH_ALL
03-08 15:51:59.938 1296 8830 I SWVDEC : --- thread_decoder(): SWVDEC_THREAD_SIGNAL_FLUSH_ALL
03-08 15:51:59.938 1296 8831 I SWVDEC : --- set_state(): SWVDEC_STATE_FLUSH_ALL -> SWVDEC_STATE_READY
03-08 15:51:59.938 1296 8831 I SWVDEC : <<< thread_eventd(): event_notification(): 'flush all done'
03-08 15:51:59.939 1296 8832 I SWVDEC : >>> swvdec_fillthisbuffer(): 0xdc4e7000 fd 40
03-08 15:51:59.940 1296 8832 I SWVDEC : >>> swvdec_fillthisbuffer(): 0xdc067000 fd 38
03-08 15:51:59.940 1296 8832 I SWVDEC : >>> swvdec_fillthisbuffer(): 0xdb79a000 fd 36
03-08 15:51:59.940 1296 8832 I OMX_SWVDEC: --- async_process_event_cmd_state_set(): 'OMX_StateExecuting-to-OMX_StateIdle' requested
03-08 15:51:59.940 1296 8832 I SWVDEC : >>> swvdec_flush(): flush all
03-08 15:51:59.940 1296 8832 I SWVDEC : --- set_state(): SWVDEC_STATE_READY -> SWVDEC_STATE_FLUSH_ALL
03-08 15:51:59.940 1296 8829 I SWVDEC : --- thread_parser(): SWVDEC_THREAD_SIGNAL_FLUSH_ALL
03-08 15:51:59.941 1296 8830 I SWVDEC : --- thread_decoder(): SWVDEC_THREAD_SIGNAL_FLUSH_ALL
03-08 15:51:59.941 1296 8831 I SWVDEC : <<< thread_eventd(): fill_buffer_done(): 0xdc4e7000, filled length 0, timestamp 0
03-08 15:51:59.941 1296 8831 I SWVDEC : <<< thread_eventd(): fill_buffer_done(): 0xdc067000, filled length 0, timestamp 0
03-08 15:51:59.941 1296 8831 I SWVDEC : <<< thread_eventd(): fill_buffer_done(): 0xdb79a000, filled length 0, timestamp 0
03-08 15:51:59.941 1296 8831 I SWVDEC : --- set_state(): SWVDEC_STATE_FLUSH_ALL -> SWVDEC_STATE_READY
03-08 15:51:59.941 1296 8831 I SWVDEC : <<< thread_eventd(): event_notification(): 'flush all done'
03-08 15:51:59.942 1296 8832 I OMX_SWVDEC: --- async_process_event_cmd_state_set(): 'OMX_StateIdle-to-OMX_StateLoaded' requested
03-08 15:51:59.943 1296 4970 I OMX_SWVDEC: --- ion_memory_free(): Free ion memory: map fd 25 ion_dev fd 24 len 3133440 flags 0 mask 0x2000000
03-08 15:51:59.943 1296 4970 I OMX_SWVDEC: --- ion_memory_free(): Free ion memory: map fd 22 ion_dev fd 21 len 3133440 flags 0 mask 0x2000000
03-08 15:51:59.943 1296 4970 I OMX_SWVDEC: --- ion_memory_free(): Free ion memory: map fd 19 ion_dev fd 18 len 3133440 flags 0 mask 0x2000000
03-08 15:51:59.944 1296 4970 I OMX_SWVDEC: --- ion_memory_free(): Free ion memory: map fd 16 ion_dev fd 15 len 3133440 flags 0 mask 0x2000000
03-08 15:51:59.944 1296 4970 I OMX_SWVDEC: --- ion_memory_free(): Free ion memory: map fd 13 ion_dev fd 12 len 3133440 flags 0 mask 0x2000000
03-08 15:51:59.945 1296 5067 I SWVDEC : >>> swvdec_stop():
03-08 15:51:59.945 1296 5067 I SWVDEC : --- unload_resources(): unload_resources
03-08 15:51:59.957 1296 5067 I SWVDEC : --- set_state(): SWVDEC_STATE_READY -> SWVDEC_STATE_INIT
03-08 15:51:59.958 1296 5067 I SWVDEC : >>> swvdec_deinit():
03-08 15:51:59.958 1296 5067 I SWVDEC : --- set_state(): SWVDEC_STATE_INIT -> SWVDEC_STATE_INVALID
03-08 15:51:59.958 1296 8831 I SWVDEC : --- thread_eventd(): SWVDEC_THREAD_SIGNAL_EXIT
03-08 15:51:59.959 1296 8830 I SWVDEC : --- thread_decoder(): SWVDEC_THREAD_SIGNAL_EXIT
03-08 15:51:59.959 1296 8829 I SWVDEC : --- thread_parser(): SWVDEC_THREAD_SIGNAL_EXIT
03-08 15:51:59.959 1296 5067 I SWVDEC : --- swvdec_deinit(): all done, goodbye!
03-08 15:51:59.959 1296 5067 I OMX_SWVDEC: --- component_deinit(): all done, goodbye!
03-08 15:51:59.959 1296 5067 I media.codec: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/fastrpc_apps_user.c:2293: fastrpc_apps_user_deinit done
03-08 15:51:59.962 15878 8824 E libsigchain: xr_default_handler signal: 11, signo: 11
03-08 15:51:59.963 15878 8824 F libc : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 8824 (mediacodec_jni), pid 15878 (ckvr.moonplayer)
03-08 15:52:00.000 2087 2087 W KeyguardUpdateMonitor: handleTimeUpdate
03-08 15:52:00.025 8849 8849 E crash_dump64: target thread=15878, meminfo.size()=38
03-08 15:52:00.053 8850 8850 I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
03-08 15:52:00.053 1333 1333 I /system/bin/tombstoned: received crash request for pid 8824
03-08 15:52:00.054 8850 8850 I crash_dump64: performing dump of process 15878 (target tid = 8824)
03-08 15:52:00.058 8850 8850 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
03-08 15:52:00.058 8850 8850 F DEBUG : Build fingerprint: 'Pico/Phoenix/PICOA8110:10/5.4.0/smartcm.1676607536:user/dev-keys'
03-08 15:52:00.058 8850 8850 F DEBUG : Revision: '0'
03-08 15:52:00.058 8850 8850 F DEBUG : ABI: 'arm64'
03-08 15:52:00.058 8850 8850 F DEBUG : Timestamp: 2023-03-08 15:52:00+0800
03-08 15:52:00.058 8850 8850 F DEBUG : pid: 15878, ppid: 754, tid: 8824, name: mediacodec_jni >>> com.rockvr.moonplayer <<<
03-08 15:52:00.058 8850 8850 F DEBUG : uid: 10116
03-08 15:52:00.058 8850 8850 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
03-08 15:52:00.058 8850 8850 F DEBUG : Cause: null pointer dereference
03-08 15:52:00.058 8850 8850 F DEBUG : x0 0000006f36152c08 x1 0000000000000000 x2 0000000000000000 x3 00000000c161d340
03-08 15:52:00.058 8850 8850 F DEBUG : x4 0000000000000001 x5 0000000000000000 x6 0000000000000001 x7 0000000000000000
03-08 15:52:00.058 8850 8850 F DEBUG : x8 fa95c016f65adf72 x9 00000070246e5000 x10 0000000000000001 x11 0000000000000000
03-08 15:52:00.058 8850 8850 F DEBUG : x12 0000000002eeab08 x13 0000000000000000 x14 fffffffffc000000 x15 0000000000000008
03-08 15:52:00.058 8850 8850 F DEBUG : x16 00000070246e5b58 x17 00000070246d34e4 x18 0000006f1fde9000 x19 0000006f36152c08
03-08 15:52:00.058 8850 8850 F DEBUG : x20 00000000c161d340 x21 0000000000000000 x22 0000006e30537df0 x23 0000006e30537df0
03-08 15:52:00.058 8850 8850 F DEBUG : x24 00000000c0000000 x25 0000006f36152c30 x26 0000006e30537df0 x27 0000006f8f262df0
03-08 15:52:00.058 8850 8850 F DEBUG : x28 0000006ec0044b28 x29 0000006e30537960
03-08 15:52:00.058 8850 8850 F DEBUG : sp 0000006e30537930 lr 0000007024635394 pc 000000702465a1f4
03-08 15:52:00.060 8850 8850 F DEBUG :
03-08 15:52:00.060 8850 8850 F DEBUG : backtrace:
03-08 15:52:00.060 8850 8850 F DEBUG : #00 pc 00000000000741f4 /apex/com.android.runtime/lib64/bionic/libc.so (je_large_dalloc+44) (BuildId: cc9bc75e5a84b0128ceda2a81c30912a)
03-08 15:52:00.060 8850 8850 F DEBUG : #01 pc 000000000004f390 /apex/com.android.runtime/lib64/bionic/libc.so (je_free+1696) (BuildId: cc9bc75e5a84b0128ceda2a81c30912a)
03-08 15:52:00.060 8850 8850 F DEBUG : #02 pc 0000000000046ad4 /apex/com.android.runtime/lib64/bionic/libc.so (free+40) (BuildId: cc9bc75e5a84b0128ceda2a81c30912a)
03-08 15:52:00.060 8850 8850 F DEBUG : #03 pc 000000000004839c /system/lib64/libEGL.so (emutls_key_destructor+80) (BuildId: 1f342a4f61529e8282ba0f0b24b4a0a4)
03-08 15:52:00.060 8850 8850 F DEBUG : #04 pc 00000000000ed3d8 /apex/com.android.runtime/lib64/bionic/libc.so (pthread_key_clean_all()+124) (BuildId: cc9bc75e5a84b0128ceda2a81c30912a)
03-08 15:52:00.060 8850 8850 F DEBUG : #05 pc 00000000000ece2c /apex/com.android.runtime/lib64/bionic/libc.so (pthread_exit+72) (BuildId: cc9bc75e5a84b0128ceda2a81c30912a)
03-08 15:52:00.060 8850 8850 F DEBUG : #06 pc 00000000000ecd08 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+40) (BuildId: cc9bc75e5a84b0128ceda2a81c30912a)
03-08 15:52:00.060 8850 8850 F DEBUG : #07 pc 000000000008b064 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: cc9bc75e5a84b0128ceda2a81c30912a)
03-08 15:52:00.113 644 701 W ServiceManagement: Waited one second for vendor.qti.hardware.radio.uim_remote_client@1.0::IUimRemoteServiceClient/uimRemoteClient0
03-08 15:52:00.113 644 701 I ServiceManagement: getService: Trying again for vendor.qti.hardware.radio.uim_remote_client@1.0::IUimRemoteServiceClient/uimRemoteClient0...
03-08 15:52:00.325 8850 8850 E DEBUG : target thread=8824, meminfo.size()=38
03-08 15:52:00.356 953 17452 I PvrTrackingService: hand:right controller imu data loss rate 0.19%
Environment
- OS: Android
- Version 10 (API 29)
- Device: Pico 4
- LibVLC version and architecture: 4.0.0-dev-20419-g490c04ad03
- LibVLCSharp version: 4.0.0.0
- VLC Unity plugin version: 0.1.6
- Scripting backend used: IL2CPP
- Target Architecture: arm64