Closed bolso80 closed 7 years ago
The crash log shows that it crashed in system library while using OpenSLES to decode ogg file to pcm buffer. Could you try to check it out which file causes this crash?
This is also happening on a Samsung S6 (Not the edge version), I guess they have the same hardware.
I/WallpaperScroller( 4273): WallpaperScroller resume
D/CrashAnrDetector( 3506): Build: samsung/zerofltedv/zeroflte:5.1.1/LMY47X/G920IDVU2COGA:user/release-keys
D/CrashAnrDetector( 3506): Hardware: universal7420
D/CrashAnrDetector( 3506): Revision: 11
D/CrashAnrDetector( 3506): Bootloader: G920IDVU2COGA
D/CrashAnrDetector( 3506): Radio: unknown
D/CrashAnrDetector( 3506): Kernel: Linux version 3.10.61-5499188 (dpi@SWHD8903) (gcc version 4.9 20140514 (prerelease) (GCC) ) #1 SMP PREEMPT Tue Jul 28 20:02:05 KST 2015
D/CrashAnrDetector( 3506):
D/CrashAnrDetector( 3506): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
D/CrashAnrDetector( 3506): Build fingerprint: 'samsung/zerofltedv/zeroflte:5.1.1/LMY47X/G920IDVU2COGA:user/release-keys'
D/CrashAnrDetector( 3506): Revision: '11'
D/CrashAnrDetector( 3506): ABI: 'arm'
D/CrashAnrDetector( 3506): pid: 26056, tid: 26119, name: GLThread 433 >>> com.ironhidegames.kingdomrushx <<<
D/CrashAnrDetector( 3506): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
D/CrashAnrDetector( 3506): r0 00000000 r1 00000000 r2 00000000 r3 00000109
D/CrashAnrDetector( 3506): r4 ee410c08 r5 ee40f400 r6 ee6f9000 r7 f7177fc8
D/CrashAnrDetector( 3506): r8 000000ff r9 ee410be8 sl dbb7ef5c fp f7177fd8
D/CrashAnrDetector( 3506): ip 00000000 sp d622fd50 lr f7150859 pc f714b116 cpsr 600f0030
D/CrashAnrDetector( 3506): d0 0000000000000000 d1 0000000000000000
D/CrashAnrDetector( 3506): d2 0000000000003274 d3 000000000000006f
D/CrashAnrDetector( 3506): d4 00000000000032a5 d5 0000000000000000
D/CrashAnrDetector( 3506): d6 0000000700000000 d7 3ce991d3eb851eb8
D/CrashAnrDetector( 3506): d8 416fca0580000000 d9 416fca0555555555
D/CrashAnrDetector( 3506): d10 0000000000000000 d11 0000000000000000
D/CrashAnrDetector( 3506): d12 0000000000000000 d13 0000000000000000
D/CrashAnrDetector( 3506): d14 0000000000000000 d15 0000000000000000
D/CrashAnrDetector( 3506): d16 0000000000000000 d17 0000000000000000
D/CrashAnrDetector( 3506): d18 4024000000000000 d19 40c3880000000000
D/CrashAnrDetector( 3506): d20 3fc555509d6ae6af d21 407213db20000000
D/CrashAnrDetector( 3506): d22 3ff451eb96e00000 d23 bebbbd388f367055
D/CrashAnrDetector( 3506): d24 3f903ab3ef110182 d25 407213db20000000
D/CrashAnrDetector( 3506): d26 400723a7d70a3d71 d27 3ff451eb96e00000
D/CrashAnrDetector( 3506): d28 3ff0000000000000 d29 bfffc5da1fed000f
D/CrashAnrDetector( 3506): d30 3fe62e42fefa39ef d31 4000000000000000
D/CrashAnrDetector( 3506): scr 80000011
D/CrashAnrDetector( 3506):
D/CrashAnrDetector( 3506): backtrace:
D/CrashAnrDetector( 3506): #00 pc 0004a116 /system/lib/libc.so (ifree+665)
D/CrashAnrDetector( 3506): #01 pc 00012d57 /system/lib/libc.so (free+10)
D/CrashAnrDetector( 3506): #02 pc 000017d4 /system/lib/libExynosOMX_Core.so (Exynos_OMX_Component_Unregister+4)
D/CrashAnrDetector( 3506): #03 pc 00001bd8 /system/lib/libExynosOMX_Core.so (Exynos_OMX_Deinit+44)
D/CrashAnrDetector( 3506): #04 pc 00000e51 /system/lib/libstagefrighthw.so (android::ExynosOMXPlugin::~ExynosOMXPlugin()+24)
D/CrashAnrDetector( 3506): #05 pc 00000e7d /system/lib/libstagefrighthw.so (android::ExynosOMXPlugin::~ExynosOMXPlugin()+4)
D/CrashAnrDetector( 3506): #06 pc 00014e01 /system/lib/libstagefright_omx.so (android::OMXMaster::clearPlugins()+60)
D/CrashAnrDetector( 3506): #07 pc 00014e33 /system/lib/libstagefright_omx.so (android::OMXMaster::~OMXMaster()+18)
D/CrashAnrDetector( 3506): #08 pc 00014e85 /system/lib/libstagefright_omx.so (android::OMXMaster::~OMXMaster()+4)
D/CrashAnrDetector( 3506): #09 pc 0001358b /system/lib/libstagefright_omx.so (android::OMX::~OMX()+42)
D/CrashAnrDetector( 3506): #10 pc 00013611 /system/lib/libstagefright_omx.so (android::OMX::~OMX()+4)
D/CrashAnrDetector( 3506): #11 pc 0000ede5 /system/lib/libutils.so (android::RefBase::decStrong(void const*) const+40)
D/CrashAnrDetector( 3506): #12 pc 00071107 /system/lib/libstagefright.so (android::sp<android::IGraphicBufferProducer>::~sp()+18)
D/CrashAnrDetector( 3506): #13 pc 000b9081 /system/lib/libstagefright.so (android::MuxOMX::~MuxOMX()+36)
D/CrashAnrDetector( 3506): #14 pc 000b90c1 /system/lib/libstagefright.so (android::MuxOMX::~MuxOMX()+4)
D/CrashAnrDetector( 3506): #15 pc 0000ede5 /system/lib/libutils.so (android::RefBase::decStrong(void const*) const+40)
D/CrashAnrDetector( 3506): #16 pc 00071107 /system/lib/libstagefright.so (android::sp<android::IGraphicBufferProducer>::~sp()+18)
D/CrashAnrDetector( 3506): #17 pc 000bf1e3 /system/lib/libstagefright.so (android::OMXCodec::~OMXCodec()+398)
D/CrashAnrDetector( 3506): #18 pc 000bf251 /system/lib/libstagefright.so (android::OMXCodec::~OMXCodec()+4)
D/CrashAnrDetector( 3506): #19 pc 0000ede5 /system/lib/libutils.so (android::RefBase::decStrong(void const*) const+40)
D/CrashAnrDetector( 3506): #20 pc 0000beab /system/lib/libwilhelm.so
D/CrashAnrDetector( 3506): #21 pc 0000c6fd /system/lib/libwilhelm.so
D/CrashAnrDetector( 3506): #22 pc 0000d2a7 /system/lib/libwilhelm.so
D/CrashAnrDetector( 3506): #23 pc 0000d2b9 /system/lib/libwilhelm.so
D/CrashAnrDetector( 3506): #24 pc 0000ede5 /system/lib/libutils.so (android::RefBase::decStrong(void const*) const+40)
D/CrashAnrDetector( 3506): #25 pc 0000a0d1 /system/lib/libwilhelm.so
D/CrashAnrDetector( 3506): #26 pc 000141cd /system/lib/libwilhelm.so
D/CrashAnrDetector( 3506): #27 pc 000192b3 /system/lib/libwilhelm.so
D/CrashAnrDetector( 3506): #28 pc 009df5bb /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so (cocos2d::experimental::AudioDecoder::decodeToPcm()+8146)
D/CrashAnrDetector( 3506): #29 pc 009dcf9d /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libco
D/CrashAnrDetector( 3506): processName:com.ironhidegames.kingdomrushx
D/CrashAnrDetector( 3506): broadcastEvent : com.ironhidegames.kingdomrushx SYSTEM_TOMBSTONE
Hi @dumganhar the crash seems to be random because the sound file is kinda always a different one.
Also we started experimenting some random crashes on other parts of the code. This is an example of another random crash
Build fingerprint: 'samsung/zeroltexx/zerolte:5.1.1/LMY47X/G925FXXU3QPA7:user/release-keys'
pid: 13744, tid: 13776, name: GLThread 3748 >>> com.ironhidegames.kingdomrushx <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4
Stack frame #00 pc 0045be82 /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so (std::__ndk1::unordered_map<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, cocos2d::Value, std::__ndk1::hash<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, std::__ndk1::equal_to<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, std::__ndk1::allocator<std::__ndk1::pair<std::
Stack frame #01 pc 00ac4de0 /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so (cocos2d::SpriteFrameCache::addSpriteFramesWithDictionary(std::__ndk1::unordered_map<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, cocos2d::Value, std::__ndk1::hash<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, std::__ndk1::equal_to<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<
Stack frame #02 pc 00ac73d8 /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so (cocos2d::SpriteFrameCache::addSpriteFramesWithDictionary(std::__ndk1::unordered_map<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, cocos2d::Value, std::__ndk1::hash<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, std::__ndk1::equal_to<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<
Stack frame #03 pc 00ac8ec0 /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so (cocos2d::SpriteFrameCache::addSpriteFramesWithFile(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&)+4276)
Stack frame #04 pc 008afab9 /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so (KRAssetsLoader::loadTexture(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&)+24)
Stack frame #05 pc 008b21c5 /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so (KRAssetsLoader::loadAssets(std::__ndk1::unordered_map<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, cocos2d::Value, std::__ndk1::hash<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, std::__ndk1::equal_to<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, std::__ndk1::alloca
Stack frame #06 pc 008afef9 /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so (KRAssetsLoader::loadAssetsInGroup(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&)+84)
Stack frame #07 pc 007ec865 /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so (KRLoadingScene::loadOneAsset()+2424)
Stack frame #08 pc 007ef41b /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so (_ZNSt6__ndk128__invoke_void_return_wrapperIvE6__callIJRNS_6__bindIM14KRLoadingSceneFvvEJPS4_EEEEEEvDpOT_+130)
Stack frame #09 pc 007ef323 /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so (_ZNSt6__ndk110__function6__funcINS_6__bindIM14KRLoadingSceneFvvEJPS3_EEENS_9allocatorIS7_EEFvvEEclEv+22)
Stack frame #10 pc 0049f4c1 /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so (std::__ndk1::function<void ()>::operator()() const+76)
Stack frame #11 pc 009f79c0 /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so (cocos2d::CallFunc::execute()+220)
Stack frame #12 pc 009f78d8 /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so (cocos2d::CallFunc::update(float)+40)
Stack frame #13 pc 009fc27c /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so (cocos2d::Sequence::update(float)+1140)
Stack frame #14 pc 009fb188 /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so (cocos2d::ActionInterval::step(float)+424)
Stack frame #15 pc 00d24450 /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so (cocos2d::ActionManager::update(float)+244)
Stack frame #16 pc 00b6722c /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so (void cocos2d::Scheduler::scheduleUpdate<cocos2d::ActionManager>(cocos2d::ActionManager*, int, bool)::{lambda(float)#1}::operator()(float) const+36)
Stack frame #17 pc 00b6d6cc /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so (_ZNSt6__ndk128__invoke_void_return_wrapperIvE6__callIJRZN7cocos2d9Scheduler14scheduleUpdateINS3_13ActionManagerEEEvPT_ibEUlfE_fEEEvDpOT_+88)
Stack frame #18 pc 00b6d5a8 /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so (std::__ndk1::__function::__func<void cocos2d::Scheduler::scheduleUpdate<cocos2d::ActionManager>(cocos2d::ActionManager*, int, bool)::{lambda(float)#1}, std::__ndk1::allocator<{lambda(float)#1}>, void (float)>::operator()(float&&)+64)
Stack frame #19 pc 0079b5a3 /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so (std::__ndk1::function<void (float)>::operator()(float) const+82)
Stack frame #20 pc 00bb311c /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so (cocos2d::Scheduler::update(float)+196)
Stack frame #21 pc 00b61db0 /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so (cocos2d::Director::drawScene()+160)
Stack frame #22 pc 00b66f24 /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so (cocos2d::Director::mainLoop()+124)
Stack frame #23 pc 0091af39 /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so (Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeRender+16)
Stack frame #24 pc 000744ed /data/dalvik-cache/arm/data@app@com.ironhidegames.kingdomrushx-1@base.apk@classes.dex
Crash dump is completed
We notice that we only have this random crashes if we preload our sounds so we believe that all the crashes are connected to the preload code but we are not experts so we don't know.
Could this be because of using multithread to pre load sounds?
What we are doing right now is: We load all our resources in a loading scene, that scene loads textures, animations and sounds, this scene takes 5 or 6 seconds to load all the assets since Kingdom Rush games are heavy load games so my theory is that while we are preloading the sounds we are also filling a lot of memory space with textures and animations and sometimes it crashes there.
We only have this crash on Android and we believe that we only have this crash on a Galaxy s6, we tested other Android devices (One Plus One, Nexus 9, Moto G, Moto X, etc) and we can't reproduce the Crash.
Also we only have this crash if we preload sounds.
We also have a testing app that only preloads the sounds and we have random crashes there too.
Thanks, Pablo
Update: we updated one of our S6 with 5.1.1 to Android 6.0.1 and we don't have any crash there.
This is the Android version we are having random crash.
I think that this is also not working on Android 4.2.2 on a Samsung Galaxy S4.... i need to do more test just to make sure that pre loading sounds is working there.
This is the crash in S4 with 4.2.2
V/AudioDecoder( 9255): SL_PLAYEVENT_HEADATEND
V/AudioDecoder( 9255): EOS signaled
V/AudioDecoder( 9255): Stopped decoding
I/OMXCodec( 9255): [OMX.google.vorbis.decoder] stop mState=4
I/OMXCodec( 9255): [OMX.google.vorbis.decoder] stop() sendCommand(0x1, OMX_CommandStateSet, OMX_StateIdle)
I/OMXCodec( 9255): [OMX.google.vorbis.decoder] Now Idle. Component sends idle done Event
I/OMXCodec( 9255): [OMX.google.vorbis.decoder] stopOmxComponent_l() mstate = 1
I/OggExtractor( 9255): ~OggSource --
I/OggExtractor( 9255): ~OggExtractor ++
I/OggExtractor( 9255): ~MyVorbisExtractor ++
I/OggExtractor( 9255): ~MyVorbisExtractor --
I/OggExtractor( 9255): ~OggExtractor --
V/AudioDecoder( 9255): decodeToPcmCallback ...
V/AudioDecoder( 9255): decodeToPcmCallback ...
V/AudioDecoder( 9255): decodeToPcmCallback ...
V/AudioDecoder( 9255): decodeToPcmCallback ...
V/AudioDecoder( 9255): decodeToPcmCallback ...
V/AudioDecoder( 9255): decodeToPcmCallback ...
V/AudioDecoder( 9255): decodeToPcmCallback ...
V/AudioDecoder( 9255): decodeToPcmCallback ...
V/AudioDecoder( 9255): decodeToPcmCallback ...
V/AudioDecoder( 9255): decodeToPcmCallback ...
V/AudioDecoder( 9255): decodeToPcmCallback ...
V/AudioDecoder( 9255): decodeToPcmCallback ...
V/AudioDecoder( 9255): decodeToPcmCallback ...
V/AudioDecoder( 9255): decodeToPcmCallback ...
V/AudioDecoder( 9255): decodeToPcmCallback ...
V/AudioDecoder( 9255): decodeToPcmCallback ...
V/AudioDecoder( 9255): decodeToPcmCallback ...
V/AudioPlayerProvider( 9255): (assets/KR4_Android/Sounds/Fx/Commons/kr4_sniper.ogg) file size: 10079
V/AudioDecoder( 9255): decodeToPcmCallback ...
V/AssetFd ( 9255): ~AssetFd: 88
V/AudioDecoder( 9255): decodeToPcmCallback ...
D/cocos2d-x debug info( 9255): Load this sound file this file kr4_enemy_healing.ogg
V/AudioDecoder( 9255): decodeToPcmCallback ...
V/AudioDecoder( 9255): decodeToPcmCallback ...
I/DEBUG ( 9187): unexpected waitpid response: n=9316, status=0000000b
I/DEBUG ( 9187): ptrace detach from 9316 failed: No such process
I/DEBUG ( 9187): debuggerd committing suicide to free the zombie!
V/AudioPolicyManagerBase( 214): stopOutput() output 2, stream 3, session 67
V/AudioPolicyManagerBase( 214): changeRefCount() stream 3, count 0
V/AudioPolicyManagerBase( 214): getNewDevice() selected device 0
V/AudioPolicyManagerBase( 214): setOutputDevice() output 2 device 0000 force 0 delayMs 192
V/AudioPolicyManagerBase( 214): setOutputDevice() prevDevice 0002
V/AudioPolicyManagerBase( 214): setOutputDevice() setting same device 0000 or null device for output 2
V/AudioPolicyManagerBase( 214): checkOutputForStrategy(0002,0002,3)
V/AudioPolicyManagerBase( 214): getOutputsForDevice device 0002 -> 0002
I/DEBUG ( 9356): debuggerd: Jul 13 2013 14:54:37
V/AudioPolicyManagerBase( 214): getOutputsForDevice device 0002 -> 0002
V/AudioPolicyManagerBase( 214): releaseOutput() 2
I/SurfaceFlinger( 210): id=160 Removed TurfaceView (2/5)
I/SurfaceFlinger( 210): id=160 Removed TurfaceView (-2/5)
I/ActivityManager( 778): Process com.ironhidegames.kingdomrushx (pid 9255) (adj 0) has died.
W/ContextImpl( 778): Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1323 com.android.server.am.ActivityManagerService.cleanUpApplicationRecordLocked:12315 com.android.server.am.ActivityManagerService.handleAppDiedLocked:3552 com.android.server.am.ActivityManagerService.appDiedLocked:3656 com.android.server.am.ActivityManagerService$AppDeathRecipient.binderDied:998
I/SurfaceFlinger( 210): id=159 Removed BppActivity (2/4)
I/SurfaceFlinger( 210): id=159 Removed BppActivity (-2/4)
D/qdoverlay( 210): Unset pipe=RGB0 dpy=0;
D/qdmemalloc( 210): ion: unmap_buffer base:0x0 size:8355840 offset:0 fd:28
D/qdmemalloc( 210): ion: unmap_buffer base:0x0 size:4096 offset:0 fd:32
D/qdmemalloc( 210): ion: unmap_buffer base:0x0 size:8355840 offset:0 fd:58
D/qdmemalloc( 210): ion: unmap_buffer base:0x0 size:4096 offset:0 fd:52
I will keep trying to investigate if there is a problem on our side but I really don't know where to look.
@pablorealini, could you tell me how did you write the preload audio code? Probably some code snippets will be better.
I have a Samsung S7 here, feel free to send your game APK to me (jianhua.chen@cocos2d-x.org). I will help to investigate what the problem is. Thanks.
Sure. Basically we load all the assets using a method that reads the textures, sounds and animations from a plist.
We have a load asset method inside a AssetsLoader custom class like this:
void KRAssetsLoader::loadAssets(ValueMap assets)
{
// Loading textures
if (!assets["textures"].isNull())
{
ValueMap textures = assets["textures"].asValueMap();
for (auto iter = textures.cbegin(); iter != textures.cend(); ++iter)
{
// Get texture data
std::string textureName = iter->first;
// Set Format First
ValueMap& textureEntry = textures[textureName].asValueMap();
std::string format = textureEntry["pixelFormat"].asString();
Texture2D::setDefaultAlphaPixelFormat(KRAssetsLoader::getPixelFormat(format));
// Load texture
KRAssetsLoader::loadTexture(textureName);
}
}
if (!assets["animations"].isNull())
{
// Loading animations
ValueMap animations = assets["animations"].asValueMap();
for (auto iter = animations.cbegin(); iter != animations.cend(); ++iter)
{
std::string animationName = iter->first;
KRAnimationCache::addAnimationsFromFile(animationName);
}
}
if (!assets["sounds"].isNull())
{
// Loading sounds
ValueMap sounds = assets["sounds"].asValueMap();
for (auto iter = sounds.cbegin(); iter != sounds.cend(); ++iter)
{
std::string packName = iter->first;
KRGameSoundEngine::getInstance()->loadSounds(packName);
}
}
}
This is important because the sounds are being loaded in the middle of all our textures and animations (we cache all animations)
And this is the method loadSounds in KRGameSoundEngine
void KRGameSoundEngine::loadSounds(const std::string& pack)
{
std::string fullPath = FileUtils::getInstance()->fullPathForFilename(pack);
ValueMap sounds = FileUtils::getInstance()->getValueMapFromFile(fullPath);
// Iterate on pack
for (auto iter = sounds.cbegin(); iter != sounds.cend(); ++iter)
{
std::string sound = iter->first;
// If sound not loaded get config and load
if (!this->isSoundLoaded(sound)) {
CCASSERT(!this->_sounds[sound].isNull(), "SOUND IN PACK NOT EXISTS");
ValueMap& soundConf = this->_sounds[sound].asValueMap();
if (soundConf.find("file") != soundConf.end()) {
std::string fileSound = this->getFileName(soundConf);
CCLOG("Load this sound file this file %s", fileSound.c_str());
AudioEngine::preload(fileSound.c_str(), std::bind(&KRGameSoundEngine::loadSoundsCallback, this, std::placeholders::_1, sound));
this->_loadSounds.push_back(sound.c_str());
}
}
}
this->_isLoadSounds = true;
}
As you can see we load multiples sounds that have the MetaData inside a plist file.
Let me know if you need anything else.
On Android 4.2.2 S4 the game crash every time if I try to preload the sounds, we created a test app and it only works if we load a single sound.
This is the device:
@pablorealini
What's the logic inside loadSoundsCallback
? Would you wait before entering game scene until loadSoundsCallback
checks all sounds are preloaded?
Let me know if you need anything else.
Yes, could you write a simple demo for reproducing this issue?
This is the logic on the callback, if we remove the callback we still have this issue.
void KRGameSoundEngine::loadSoundsCallback(bool result, const std::string& sound)
{
this->_soundsLoaded++;
if (!result) {
CCLOG("SOUND %s NOT LOADED", sound.c_str());
}
if (this->_isLoadSounds) {
if (this->_soundsLoaded == this->_loadSounds.size()) {
AudioEngine::printCacheSize(false);
}
}
}
We aren't waiting for all the sounds to load the next scene. Remember that some times we load some sounds between loading big textures and the game mostly crash on the loading scene, sometimes at the very beginning or in the middle or near to the end, is a random crash, sometime everything just load fine and it doesn't
I didn't try to load only sounds first and then the textures and
To put an example, on our game the player can chose between some characters so we have some Metadata like the texture and sound each character use, this is why each character loads the textures and sound and then another one loads, and so on.
Note: On android 4.2.2 it crashed every time, I can't enter to the gameplay scene at all.
We created a test case that o lo loads the sounds and it also crash on a galaxy s6 but you need to reload the scene sometimes multiple times before seeing the crash, sometimes just one time.
On the S4 with 4.2.2 just with 3 or 4 sounds the test crash almost every time.
We updated one of our galaxy s6 to android 6.0.1 and the game doesn't crash.
Note: KRGameSoundEngine is a singleton class.
@pablorealini If a demo for reproducing this issue is difficult for you, do you mind send the game apk to me through email (jianhua.chen@cocos2d-x.org)? I will try to find out what the problem is. Thanks.
Sadly I cannot send the Apk of the game :( the game is currently under development and we can reveal anything about it :(
Do you have a device with 4.2.2 to test the preload? because is very easy to crash the preload on that version of Android, at least the one we currently have.
We really don't know what to do or where to look for.
I am doing a lot of testing on Android devices with multiples Android versions so I really think that there is a problem with AudioEngine on 4.2.2 and with Samsung S6 on 5.1.1
I have 20+ Android devices here to test, I am also testing this on Kindle tablets and phone.
I will keep posting everything I found here.
I recorded a view that shows the crash using a test-app Sadly I am not at the office at this momento and I don't have the code for that app here but is pretty simple.
The app loads around 100 sounds in the init of the scene, each time you touch the cocos image the scene is replaced with a new one and the sounds are being loaded again. Sometimes the crash happen on startup and sometime during a reload of the scene.
This test crash every time on a S4 with 4.2.2
Video: https://drive.google.com/file/d/0B5ZTA8WK-EZLLV9HcVFqZW5DaWs/view?usp=sharing
The crash:
V/BroadcastQueue( 3513): [background] Process cur broadcast BroadcastRecord{23f2ca19 u0 android.intent.action.DROPBOX_ENTRY_ADDED} DELIVERED for app ProcessRecord{22526235 31845:com.samsung.android.sm/1000}
D/CrashAnrDetector( 3513): Build: samsung/zeroltexx/zerolte:5.1.1/LMY47X/G925FXXU3QPA7:user/release-keys
D/CrashAnrDetector( 3513): Hardware: universal7420
D/CrashAnrDetector( 3513): Revision: 10
D/CrashAnrDetector( 3513): Bootloader: G925FXXU3QPA7
D/CrashAnrDetector( 3513): Radio: unknown
D/CrashAnrDetector( 3513): Kernel: Linux version 3.10.61-6925866 (dpi@SWDD5908) (gcc version 4.9 20140514 (prerelease) (GCC) ) #1 SMP PREEMPT Thu Jan 14 15:30:39 KST 2016
D/CrashAnrDetector( 3513):
D/CrashAnrDetector( 3513): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
D/CrashAnrDetector( 3513): Build fingerprint: 'samsung/zeroltexx/zerolte:5.1.1/LMY47X/G925FXXU3QPA7:user/release-keys'
D/CrashAnrDetector( 3513): Revision: '10'
D/CrashAnrDetector( 3513): ABI: 'arm'
D/CrashAnrDetector( 3513): pid: 4456, tid: 4541, name: GLThread 4678 >>> com.ironhidegames.PreloadTest <<<
D/CrashAnrDetector( 3513): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
D/CrashAnrDetector( 3513): r0 00000000 r1 00000000 r2 00000000 r3 00000109
D/CrashAnrDetector( 3513): r4 ee810c08 r5 ee80f400 r6 ee9c3000 r7 f6fc2fc8
D/CrashAnrDetector( 3513): r8 000000ff r9 ee810be8 sl f4974210 fp f6fc2fd8
D/CrashAnrDetector( 3513): ip 00000000 sp dc50b7a0 lr f6f9b889 pc f6f9614a cpsr 600f0030
D/CrashAnrDetector( 3513): d0 0000000000000000 d1 0000000000000000
D/CrashAnrDetector( 3513): d2 0000000000000bdd d3 0000000000000005
D/CrashAnrDetector( 3513): d4 0000000000000be2 d5 0000000000000000
D/CrashAnrDetector( 3513): d6 0000000200000000 d7 3ce31e61d1eb851f
D/CrashAnrDetector( 3513): d8 3e8000003f400000 d9 0000000000000000
D/CrashAnrDetector( 3513): d10 0000000000000000 d11 0000000000000000
D/CrashAnrDetector( 3513): d12 0000000000000000 d13 0000000000000000
D/CrashAnrDetector( 3513): d14 0000000000000000 d15 0000000000000000
D/CrashAnrDetector( 3513): d16 0000000000000000 d17 0000000000000000
D/CrashAnrDetector( 3513): d18 4024000000000000 d19 4024000000000000
D/CrashAnrDetector( 3513): d20 3fc555509d6ae6af d21 405ffde360000000
D/CrashAnrDetector( 3513): d22 400d333340000000 d23 bebbbd388f367055
D/CrashAnrDetector( 3513): d24 3f903ab3ef110182 d25 405ffde360000000
D/CrashAnrDetector( 3513): d26 3ff4798747ae147b d27 400d333340000000
D/CrashAnrDetector( 3513): d28 3ff0000000000000 d29 bfffc5da1fed000f
D/CrashAnrDetector( 3513): d30 3fe62e42fefa39ef d31 4000000000000000
D/CrashAnrDetector( 3513): scr 20000011
D/CrashAnrDetector( 3513):
D/CrashAnrDetector( 3513): backtrace:
D/CrashAnrDetector( 3513): #00 pc 0004a14a /system/lib/libc.so (ifree+665)
D/CrashAnrDetector( 3513): #01 pc 00012d57 /system/lib/libc.so (free+10)
D/CrashAnrDetector( 3513): #02 pc 000017d4 /system/lib/libExynosOMX_Core.so (Exynos_OMX_Component_Unregister+4)
D/CrashAnrDetector( 3513): #03 pc 00001bd8 /system/lib/libExynosOMX_Core.so (Exynos_OMX_Deinit+44)
D/CrashAnrDetector( 3513): #04 pc 00000e51 /system/lib/libstagefrighthw.so (android::ExynosOMXPlugin::~ExynosOMXPlugin()+24)
D/CrashAnrDetector( 3513): #05 pc 00000e7d /system/lib/libstagefrighthw.so (android::ExynosOMXPlugin::~ExynosOMXPlugin()+4)
D/CrashAnrDetector( 3513): #06 pc 00014ea9 /system/lib/libstagefright_omx.so (android::OMXMaster::clearPlugins()+60)
D/CrashAnrDetector( 3513): #07 pc 00014edb /system/lib/libstagefright_omx.so (android::OMXMaster::~OMXMaster()+18)
D/CrashAnrDetector( 3513): #08 pc 00014f2d /system/lib/libstagefright_omx.so (android::OMXMaster::~OMXMaster()+4)
D/CrashAnrDetector( 3513): #09 pc 00013627 /system/lib/libstagefright_omx.so (android::OMX::~OMX()+42)
D/CrashAnrDetector( 3513): #10 pc 000136ad /system/lib/libstagefright_omx.so (android::OMX::~OMX()+4)
D/CrashAnrDetector( 3513): #11 pc 0000ede5 /system/lib/libutils.so (android::RefBase::decStrong(void const*) const+40)
D/CrashAnrDetector( 3513): #12 pc 00072213 /system/lib/libstagefright.so (android::sp<android::IGraphicBufferProducer>::~sp()+18)
D/CrashAnrDetector( 3513): #13 pc 000b3bc1 /system/lib/libstagefright.so (android::MuxOMX::~MuxOMX()+36)
D/CrashAnrDetector( 3513): #14 pc 000b3c01 /system/lib/libstagefright.so (android::MuxOMX::~MuxOMX()+4)
D/CrashAnrDetector( 3513): #15 pc 0000ede5 /system/lib/libutils.so (android::RefBase::decStrong(void const*) const+40)
D/CrashAnrDetector( 3513): #16 pc 00072213 /system/lib/libstagefright.so (android::sp<android::IGraphicBufferProducer>::~sp()+18)
D/CrashAnrDetector( 3513): #17 pc 000b9def /system/lib/libstagefright.so (android::OMXCodec::~OMXCodec()+338)
D/CrashAnrDetector( 3513): #18 pc 000b9e55 /system/lib/libstagefright.so (android::OMXCodec::~OMXCodec()+4)
D/CrashAnrDetector( 3513): #19 pc 0000ede5 /system/lib/libutils.so (android::RefBase::decStrong(void const*) const+40)
D/CrashAnrDetector( 3513): #20 pc 0000beab /system/lib/libwilhelm.so
D/CrashAnrDetector( 3513): #21 pc 0000c6fd /system/lib/libwilhelm.so
D/CrashAnrDetector( 3513): #22 pc 0000d2a7 /system/lib/libwilhelm.so
D/CrashAnrDetector( 3513): #23 pc 0000d2b9 /system/lib/libwilhelm.so
D/CrashAnrDetector( 3513): #24 pc 0000ede5 /system/lib/libutils.so (android::RefBase::decStrong(void const*) const+40)
D/CrashAnrDetector( 3513): #25 pc 0000a0d1 /system/lib/libwilhelm.so
D/CrashAnrDetector( 3513): #26 pc 000141cd /system/lib/libwilhelm.so
D/CrashAnrDetector( 3513): #27 pc 000192b3 /system/lib/libwilhelm.so
D/CrashAnrDetector( 3513): #28 pc 00464329 /data/app/com.ironhidegames.PreloadTest-1/lib/arm/libMyGame.so (cocos2d::experimental::AudioDecoder::decodeToPcm()+3316)
D/CrashAnrDetector( 3513): #29 pc 0046342d /data/app/com.ironhidegames.PreloadTest-1/lib/arm/libMyGame.so (coc
D/CrashAnrDetector( 3513): processName:com.ironhidegames.PreloadTest
D/CrashAnrDetector( 3513): broadcastEvent : com.ironhidegames.PreloadTest SYSTEM_TOMBSTONE
If you could extract out your audio stuff into a simple example project you could avoid the "sending out details" issue. Use a few sounds from http://freesounds.org/ or just leave the file paths blank or with dummy text and post the code or a zip of the helloworld project that crashes in the same way.
I will upload a test case tomorrow morning GTM-3
Sent from my iPhone
On Nov 21, 2016, at 18:34, Steve Tranby notifications@github.com wrote:
If you could extract out your audio stuff into a simple example project you could avoid the "sending out details" issue. Use a few sounds from http://freesounds.org/ or just leave the file paths blank or with dummy text and post the code or a zip of the helloworld project that crashes in the same way.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
Ok: This test crash almost every time on a Galaxy S4 with Android 4.2.2
#include "HelloWorldScene.h"
#include "audio/include/AudioEngine.h"
using namespace cocos2d::experimental;
USING_NS_CC;
Scene* HelloWorld::createScene()
{
// 'scene' is an autorelease object
auto scene = Scene::create();
// 'layer' is an autorelease object
auto layer = HelloWorld::create();
// add layer as a child to scene
scene->addChild(layer);
// return the scene
return scene;
}
// on "init" you need to initialize your instance
bool HelloWorld::init()
{
//////////////////////////////
// 1. super init first
if ( !Layer::init() )
{
return false;
}
Director::getInstance()->getEventDispatcher()->setEnabled(true);
auto visibleSize = Director::getInstance()->getVisibleSize();
Vec2 origin = Director::getInstance()->getVisibleOrigin();
/////////////////////////////
// 2. add a menu item with "X" image, which is clicked to quit the program
// you may modify it.
// add a "close" icon to exit the progress. it's an autorelease object
auto closeItem = MenuItemImage::create(
"CloseNormal.png",
"CloseSelected.png",
CC_CALLBACK_1(HelloWorld::menuCloseCallback, this));
closeItem->setPosition(Vec2(origin.x + visibleSize.width - closeItem->getContentSize().width/2 ,
origin.y + closeItem->getContentSize().height/2));
auto menu = Menu::create(closeItem, NULL);
menu->setPosition(Vec2::ZERO);
this->addChild(menu, 1);
auto restartItem = MenuItemImage::create(
"HelloWorld.png",
"HelloWorld.png",
CC_CALLBACK_1(HelloWorld::menuRestartCallback, this));
restartItem->setPosition(Vec2(visibleSize.width/2 + origin.x, visibleSize.height/2 + origin.y));
// create menu, it's an autorelease object
auto menu2 = Menu::create(restartItem, NULL);
menu2->setPosition(Vec2::ZERO);
this->addChild(menu2, 1);
/////////////////////////////
// 3. add your codes below...
// add a label shows "Hello World"
// create and initialize a label
this->_label = Label::createWithTTF("Preload Test", "fonts/Marker Felt.ttf", 24);
// position the label on the center of the screen
this->_label->setPosition(Vec2(origin.x + visibleSize.width/2,
origin.y + visibleSize.height - this->_label->getContentSize().height));
// add the label as a child to this layer
this->addChild(this->_label, 1);
CCLOG("PRELOAD");
for(int i = 1; i < 102; i++) {
std::stringstream stream;
stream << i;
AudioEngine::preload("sound" + stream.str() + ".ogg");
}
return true;
}
void HelloWorld::menuCloseCallback(Ref* pSender)
{
//Close the cocos2d-x game scene and quit the application
Director::getInstance()->end();
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
exit(0);
#endif
/*To navigate back to native iOS screen(if present) without quitting the application ,do not use Director::getInstance()->end() and exit(0) as given above,instead trigger a custom event created in RootViewController.mm as below*/
//EventCustom customEndEvent("game_scene_close_event");
//_eventDispatcher->dispatchEvent(&customEndEvent);
}
void HelloWorld::menuRestartCallback(Ref* pSender)
{
Director::getInstance()->getEventDispatcher()->setEnabled(false);
this->setColor(Color3B::BLACK);
CCLOG("UNCACHE");
for(int i = 1; i < 102; i++) {
std::stringstream stream;
stream << i;
AudioEngine::uncache("sound" + stream.str() + ".ogg");
}
// create a scene. it's an autorelease object
auto scene = HelloWorld::createScene();
// Create Scene
Director::getInstance()->replaceScene(scene);
}
Here are the sound files so you can download it: https://drive.google.com/file/d/0B5ZTA8WK-EZLZ3dkdnRvRDBPV1E/view?usp=sharing
Here you have the APK: https://drive.google.com/file/d/0B5ZTA8WK-EZLaGhpZ1VWOGVMc2M/view?usp=sharing
Thanks for the help.
@dumganhar didi you have any time to look at this?
Thanks!
Same problem here Samsung Galaxy Grand (Baffin)
@dumganhar did you have time for this? thanks!
There is something wrong with multithreading.
Temporary solution is replace ThreadPool::newCachedThreadPool(1, 8, 5, 2, 2)
by ThreadPool::newSingleThreadPool()
in AudioPlayerProvider.cpp
@formatCvt that worked for you? will try it on monday.
yes, that fix this issue on Samsung Galaxy Grand (Baffin), but i still trying to figure out what is wrong with multithreading.
@pablorealini, sorry for my late reply. I'll check your demo today.
@formatCvt ,
There is something wrong with multithreading. Temporary solution is replace ThreadPool::newCachedThreadPool(1, 8, 5, 2, 2) by ThreadPool::newSingleThreadPool() in AudioPlayerProvider.cpp
So is it possible OpenSLES API isn't multithread-safe implementation?
@dumganhar maybe only on Samsung Galaxy devices, because on other devices multithreading working fine.
@formatCvt
There is something wrong with multithreading. Temporary solution is replace ThreadPool::newCachedThreadPool(1, 8, 5, 2, 2) by ThreadPool::newSingleThreadPool() in AudioPlayerProvider.cpp
This seems to work fine on Galaxy Devices we tested on (S3, S4, S6, S6 Edge)
@pablorealini, @formatCvt ,
Probably, we need to use the third-party ogg decoder (libvorbis) for Android to avoid the multi-thread problems in the implementation of OpenSLES
.
I'll try to implement it.
@dumganhar Sounds good =)
@dumganhar Sound good. Let me know if you find a solution for this, for now @formatCvt workaround seems to work.
@pablorealini @formatCvt ,
I reviewed the source code of
, I found this code:
//...
static EXYNOS_OMX_COMPONENT_REGLIST *gComponentList = NULL;
//...
OMX_API OMX_ERRORTYPE OMX_APIENTRY Exynos_OMX_Deinit(void)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
FunctionIn();
Exynos_OSAL_MutexTerminate(ghLoadComponentListMutex);
ghLoadComponentListMutex = NULL;
Exynos_OMX_ResourceManager_Deinit();
if (OMX_ErrorNone != Exynos_OMX_Component_Unregister(gComponentList)) {
ret = OMX_ErrorUndefined;
goto EXIT;
}
gComponentList = NULL;
gComponentNum = 0;
gInitialized = 0;
EXIT:
FunctionOut();
return ret;
}
OMX_ERRORTYPE Exynos_OMX_Component_Unregister(EXYNOS_OMX_COMPONENT_REGLIST *componentList)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
Exynos_OSAL_Free(componentList);
EXIT:
return ret;
}
Exynos_OMX_Deinit
may be invoked in different threads while destroying OPENSLES player object could be invoked by different threads at the same time.
So gComponentList
may be free
multiple times by thread racing.
Samsung stagefrighthw plugin
.I finally found a better workaround, that's adding thread lock while realizing and destroying OpenSLES Player object. I have tested a lot, and didn't find crash any more. Pull Request is on the way.
UPDATE: Pull Request is here https://github.com/cocos2d/cocos2d-x/pull/17049
@pablorealini , @formatCvt , please help to test and be sure that you have enable multithread decoding(I mean to revert code to ThreadPool::newCachedThreadPool(1, 8, 5, 2, 2)).
That's great! I will help test this tomorrow morning in all our Samsung devices.
Sent from my iPhone
On Dec 21, 2016, at 00:57, James Chen notifications@github.com wrote:
UPDATE: Pull Request is here #17049
@pablorealini , @formatCvt , please help to test and be sure that you have enable multithread decoding(I means to revert code to ThreadPool::newCachedThreadPool(1, 8, 5, 2, 2)).
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
thanks, but doesn't help (Samsung Galaxy Grand). I submitted review with changes, but with my changes it's look like a fake multitherading =)
@dumganhar we tested your change with the revert to (ThreadPool::newCachedThreadPool(1, 8, 5, 2, 2))) on galaxy s3, s4 and s6 edge and is working.
@bolso80, good to know it works for you.
But @formatCvt still get problem on Samsung Galaxy Grand
.
@bolso80 , did you have a Samsung Galaxy Grand to test?
@formatCvt , did the crash stack on your Samsung Galaxy Grand
the same as @bolso80 and @formatCvt got?
I just wanna confirm that whether it's the same issue.
Hmm, may be you are right and this is a different issue.
I have two types of crash (both with and without patch from pull request #17049 ):
D/CrashAnrDetector( 549): Build: samsung/baffinxx/baffin:4.2.2/JDQ39/I9082XXUBNA4:user/release-keys
D/CrashAnrDetector( 549): Hardware: capri
D/CrashAnrDetector( 549): Revision: 5
D/CrashAnrDetector( 549): Bootloader: unknown
D/CrashAnrDetector( 549): Radio: unknown
D/CrashAnrDetector( 549): Kernel: Linux version 3.0.31-1226815 (se.infra@R0210-09) (gcc version 4.6.x-google 20120106 (prerelease) (GCC) ) #1 SMP PREEMPT Wed Jan 22 11:25:54 KST 2014
D/CrashAnrDetector( 549):
D/CrashAnrDetector( 549): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
D/CrashAnrDetector( 549): Build fingerprint: 'samsung/baffinxx/baffin:4.2.2/JDQ39/I9082XXUBNA4:user/release-keys'
D/CrashAnrDetector( 549): Revision: '5'
D/CrashAnrDetector( 549): pid: 18945, tid: 18983, name: Thread-10578 >>> com.hatedonate.lift <<<
D/CrashAnrDetector( 549): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000
D/CrashAnrDetector( 549): r0 00000000 r1 00000000 r2 00010460 r3 00000000
D/CrashAnrDetector( 549): r4 00000000 r5 00000000 r6 00000000 r7 00000000
D/CrashAnrDetector( 549): r8 00000000 r9 4e118e2c sl 4c3f9665 fp 00000016
D/CrashAnrDetector( 549): ip 00000000 sp 57a72970 lr 00000000 pc 40160eac cpsr 20000050
D/CrashAnrDetector( 549): d0 656c6c6163203a5d d1 6d6f635f657a696c
D/CrashAnrDetector( 549): d2 3a7070632e72656b d3 696c203a29363437
D/CrashAnrDetector( 549): d4 3ce551eb82c00000 d5 4037000000000000
D/CrashAnrDetector( 549): d6 4974240000000000 d7 fffffffd00000000
D/CrashAnrDetector( 549): d8 0000000000000000 d9 0000000000000000
D/CrashAnrDetector( 549): d10 0000000000000000 d11 0000000000000000
D/CrashAnrDetector( 549): d12 0000000000000000 d13 0000000000000000
D/CrashAnrDetector( 549): d14 0000000000000000 d15 0000000000000000
D/CrashAnrDetector( 549): d16 3feffff898000000 d17 3f27fc7600000000
D/CrashAnrDetector( 549): d18 3d50a7fffe260000 d19 3fe0000000000000
D/CrashAnrDetector( 549): d20 3fe0000000000854 d21 bf800000bf825ddf
D/CrashAnrDetector( 549): d22 0000000000000000 d23 00000000c1a17aab
D/CrashAnrDetector( 549): d24 000000004038c089 d25 0000000000000000
D/CrashAnrDetector( 549): d26 3fddb3d800000000 d27 0000000000000000
D/CrashAnrDetector( 549): d28 0000000000000000 d29 bf800000bf825ddf
D/CrashAnrDetector( 549): d30 c42d3481c42d3480 d31 442cebae442b1258
D/CrashAnrDetector( 549): scr 20000010
D/CrashAnrDetector( 549):
D/CrashAnrDetector( 549): backtrace:
D/CrashAnrDetector( 549): #00 pc 00018eac /system/lib/libc.so (memset+148)
D/CrashAnrDetector( 549): #01 pc 00001730 /system/lib/libsomxcore.so (SEC_OMX_Component_Unregister+20)
D/CrashAnrDetector( 549):
D/CrashAnrDetector( 549): stack:
D/CrashAnrDetector( 549): 57a72930 00000047
D/CrashAnrDetector( 549): 57a72934 00000047
D/CrashAnrDetector( 549): 57a72938 4e11a510
D/CrashAnrDetector( 549): 57a7293c 40154f25 /system/lib/libc.so (free+12)
D/CrashAnrDetector( 549): 57a72940 00000000
D/CrashAnrDetector( 549): 57a72944 401d62af /system/lib/libutils.so (android::SharedBuffer::release(unsigned int) const+34)
D/CrashAnrDetector( 549): 57a72948 c0000000
D/CrashAnrDetector( 549): 57a7294c 00000000
D/CrashAnrDetector( 549): 57a72950 00000000
D/CrashAnrDetector( 549): 57a72954 00000000
D/CrashAnrDetector( 549): 57a72958 00000002
D/CrashAnrDetector( 549): 57a7295c 4d4b8018 /system/lib/libBrcmOMX_Core.so
D/CrashAnrDetector( 549): 57a72960 40095cc0
D/CrashAnrDetector( 549): 57a72964 00004000
D/CrashAnrDetector( 549): 57a72968 df0027ad
D/CrashAnrDetector( 549): 57a7296c 00000000
D/CrashAnrDetector( 549): #00 57a72970 00000000
D/CrashAnrDetector( 549): 57a72974 00000000
D/CrashAnrDetector( 549): 57a72978 4e10c93c
D/CrashAnrDetector( 549): 57a7297c 4e119f90
D/CrashAnrDetector( 549): 57a72980 00000000
D/CrashAnrDetector( 549): 57a72984 4c2ee734 /system/lib/libsomxcore.so (SEC_OMX_Component_Unregister+24)
D/CrashAnrDetector( 549): #01 57a72988 4c2f0a70 /system/lib/libsomxcore.so
D/CrashAnrDetector( 549):
D/CrashAnrDetector( 549): memory near r2:
D/CrashAnrDetector( 549): 00010440 ffffffff ffffffff ffffffff ffffffff
D/CrashAnrDetector( 549): 00010450 ffffffff ffffffff ffffffff ffffffff
D/CrashAnrDetector( 549): 00010460 ffffffff ffffffff ffffffff ffffffff
D/CrashAnrDetector( 549): 00010470 ffffffff ffffffff ffffffff ffffffff
D/CrashAnrDetector( 549): 00010480 ffffffff ffffffff ffffffff ffffffff
D/CrashAnrDetector( 549): 00010490 ffffffff ffffffff ffffffff ffffffff
D/CrashAnrDetector( 549): 000104a0 ffffffff ffffffff ffffffff ffffffff
D/CrashAnrDetector( 549): 000104b0 ffffffff ffffffff ffffffff ffffffff
D/CrashAnrDetector( 549): 000104c0 ffffffff ffffffff ffffffff ffffffff
D/CrashAnrDetector( 549): 000104d0 ffffffff ffffffff ffffffff ffffffff
D/CrashAnrDetector( 549): 000104e0 ffffffff ffffffff ffffffff ffffffff
D/CrashAnrDetector( 549): 000104f0 ffffffff ffffffff ffffffff ffffffff
D/CrashAnrDetector( 549): 00010500 ffffffff ffffffff ffffffff ffffffff
D/CrashAnrDetector( 549): 00010510 ffffffff ffffffff ffffffff ffffffff
D/CrashAnrDetector( 549): 00010520 ffffffff ffffffff ffffffff ffffffff
D/CrashAnrDetector( 549): 00010530 ffffffff ffffffff ffffffff ffffffff
D/CrashAnrDetector( 549):
D/CrashAnrDetector( 549): memory near r9:
D/CrashAnrDetector( 549): 4e118e0c 4c39d940 00000000 401e06f8 00000000
D/CrashAnrDetector( 549): 4e118e1c 00000000 00000007 00000004 00000000
D/CrashAnrDetector( 549): 4e118e2c 4dc34aa0 4c39da18 00000000 401e06f8
D/CrashAnrDetector( 549): 4e118e3c 00000000 00000000 00000000 00000018
D/CrashAnrDetector( 549): 4e118e4c 401e06f8 00000000 00000000 00000000
D/CrashAnrDetector( 549): 4e118e5c 00000018 00000000 00000000 00000100
D/CrashAnrDetector( 549): 4e118e6c fffffc0d 00000001 00000000 ffffffff
D/CrashAnrDetector( 549): 4e118e7c ffffffff 00000002 00000000 ffffffff
D/CrashAnrDetector( 549): 4e118e8c ffffffff 00000000 00000000 00000000
D/CrashAnrDetector( 549): 4e118e9c dead10cc deadc04d 00000000 00000000
D/CrashAnrDetector( 549): 4e118eac 00000000 000
D/CrashAnrDetector( 549): processName:com.hatedonate.lift
D/CrashAnrDetector( 549): broadcastEvent : com.hatedonate.lift SYSTEM_TOMBSTONE
and
D/CrashAnrDetector( 549): Build: samsung/baffinxx/baffin:4.2.2/JDQ39/I9082XXUBNA4:user/release-keys
D/CrashAnrDetector( 549): Hardware: capri
D/CrashAnrDetector( 549): Revision: 5
D/CrashAnrDetector( 549): Bootloader: unknown
D/CrashAnrDetector( 549): Radio: unknown
D/CrashAnrDetector( 549): Kernel: Linux version 3.0.31-1226815 (se.infra@R0210-09) (gcc version 4.6.x-google 20120106 (prerelease) (GCC) ) #1 SMP PREEMPT Wed Jan 22 11:25:54 KST 2014
D/CrashAnrDetector( 549):
D/CrashAnrDetector( 549): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
D/CrashAnrDetector( 549): Build fingerprint: 'samsung/baffinxx/baffin:4.2.2/JDQ39/I9082XXUBNA4:user/release-keys'
D/CrashAnrDetector( 549): Revision: '5'
D/CrashAnrDetector( 549): pid: 20961, tid: 20992, name: ALooper >>> com.hatedonate.lift <<<
D/CrashAnrDetector( 549): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 847ec5d8
D/CrashAnrDetector( 549): r0 00000000 r1 00000001 r2 4db2ed73 r3 4db2ed72
D/CrashAnrDetector( 549): r4 0000001c r5 4db31010 r6 4db2eba2 r7 4db30ce8
D/CrashAnrDetector( 549): r8 0000004a r9 4db2ed8b sl 00004842 fp 40193228
D/CrashAnrDetector( 549): ip 4db3103c sp 57372b60 lr 4db2c7ef pc 4db2c802 cpsr 000d0030
D/CrashAnrDetector( 549): d0 726170732e726564 d1 6f6365642e346376
D/CrashAnrDetector( 549): d2 6e20226f732e786d d3 646e756f6620746f
D/CrashAnrDetector( 549): d4 3ce6000002000000 d5 4037000000000000
D/CrashAnrDetector( 549): d6 4026000000000000 d7 0000000000000000
D/CrashAnrDetector( 549): d8 0000000000000000 d9 0000000000000000
D/CrashAnrDetector( 549): d10 0000000000000000 d11 0000000000000000
D/CrashAnrDetector( 549): d12 0000000000000000 d13 0000000000000000
D/CrashAnrDetector( 549): d14 0000000000000000 d15 0000000000000000
D/CrashAnrDetector( 549): d16 0000000000076381 d17 0000000000000f15
D/CrashAnrDetector( 549): d18 3fdffffffffffe48 d19 3fe0000000000000
D/CrashAnrDetector( 549): d20 3fe00000000000dc d21 bf800000bf825ddf
D/CrashAnrDetector( 549): d22 0000000000000000 d23 00000000c1a17aab
D/CrashAnrDetector( 549): d24 000000004038c089 d25 0000000000000000
D/CrashAnrDetector( 549): d26 3fddb3d800000000 d27 0000000000000000
D/CrashAnrDetector( 549): d28 0000000000000000 d29 bf800000bf825ddf
D/CrashAnrDetector( 549): d30 c42d3481c42d3480 d31 442cebae442b1258
D/CrashAnrDetector( 549): scr 20000010
D/CrashAnrDetector( 549):
D/CrashAnrDetector( 549): backtrace:
D/CrashAnrDetector( 549): #00 pc 00002802 /system/lib/libstagefrighthw.so (android::createLegacyOMXPlugin()+109)
D/CrashAnrDetector( 549): #01 pc 00002d6f /system/lib/libstagefrighthw.so (android::BrcmOmxPluginNew::BrcmOmxPluginNew()+42)
D/CrashAnrDetector( 549): #02 pc 00002e6b /system/lib/libstagefrighthw.so (android::createOMXPlugin()+10)
D/CrashAnrDetector( 549): #03 pc 0000df4b /system/lib/libstagefright_omx.so (android::OMXMaster::addPlugin(char const*)+38)
D/CrashAnrDetector( 549): #04 pc 0000df6d /system/lib/libstagefright_omx.so (android::OMXMaster::addVendorPlugin()+8)
D/CrashAnrDetector( 549): #05 pc 0000dfff /system/lib/libstagefright_omx.so (android::OMXMaster::OMXMaster()+106)
D/CrashAnrDetector( 549): #06 pc 0000c8a3 /system/lib/libstagefright_omx.so (android::OMX::OMX()+110)
D/CrashAnrDetector( 549): #07 pc 00084c9b /system/lib/libstagefright.so (android::MuxOMX::allocateNode(char const*, android::sp<android::IOMXObserver> const&, void**)+54)
D/CrashAnrDetector( 549): #08 pc 0008b811 /system/lib/libstagefright.so (android::OMXCodec::Create(android::sp<android::IOMX> const&, android::sp<android::MetaData> const&, bool, android::sp<android::MediaSource> const&, char const*, unsigned int, android::sp<ANativeWindow> const&)+696)
D/CrashAnrDetector( 549): #09 pc 0000d3bd /system/lib/libwilhelm.so
D/CrashAnrDetector( 549): #10 pc 0000ee15 /system/lib/libwilhelm.so
D/CrashAnrDetector( 549): #11 pc 00007439 /system/lib/libstagefright_foundation.so (android::ALooperRoster::deliverMessage(android::sp<android::AMessage> const&)+188)
D/CrashAnrDetector( 549): #12 pc 00006ced /system/lib/libstagefright_foundation.so (android::ALooper::loop()+204)
D/CrashAnrDetector( 549): #13 pc 0001146b /system/lib/libutils.so (android::Thread::_threadLoop(void*)+94)
D/CrashAnrDetector( 549): #14 pc 00010fe5 /system/lib/libutils.so
D/CrashAnrDetector( 549): #15 pc 0000e3e8 /system/lib/libc.so (__thread_entry+72)
D/CrashAnrDetector( 549): #16 pc 0000dad4 /system/lib/libc.so (pthread_create+160)
D/CrashAnrDetector( 549):
D/CrashAnrDetector( 549): stack:
D/CrashAnrDetector( 549): 57372b20 00000055
D/CrashAnrDetector( 549): 57372b24 00000000
D/CrashAnrDetector( 549): 57372b28 57372b90
D/CrashAnrDetector( 549): 57372b2c 57372aec
D/CrashAnrDetector( 549): 57372b30 4008e568 /system/bin/linker
D/CrashAnrDetector( 549): 57372b34 00000000
D/CrashAnrDetector( 549): 57372b38 57372bfc
D/CrashAnrDetector( 549): 57372b3c 00000000
D/CrashAnrDetector( 549): 57372b40 0000001c
D/CrashAnrDetector( 549): 57372b44 4db30ce8 /system/lib/libstagefrighthw.so
D/CrashAnrDetector( 549): 57372b48 0000004a
D/CrashAnrDetector( 549): 57372b4c 57372b5c
D/CrashAnrDetector( 549): 57372b50 4db2c7ef /system/lib/libstagefrighthw.so (android::createLegacyOMXPlugin()+90)
D/CrashAnrDetector( 549): 57372b54 80884b00
D/CrashAnrDetector( 549): 57372b58 df0027ad
D/CrashAnrDetector( 549): 57372b5c 00000000
D/CrashAnrDetector( 549): #00 57372b60 00000006
D/CrashAnrDetector( 549): 57372b64 2e584d4f
D/CrashAnrDetector( 549): 57372b68 4d435242
D/CrashAnrDetector( 549): 57372b6c 3463762e
D/CrashAnrDetector( 549): 57372b70 6365642e
D/CrashAnrDetector( 549): 57372b74
D/CrashAnrDetector( 549): processName:com.hatedonate.lift
D/CrashAnrDetector( 549): broadcastEvent : com.hatedonate.lift SYSTEM_TOMBSTONE
@formatCvt, thanks for your feedback. I will try to refactor decoding thing for android. For first test, decoding ogg by third-party library will improve performance by twice, I mean time cost will be half.
I will continue to investigate and let you know.
@pablorealini , @formatCvt
We are trying to decoding audio files by ourself rather than OpenSLES API. Since on android, using OpenSLES API to decode ogg, mp3 to pcm buffer will cause bundle of system issues that we can't fix.
I have submitted a pull request for this (#17233) Could you have a try and give me feedback.
thanks, i will try next week
Great! We will test this early next week in all our android devices and let you know
Sent from my iPhone
On Jan 20, 2017, at 08:36, Andrew V. Belousoff notifications@github.com wrote:
thanks, i will try next week
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
@pablorealini what about your test results?
@formatCvt
We merged this fix on 3.14 and test it with @pablorealini in some devices and we dont have any crashes at the moment.
Hi @dumganhar
When we preload sounds with AudioEngine on android we have a random crash. It only happens on a Samsung Galaxy S6 Edge. We are preloading between 80 to 100 ogg, if we don't preload and play the sounds we don't have any crash but we have a lot of delay trying to play a sound, also the game freeze for some frames.
This is new for us since we updated to version 3.13.1 recently.
Thanks for the help!
This is the crash:
V/AudioDecoder(30916): decodeToPcmCallback ...
V/AudioDecoder(30916): resample() 86400 output frames
V/AudioDecoder(30916): outFrames: 172800
V/AudioDecoder(30916): resample() complete
V/AudioDecoder(30916): reset() complete
V/AudioResampler(30916): resampler load 12 -> 6 MHz due to delta -6 MHz from quality 2
V/AudioDecoder(30916): decodeToPcmCallback ...
I/DEBUG ( 2961):
I/DEBUG ( 2961): Build fingerprint: 'samsung/zeroltexx/zerolte:5.1.1/LMY47X/G925FXXU3QPA7:user/release-keys'
I/DEBUG ( 2961): Revision: '10'
I/DEBUG ( 2961): ABI: 'arm'
I/DEBUG ( 2961): pid: 30916, tid: 31214, name: GLThread 2674 >>> com.ironhidegames.kingdomrushx <<<
I/DEBUG ( 2961): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x7bdef7bd
I/DEBUG ( 2961): r0 5294a529 r1 f4c00000 r2 4a5294a5 r3 00000109
I/DEBUG ( 2961): r4 ee812808 r5 ee811000 r6 d856d000 r7 f6fc2fc8
I/DEBUG ( 2961): r8 000000ff r9 ee8127e8 sl ee849bd0 fp f6fc2fd8
I/DEBUG ( 2961): ip f6fb67cc sp d3151d50 lr f6f95fcf pc f6f9614a cpsr 200f0030
I/DEBUG ( 2961):
I/DEBUG ( 2961): backtrace:
I/DEBUG ( 2961): #00 pc 0004a14a /system/lib/libc.so (ifree+665)
I/DEBUG ( 2961): #01 pc 00012d57 /system/lib/libc.so (free+10)
I/DEBUG ( 2961): #02 pc 000017d4 /system/lib/libExynosOMX_Core.so (Exynos_OMX_Component_Unregister+4)
I/DEBUG ( 2961): #03 pc 00001bd8 /system/lib/libExynosOMX_Core.so (Exynos_OMX_Deinit+44)
I/DEBUG ( 2961): #04 pc 00000e51 /system/lib/libstagefrighthw.so (android::ExynosOMXPlugin::~ExynosOMXPlugin()+24)
I/DEBUG ( 2961): #05 pc 00000e7d /system/lib/libstagefrighthw.so (android::ExynosOMXPlugin::~ExynosOMXPlugin()+4)
I/DEBUG ( 2961): #06 pc 00014ea9 /system/lib/libstagefright_omx.so (android::OMXMaster::clearPlugins()+60)
I/DEBUG ( 2961): #07 pc 00014edb /system/lib/libstagefright_omx.so (android::OMXMaster::~OMXMaster()+18)
I/DEBUG ( 2961): #08 pc 00014f2d /system/lib/libstagefright_omx.so (android::OMXMaster::~OMXMaster()+4)
I/DEBUG ( 2961): #09 pc 00013627 /system/lib/libstagefright_omx.so (android::OMX::~OMX()+42)
I/DEBUG ( 2961): #10 pc 000136ad /system/lib/libstagefright_omx.so (android::OMX::~OMX()+4)
I/DEBUG ( 2961): #11 pc 0000ede5 /system/lib/libutils.so (android::RefBase::decStrong(void const*) const+40)
I/DEBUG ( 2961): #12 pc 00072213 /system/lib/libstagefright.so (android::sp::~sp()+18)
I/DEBUG ( 2961): #13 pc 000b3bc1 /system/lib/libstagefright.so (android::MuxOMX::~MuxOMX()+36)
I/DEBUG ( 2961): #14 pc 000b3c01 /system/lib/libstagefright.so (android::MuxOMX::~MuxOMX()+4)
I/DEBUG ( 2961): #15 pc 0000ede5 /system/lib/libutils.so (android::RefBase::decStrong(void const*) const+40)
I/DEBUG ( 2961): #16 pc 00072213 /system/lib/libstagefright.so (android::sp::~sp()+18)
I/DEBUG ( 2961): #17 pc 000b9def /system/lib/libstagefright.so (android::OMXCodec::~OMXCodec()+338)
I/DEBUG ( 2961): #18 pc 000b9e55 /system/lib/libstagefright.so (android::OMXCodec::~OMXCodec()+4)
I/DEBUG ( 2961): #19 pc 0000ede5 /system/lib/libutils.so (android::RefBase::decStrong(void const*) const+40)
I/DEBUG ( 2961): #20 pc 0000beab /system/lib/libwilhelm.so
I/DEBUG ( 2961): #21 pc 0000c6fd /system/lib/libwilhelm.so
I/DEBUG ( 2961): #22 pc 0000d2a7 /system/lib/libwilhelm.so
I/DEBUG ( 2961): #23 pc 0000d2b9 /system/lib/libwilhelm.so
I/DEBUG ( 2961): #24 pc 0000ede5 /system/lib/libutils.so (android::RefBase::decStrong(void const*) const+40)
I/DEBUG ( 2961): #25 pc 0000a0d1 /system/lib/libwilhelm.so
I/DEBUG ( 2961): #26 pc 000141cd /system/lib/libwilhelm.so
I/DEBUG ( 2961): #27 pc 000192b3 /system/lib/libwilhelm.so
I/DEBUG ( 2961): #28 pc 009de3d3 /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so (cocos2d::experimental::AudioDecoder::decodeToPcm()+8146)
I/DEBUG ( 2961): #29 pc 009dbdb5 /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so (cocos2d::experimental::AudioDecoder::start()+52)
I/DEBUG ( 2961): #30 pc 0098dd9b /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so
I/DEBUG ( 2961): #31 pc 009a3125 /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so
I/DEBUG ( 2961): #32 pc 009a02d9 /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so
I/DEBUG ( 2961): #33 pc 0076faeb /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so (std::__ndk1::function<void (int)>::operator()(int) const+82)
I/DEBUG ( 2961): #34 pc 009d126b /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so
I/DEBUG ( 2961): #35 pc 009db8b1 /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so
I/DEBUG ( 2961): #36 pc 009db821 /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so
I/DEBUG ( 2961): #37 pc 0076faeb /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so (std::__ndk1::function<void (int)>::operator()(int) const+82)
I/DEBUG ( 2961): #38 pc 009d1e7b /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so
I/DEBUG ( 2961): #39 pc 009d615d /data/app/com.ironhidegames.kingdomrushx-1/lib/arm/libcocos2dcpp.so
I/DEBUG ( 2961): #40 pc 000174e7 /system/lib/libc.so (__pthread_start(void*)+30)
I/DEBUG ( 2961): #41 pc 00015503 /system/lib/libc.so (__start_thread+6)