imkira/unity-sysfont

demo crash android

eddieKayac opened this issue · 7 comments

hi
the demo crash after 30 seconds on android Nexus one and htc desire
no problem on the samsung galaxy s
(seem to no crashing in landscape)

08-16 18:13:31.657: E/InputDispatcher(1360): channel '40bc24f0 com.test.nguisysfont/com.unity3d.player.UnityPlayerNativeActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x8
08-16 18:13:31.657: E/InputDispatcher(1360): channel '40bc24f0 com.test.nguisysfont/com.unity3d.player.UnityPlayerNativeActivity (server)' ~ Channel is unrecoverably broken and will be disposed!

the fps counter seems to be the problem . to much sys font refresh on updates

Hello Eddie, I don't think there is a problem with the FPS counter at all regarding refreshing "too much" (it only refreshes twice a second). Anyway, I have investigated this issue and it appears the problem is related to some buggy OpenGL drivers for Adreno 200 (both of which are present in the devices you specified) not handling texture memory correctly (like reading texture memory out-of-bounds). I could make a work around but I currently have no android device with the Adreno 200.

I have read in other projects that a way to work it around would be to use PowerOfTwo textures, which is what unity-sysfont is already using, so that would not be the cause. I am wondering if using GL_ALPHA textures is the cause for the random crash.

If you feel adventurous enough, you can change the Bitmap.Config.ALPHA_8 to Bitmap.Config.ARGB_8888 at android/src/com/github/imkira/unitysysfont/TextureUpdate.java

After that you can recompile Sysfont.jar file by typing:

rake build:android

and overwrite the Sysfont.jar file inside unity with the newly compiled one at android/bin/SysFont.jar.

i didn t tes the alpha things but the bug was only in the demo scene.
in the fps counter there is Application.targetFrameRate = 300; who is the problem for android devices and make them crash after few minutes

Are you telling me the bug is related to the Application.targetFrameRate = 300instruction?
I mean, if you remove all unity-sysfont labels and let the app with the Application.targetFrameRate = 300 it will crash after some seconds? And if you remove Application.targetFrameRate = 300 and leave unity-sysfont untouched it won't crash?

yes it is related to the Application.targetFrameRate = 300
i didn't try to remove all the sysfont but seems like i have no bug in my games related to sysfont.

if I remove Application.targetFrameRate = 300 and leave unity-sysfont untouched it won't crash

Ok, thank you very much for your feedback. I will close this ticket for now.