flutter_soloud icon indicating copy to clipboard operation
flutter_soloud copied to clipboard

VS Code: Lost connection to device.

Open FluffyBunniesTasteTheBest opened this issue 5 months ago • 5 comments

Thank you very much for providing flutter_soloud.

Description

When running the app on an Android (12, 13, 14) device, it occassionally happenes that VS Code loses the connection to the device while the app is starting. If the connection gets lost, debug console shows the following:

I/flutter (29412): 2024-09-01 13:06:03.185783: FINEST: flutter_soloud.SoLoud: init() called
D/ven.awesome(29412): PlayerBase::PlayerBase()
D/ven.awesome(29412): TrackPlayerBase::TrackPlayerBase()
I/libOpenSLES(29412): Emulating old channel mask behavior (ignoring positional mask 0x3, using default mask 0x3 based on channel count of 2)
D/AudioTrack(29412): INSP: type=audio,case=1,set=0xb40000706725a230,stream_type=3,sample_rate=44100,format=0x5,channel_mask=0x3,frame_count=0,flags=0x104,notification_frames=-3,session_id=369,transfer_type=0,uid=-1,pid=-1
D/AudioTrack(29412): set(): 0xb40000706725a230, Create AudioTrackThread, tid = 29466
D/AudioTrack(29412): createTrack_l(0): AUDIO_OUTPUT_FLAG_FAST denied by server; frameCount 0 -> 1418
D/AudioTrack(29412): createTrack_l(46): 0xb40000706725a230, mCblk = 0x7204554000, mLatency = 74, mAfLatency = 42, frameCount = 1418, mSampleRate = 44100, mFlags = 0, mReqFrameCount = 1418, mNotificationFramesAct = 472
D/AudioTrack(29412): start(46): 0xb40000706725a230, prior state:STATE_STOPPED
D/ven.awesome(29412): PlayerBase::stop() from IPlayer
D/AudioTrack(29412): stop(46): 0xb40000706725a230, prior state:STATE_ACTIVE
D/AudioTrack(29412): stop(46): called with 0 frames delivered
D/AudioTrackShared(29412): this(0xb40000700725ab90), mCblk(0x7204554000), front(0), mIsOut 1, interrupt() FUTEX_WAKE
D/AudioTrack(29412): stop(46): 0xb40000706725a230 stop done
D/AudioTrack(29412): start(46): 0xb40000706725a230, prior state:STATE_STOPPED
I/flutter (29412): 2024-09-01 13:06:03.482217: FINEST: flutter_soloud.SoLoudLoader_io: initialize() called
I/flutter (29412): 2024-09-01 13:06:03.618966: FINEST: flutter_soloud.FlutterSoLoudFfi: STATE CHANGED EVENT state: PlayerStateNotification.started
I/flutter (29412): 2024-09-01 13:06:03.630874: INFO: flutter_soloud.SoLoudLoader_io: Temporary directory initialized at /data/user/0/com.supermega.awesome_app/cache/SoLoudLoader-Temp-Files
E/BLASTBufferQueue(29412): [SurfaceView[com.supermega.awesome_app/com.supermega.awesome_app.MainActivity]#1](f:0,a:2) isEGL=1, mPendingRelease.size()=1, mMaxAcquiredBuffers=4, currentMaxAcquiredBufferCount=2
E/BLASTBufferQueue(29412): [SurfaceView[com.supermega.awesome_app/com.supermega.awesome_app.MainActivity]#1](f:0,a:3) isEGL=1, mPendingRelease.size()=2, mMaxAcquiredBuffers=4, currentMaxAcquiredBufferCount=2
I/flutter (29412): 2024-09-01 13:06:10.547654: FINEST: flutter_soloud.FlutterSoLoudFfi: FILE LOADED EVENT error: noError  hash: 2006529388  file: /data/user/0/com.supermega.awesome_app/cache/SoLoudLoader-Temp-Files/temp-sound-asset-0x25ea5d95
I/flutter (29412): 2024-09-01 13:06:13.471286: FINEST: flutter_soloud.FlutterSoLoudFfi: FILE LOADED EVENT error: noError  hash: 1893300200  file: /data/user/0/com.supermega.awesome_app/cache/SoLoudLoader-Temp-Files/temp-sound-asset-0x13f3cb8f
I/flutter (29412): 2024-09-01 13:06:15.805302: FINEST: flutter_soloud.FlutterSoLoudFfi: FILE LOADED EVENT error: noError  hash: 179615633  file: /data/user/0/com.supermega.awesome_app/cache/SoLoudLoader-Temp-Files/temp-sound-asset-0x1c64a24a
I/flutter (29412): 2024-09-01 13:06:18.077289: FINEST: flutter_soloud.FlutterSoLoudFfi: FILE LOADED EVENT error: noError  hash: 1603303707  file: /data/user/0/com.supermega.awesome_app/cache/SoLoudLoader-Temp-Files/temp-sound-asset-0x3a8643a1
Lost connection to device.

Exited.

First time this got noticed was after upgrading from version 2.0.2 to 2.1.1. With the current 2.1.2 version it happens so frequently that it impacts work, hence downgrading to 2.0.2 was necessary.

Expected Behavior

The connection to VS Code's debugger shouldn't be closed.

Additional Context

Another thing, that could be related to it, is that in debug build, it sometimes takes up to half a minute until the app finishes loading the audio files. In release builds it works fine though and the same files are loaded in about a second.

Could this be related to the content of the (ogg) audio files? If the app starts, they are playing just fine though...

Sorry for not being able to provide any more details, but I thought you might be interested in knowing about it anyway.