unity
unity copied to clipboard
Android crash on startup with multiple cameras
On Android, if multiple cameras are added to the layouts, the app crash after a few seconds.
Logs
I/MediaCodec(28387): setCodecState state(0), called in 6
F/libc (28387): ../player/loadfile.c:1939: void play_current_file(struct MPContext *): assertion "mpctx->stop_play" failed
F/libc (28387): Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 28673 (Thread-6), pid 28387 (m.bluecherrydvr)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'samsung/a32ub/a32:13/TP1A.220624.014/A325MUBS6DXA2:user/release-keys'
Revision: '4'
ABI: 'arm64'
Processor: '6'
Timestamp: 2024-02-11 16:43:52.642906233-0300
Process uptime: 52s
Cmdline: com.bluecherrydvr
pid: 28387, tid: 28673, name: Thread-6 >>> com.bluecherrydvr <<<
uid: 10420
signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
Abort message: '../player/loadfile.c:1939: void play_current_file(struct MPContext *): assertion "mpctx->stop_play" failed'
x0 0000000000000000 x1 0000000000007001 x2 0000000000000006 x3 00000079061ff960
x4 0000808080808080 x5 0000808080808080 x6 0000808080808080 x7 8080808080808080
x8 00000000000000f0 x9 0000007a6888bb70 x10 0000000000000001 x11 0000007a68901ab0
x12 0101010101010101 x13 0000000065c92378 x14 001234d42ff8074b x15 0000000000000018
x16 0000007a68972a48 x17 0000007a6894ac10 x18 00000079057fc000 x19 00000000000000ac
x20 00000000000000b2 x21 0000000000006ee3 x22 0000000000007001 x23 00000000ffffffff
x24 0000000000000001 x25 0000000000000002 x26 b4000079be2fb4d0 x27 0000000000000000
x28 b40000792f2ec250 x29 00000079061ff9e0
lr 0000007a688f1d84 sp 00000079061ff940 pc 0000007a688f1db4 pst 0000000000000000
backtrace:
#00 pc 000000000008ddb4 /apex/com.android.runtime/lib64/bionic/libc.so (abort+180) (BuildId: 4d6e56b2321dd2889f771482b268b706)
#01 pc 000000000008e1b4 /apex/com.android.runtime/lib64/bionic/libc.so (__assert2+36) (BuildId: 4d6e56b2321dd2889f771482b268b706)
#02 pc 000000000040770c /data/app/~~pcOrEKgnuC7-8tTGjlen7g==/com.bluecherrydvr-9dZmFTuo7VDbjYdBuHE5vg==/lib/arm64/libmpv.so
#03 pc 00000000004068f4 /data/app/~~pcOrEKgnuC7-8tTGjlen7g==/com.bluecherrydvr-9dZmFTuo7VDbjYdBuHE5vg==/lib/arm64/libmpv.so
#04 pc 00000000003ece78 /data/app/~~pcOrEKgnuC7-8tTGjlen7g==/com.bluecherrydvr-9dZmFTuo7VDbjYdBuHE5vg==/lib/arm64/libmpv.so
#05 pc 00000000000fd040 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+208) (BuildId: 4d6e56b2321dd2889f771482b268b706)
#06 pc 000000000008f5e0 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 4d6e56b2321dd2889f771482b268b706)
Lost connection to device.
Didn't test on iOS. Windows and macOS work fine. Sometimes reproducible on Linux.
I believe this is due to the amount of memory allocated at the same time when the app starts. Creating players simultaneously may be causing this issue