mikeperri / flutter_sequencer

A Flutter plugin for music sequencing.
Other
90 stars 38 forks source link

Flutter Sequencer Example crashes when headphones are used #23

Open kNoAPP opened 2 years ago

kNoAPP commented 2 years ago

I am considering using this Flutter library for a project, so I did some testing on it to confirm it has what I need. I got the example app building to a Google Pixel 6 Pro running Android 12 (API 31). But then I encountered issues.

When the app is opened with no audio device connected, it behaves normally and without bugs. Audio is generated and the demos are nicely functional.

When the app is opened while my MDR-XB950N1 headphones are connected via bluetooth, the app crashes with this error:

Launching lib\main.dart on Pixel 6 Pro in debug mode...
√  Built build\app\outputs\flutter-apk\app-debug.apk.
W/FlutterActivityAndFragmentDelegate(18640): A splash screen was provided to Flutter, but this is deprecated. See flutter.dev/go/android-splash-migration for migration steps.
Connecting to VM Service at ws://127.0.0.1:56669/l-Du46d7jZ4=/ws
I/FLUTTER_SEQUENCER(18640): Successfully set asset manager in native module
I/OboeAudio(18640): openStream() OUTPUT -------- OboeVersion1.6.1 --------
D/OboeAudio(18640): AAudioLoader():  dlopen(libaaudio.so) returned 0x5498c18b819fa7b9
I/AAudio  (18640): AAudioStreamBuilder_openStream() called ----------------------------------------
I/AudioStreamBuilder(18640): rate   =  44100, channels  = 2, format   = 5, sharing = SH, dir = OUTPUT
I/AudioStreamBuilder(18640): device =      0, sessionId = -1, perfMode = 12, callback: ON with frames = 0
I/AudioStreamBuilder(18640): usage  =      1, contentType = 2, inputPreset = 6, allowedCapturePolicy = 0
I/AudioStreamBuilder(18640): privacy sensitive = false
I/AudioStreamBuilder(18640): opPackageName = (null)
I/AudioStreamBuilder(18640): attributionTag = (null)
D/quencer_exampl(18640): PlayerBase::PlayerBase()
D/quencer_exampl(18640): PlayerBase::PlayerBase()
D/AudioStreamInternal_Client(18640): ~AudioStreamInternal() 0x73cf18e870 called
D/AAudioStream(18640): ~AudioStream(s#1) mPlayerBase strongCount = 1
D/quencer_exampl(18640): PlayerBase::~PlayerBase()
D/AudioStreamTrack(18640): open(), request notificationFrames = -8, frameCount = 0
D/AudioTrack(18640): createTrack_l(0): AUDIO_OUTPUT_FLAG_FAST denied by server; frameCount 0 -> 10632
D/AAudioStream(18640): setState(s#2) from 0 to 2
D/AudioStreamTrack(18640): open() flags changed from 0x00000104 to 0x00000000
D/AudioStreamTrack(18640): open() perfMode changed from 12 to 10
I/AAudio  (18640): AAudioStreamBuilder_openStream() returns 0 = AAUDIO_OK for s#2 ----------------
D/OboeAudio(18640): AudioStreamAAudio.open() format=2, sampleRate=44100, capacity = 10632
D/OboeAudio(18640): AudioStreamAAudio.open: AAudioStream_Open() returned AAUDIO_OK
D/AAudio  (18640): AAudioStream_requestStart(s#2) called --------------
D/AAudioStream(18640): setState(s#2) from 2 to 3
D/AAudio  (18640): AAudioStream_requestStart(s#2) returned 0 ---------
D/AudioStreamLegacy(18640): onAudioDeviceUpdate(deviceId = 685)
F/libc    (18640): Fatal signal 5 (SIGTRAP), code 1 (TRAP_BRKPT), fault addr 0x7204a96ea0 in tid 18707 (1.ui), pid 18640 (quencer_example)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'google/raven/raven:12/SD1A.210817.036.A8/7847443:user/release-keys'
Revision: 'MP1.0'
ABI: 'arm64'
Timestamp: 2021-11-09 10:55:03.879398783-0800
Process uptime: 0s
Cmdline: com.michaeljperri.flutter_sequencer_example
pid: 18640, tid: 18707, name: 1.ui  >>> com.michaeljperri.flutter_sequencer_example <<<
uid: 10297
tagged_addr_ctrl: 0000000000000001
signal 5 (SIGTRAP), code 1 (TRAP_BRKPT), fault addr 0x7204a96ea0
    x0  0000007204f915a0  x1  0000000000000000  x2  0000000000000000  x3  0000007545091288
    x4  0000007294c7b938  x5  0000000000000020  x6  0000007294c7b968  x7  0000000000000032
    x8  0000007294c7c000  x9  0000000000000000  x10 34fc7ec1cdb0d70c  x11 0000000000004913
    x12 0000007294c7b940  x13 00000000b35fc7fa  x14 0000000000000010  x15 0000000000000010
    x16 000000754508ef70  x17 0000007545082894  x18 00000071f2c8c000  x19 0000007294c7bcb0
    x20 0000007545092000  x21 0000007294c7bcb0  x22 00000000000048f1  x23 00000000000048d0
    x24 0000007294c7bcb0  x25 0000007294c7bcb0  x26 0000007294c7bff8  x27 00000000000fc000
    x28 00000000000fe000  x29 0000007294c7bb10
    lr  0000007204a96e9c  sp  0000007294c7ba60  pc  0000007204a96ea0  pst 0000000060001000
backtrace:
      #00 pc 00000000001f4ea0  /data/app/~~O_J2zAoVOddDgZu0DHSAjw==/com.michaeljperri.flutter_sequencer_example-3d2igE8yirPhGDVfreKdLQ==/lib/arm64/libflutter_sequencer.so (BuildId: c1410f1d3d70d91511332f25278e8c49e56294d6)
      #01 pc 00000000001cbaac  /data/app/~~O_J2zAoVOddDgZu0DHSAjw==/com.michaeljperri.flutter_sequencer_example-3d2igE8yirPhGDVfreKdLQ==/lib/arm64/libflutter_sequencer.so (BuildId: c1410f1d3d70d91511332f25278e8c49e56294d6)
      #02 pc 00000000001b62e0  /data/app/~~O_J2zAoVOddDgZu0DHSAjw==/com.michaeljperri.flutter_sequencer_example-3d2igE8yirPhGDVfreKdLQ==/lib/arm64/libflutter_sequencer.so (SfizzSamplerInstrument::setSamplesPerBlock(int)+36) (BuildId: c1410f1d3d70d91511332f25278e8c49e56294d6)
      #03 pc 00000000001b7320  /data/app/~~O_J2zAoVOddDgZu0DHSAjw==/com.michaeljperri.flutter_sequencer_example-3d2igE8yirPhGDVfreKdLQ==/lib/arm64/libflutter_sequencer.so (BuildId: c1410f1d3d70d91511332f25278e8c49e56294d6)
      #04 pc 00000000001b7248  /data/app/~~O_J2zAoVOddDgZu0DHSAjw==/com.michaeljperri.flutter_sequencer_example-3d2igE8yirPhGDVfreKdLQ==/lib/arm64/libflutter_sequencer.so (BuildId: c1410f1d3d70d91511332f25278e8c49e56294d6)
      #05 pc 00000000001b71e8  /data/app/~~O_J2zAoVOddDgZu0DHSAjw==/com.michaeljperri.flutter_sequencer_example-3d2igE8yirPhGDVfreKdLQ==/lib/arm64/libflutter_sequencer.so (BuildId: c1410f1d3d70d91511332f25278e8c49e56294d6)
      #06 pc 00000000001b6f00  /data/app/~~O_J2zAoVOddDgZu0DHSAjw==/com.michaeljperri.flutter_sequencer_example-3d2igE8yirPhGDVfreKdLQ==/lib/arm64/libflutter_sequencer.so (BuildId: c1410f1d3d70d91511332f25278e8c49e56294d6)
      #07 pc 00000000000b1690  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+204) (BuildId: 28943f8bb3b7b23557619af9a38223c5)
      #08 pc 00000000000510ac  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 28943f8bb3b7b23557619af9a38223c5)
Lost connection to device.
Exited (sigterm)

My flutter doctor:

PS C:\Users\alden\OneDrive\Desktop\flutter_sequencer\example> flutter doctor -v
[√] Flutter (Channel stable, 2.5.3, on Microsoft Windows [Version 10.0.22000.282], locale en-US)
    • Flutter version 2.5.3 at C:\flutter
    • Upstream repository https://github.com/flutter/flutter
    • Framework revision 18116933e7 (4 weeks ago), 2021-10-15 10:46:35 -0700
    • Engine revision d3ea636dc5
    • Dart version 2.14.4

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at c:/Users/alden/AppData/Local/Android/Sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: c:/Program Files/Android/Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Android Studio (version 2020.3)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[√] Android Studio
    • Android Studio at c:/Program Files/Android/Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • android-studio-dir = c:/Program Files/Android/Android Studio
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[√] IntelliJ IDEA Ultimate Edition (version 2021.1)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2021.1.1
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart

[√] VS Code (version 1.62.0)
    • VS Code at C:\Users\alden\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.28.0

[√] Connected device (3 available)
    • Pixel 6 Pro (mobile) • 19181FDEE001G3 • android-arm64  • Android 12 (API 31)
    • Chrome (web)         • chrome         • web-javascript • Google Chrome 95.0.4638.69
    • Edge (web)           • edge           • web-javascript • Microsoft Edge 95.0.1020.40

• No issues found!