wang-bin / fvp

Flutter video player plugin for all desktop+mobile platforms. download prebuilt examples from github actions. https://pub.dev/packages/fvp
BSD 3-Clause "New" or "Revised" License
126 stars 20 forks source link

App crash on startup on firestick #43

Closed lKinderBueno closed 8 months ago

lKinderBueno commented 9 months ago

Describe the bug Once the app is compiled, it crashes on the Amazon Firestick.
It has been reported by other users that the same app crashes on specific devices as Chromecast 4k TV and other Amazon and Nvidia devices. I was able to run it on smartphones and more and less performant android tv boxes.

Log

Launching lib\main.dart on AFTT in debug mode...
Running Gradle task 'assembleDebug'...
√  Built build\app\outputs\flutter-apk\app-debug.apk.
E/AndroidRuntime(24320): dexopt flags broken, ignoring value of v=n,o=v,m=y in dalvik.vm.dexopt-flags
E/AndroidRuntime(24334): dexopt flags broken, ignoring value of v=n,o=v,m=y in dalvik.vm.dexopt-flags
E/AndroidRuntime(24389): dexopt flags broken, ignoring value of v=n,o=v,m=y in dalvik.vm.dexopt-flags
Debug service listening on ws://127.0.0.1:60477/cWOL1nyLmvM=/ws
Syncing files to device AFTT...
I/flutter (24404): mdk.INFO: 12:02:38.011: 0.22.0 (git 38bae84) - Multimedia Development Kit. Copyright (c) 2016-2023 WangBin(QtAV author) <wbsecg1 at gmail.com>
I/flutter (24404): Build for: Android19/22.0.0 ARMv7; Clang14.0.7 (https://android.googlesource.com/toolchain/llvm-project 4c603efb0cca074e9238af8b4106c30add4418f6)GCC4.2.1; libc++11000; 05:35:46 Sep 24 2023
W/libOpenSLES(24404): Leaving Object::GetInterface (SL_RESULT_FEATURE_UNSUPPORTED)
W/libOpenSLES(24404): Leaving Object::GetInterface (SL_RESULT_FEATURE_UNSUPPORTED)
I/flutter (24404): fvp.FINE: 12:02:38.538: 53515321 player3082280240 create(https://supertest.netsons.org/video_sub.mp4)
F/libc    (24404): Fatal signal 7 (SIGBUS), code 1, fault addr 0xb7cd1f98 in tid 24450 (mdk.demux@-1211)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'Amazon/full_tank/tank:5.1.1/LVY48F/288.6.8.8_user_688802420:user/release-keys'
Revision: '0'
ABI: 'arm'
pid: 24404, tid: 24450, oom: 0, name: mdk.demux@-1211  >>> com.example.test <<<
signal 7 (SIGBUS), code 1 (BUS_ADRALN), fault addr 0xb7cd1f98
    r0 00000000  r1 b7cd1f98  r2 9951d778  r3 99521d08
    r4 00000000  r5 b7cd1f98  r6 00000001  r7 926fa080
    r8 00000000  r9 ffffffff  sl b7cc5350  fp 00000001
    ip 00000000  sp 926fa078  lr 9951d727  pc 9951d74a  cpsr 60070030
backtrace:
    #00 pc 0001074a  /data/app/com.example.test-1/lib/arm/libffmpeg.so
    #01 pc 00010723  /data/app/com.example.test-1/lib/arm/libffmpeg.so
list of open files:
0->/dev/null
1->/dev/null
2->/dev/null
3->/dev/cpuctl/tasks
4->/sys/kernel/debug/tracing/trace_marker
5->/system/framework/framework-res.apk
6->/system/framework/fireos-res/fireos-res.apk
7->/dev/binder
8->/dev/__properties__
9->/system/framework/core-libart.jar
10->pipe:[178078]
11->/dev/alarm
12->socket:[180355]
13->/dev/cpuctl/bg_non_interactive/tasks
14->socket:[179882]
15->pipe:[179883]
16->pipe:[179883]
17->socket:[180360]
18->pipe:[178078]
19->anon_inode:[eventpoll]
20->/data/app/com.example.test-1/base.apk
21->anon_inode:[timerfd]
22->pipe:[178090]
23->pipe:[178090]
24->anon_inode:[eventpoll]
25->anon_inode:[timerfd]
26->pipe:[181265]
27->pipe:[181265]
28->anon_inode:[eventpoll]
29->anon_inode:[timerfd]
30->pipe:[180375]
31->pipe:[180375]
32->anon_inode:[eventpoll]
33->anon_inode:[timerfd]
34->pipe:[180376]
35->pipe:[180376]
36->anon_inode:[eventpoll]
37->/dev/mali
38->socket:[178091]
39->/dev/ion
40->pipe:[180378]
41->pipe:[180378]
42->anon_inode:[eventpoll]
43->/data/data/com.example.test/code_cache/flutter_engine/cdbeda788a293fa29665dc3fa3d6e63bd221cb0d/skia/0d31aa1f49cb8cfd790c44d92a9a023839524865
44->pipe:[179925]
45->/data/data/com.example.test/code_cache/flutter_engine/cdbeda788a293fa29665dc3fa3d6e63bd221cb0d/skia/0d31aa1f49cb8cfd790c44d92a9a023839524865/sksl
46->socket:[179923]
47->pipe:[179925]
48->anon_inode:[eventpoll]
49->socket:[180379]
50->socket:[178093]
51->anon_inode:dmabuf
52->socket:[179928]
53->anon_inode:dmabuf
54->anon_inode:dmabuf
55->anon_inode:dmabuf
56->anon_inode:dmabuf
57->anon_inode:dmabuf
58->socket:[178098]
59->socket:[178096]
60->socket:[178114]
number of open files:61
Tombstone written to: /data/tombstones/tombstone_06
Lost connection to device.
wang-bin commented 9 months ago

Crash in ffmpeg. Not sure the reason now.

wang-bin commented 9 months ago

The backtrace is not complete, i need the full backtrace. If you are running in android studio, disable log filter(default is displaying current app's log), then you will see full backtrace. Or you can run command line

logcat -c # clear log before app run
logcat
lKinderBueno commented 8 months ago

Sorry for the long wait, but I did not have access to the device till today. Here is the full log. The package name is "com.example.test" log.txt

wang-bin commented 8 months ago

The error is different in this log. What about changing this line to

      final Number h = call.argument("player");
      final long handle = h.longValue();
lKinderBueno commented 8 months ago

The error is different in this log. What about changing this line to

      final Number h = call.argument("player");
      final long handle = h.longValue();

The logo I posted before was from another firestick model, the 4k one. The first log was from the first firestick gen. I changed, but it crashes.

Launching lib\main.dart on AFTMM in debug mode...
Running Gradle task 'assembleDebug'...
√  Built build\app\outputs\flutter-apk\app-debug.apk.
Installing build\app\outputs\flutter-apk\app-debug.apk...
Debug service listening on ws://127.0.0.1:54475/ZeoG5oR9qXc=/ws
Syncing files to device AFTMM...
W/libOpenSLES(10254): Leaving Object::GetInterface (SL_RESULT_FEATURE_UNSUPPORTED)
W/libOpenSLES(10254): Leaving Object::GetInterface (SL_RESULT_FEATURE_UNSUPPORTED)
W/mdk.adec1@20525(10254): type=1400 audit(0.0:1237): avc: denied { read } for name="u:object_r:dolby_prop:s0" dev="tmpfs" ino=12426 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:dolby_prop:s0 tclass=file permissive=0
I/libOpenSLES(10254): Emulating old channel mask behavior (ignoring positional mask 0x3, using default mask 0x3 based on channel count of 2)
E/libc    (10254): Access denied finding property "dolby.dma.minbufcnt"
W/libOpenSLES(10254): Leaving PlaybackRate::GetRateRange (SL_RESULT_PARAMETER_INVALID)
W/VideoCapabilities(10254): Unrecognized profile/level 1/32 for video/mp4v-es
W/VideoCapabilities(10254): Unrecognized profile/level 32768/2 for video/mp4v-es
W/VideoCapabilities(10254): Unrecognized profile/level 32768/64 for video/mp4v-es
E/libEGL  (10254): validate_display:99 error 3008 (EGL_BAD_DISPLAY)
W/VideoCapabilities(10254): Unsupported mime video/dolby-vision
W/VideoCapabilities(10254): Unsupported mime video/dolby-vision
W/VideoCapabilities(10254): Unsupported mime video/dolby-vision
E/libEGL  (10254): validate_display:99 error 3008 (EGL_BAD_DISPLAY)
W/VideoCapabilities(10254): Unsupported mime video/dolby-vision
W/VideoCapabilities(10254): Unsupported mime video/dolby-vision
W/VideoCapabilities(10254): Unsupported mime video/dolby-vision
W/VideoCapabilities(10254): Unrecognized profile/level 0/0 for video/mpeg2
W/VideoCapabilities(10254): Unrecognized profile/level 0/2 for video/mpeg2
W/VideoCapabilities(10254): Unrecognized profile/level 0/3 for video/mpeg2
I/VideoCapabilities(10254): Unsupported profile 4 for video/mp4v-es
I/OMXClient(10254): MuxOMX ctor
F/libc    (10254): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 10404 (Thread-4)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'Amazon/mantis/mantis:6.0/NS6298/4760N:user/amz-p,release-keys'
Revision: '0'
ABI: 'arm'
pid: 10254, tid: 10404, oom: 0, name: Thread-4  >>> com.example.test <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
r0 00000000  r1 00000000  r2 7fffffff  r3 00000000
r4 8528a1f8  r5 00000000  r6 7a67a400  r7 7a67a4a8
r8 00000000  r9 85004bf8  sl 86fa1e40  fp 85004b80
ip 7a67a2f8  sp 7a67a3d8  lr ac7daa81  pc 8522b6cc  cpsr 600f0030
backtrace:
#00 pc 000c26cc  /data/app/com.example.test-1/lib/arm/libmdk.so
#01 pc 0007e971  /data/app/com.example.test-1/lib/arm/libmdk.so
#02 pc 0007be09  /data/app/com.example.test-1/lib/arm/libmdk.so
#03 pc 00046f83  /system/lib/libc.so (_ZL15__pthread_startPv+22)
#04 pc 00019d0d  /system/lib/libc.so (__start_thread+6)
Lost connection to device.

log.txt

wang-bin commented 8 months ago

The debug symbol is missing in previous build, so i can't see the crash line number. please use the latest sdk and try again https://sourceforge.net/projects/mdk-sdk/files/nightly/mdk-sdk-android.7z/download

lKinderBueno commented 8 months ago

These are the logs using the latest sdk:

Launching lib\main.dart on AFTMM in debug mode...
Running Gradle task 'assembleDebug'...
√  Built build\app\outputs\flutter-apk\app-debug.apk.
Debug service listening on ws://127.0.0.1:60678/Y78YUsuQe-E=/ws
Syncing files to device AFTMM...
W/libOpenSLES( 1554): Leaving Object::GetInterface (SL_RESULT_FEATURE_UNSUPPORTED)
W/libOpenSLES( 1554): Leaving Object::GetInterface (SL_RESULT_FEATURE_UNSUPPORTED)
W/VideoCapabilities( 1554): Unrecognized profile/level 1/32 for video/mp4v-es
W/VideoCapabilities( 1554): Unrecognized profile/level 32768/2 for video/mp4v-es
W/VideoCapabilities( 1554): Unrecognized profile/level 32768/64 for video/mp4v-es
E/libEGL  ( 1554): validate_display:99 error 3008 (EGL_BAD_DISPLAY)
E/libEGL  ( 1554): validate_display:99 error 3008 (EGL_BAD_DISPLAY)
I/libOpenSLES( 1554): Emulating old channel mask behavior (ignoring positional mask 0x3, using default mask 0x3 based on channel count of 2)
E/libc    ( 1554): Access denied finding property "dolby.dma.minbufcnt"
W/libOpenSLES( 1554): Leaving PlaybackRate::GetRateRange (SL_RESULT_PARAMETER_INVALID)
W/mdk.adec1@20599( 1554): type=1400 audit(0.0:1255): avc: denied { read } for name="u:object_r:dolby_prop:s0" dev="tmpfs" ino=12426 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:dolby_prop:s0 tclass=file permissive=0
W/VideoCapabilities( 1554): Unsupported mime video/dolby-vision
W/VideoCapabilities( 1554): Unsupported mime video/dolby-vision
W/VideoCapabilities( 1554): Unsupported mime video/dolby-vision
W/VideoCapabilities( 1554): Unsupported mime video/dolby-vision
W/VideoCapabilities( 1554): Unsupported mime video/dolby-vision
W/VideoCapabilities( 1554): Unsupported mime video/dolby-vision
W/VideoCapabilities( 1554): Unrecognized profile/level 0/0 for video/mpeg2
W/VideoCapabilities( 1554): Unrecognized profile/level 0/2 for video/mpeg2
W/VideoCapabilities( 1554): Unrecognized profile/level 0/3 for video/mpeg2
I/VideoCapabilities( 1554): Unsupported profile 4 for video/mp4v-es
I/OMXClient( 1554): MuxOMX ctor
F/libc    ( 1554): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 1626 (Thread-4)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'Amazon/mantis/mantis:6.0/NS6298/4760N:user/amz-p,release-keys'
Revision: '0'
ABI: 'arm'
pid: 1554, tid: 1626, oom: 0, name: Thread-4  >>> com.example.test <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
    r0 00000000  r1 00000000  r2 7fffffff  r3 00000000
    r4 8558a948  r5 00000000  r6 7ad7f3f8  r7 7ad7f4a0
    r8 00000000  r9 7cffb478  sl 7bbfb000  fp 7cffb400
    ip 7ad7f2f0  sp 7ad7f3d0  lr ac7daa81  pc 8552be2c  cpsr 600f0030
backtrace:
    #00 pc 000c2e2c  /data/app/com.example.test-1/lib/arm/libmdk.so
    #01 pc 0007eb25  /data/app/com.example.test-1/lib/arm/libmdk.so
    #02 pc 0007be1d  /data/app/com.example.test-1/lib/arm/libmdk.so
    #03 pc 00046f83  /system/lib/libc.so (_ZL15__pthread_startPv+22)
    #04 pc 00019d0d  /system/lib/libc.so (__start_thread+6)
Lost connection to device.

log.txt

wang-bin commented 8 months ago

I can see the line number, but seems wrong. btw, did you enable logging? I can't see any log from fvp

Add

import 'package:logging/logging.dart';
import 'package:intl/intl.dart';

add the following lines before registerWith()

  Logger.root.level = Level.ALL;
  Logger.root.onRecord.listen((record) {
    print('${record.loggerName}: ${record.message}');
  });
wang-bin commented 8 months ago

Should be fixed in this build https://github.com/wang-bin/mdk-sdk/actions/runs/6525513489

lKinderBueno commented 8 months ago

Sorry, I created a new project and I forgot to add the logs. I just test the new build and it is working. Thank you very much