Skip to content

App crash when stop RTMP stream with vlc-unity on Pico neo 3

Summary

I used VLC-Unity to play RTMP streams on Pico neo 3. There are two things that can cause an app crash:

  1. closing Njinx or FFMPEG before stopping play stream (MediaPlayer.Stop()) will cause a crash;
  2. Pause (MediaPlayer.Pause()) and then stop (MediaPlayer.Stop()) when playing stream.

Minimal project and steps to reproduce

1.Use njinx and ffmpeg to build a rtmp stream;

2.Create a Unity Project with Pico SDK;

3.Import VLC-Unity, add ExampleVLCPlayer, add Open button and Stop button;

4.Build and run on pico neo 3, start rtmp stream, click play button;

5.stop rtmp stream, then click stop button;

6.app crash, can use Unity Android Logcat see error message.

What is the current bug behavior?

when mediaPlayer.Stop(), app crashed.

What is the expected correct behavior?

The app should not crash when stop play stream.

Does it work on other plaforms? Does it work with the official VLC apps?

This error does not appear on Android phones, Windows, or UWP platforms.

Relevant logs and/or screenshots

2023/07/14 09:49:14.143 7401 9391 Info chatty uid=10433(com.MSUN.MRDoctor) identical 6 lines
2023/07/14 09:49:14.154 7401 9391 Info VLCUnity [VLC-Unity] get Video Frame 98
2023/07/14 09:49:14.165 7401 9391 Info VLCUnity [VLC-Unity] get Video Frame 96
2023/07/14 09:49:14.187 7401 9391 Info chatty uid=10433(com.MSUN.MRDoctor) identical 2 lines
2023/07/14 09:49:14.199 7401 9391 Info VLCUnity [VLC-Unity] get Video Frame 96
2023/07/14 09:49:14.210 7401 9476 Info Unity rtmp://192.168.50.50:1937/live/home : MediaPlayer_Stopping
2023/07/14 09:49:14.262 7401 9557 Error NdkMediaCodec sf error code: -38
2023/07/14 09:49:14.266 932 2497 Info JNI_PART PC_Services: 20230318A_For_Neo3_5.3.0 
2023/07/14 09:49:14.266 932 2497 Info JNI_PART SENSOR version:  SENSOR 1.0.0.118 7297ae9 
2023/07/14 09:49:14.266 932 2497 Info JNI_PART PClog_StatusInfo:1897.425890,Static:72,OutDoor:0,BrightNessCam3:3.774193,Frq:60.000000,pid:932,cpu:2
2023/07/14 09:49:14.268 7401 9545 Info VLCUnity [VLC-Unity] output callback cleanup
2023/07/14 09:49:14.268 7401 9545 Info VLCUnity [VLC-Unity] destroy_fbo
2023/07/14 09:49:14.268 7401 9545 Error libEGL call to OpenGL ES API with no current context (logged once per thread)
2023/07/14 09:49:14.282 1253 9247 Info OMX-VDEC-1080P omx_vdec::component_deinit() complete
2023/07/14 09:49:14.287 7401 9476 Info Unity rtmp://192.168.50.50:1937/live/home : MediaPlayer_Stopped
2023/07/14 09:49:14.287 7401 9545 Error libsigchain xr_default_handler signal: 11, signo: 11
2023/07/14 09:49:14.288 7401 9545 Fatal libc Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 9545 (mediacodec_jni), pid 7401 (m.MSUN.MRDoctor)
2023/07/14 09:49:14.288 7401 9545 Info INFO target_proc_name=/system/bin/pvrtrackingservice, want_cmdline_name=com.MSUN.MRDoctor             .
2023/07/14 09:49:14.288 7401 9545 Info INFO endtime
2023/07/14 09:49:14.346 9573 9573 Error crash_dump64 target thread=7401, meminfo.size()=38
2023/07/14 09:49:14.375 9574 9574 Info crash_dump64 obtaining output fd from tombstoned, type: kDebuggerdTombstone
2023/07/14 09:49:14.375 1278 1278 Info /system/bin/tombstoned received crash request for pid 9545
2023/07/14 09:49:14.376 9574 9574 Info crash_dump64 performing dump of process 7401 (target tid = 9545)
2023/07/14 09:49:14.380 9574 9574 Fatal DEBUG *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2023/07/14 09:49:14.380 9574 9574 Fatal DEBUG Build fingerprint: 'Pico/A7H10/PICOA7H10:10/5.6.3/smartcm.1684438536:user/dev-keys'
2023/07/14 09:49:14.380 9574 9574 Fatal DEBUG Revision: '0'
2023/07/14 09:49:14.380 9574 9574 Fatal DEBUG ABI: 'arm64'
2023/07/14 09:49:14.380 9574 9574 Fatal DEBUG Timestamp: 2023-07-14 09:49:14+0800
2023/07/14 09:49:14.380 9574 9574 Fatal DEBUG pid: 7401, ppid: 731, tid: 9545, name: mediacodec_jni  >>> com.MSUN.MRDoctor <<<
2023/07/14 09:49:14.380 9574 9574 Fatal DEBUG uid: 10433
2023/07/14 09:49:14.380 9574 9574 Fatal DEBUG signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
2023/07/14 09:49:14.380 9574 9574 Fatal DEBUG Cause: null pointer dereference
2023/07/14 09:49:14.380 9574 9574 Fatal DEBUG     x0  00000071d33c6808  x1  0000000000000000  x2  0000000000000000  x3  0000000073a49360
2023/07/14 09:49:14.380 9574 9574 Fatal DEBUG     x4  0000000000000001  x5  0000000000000000  x6  0000000000000001  x7  0000000000000000
2023/07/14 09:49:14.380 9574 9574 Fatal DEBUG     x8  65266e34192a01cc  x9  00000073d1b9a000  x10 0000000000000001  x11 0000000000000000
2023/07/14 09:49:14.380 9574 9574 Fatal DEBUG     x12 0000000006719f28  x13 0000000000000000  x14 fffffffffc000000  x15 0000000000000004
2023/07/14 09:49:14.380 9574 9574 Fatal DEBUG     x16 00000073d1b9ab58  x17 00000073d1b88564  x18 000000717d97a000  x19 00000071d33c6808
2023/07/14 09:49:14.380 9574 9574 Fatal DEBUG     x20 0000000073a49360  x21 0000000000000000  x22 000000733bed7df0  x23 000000733bed7df0
2023/07/14 09:49:14.380 9574 9574 Fatal DEBUG     x24 0000000040000000  x25 00000071d33c6830  x26 000000733bed7df0  x27 0000007340088df0
2023/07/14 09:49:14.380 9574 9574 Fatal DEBUG     x28 00000072cfca16d0  x29 000000733bed7960
2023/07/14 09:49:14.380 9574 9574 Fatal DEBUG     sp  000000733bed7930  lr  00000073d1aea418  pc  00000073d1b0f278
2023/07/14 09:49:14.382 9574 9574 Fatal DEBUG 
2023/07/14 09:49:14.382 9574 9574 Fatal DEBUG backtrace:
2023/07/14 09:49:14.382 9574 9574 Fatal DEBUG       #00 pc 0000000000074278  /apex/com.android.runtime/lib64/bionic/libc.so (je_large_dalloc+44) (BuildId: c531ce59e908b274babdd55c313f24d1)
2023/07/14 09:49:14.382 9574 9574 Fatal DEBUG       #01 pc 000000000004f414  /apex/com.android.runtime/lib64/bionic/libc.so (je_free+1696) (BuildId: c531ce59e908b274babdd55c313f24d1)
2023/07/14 09:49:14.382 9574 9574 Fatal DEBUG       #02 pc 0000000000046b04  /apex/com.android.runtime/lib64/bionic/libc.so (free+40) (BuildId: c531ce59e908b274babdd55c313f24d1)
2023/07/14 09:49:14.382 9574 9574 Fatal DEBUG       #03 pc 00000000000503e4  /system/lib64/libEGL.so (emutls_key_destructor+80) (BuildId: e8ed78d296bfea4d445e9b643442c2b9)
2023/07/14 09:49:14.382 9574 9574 Fatal DEBUG       #04 pc 00000000000ed458  /apex/com.android.runtime/lib64/bionic/libc.so (pthread_key_clean_all()+124) (BuildId: c531ce59e908b274babdd55c313f24d1)
2023/07/14 09:49:14.382 9574 9574 Fatal DEBUG       #05 pc 00000000000eceac  /apex/com.android.runtime/lib64/bionic/libc.so (pthread_exit+72) (BuildId: c531ce59e908b274babdd55c313f24d1)
2023/07/14 09:49:14.382 9574 9574 Fatal DEBUG       #06 pc 00000000000ecd88  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+40) (BuildId: c531ce59e908b274babdd55c313f24d1)
2023/07/14 09:49:14.382 9574 9574 Fatal DEBUG       #07 pc 000000000008b0e4  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: c531ce59e908b274babdd55c313f24d1)

Environment

  • OS: Android
  • Version: 10(API29)
  • Device: Pico neo 3
  • LibVLC version and architecture: 4cca610
  • LibVLCSharp version: 4.0.0.0
  • VLC Unity plugin version: 0.1.7
  • Scripting backend used: il2cpp
  • Target Architecture: arm64

Possible fixes