Xamarin.Android: Unable to consistently play RTSP stream (+ disposing MediaPlayer with VOUT event crashes)
Hello,
please find attached a straight sample project. TestVLC.zip
We are facing issues with VideoLan.LibVLC.Android (v3.1.2.1 as well as v3.1.2) in our Xamarin Standard .NET project. Basically, it seems that on certain Android devices, the MediaPlayer cannot play RTSP streams.
For example on a OnePlus One (Android 8.1 API 27) and on a Samsung Galaxy S5 (Android 6.0.1 API 23), the RTSP video does not play (Video 1 in the sample project). Here's the output log:
[VLC] [a92d9430/7a41] libvlc demux: Nothing to play for rtsp://freja.hiof.no:1935/rtplive/_definst_/hessdalen03.stream
[VLC] [92893ab0/7a41] libvlc stream: Failed to setup RTSP session
[VLC] [92893ab0/7a41] libvlc stream: read error: Protocol not available
[VLC] [92893ab0/7a41] libvlc stream: Failed to teardown RTSP session
[VLC] [9570d030/7a41] libvlc input: Your input can't be opened
[VLC] [9570d030/7a41] libvlc input: VLC is unable to open the MRL 'rtsp://freja.hiof.no:1935/rtplive/_definst_/hessdalen03.stream'. Check the log for details.
Running the app on a Samsung Galaxy Tab S2 (Android 7 API 24), Video 1 plays just fine:
[ ViewRootImpl@6917d8d[MainActivity]] ViewPostImeInputStage processPointer 0
[BoostFramework] mAcquireFunc method = public int com.qualcomm.qti.Performance.perfLockAcquire(int,int[])
[BoostFramework] mReleaseFunc method = public int com.qualcomm.qti.Performance.perfLockRelease()
[BoostFramework] mAcquireTouchFunc method = public int com.qualcomm.qti.Performance.perfLockAcquireTouch(android.view.MotionEvent,android.util.DisplayMetrics,int,int[])
[BoostFramework] mIOPStart method = public int com.qualcomm.qti.Performance.perfIOPrefetchStart(int,java.lang.String)
[BoostFramework] mIOPStop method = public int com.qualcomm.qti.Performance.perfIOPrefetchStop()
[BoostFramework] BoostFramework() : mPerf = com.qualcomm.qti.Performance@81c5e68
[Mono] DllImport searching in: '__Internal' ('(null)').
[Mono] Searching for 'java_interop_jnienv_call_float_method_a'.
[Mono] Probing 'java_interop_jnienv_call_float_method_a'.
[Mono] Found as 'java_interop_jnienv_call_float_method_a'.
[ViewRootImpl@6917d8d[MainActivity]] ViewPostImeInputStage processPointer 1
[Mono] Loading reference 3 of /storage/emulated/0/Android/data/com.inim.testvlc/files/.__override__/TestVLC.dll asmctx DEFAULT, looking for LibVLCSharp, Version=3.2.3.0, Culture=neutral, PublicKeyToken=null
[Mono] Assembly Ref addref TestVLC[0x7f7e9f0600] -> LibVLCSharp[0x7f7e9f0400]: 4
[Mono] Loading reference 4 of /storage/emulated/0/Android/data/com.inim.testvlc/files/.__override__/TestVLC.dll asmctx DEFAULT, looking for LibVLCSharp.Forms, Version=3.2.3.0, Culture=neutral, PublicKeyToken=null
[Mono] Assembly Ref addref TestVLC[0x7f7e9f0600] -> LibVLCSharp.Forms[0x7f7e9f0500]: 3
[Mono] DllImport searching in: 'libvlc' ('libvlc.so').
[Mono] Searching for 'libvlc_new'.
[Mono] Probing 'libvlc_new'.
[Mono] Found as 'libvlc_new'.
[InputMethodManager] HSI from window - flag : 0 Pid : 11541
[Mono] Loading reference 3 of /storage/emulated/0/Android/data/com.inim.testvlc/files/.__override__/LibVLCSharp.Forms.dll asmctx DEFAULT, looking for Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065
[Mono] Assembly Ref addref LibVLCSharp.Forms[0x7f7e9f0500] -> Mono.Android[0x7f708e8400]: 45
[art] JNI RegisterNativeMethods: attempt to register 0 native methods for md546698daa40cfc4c645e97972c2567f23.VideoViewRenderer
[Mono] Loading reference 2 of /storage/emulated/0/Android/data/com.inim.testvlc/files/.__override__/LibVLCSharp.Android.AWindow.dll asmctx DEFAULT, looking for Java.Interop, Version=0.1.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065
[Mono] Assembly Ref addref LibVLCSharp.Android.AWindow[0x7f7e9f0300] -> Java.Interop[0x7f708e8500]: 10
[art] JNI RegisterNativeMethods: attempt to register 0 native methods for md51558244f76c53b6aeda52c8a337f2c37.ActivityIndicatorRenderer
[Mono] DllImport searching in: 'libvlc' ('libvlc.so').
[Mono] Searching for 'libvlc_media_player_new'.
[Mono] Probing 'libvlc_media_player_new'.
[Mono] Found as 'libvlc_media_player_new'.
[VLC] [0000007f5320e190/2d15] libvlc audio output: GetStaticFieldID(AudioFormat.ENCODING_DOLBY_TRUEHD) failed
[Mono] DllImport searching in: 'libvlc' ('libvlc.so').
[Mono] Searching for 'libvlc_media_player_set_android_context'.
[Mono] Probing 'libvlc_media_player_set_android_context'.
[Mono] Found as 'libvlc_media_player_set_android_context'.
[Mono] DllImport searching in: 'libvlc' ('libvlc.so').
[Mono] Searching for 'libvlc_media_new_location'.
[Mono] Probing 'libvlc_media_new_location'.
[Mono] Found as 'libvlc_media_new_location'.
[Mono] DllImport searching in: 'libvlc' ('libvlc.so').
[Mono] Searching for 'libvlc_media_new_path'.
[Mono] Probing 'libvlc_media_new_path'.
[Mono] Found as 'libvlc_media_new_path'.
[Mono] DllImport searching in: 'libvlc' ('libvlc.so').
[Mono] Searching for 'libvlc_media_new_as_node'.
[Mono] Probing 'libvlc_media_new_as_node'.
[Mono] Found as 'libvlc_media_new_as_node'.
[Mono] DllImport searching in: 'libvlc' ('libvlc.so').
[Mono] Searching for 'libvlc_media_player_set_media'.
[Mono] Probing 'libvlc_media_player_set_media'.
[Mono] Found as 'libvlc_media_player_set_media'.
[Mono] DllImport searching in: 'libvlc' ('libvlc.so').
[Mono] Searching for 'libvlc_media_player_play'.
[Mono] Probing 'libvlc_media_player_play'.
[Mono] Found as 'libvlc_media_player_play'.
[Mono] DllImport searching in: 'libvlc' ('libvlc.so').
[Mono] Searching for 'libvlc_media_player_get_media'.
[Mono] Probing 'libvlc_media_player_get_media'.
[Mono] Found as 'libvlc_media_player_get_media'.
[Mono] DllImport searching in: 'libvlc' ('libvlc.so').
[Mono] Searching for 'libvlc_media_add_option'.
[Mono] Probing 'libvlc_media_add_option'.
[Mono] Found as 'libvlc_media_add_option'.
[Mono] DllImport searching in: 'libvlc' ('libvlc.so').
[Mono] Searching for 'libvlc_media_player_event_manager'.
[Mono] Probing 'libvlc_media_player_event_manager'.
[Mono] Found as 'libvlc_media_player_event_manager'.
[Mono] DllImport searching in: 'libvlc' ('libvlc.so').
[Mono] Searching for 'libvlc_event_attach'.
[Mono] Probing 'libvlc_event_attach'.
[Mono] Found as 'libvlc_event_attach'.
[ViewRootImpl@6917d8d[MainActivity]] Relayout returned: oldFrame=[0,0][1536,2048] newFrame=[0,0][1536,2048] result=0x7 surface={isValid=true 546847398912} surfaceGenerationChanged=true
[ViewRootImpl@6917d8d[MainActivity]] mHardwareRenderer.updateSurface() mSurface={isValid=true 546847398912}
[SurfaceView] Relayout returned: oldFrame=[0,0][0,0] newFrame=[0,176][1536,2048] result=0x7 surface={Surface(name=null)/@0x48a9b0c isValid=true 546849846272}
[SurfaceView] Relayout returned: oldFrame=[0,176][1536,2048] newFrame=[0,176][1536,2048] result=0x1 surface={Surface(name=null)/@0x48a9b0c isValid=true 546849849856}
[AudioTrack] Client defaulted notificationFrames to 3848 for frameCount 7696
[AudioTrack] updateAudioTranstionLength FadeIn[0] FadeOut[0] FadeInRing[0]
[AudioCapabilities] Unsupported mime audio/mpeg-L1
[AudioCapabilities] Unsupported mime audio/mpeg-L2
[AudioCapabilities] Unsupported mime audio/x-ms-wma
[AudioCapabilities] Unsupported mime audio/x-ima
[AudioCapabilities] Unsupported mime audio/evrc
[AudioCapabilities] Unsupported mime audio/qcelp
[VideoCapabilities] Unrecognized profile 2130706433 for video/avc
[Utils] could not parse long range '175-174'
[AudioCapabilities] Unsupported mime audio/qcelp
[AudioCapabilities] Unsupported mime audio/evrc
[VideoCapabilities] Unsupported mime video/wvc1
[VideoCapabilities] Unsupported mime video/x-ms-wmv
[VideoCapabilities] Unrecognized profile/level 1/32 for video/mp4v-es
[VideoCapabilities] Unrecognized profile/level 32768/2 for video/mp4v-es
[VideoCapabilities] Unrecognized profile/level 32768/64 for video/mp4v-es
[VideoCapabilities] Unsupported mime video/wvc1
[VideoCapabilities] Unsupported mime video/x-ms-wmv
[VideoCapabilities] Unsupported mime video/x-ms-wmv7
[VideoCapabilities] Unsupported mime video/x-ms-wmv8
[VideoCapabilities] Unsupported mime video/mp43
[VideoCapabilities] Unsupported profile 4 for video/mp4v-es
[VLC] [0000007f4f8bf490/2d6c] libvlc window: request 1 not implemented
[VLC] [0000007f4f8bf490/2d6c] libvlc window: request 1 not implemented
[VLC] [0000007f4f8bf490/2d6c] libvlc window: request 0 not implemented
[VLC] [0000007f4f8bf490/2d6c] libvlc window: request 0 not implemented
[VLC] [0000007f4f8bf490/2d6c] libvlc window: request 1 not implemented
Thread started: #2
[ACodec] [] Now uninitialized
[ACodec] [] onAllocateComponent
[OMXClient] MuxOMX ctor
[ACodec] [OMX.qcom.video.decoder.avc] Now Loaded
[MediaCodec] [OMX.qcom.video.decoder.avc] setting surface generation to 11817985
[ACodec] [OMX.qcom.video.decoder.avc] OMX_QCOM_FramePacking_OnlyOneCompleteFrame is setting
[ACodec] [OMX.qcom.video.decoder.avc] Now Loaded->Idle
[SurfaceUtils] set up nativeWindow 0x7f50f0be10 for 1280x720, color 0x7fa30c04, rotation 0, usage 0x42002900
[ACodec] [OMX.qcom.video.decoder.avc] configureOutputBuffersFromNativeWindow setBufferCount : 23, minUndequeuedBuffers : 5
[ACodec] [OMX.qcom.video.decoder.avc] Now Idle->Executing
[ACodec] [OMX.qcom.video.decoder.avc] Now Executing
[ACodec] [OMX.qcom.video.decoder.avc] Now handling output port settings change
[SurfaceUtils] set up nativeWindow 0x7f50f0be10 for 1280x720, color 0x7fa30c04, rotation 0, usage 0x42002900
[ACodec] [OMX.qcom.video.decoder.avc] configureOutputBuffersFromNativeWindow setBufferCount : 16, minUndequeuedBuffers : 5
[ACodec] [OMX.qcom.video.decoder.avc] Now Executing
[VLC] [0000007f727c6990/2d79] libvlc decoder: output: 2141391876 unknown, 1280x720 stride 1280 736, crop 0 0 0 0
[Adreno] Invalid colorspace 0
[AudioTrack] releaseBuffer() track 0x7f52f7e700 disabled due to previous underrun, restarting
[Adreno] Invalid colorspace 0
[Adreno] Invalid colorspace 0
[Adreno] Invalid colorspace 0
[VLC] [0000007f4f8bf490/2d6c] libvlc window: request 3 not implemented
[Adreno] Invalid colorspace 0
[Adreno] Invalid colorspace 0
[Adreno] Invalid colorspace 0
[Adreno] Invalid colorspace 0
[Adreno] Invalid colorspace 0
[Adreno] Invalid colorspace 0
[Adreno] Invalid colorspace 0
[Adreno] Invalid colorspace 0
[Adreno] Invalid colorspace 0
The same, successful result, goes for a Honor Play (Android 9 API 28) device:
[ViewRootImpl] jank_removeInvalidNode all the node in jank list is out of time
[HwSecImmHelper] mSecurityInputMethodService is null
[AudioTrack] StreamType not music do not upload bigdata
[PlayerBase] baseStart() piid=21239
[android.media.AudioTrack] [HSM] AudioTrace play() uid: 11698, pid: 8840
[PlayerBase] isRestricted: falseLeftvolume: 1.0 Rightvolume: 1.0mPanMultiplierL: 1.0mPanMultiplierR: 1.0
[VideoCapabilities] Unrecognized profile 4 for video/hevc
[VideoCapabilities] Unrecognized profile/level 0/0 for video/mpeg2
[VideoCapabilities] Unrecognized profile/level 0/2 for video/mpeg2
[VideoCapabilities] Unrecognized profile/level 0/3 for video/mpeg2
[VideoCapabilities] Unsupported profile 5 for video/mpeg2
[chatty] uid=11698(com.inim.testvlc) mediacodec_jni identical 2 lines
[VideoCapabilities] Unsupported profile 5 for video/mpeg2
[VideoCapabilities] Unrecognized profile/level 1/32 for video/mp4v-es
[VideoCapabilities] Unrecognized profile/level 32768/2 for video/mp4v-es
[VideoCapabilities] Unrecognized profile/level 32768/64 for video/mp4v-es
[VideoCapabilities] Unsupported profile 4 for video/mp4v-es
[VLC] [00000079b2b55690/2317] libvlc window: request 1 not implemented
[VLC] [00000079b2b55690/2317] libvlc window: request 1 not implemented
[mali_winsys] EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
[VLC] [00000079b2b55690/2317] libvlc window: request 0 not implemented
[VLC] [00000079b2b55690/2317] libvlc window: request 0 not implemented
[VLC] [00000079b2b55690/2317] libvlc window: request 1 not implemented
Thread started: #3
[OMXClient] IOmx service obtained
[ACodec] In onAllocateComponent create compenent, codec name: OMX.hisi.video.decoder.avc
[SurfaceUtils] connecting to surface 0x79cda72010, reason connectToSurface
[MediaCodec] [OMX.hisi.video.decoder.avc] setting surface generation to 9052161
[SurfaceUtils] disconnecting from surface 0x79cda72010, reason connectToSurface(reconnect)
[SurfaceUtils] connecting to surface 0x79cda72010, reason connectToSurface(reconnect)
[ViewRootImpl] jank_removeInvalidNode all the node in jank list is out of time
[ACodec] [OMX.hisi.video.decoder.avc] setPortMode on output to DynamicANWBuffer failed w/ err -2147483648
[libc] Access denied finding property "ro.kirin.product.platform"
[HwExtendedCodec] mime: video/avc matching compontent failed!
[HwExtendedCodec] mime is [video/avc] at setVideoFormat
[ACodec] [OMX.hisi.video.decoder.avc] got color aspects (R:2(Limited), P:1(BT709_5), M:1(BT709_5), T:3(SMPTE170M)) err=0(NO_ERROR)
[ACodec] [OMX.hisi.video.decoder.avc] got color aspects (R:2(Limited), P:1(BT709_5), M:1(BT709_5), T:3(SMPTE170M)) err=0(NO_ERROR)
[ACodec] [OMX.hisi.video.decoder.avc] using color aspects (R:2(Limited), P:1(BT709_5), M:1(BT709_5), T:3(SMPTE170M)) and dataspace 0x104
[ACodec] onStart
[SurfaceUtils] disconnecting from surface 0x79cda72010, reason setNativeWindowSizeFormatAndUsage
[SurfaceUtils] connecting to surface 0x79cda72010, reason setNativeWindowSizeFormatAndUsage
[SurfaceUtils] set up nativeWindow 0x79cda72010 for 1280x720, color 0x30d, rotation 0, usage 0x20002900
[MapperHal] buffer descriptor with invalid usage bits 0x2000
[MapperHal] buffer descriptor with invalid usage bits 0x2000
[MapperHal] buffer descriptor with invalid usage bits 0x2000
[MapperHal] buffer descriptor with invalid usage bits 0x2000
[MapperHal] buffer descriptor with invalid usage bits 0x2000
[MapperHal] buffer descriptor with invalid usage bits 0x2000
[ACodec] [OMX.hisi.video.decoder.avc] got color aspects (R:2(Limited), P:1(BT709_5), M:1(BT709_5), T:3(SMPTE170M)) err=0(NO_ERROR)
[ACodec] [OMX.hisi.video.decoder.avc] got color aspects (R:2(Limited), P:1(BT709_5), M:1(BT709_5), T:3(SMPTE170M)) err=0(NO_ERROR)
[ACodec] [OMX.hisi.video.decoder.avc] using color aspects (R:2(Limited), P:1(BT709_5), M:1(BT709_5), T:3(SMPTE170M)) and dataspace 0x104
[ACodec] [OMX.hisi.video.decoder.avc] got color aspects (R:2(Limited), P:1(BT709_5), M:1(BT709_5), T:3(SMPTE170M)) err=0(NO_ERROR)
[ACodec] [OMX.hisi.video.decoder.avc] got color aspects (R:2(Limited), P:1(BT709_5), M:1(BT709_5), T:3(SMPTE170M)) err=0(NO_ERROR)
[ACodec] [OMX.hisi.video.decoder.avc] using color aspects (R:2(Limited), P:1(BT709_5), M:1(BT709_5), T:3(SMPTE170M)) and dataspace 0x104
[SurfaceUtils] disconnecting from surface 0x79cda72010, reason setNativeWindowSizeFormatAndUsage
[SurfaceUtils] connecting to surface 0x79cda72010, reason setNativeWindowSizeFormatAndUsage
[SurfaceUtils] set up nativeWindow 0x79cda72010 for 1280x720, color 0x30d, rotation 0, usage 0x20002900
[ACodec] [OMX.hisi.video.decoder.avc] setting nBufferCountActual to 18 failed: -2147483648
[MapperHal] buffer descriptor with invalid usage bits 0x2000
[MapperHal] buffer descriptor with invalid usage bits 0x2000
[MapperHal] buffer descriptor with invalid usage bits 0x2000
[MapperHal] buffer descriptor with invalid usage bits 0x2000
[MapperHal] buffer descriptor with invalid usage bits 0x2000
[MapperHal] buffer descriptor with invalid usage bits 0x2000
[MapperHal] buffer descriptor with invalid usage bits 0x2000
[MapperHal] buffer descriptor with invalid usage bits 0x2000
[MapperHal] buffer descriptor with invalid usage bits 0x2000
[MapperHal] buffer descriptor with invalid usage bits 0x2000
[MapperHal] buffer descriptor with invalid usage bits 0x2000
[MapperHal] buffer descriptor with invalid usage bits 0x2000
[MapperHal] buffer descriptor with invalid usage bits 0x2000
[MapperHal] buffer descriptor with invalid usage bits 0x2000
[MapperHal] buffer descriptor with invalid usage bits 0x2000
[MapperHal] buffer descriptor with invalid usage bits 0x2000
[MapperHal] buffer descriptor with invalid usage bits 0x2000
[VLC] [00000079fce2f890/2325] libvlc decoder: output: 781 unknown, 1280x720 stride 1280 720, crop 0 0 0 0
[ACodec] date space update : 0x104
[VLC] [00000079b2b55690/2317] libvlc window: request 3 not implemented
[AudioTrack] releaseBuffer() track 0x7a054d6c00 disabled due to previous underrun, restarting
[AudioTrack] audioTrack send start state to pg
[AudioTrack] audioTrack continuously zero data counter >= 20, send pause/stop state to pg, counter: 20
[AudioTrack] audioTrack send start state to pg
[AudioTrack] audioTrack continuously zero data counter >= 20, send pause/stop state to pg, counter: 20
[AudioTrack] audioTrack send start state to pg
[AudioTrack] audioTrack continuously zero data counter >= 20, send pause/stop state to pg, counter: 20
[AudioTrack] audioTrack send start state to pg
[AudioTrack] audioTrack continuously zero data counter >= 20, send pause/stop state to pg, counter: 20
[AudioTrack] audioTrack send start state to pg
[AudioTrack] audioTrack continuously zero data counter >= 20, send pause/stop state to pg, counter: 20
[AudioTrack] audioTrack send start state to pg
[AudioTrack] audioTrack continuously zero data counter >= 20, send pause/stop state to pg, counter: 20
[AudioTrack] audioTrack send start state to pg
[AudioTrack] audioTrack continuously zero data counter >= 20, send pause/stop state to pg, counter: 20
[AudioTrack] audioTrack send start state to pg
[AudioTrack] audioTrack continuously zero data counter >= 20, send pause/stop state to pg, counter: 20
[AudioTrack] audioTrack send start state to pg
[AudioTrack] audioTrack continuously zero data counter >= 20, send pause/stop state to pg, counter: 20
[AudioTrack] audioTrack send start state to pg
[] [ZeroHung]zrhung_get_config: Get config failed for wp[0x0008]
[AudioTrack] audioTrack continuously zero data counter >= 20, send pause/stop state to pg, counter: 20
[AudioTrack] audioTrack send start state to pg
[AudioTrack] audioTrack continuously zero data counter >= 20, send pause/stop state to pg, counter: 20
[AudioTrack] audioTrack send start state to pg
[AudioTrack] audioTrack continuously zero data counter >= 20, send pause/stop state to pg, counter: 20
[AudioTrack] audioTrack send start state to pg
[AudioTrack] audioTrack continuously zero data counter >= 20, send pause/stop state to pg, counter: 20
[AudioTrack] audioTrack send start state to pg
[AudioTrack] audioTrack continuously zero data counter >= 20, send pause/stop state to pg, counter: 20
[AudioTrack] audioTrack send start state to pg
[PlayerBase] basePause() piid=21239
[android.media.AudioTrack] [HSM] AudioTrace pause() uid: 11698, pid: 8840
[PlayerBase] baseStart() piid=21239
[android.media.AudioTrack] [HSM] AudioTrace play() uid: 11698, pid: 8840
[AudioTrack] audioTrack continuously zero data counter >= 20, send pause/stop state to pg, counter: 20
[PlayerBase] basePause() piid=21239
[android.media.AudioTrack] [HSM] AudioTrace pause() uid: 11698, pid: 8840
[PlayerBase] baseStart() piid=21239
[android.media.AudioTrack] [HSM] AudioTrace play() uid: 11698, pid: 8840
[AudioTrack] audioTrack send start state to pg
[AudioTrack] audioTrack continuously zero data counter >= 20, send pause/stop state to pg, counter: 20
[PlayerBase] basePause() piid=21239
[android.media.AudioTrack] [HSM] AudioTrace pause() uid: 11698, pid: 8840
[PlayerBase] baseStart() piid=21239
[android.media.AudioTrack] [HSM] AudioTrace play() uid: 11698, pid: 8840
[AudioTrack] audioTrack send start state to pg
[PlayerBase] basePause() piid=21239
[android.media.AudioTrack] [HSM] AudioTrace pause() uid: 11698, pid: 8840
[PlayerBase] baseStart() piid=21239
[android.media.AudioTrack] [HSM] AudioTrace play() uid: 11698, pid: 8840
[AudioTrack] audioTrack continuously zero data counter >= 20, send pause/stop state to pg, counter: 20
[PlayerBase] basePause() piid=21239
[android.media.AudioTrack] [HSM] AudioTrace pause() uid: 11698, pid: 8840
[PlayerBase] baseStart() piid=21239
[android.media.AudioTrack] [HSM] AudioTrace play() uid: 11698, pid: 8840
[AudioTrack] audioTrack send start state to pg
[AudioTrack] audioTrack continuously zero data counter >= 20, send pause/stop state to pg, counter: 20
[PlayerBase] basePause() piid=21239
[android.media.AudioTrack] [HSM] AudioTrace pause() uid: 11698, pid: 8840
[PlayerBase] baseStart() piid=21239
[android.media.AudioTrack] [HSM] AudioTrace play() uid: 11698, pid: 8840
[AudioTrack] audioTrack send start state to pg
[AudioTrack] audioTrack continuously zero data counter >= 20, send pause/stop state to pg, counter: 20
[PlayerBase] basePause() piid=21239
[android.media.AudioTrack] [HSM] AudioTrace pause() uid: 11698, pid: 8840
[PlayerBase] baseStart() piid=21239
[android.media.AudioTrack] [HSM] AudioTrace play() uid: 11698, pid: 8840
[AudioTrack] audioTrack send start state to pg
[AudioTrack] audioTrack continuously zero data counter >= 20, send pause/stop state to pg, counter: 20
[PlayerBase] basePause() piid=21239
[android.media.AudioTrack] [HSM] AudioTrace pause() uid: 11698, pid: 8840
[PlayerBase] baseStart() piid=21239
[android.media.AudioTrack] [HSM] AudioTrace play() uid: 11698, pid: 8840
[AudioTrack] audioTrack send start state to pg
[PlayerBase] basePause() piid=21239
[android.media.AudioTrack] [HSM] AudioTrace pause() uid: 11698, pid: 8840
[PlayerBase] baseStart() piid=21239
[android.media.AudioTrack] [HSM] AudioTrace play() uid: 11698, pid: 8840
[AudioTrack] audioTrack continuously zero data counter >= 20, send pause/stop state to pg, counter: 20
[AudioTrack] audioTrack send start state to pg
[AudioTrack] audioTrack continuously zero data counter >= 20, send pause/stop state to pg, counter: 20
[AudioTrack] audioTrack send start state to pg
[AudioTrack] audioTrack continuously zero data counter >= 20, send pause/stop state to pg, counter: 20
[AudioTrack] audioTrack send start state to pg
[AudioTrack] audioTrack continuously zero data counter >= 20, send pause/stop state to pg, counter: 20
[... last two lines keep repeating ...]
No issues in any device when playing Video 2 (MJPG stream) instead.
If we downgrade to VideoLAN.LibVLC.Android v3.0.0 (both Xamarin.Forms and Xamarin.Android projects) the issue disappears altogether.
E.g. on Samsung Galaxy S5:
[ViewRootImpl] ViewPostImeInputStage processPointer 0
[Mono] DllImport searching in: '__Internal' ('(null)').
[Mono] Searching for 'java_interop_jnienv_call_float_method_a'.
[Mono] Probing 'java_interop_jnienv_call_float_method_a'.
[Mono] Found as 'java_interop_jnienv_call_float_method_a'.
[ViewRootImpl] ViewPostImeInputStage processPointer 1
[Mono] Loading reference 3 of /storage/emulated/0/Android/data/com.inim.testvlc/files/.__override__/TestVLC.dll asmctx DEFAULT, looking for LibVLCSharp, Version=3.2.3.0, Culture=neutral, PublicKeyToken=null
[Mono] Assembly Ref addref TestVLC[0xadd879c0] -> LibVLCSharp[0xadd87660]: 4
[Mono] Loading reference 4 of /storage/emulated/0/Android/data/com.inim.testvlc/files/.__override__/TestVLC.dll asmctx DEFAULT, looking for LibVLCSharp.Forms, Version=3.2.3.0, Culture=neutral, PublicKeyToken=null
[Mono] Assembly Ref addref TestVLC[0xadd879c0] -> LibVLCSharp.Forms[0xadd87840]: 3
[Mono] DllImport searching in: 'libvlc' ('libvlc.so').
[Mono] Searching for 'libvlc_new'.
[Mono] Probing 'libvlc_new'.
[Mono] Found as 'libvlc_new'.
[Mono] Loading reference 3 of /storage/emulated/0/Android/data/com.inim.testvlc/files/.__override__/LibVLCSharp.Forms.dll asmctx DEFAULT, looking for Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065
[Mono] Assembly Ref addref LibVLCSharp.Forms[0xadd87840] -> Mono.Android[0xadd88f80]: 45
[art] JNI RegisterNativeMethods: attempt to register 0 native methods for md546698daa40cfc4c645e97972c2567f23.VideoViewRenderer
[Mono] Loading reference 2 of /storage/emulated/0/Android/data/com.inim.testvlc/files/.__override__/LibVLCSharp.Android.AWindow.dll asmctx DEFAULT, looking for Java.Interop, Version=0.1.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065
[Mono] Assembly Ref addref LibVLCSharp.Android.AWindow[0xadd871e0] -> Java.Interop[0xadd890a0]: 10
[art] JNI RegisterNativeMethods: attempt to register 0 native methods for md51558244f76c53b6aeda52c8a337f2c37.ActivityIndicatorRenderer
[Mono] DllImport searching in: 'libvlc' ('libvlc.so').
[Mono] Searching for 'libvlc_media_player_new'.
[Mono] Probing 'libvlc_media_player_new'.
[Mono] Found as 'libvlc_media_player_new'.
[VLC] [99c4a0b0/59b5] libvlc audio output: GetStaticFieldID(AudioFormat.ENCODING_IEC61937) failed
[VLC] [99c4a0b0/59b5] libvlc audio output: GetStaticFieldID(AudioFormat.ENCODING_DOLBY_TRUEHD) failed
[Mono] DllImport searching in: 'libvlc' ('libvlc.so').
[Mono] Searching for 'libvlc_media_player_set_android_context'.
[Mono] Probing 'libvlc_media_player_set_android_context'.
[Mono] Found as 'libvlc_media_player_set_android_context'.
[Mono] DllImport searching in: 'libvlc' ('libvlc.so').
[Mono] Searching for 'libvlc_media_new_location'.
[Mono] Probing 'libvlc_media_new_location'.
[Mono] Found as 'libvlc_media_new_location'.
[Mono] DllImport searching in: 'libvlc' ('libvlc.so').
[Mono] Searching for 'libvlc_media_new_path'.
[Mono] Probing 'libvlc_media_new_path'.
[Mono] Found as 'libvlc_media_new_path'.
[Mono] DllImport searching in: 'libvlc' ('libvlc.so').
[Mono] Searching for 'libvlc_media_new_as_node'.
[Mono] Probing 'libvlc_media_new_as_node'.
[Mono] Found as 'libvlc_media_new_as_node'.
[Mono] DllImport searching in: 'libvlc' ('libvlc.so').
[Mono] Searching for 'libvlc_media_player_set_media'.
[Mono] Probing 'libvlc_media_player_set_media'.
[Mono] Found as 'libvlc_media_player_set_media'.
[Mono] DllImport searching in: 'libvlc' ('libvlc.so').
[Mono] Searching for 'libvlc_media_player_play'.
[Mono] Probing 'libvlc_media_player_play'.
[Mono] Found as 'libvlc_media_player_play'.
[Mono] DllImport searching in: 'libvlc' ('libvlc.so').
[Mono] Searching for 'libvlc_media_player_get_media'.
[Mono] Probing 'libvlc_media_player_get_media'.
[Mono] Found as 'libvlc_media_player_get_media'.
[Mono] DllImport searching in: 'libvlc' ('libvlc.so').
[Mono] Searching for 'libvlc_media_player_event_manager'.
[Mono] Probing 'libvlc_media_player_event_manager'.
[Mono] Found as 'libvlc_media_player_event_manager'.
[Mono] DllImport searching in: 'libvlc' ('libvlc.so').
[Mono] Searching for 'libvlc_event_attach'.
[Mono] Probing 'libvlc_event_attach'.
[Mono] Found as 'libvlc_event_attach'.
[VLC] [90dbc030/5a2a] libvlc window: request 1 not implemented
[libEGL] eglInitialize EGLDisplay = 0x908f041c
[VLC] [92cb91b0/5a2a] libvlc gl: shader program: --From Vertex Shader:
[VLC] --From Fragment Shader:
[VLC] Link was successful.
[VLC] [92cb91b0/5a2a] libvlc gl: shader program: --From Vertex Shader:
[VLC] --From Fragment Shader:
[VLC] Link was successful.
[VLC] [90dbc030/5a2a] libvlc window: request 0 not implemented
[VLC] [90dbc030/5a2a] libvlc window: request 0 not implemented
[VLC] [90dbc030/5a2a] libvlc window: request 1 not implemented
Thread started: #2
[AudioTrack] releaseBuffer() track 0x95ab2600 disabled due to previous underrun, restarting
[VLC] [90dbc030/5a2a] libvlc window: request 3 not implemented
In addition, we are facing the -possibly- same issue as #123 on every device except the Honor Play (both v.3.1.2.1 and v.3.0.0): when playing Video 2 or Video 1 (when the player starts playing the stream), if the user presses the back button the app crashes and it outputs the following
[ViewRootImpl] ViewPostImeInputStage processPointer 0
[ViewRootImpl] ViewPostImeInputStage processPointer 1
[Mono] DllImport searching in: 'libvlc' ('libvlc.so').
[Mono] Searching for 'libvlc_media_player_stop'.
[Mono] Probing 'libvlc_media_player_stop'.
[Mono] Found as 'libvlc_media_player_stop'.
[art] Native thread exiting without having called DetachCurrentThread (maybe it's going to use a pthread_key_create destructor?): Thread[15,tid=540,Native,Thread*=0x924bbe00,peer=0x12e75100,"AWindowHandler"]
[mono-rt] /proc/self/maps:
[mono-rt] 12c00000-12ded000 rw-p 00000000 00:04 9777 /dev/ashmem/dalvik-main space (deleted)
[mono-rt] 12ded000-12fed000 rw-p 001ed000 00:04 9777 /dev/ashmem/dalvik-main space (deleted)
[mono-rt] 12fed000-1ac00000 ---p 003ed000 00:04 9777 /dev/ashmem/dalvik-main space (deleted)
[mono-rt] 32c00000-32c01000 rw-p 00000000 00:04 9778 /dev/ashmem/dalvik-main space 1 (deleted)
[mono-rt] 32c01000-3ac00000 ---p 00001000 00:04 9778 /dev/ashmem/dalvik-main space 1 (deleted)
[mono-rt] 6f3c2000-70142000 rw-p 00000000 b3:1a 130586 /data/dalvik-cache/arm/system@framework@boot.art
[mono-rt] 70142000-7307d000 r--p 00000000 b3:17 2415 /system/framework/arm/boot.oat
[mono-rt] 7307d000-752fc000 r-xp 02f3b000 b3:17 2415 /system/framework/arm/boot.oat
[mono-rt] 752fc000-752fd000 rw-p 051ba000 b3:17 2415 /system/framework/arm/boot.oat
[mono-rt] 752fd000-75464000 rw-p 00000000 00:04 9776 /dev/ashmem/dalvik-zygote space (deleted)
[mono-rt] 75464000-75465000 rw-p 00000000 00:04 10095 /dev/ashmem/dalvik-non moving space (deleted)
[mono-rt] 75465000-75472000 rw-p 00001000 00:04 10095 /dev/ashmem/dalvik-non moving space (deleted)
[mono-rt] 75472000-78afe000 ---p 0000e000 00:04 10095 /dev/ashmem/dalvik-non moving space (deleted)
[mono-rt] 78afe000-792fd000 rw-p 0369a000 00:04 10095 /dev/ashmem/dalvik-non moving space (deleted)
[mono-rt] 8d720000-8d802000 rw-s 0006a000 00:0b 7311 /dev/kgsl-3d0
[mono-rt] 8d803000-8db80000 rw-s 00000000 00:08 5467 anon_inode:dmabuf
[mono-rt] 8db80000-8dbc0000 rw-p 00000000 00:00 0 [anon:libc_malloc]
[mono-rt] 8dbe1000-8df5e000 rw-s 00000000 00:08 5467 anon_inode:dmabuf
[mono-rt] 8df5e000-8df6f000 rw-s 00062000 00:0b 7311 /dev/kgsl-3d0
[mono-rt] 8df6f000-8df80000 rw-s 00061000 00:0b 7311 /dev/kgsl-3d0
[mono-rt] 8df80000-8fd80000 rw-p 00000000 00:00 0 [anon:libc_malloc]
[mono-rt] 8fdbd000-9013a000 rw-s 00000000 00:08 5467 anon_inode:dmabuf
[mono-rt] 90140000-9017a000 rw-s 0005e000 00:0b 7311 /dev/kgsl-3d0
[mono-rt] 9017a000-9018b000 rw-s 00060000 00:0b 7311 /dev/kgsl-3d0
[mono-rt] 90190000-901ca000 rw-s 0005d000 00:0b 7311 /dev/kgsl-3d0
[libc] Fatal signal 11 (SIGSEGV), code 1, fault addr 0x2 in tid 540 (AWindowHandler)
Please note that the app crashes only if we register to the VOUT event.
On the Honor Play no issues at all.
LibVLCSharp v.3.2.3
LibVLCSharp.Forms v3.2.3
Xamarin.Forms v4.2.0.815419
VideoLAN.LibVLC.Android:
Device | RTSP Video on v3.1.2.1 | MJPG Video on v3.1.2.1 | RTSP Video on v.3.0.0 | MJPG Video on v.3.0.0 | VOUT Event on disposing |
---|---|---|---|---|---|
OnePlus One | NOT WORKING | WORKING | WORKING | WORKING | CRASH |
Samsung Galaxy S5 | NOT WORKING | WORKING | WORKING | WORKING | CRASH |
Samsung Glaxy Tab S2 | WORKING | WORKING | WORKING | WORKING | CRASH |
Honor Play | WORKING | WORKING | WORKING | WORKING | WORKING |
Thank you in advance.