Closed hunnydarapstar closed 7 years ago
also receiving this error in logcat while using hybridmediaplayerfactory
E/android.media.AudioTrack: AudioTrack.write() called with invalid size (38400) value
@hunnydarapstar Hi. Thank you for the issue report.
I am checking the implementation around using the AudioTrack
class in native layer, but I do not see any implementation bugs there. Could you give me more info to investigate it?
adb shell dumpsys media.audio_flinger
(while playing audio using HybridMediaPlayer)Thanks.
Hello @h6ah4i
adb shell dumpsys media.audio_flinger
Library audio_pre_processing
(no effects)
Library offload_bundle
(no effects)
Library proxy
Visualizer / The Android Open Source Project
UUID: 1d0a1a53-7d5d-48f2-8e71-27fbd10d842c
TYPE: e46b26a0-dddd-11db-8afd-0002a5d5c51b
apiVersion: 00020000
flags: 00400008
Library loudness_enhancer
Loudness Enhancer / The Android Open Source Project
UUID: fa415329-2034-4bea-b5dc-5b381c8d1e2c
TYPE: fe3199be-aed0-413f-87bb-11260eb63cf1
apiVersion: 00020000
flags: 00000008
Library downmix
Multichannel Downmix To Stereo / The Android Open Source Project
UUID: 93f04452-e4fe-41cc-91f9-e475b6d1d69f
TYPE: 381e49cc-a858-4aa2-87f6-e8388e7601b2
apiVersion: 00020000
flags: 00000008
Library visualizer_hw
(no effects)
Library visualizer_sw
(no effects)
Library qcreverb
QTI Insert Preset Reverb / Qualcomm Technologies, Inc.
UUID: b08a0e38-22a5-11e2-b87b-f23c91aec05e
TYPE: 47382d60-ddd8-11db-bf3a-0002a5d5c51b
apiVersion: 00020000
flags: 00000088
QTI Auxiliary Preset Reverb / Qualcomm Technologies, Inc.
UUID: 53ef1db5-c0c0-445b-b060-e34d20ebb70a
TYPE: 47382d60-ddd8-11db-bf3a-0002a5d5c51b
apiVersion: 00020000
flags: 00000001
QTI Insert Environmental Reverb / Qualcomm Technologies, Inc.
UUID: 791fff8b-8129-4655-83a4-59bc61034c3a
TYPE: c2e5d5f0-94bd-4763-9cac-4e234d06839e
apiVersion: 00020000
flags: 00000088
QTI Auxiliary Environmental Reverb / Qualcomm Technologies, Inc.
UUID: a8c1e5f3-293d-43cd-95ec-d5e26c02e217
TYPE: c2e5d5f0-94bd-4763-9cac-4e234d06839e
apiVersion: 00020000
flags: 00000001
Library qcvirt
Qualcomm Virtualizer / Qualcomm Technologies, Inc.
UUID: e6c98a16-22a3-11e2-b87b-f23c91aec05e
TYPE: 37cc2c00-dddd-11db-8577-0002a5d5c51b
apiVersion: 00020000
flags: 00000290
Library qcbassboost
Qualcomm Bass Boost / Qualcomm Technologies, Inc.
UUID: 23aca180-44bd-11e2-bcfd-0800200c9a66
TYPE: 0634f220-ddd4-11db-a0fc-0002a5d5c51b
apiVersion: 00020000
flags: 00000290
Library reverb
(no effects)
Library bundle
Volume / NXP Software Ltd.
UUID: 119341a0-8469-11df-81f9-0002a5d5c51b
TYPE: 09e8ede0-ddde-11db-b4f6-0002a5d5c51b
apiVersion: 00020000
flags: 00000050
Equalizer / NXP Software Ltd.
UUID: ce772f20-847d-11df-bb17-0002a5d5c51b
TYPE: 0bed4300-ddd6-11db-8f34-0002a5d5c51b
apiVersion: 00020000
flags: 00000048
Clients:
pid: 1084
pid: 1262
pid: 13358
Notification Clients:
pid: 248
pid: 256
pid: 331
pid: 716
pid: 1084
pid: 1262
pid: 12806
pid: 13358
Global session refs:
session pid count
361 1262 1
2169 1084 1
2209 13358 4
Hardware status: 0
Standby Time mSec: 3000
Output thread 0xb5a90a40 type 0 (MIXER): Thread name: AudioOut_D I/O handle: 13 TID: 467 Standby: no Sample rate: 48000 Hz HAL frame count: 1920 HAL format: 0x1 (pcm16) HAL buffer size: 7680 bytes Channel count: 2 Channel mask: 0x00000003 (front-left, front-right) Processing format: 0x1 (pcm16) Processing frame size: 4 bytes Pending config events: none Output device: 0x2 (SPEAKER) Input device: 0 (NONE) Audio source: 0 (default) Normal frame count: 1920 Last write occurred (msecs): 31 Total writes: 21149 Delayed writes: 0 Blocked in write: yes Suspend count: 0 Sink buffer : 0xb5cfb000 Mixer buffer: 0xb5af1000 Effect buffer: 0xb5cfd000 Fast track availMask=0xfe Standby delay ns=3000000000 AudioStreamOut: 0xb61c8230 flags 0x2 (PRIMARY) Thread throttle time (msecs): 4650 AudioMixer tracks: 0x00000001 Master mono: off FastMixer not initialized Stream volumes in dB: 0:0, 1:-6, 2:0, 3:-7.4, 4:-4.5, 5:0, 6:0, 7:-6, 8:-6, 9:0, 10:0, 11:0, 12:0 Normal mixer raw underrun counters: partial=0 empty=0 1 Tracks of which 1 are active Name Active Client Type Fmt Chn mask Session fCount S F SRate L dB R dB Server Main buf Aux Buf Flags UndFrmCnt 0 yes 13358 3 00000005 00000003 2209 4800 A 3 48000 0 0 000AB180 0xb587e000 0x0 0x400 1920 1 Effect Chains 3 effects for session 2209 In buffer Out buffer Active tracks: 0xb587e000 0xb5cfd000 1 Effect ID 27: Session Status State Engine: 02209 000 003 0xb5ca38b0 Descriptor:
Output thread 0xb5a1d700 type 0 (MIXER): Thread name: AudioOut_15 I/O handle: 21 TID: 469 Standby: yes Sample rate: 48000 Hz HAL frame count: 240 HAL format: 0x1 (pcm16) HAL buffer size: 960 bytes Channel count: 2 Channel mask: 0x00000003 (front-left, front-right) Processing format: 0x5 (pcmfloat) Processing frame size: 8 bytes Pending config events: none Output device: 0x2 (SPEAKER) Input device: 0 (NONE) Audio source: 0 (default) Normal frame count: 960 Last write occurred (msecs): 30038 Total writes: 21987 Delayed writes: 0 Blocked in write: no Suspend count: 0 Sink buffer : 0xb5ae3000 Mixer buffer: 0xb5ae1000 Effect buffer: 0xb618c000 Fast track availMask=0xfc Standby delay ns=3000000000 AudioStreamOut: 0xb61c8268 flags 0x4 (FAST) Thread throttle time (msecs): 0 AudioMixer tracks: 0x00000006 Master mono: off FastMixer command=COLD_IDLE writeSequence=177168 framesWritten=21260160 numTracks=1 writeErrors=0 underruns=16 overruns=47 sampleRate=48000 frameCount=240 measuredWarmup=15.9 ms, warmupCycles=6 mixPeriod=5.00 ms Simple moving statistics over last 3.2 seconds: wall clock time in ms per mix cycle: mean=5.00 min=4.10 max=5.90 stddev=0.10 raw CPU load in us per mix cycle: mean=130 min=0 max=951 stddev=65 Fast tracks: sMaxFastTracks=8 activeMask=0x1 Index Active Full Partial Empty Recent Ready 0 yes 904 0 0 full 1200 1 no 0 0 0 full 0 2 no 546 0 100 empty 0 3 no 0 0 0 full 0 4 no 0 0 0 full 0 5 no 0 0 0 full 0 6 no 0 0 0 full 0 7 no 0 0 0 full 0 Stream volumes in dB: 0:0, 1:-6, 2:0, 3:0, 4:-4.5, 5:0, 6:0, 7:-6, 8:-6, 9:0, 10:0, 11:0, 12:0 Normal mixer raw underrun counters: partial=0 empty=0 2 Tracks of which 0 are active Name Active Client Type Fmt Chn mask Session fCount S F SRate L dB R dB Server Main buf Aux Buf Flags UndFrmCnt 2 no 1084 1 00000001 00000003 2169 8329 S 1 44100 -inf -inf 00004112 0xb5ae3000 0x0 0x600 0 F 1 no 1262 0 00000001 00000001 361 960 I 0 48000 -10 -10 00000000 0xb5ae3000 0x0 0x000 0 0 Effect Chains
USB audio module: No output streams.
No input streams.
Reroute submix audio module: route[0] rate in=0 out=0, addr=[] route[1] rate in=0 out=0, addr=[] route[2] rate in=0 out=0, addr=[] route[3] rate in=0 out=0, addr=[] route[4] rate in=0 out=0, addr=[] route[5] rate in=0 out=0, addr=[] route[6] rate in=0 out=0, addr=[] route[7] rate in=0 out=0, addr=[] route[8] rate in=0 out=0, addr=[] route[9] rate in=48000 out=48000, addr=[]
I will give the sample project soon... till then you can have a look at this. Thanks :)
@hunnydarapstar Hi. I have just fixed the AudioTrack warning message bug 🎉 However it does not affect to the playback stopping issue though, so I'll continue trying to fix it on this weekend.
@h6ah4i Thanks for putting in the brilliant effort, you have already done marvelous job by creating this library. kudos. I know you 'll fix this soon.
@hunnydarapstar Still I cannot get reproduced the playback stopping issue on my setup. I hope your sample project will break through the current situation.
@h6ah4i Hiii I have created sample project for you on github. Take a look here https://github.com/hunnydarapstar/sample-openslmediaplayer-buggy To reproduce the bug, you have to carefully change 20-25 tracks (make sure you are testing on device having more than 30 tracks), after sometime while you forward a track, playback will stop and you can start your investigation. If you need any help regarding reproducing the bug, Feel free to ask. Thanks :)
P.S I use openslmediaplayer library in build.gradle via
compile 'com.h6ah4i.android:openslmediaplayer:0.7.2'
and do not have NDK installed in Android Studio.
@hunnydarapstar Thanks for the sample app! I've been trying to reproduce the bug using the app, but still it does not occur on my setups;
[Devices]
[Media files]
Is this issue can easily be reproduced on both of your devices? Also, I want to know that this issue can be reproduced when using OpenSLMediaPlayerFactory
instead of HybridMediaPlayerFactory
.
BTW, I found an another issue related to Android 7.0+. I am going to dig into this and possibly I will report it to Google.
https://github.com/h6ah4i/android-openslmediaplayer/issues/28
UPDATE I've just reproduced the bug on my Nexus 5X!
Also, I tweaked the sample app to automate the testing
@h6ah4i info : this bug is only present while we use HybridMediaPlayerFactory
.
You reproduced the bug, now thats called progress :)
and one more thing when playback stops you just toggle play/pause 4-5 times and again change 2-3 tracks, the playback will start again. I probably suspect when the bug is encountered, mediaplayer is hanged in some state, which it revives after again changing tracks.
Hii @h6ah4i
Any updates on this issue ?
@hunnydarapstar Have you tested the latest code on the develop branch? I think this issue has been resolved by the commit ea3c0f0. (I thought you have already successful to build the library because your question post on issue #22 has been removed.)
@h6ah4i On issue #22 my question was resolved but I again encountered another error while building the project
Android NDK: WARNING: Ignoring unknown import directory: F:/AndroidExamples/android-openslmediaplayer/library/src/main/jni/../dep_libs/cxxdasp/android/dep_libs/cxxporthelper/android/module
Android NDK: F:/AndroidExamples/android-openslmediaplayer/library/src/main/jni/cxxporthelper/Android.mk: Cannot find module with tag 'cxxporthelper/cxxporthelper' in import path
F:/AndroidExamples/android-openslmediaplayer/library/src/main/jni/cxxporthelper/Android.mk:21: *** Android NDK: Aborting. . Stop.
Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?
Android NDK: The following directories were searched:
Android NDK:
make: Entering directory `F:/AndroidExamples/android-openslmediaplayer/library/src/main/jni'
make: Leaving directory `F:/AndroidExamples/android-openslmediaplayer/library/src/main/jni'
:library:ndkBuildReleaseNonJniDebuggable FAILED
Can you fix this ?
@hunnydarapstar I am not sure what is happening, but at least it seems that you have not used SUBST
command yet. Gnu tools cannot handle the path name longer than MAX_PATH
(=260 chars), so you have to take care about that.
SUBST X: F:/AndroidExamples/android-openslmediaplayer
Finally, I managed to build the library, and tons of thanks the issue has been resolved. Thank you for doing a brilliant job in maintaining the library, best of luck for future :1st_place_medal:
Hello h6ah4i first of all amazing mediaplayer library, I just found one glitch while using HybridMediaPlayerFactory when my app changes tracks, after 10-15 changes it suddenly stops playback with no error or warning in logcat too :( This is my code for changing tracks:
Above code working fine in case of OpenSLMediaPlayerFactory.. Please Suggest if I am doing something wrong...!!