Android performance issue

Hi all,

I found many developers reported Android performance issue on Android, such as this ticket. But many tickets are outdated or did not provide a method to reproduce it. So i created an issue here to collect needed informations and try to fix it.

You are appreciated if you can add a comment there with needed information:

  • cocos2d-x version
  • the Android device information
    • Android OS version
    • device type
  • how to reproduce the performance issue

Thanks.

1 Like

Run cpp-tests on Xiaomi4 with Android 6.0.1, its resolution is 1920*1080. Its FPS is 59-60, not performance issue.

I’ve left a comment on GitHub, but I’ll post it here too:

I have the performance issues on my game and it appears to be something to do with SimpleAudioEngine?

My game makes a sound every time you tap the screen. When tapping the screen on an Android 6 device, the game stutters quite badly. I found that disabling the sound effects (but leaving the background music playing) stops all stuttering and the game runs at a smooth 60fps.

Cocos2D-X 3.10
Android 6.0
Device: Elephone P9000

The game works fine on my Android 5.1 Amazon Fire tablet, which is a much lower spec device.

Thanks @KentuckyFriedKermit.

Android rendering performance issue is fixed in v3.12. Android audio performance issue is fixed in https://github.com/cocos2d/cocos2d-x/pull/15875. Would you please take a try and give some feedback? Thanks.

Hello guys,

I’m facing an issue with blurry pixels, either I use :
sprice_image.getTexture().setAntiAliasTexParameters();
or
sprice_image.getTexture().setAliasTexParameters();

The images (all the images) of my android app are blurry, here’s a comparison between mine and one from Play Store.
My App (BLURRY).

I have used same graphics to show you the difference, I won’t use them on my official APP (I redesigned all of them myself)

cocos2d-x set 3D projection by default, so all your sprites scaled a bit with perspective matrix, try to set 2D projection:
Director::getInstance()->setProjection(Director::Projection::_2D);

@anglevet yep, cocos2d-x uses perspective projection by default, but the default one should have the same effect as 2d projection if the z value is 0.

My game crash randomly in android. After I analysed the dump message, I
found a strange log.Before crashed the function WebPSafeCalloc was called.It’s strange because I dont have any webp format image and I found that the function WebPSafeCalloc was defiended in marmalade which I never used. Here is the dump message.
version :cocos2d-x 2.2.3

Crash reason: SIGSEGV
Crash address: 0x9cb05020
Process uptime: not available

Thread 16 (crashed)
0 0x9cb05020
r0 = 0x28000000 r1 = 0x41835cb2 r2 = 0x00000000 r3 = 0x00000000
r4 = 0x9dfc8e08 r5 = 0x41835cb2 r6 = 0xa15cfbe0 r7 = 0x00000fff
r8 = 0x9dfcb9f0 r9 = 0x8f61a9f8 r10 = 0x9dfc8ea0 r12 = 0xab06b964
fp = 0x28000000 sp = 0x9e9fb758 lr = 0x9e2b5ae0 pc = 0x9cb05020
Found by: given as instruction pointer in context
1 dalvik-main space (deleted) + 0x153ffffe
sp = 0x9e9fb768 pc = 0x28000000
Found by: stack scanning
2 dalvik-main space (deleted) + 0x2ec35cb0
sp = 0x9e9fb76c pc = 0x41835cb2
Found by: stack scanning
3 libcocos2dlua.so!luaopen_string + 0x7ea
sp = 0x9e9fb7c0 pc = 0x9f783318
Found by: stack scanning
4 libcocos2dlua.so!luaopen_string + 0x99e
sp = 0x9e9fb7d0 pc = 0x9f7834cc
Found by: stack scanning
5 libcocos2dlua.so!luaopen_string + 0xb12
sp = 0x9e9fb7f0 pc = 0x9f783640
Found by: stack scanning
6 libcocos2dlua.so!luaopen_string + 0xac2
sp = 0x9e9fb7f4 pc = 0x9f7835f0
Found by: stack scanning
7 libcocos2dlua.so!WebPSafeCalloc + 0x1f0d
sp = 0x9e9fb800 pc = 0x9f73c954
Found by: stack scanning
8 dalvik-alloc space (deleted) + 0x3991e
sp = 0x9e9fb828 pc = 0x78dd4920
Found by: stack scanning
9 dalvik-alloc space (deleted) + 0x73dbe
sp = 0x9e9fb82c pc = 0x78e0edc0
Found by: stack scanning
10 libcocos2dlua.so!lua_pcall + 0x46
sp = 0x9e9fb840 pc = 0x9f749b58
Found by: stack scanning
11 libcocos2dlua.so!_ZN7cocos2d10CCLuaStack15executeFunctionEi + 0x14a
sp = 0x9e9fb850 pc = 0x9f427d2c
Found by: stack scanning
12 libcocos2dlua.so!_ZN7cocos2d10CCLuaStack21pushFunctionByHandlerEi + 0x3a
sp = 0x9e9fb860 pc = 0x9f427b98
Found by: stack scanning
13 libcocos2dlua.so!_ZN7cocos2d10CCLuaStack24executeFunctionByHandlerEii + 0x8a
sp = 0x9e9fb870 pc = 0x9f427f0c
Found by: stack scanning
14 libcocos2dlua.so!__udivdi3 + 0xbe876
sp = 0x9e9fb874 pc = 0x9f958d48
Found by: stack scanning
15 libcocos2dlua.so!_ZN26LuaCocoStudioEventListener17eventCallbackFuncEPN7cocos2d8CCObjectEi + 0xae
sp = 0x9e9fb890 pc = 0x9f55ac60
Found by: stack scanning
16 libcocos2dlua.so!_ZN7cocos2d3gui6Widget14releaseUpEventEv + 0xbe
sp = 0x9e9fb8b0 pc = 0x9f63d9dc
Found by: stack scanning
17 libcocos2dlua.so!_ZN7cocos2d3gui6Widget12onTouchEndedEPNS_7CCTouchEPNS_7CCEventE + 0xae
sp = 0x9e9fb8c0 pc = 0x9f63d744
Found by: stack scanning
18 dalvik-main space (deleted) + 0x31789dd0
sp = 0x9e9fb8dc pc = 0x44389dd2
Found by: stack scanning
19 dalvik-main space (deleted) + 0x2fc5a4ff
sp = 0x9e9fb8e0 pc = 0x4285a501
Found by: stack scanning
20 libcocos2dlua.so!__udivdi3 + 0x174526
sp = 0x9e9fb8e8 pc = 0x9fa0e9f8
Found by: stack scanning
21 libcocos2dlua.so!_ZN7cocos2d3gui10TouchGroup12ccTouchEndedEPNS_7CCTouchEPNS_7CCEventE + 0x86
sp = 0x9e9fb8f0 pc = 0x9f645acc
Found by: stack scanning
22 libcocos2dlua.so!_ZN7cocos2d17CCTouchDispatcher7touchesEPNS_5CCSetEPNS_7CCEventEj + 0x2aa
sp = 0x9e9fb918 pc = 0x9f419ac4
Found by: stack scanning
23 dalvik-main space (deleted) + 0x17733223
sp = 0x9e9fb954 pc = 0x2a333225
Found by: stack scanning
24 libcocos2dlua.so!_ZN7cocos2d17CCTouchDispatcher12touchesEndedEPNS_5CCSetEPNS_7CCEventE + 0x3a
sp = 0x9e9fb990 pc = 0x9f41a164
Found by: stack scanning
25 libcocos2dlua.so!ZN7cocos2d17CCEGLViewProtocol16handleTouchesEndEiPiPfS2 + 0x7e
sp = 0x9e9fb9a8 pc = 0x9f3c2074
Found by: stack scanning
26 libcocos2dlua.so!__udivdi3 + 0x15520e
sp = 0x9e9fb9c4 pc = 0x9f9ef6e0
Found by: stack scanning
27 libcocos2dlua.so!Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeTouchesEnd + 0x5a
sp = 0x9e9fb9e0 pc = 0x9f3c9b08
Found by: stack scanning
28 dalvik-alloc space (deleted) + 0x3991e
sp = 0x9e9fb9e8 pc = 0x78dd4920
Found by: stack scanning

Sorry, v2.2.3 is a too old version. We don’t have resource to support it.

“Android rendering performance issue is fixed in v3.12.”
How can I get the details ,and How can I update my project to this version? from 3.11.

And I found another Android performance issue:
Most of Android phone has a HD resolution screen(eg 1080p),but the GPU is so bad.
As a 3-D game,it is very hard to running @60fps @1080p.And we need not at all.
I hope to rendering with Just 720p or any other size .
“setDesignResolutionSize” is useless for this problem.
Sorry about my poor English ,Hope you can see what i mean…
In CN cocos forum, No one reply me about this

I had solved this problem, :wink: see here (CN) forum.cocos.com/t/cocos2d-x/43743/4

1 Like

is error! help me!thinks