Page 1 of 1
[SOLVED] Bitmap composed of Noise + Expression crashes on Android
Posted: Wed Jul 28, 2021 7:39 am
by Ats
Hi guys. I made a short example of something working perfectly on PC, but crashing on Android:
Code: Select all
<?xml version="1.0" encoding="iso-8859-1" ?>
<ZApplication Name="App" Caption="Debug Background" GLBase="1" ClearColor="0 0 0 1" ScreenMode="0" MouseVisible="255" FileVersion="2" AndroidPackageName="com.txori.debug_background">
<OnLoaded>
<ZExpression>
<Expression>
<![CDATA[App.ClearColor.A = 1;
CloudsSetup[0] = rnd();
CloudsSetup[1] = rnd();
CloudsSetup[2] = rnd();
BackgroundNoise.Offset = 0.2 * rnd();
BackgroundNoise.ZHeight = 200 * rnd();
@RefreshContent(Component: CloudsBitmap);
@SpawnModel(Model:BackgroundModel, SpawnStyle:1);]]>
</Expression>
</ZExpression>
</OnLoaded>
<Content>
<Group Comment="Background">
<Children>
<Model Name="BackgroundModel" Comment="Nebula">
<Definitions>
<Array Name="CloudsSetup" SizeDim1="3"/>
</Definitions>
<OnRender>
<UseMaterial Material="CloudsMaterial"/>
<RenderMesh Mesh="BackgroundMesh"/>
</OnRender>
</Model>
<Material Name="CloudsMaterial" Shading="1" Light="0" ZBuffer="0" Shader="TextureShader">
<Textures>
<MaterialTexture Texture="CloudsBitmap" TextureWrapMode="1"/>
</Textures>
</Material>
<Bitmap Name="CloudsBitmap" Width="128">
<Producers>
<BitmapNoise Name="BackgroundNoise" Offset="0.1365" Persistence="0.2" ZHeight="13.0273" Tile="255"/>
<BitmapExpression>
<Expression>
<![CDATA[Pixel.R *= sin(CloudsSetup[0] < 0.5 ? X : Y) * 0.9;
Pixel.G *= sin(CloudsSetup[1] < 0.5 ? X : Y) * 0.9;
Pixel.B *= sin(CloudsSetup[2] < 0.5 ? X : Y) * 0.9;
Pixel.A = 1;]]>
</Expression>
</BitmapExpression>
</Producers>
</Bitmap>
<Shader Name="TextureShader">
<VertexShaderSource>
<![CDATA[//
#ifdef GL_ES
precision mediump float;
#endif
uniform mat4 modelViewProjectionMatrix;
attribute vec4 position; // vertex position
attribute vec2 texCoord; // texture coordinates
varying vec2 t;
void main()
{
gl_Position = modelViewProjectionMatrix * position;
t = texCoord;
}]]>
</VertexShaderSource>
<FragmentShaderSource>
<![CDATA[//
#ifdef GL_ES
precision mediump float;
#endif
uniform sampler2D tex1;
varying vec2 t;
void main()
{
gl_FragColor = vec4(texture2D(tex1, t).rgb, 1.0);
}]]>
</FragmentShaderSource>
</Shader>
<Array Name="Viewport" Type="1" SizeDim1="4"/>
<Variable Name="ScreenWidth" Type="1"/>
<Variable Name="ScreenHeight" Type="1"/>
<Mesh Name="BackgroundMesh">
<Producers>
<MeshBox Name="BackgroundMeshSize" Scale="10 5 1" Grid2DOnly="255"/>
</Producers>
</Mesh>
</Children>
</Group>
</Content>
</ZApplication>
The mere fact to add BitmapExpression (even empty) after BitmapNoise inside CloudsBitmap crashes the app on Android.
Since this was working perfectly on GLBase compatible, maybe the problem could come from the TextureShader, but I'm not sure...
Re: Bitmap composed of Noise + Expression crashes on Android
Posted: Wed Jul 28, 2021 7:54 am
by VilleK
Have you rebuilt the Android binary recently? Please check that it is built from the latest ZGE sources.
Do you get any crash log?
Re: Bitmap composed of Noise + Expression crashes on Android
Posted: Wed Jul 28, 2021 8:40 am
by Ats
You're right, I keep forgetting about building a new libzgeandroid.so, but even doing so, it is still crashing:
Code: Select all
07-28 10:38:14.363 12220 12220 E ZgeAndroid: /storage/emulated/0
07-28 10:38:14.363 12220 12220 E ZgeAndroid: /data/user/0/com.txori.debug_background/files/
07-28 10:38:14.363 12220 12220 E ZgeAndroid: /data/user/0/com.txori.debug_background/lib/
07-28 10:38:14.366 12220 12220 E ZgeAndroid: JNI_OnLoad
07-28 10:38:14.366 12220 12220 E ZgeAndroid: glColorPointer
07-28 10:38:14.367 12220 12220 E ZgeAndroid: glDepthRange
07-28 10:38:14.367 12220 12220 E ZgeAndroid: glDisableClientState
07-28 10:38:14.367 12220 12220 E ZgeAndroid: glEnableClientState
07-28 10:38:14.367 12220 12220 E ZgeAndroid: glGenLists
07-28 10:38:14.367 12220 12220 E ZgeAndroid: glMateriali
07-28 10:38:14.368 12220 12220 E ZgeAndroid: glIndexMask
07-28 10:38:14.368 12220 12220 E ZgeAndroid: glLightModelf
07-28 10:38:14.368 12220 12220 E ZgeAndroid: glLightModelfv
07-28 10:38:14.368 12220 12220 E ZgeAndroid: glLightfv
07-28 10:38:14.368 12220 12220 E ZgeAndroid: glListBase
07-28 10:38:14.368 12220 12220 E ZgeAndroid: glLoadIdentity
07-28 10:38:14.369 12220 12220 E ZgeAndroid: glLoadMatrixf
07-28 10:38:14.369 12220 12220 E ZgeAndroid: glMaterialf
07-28 10:38:14.369 12220 12220 E ZgeAndroid: glMaterialfv
07-28 10:38:14.369 12220 12220 E ZgeAndroid: glMatrixMode
07-28 10:38:14.369 12220 12220 E ZgeAndroid: glNormal3f
07-28 10:38:14.369 12220 12220 E ZgeAndroid: glNormalPointer
07-28 10:38:14.369 12220 12220 E ZgeAndroid: glOrthof
07-28 10:38:14.369 12220 12220 E ZgeAndroid: glFrustumf
07-28 10:38:14.369 12220 12220 E ZgeAndroid: glBegin
07-28 10:38:14.369 12220 12220 E ZgeAndroid: glCallList
07-28 10:38:14.369 12220 12220 E ZgeAndroid: glColor3f
07-28 10:38:14.369 12220 12220 E ZgeAndroid: glColor3fv
07-28 10:38:14.371 12220 12220 E ZgeAndroid: glColor4fv
07-28 10:38:14.372 12220 12220 E ZgeAndroid: glEnd
07-28 10:38:14.372 12220 12220 E ZgeAndroid: glColorMaterial
07-28 10:38:14.372 12220 12220 E ZgeAndroid: glDeleteLists
07-28 10:38:14.372 12220 12220 E ZgeAndroid: glDrawBuffer
07-28 10:38:14.372 12220 12220 E ZgeAndroid: glGetTexImage
07-28 10:38:14.372 12220 12220 E ZgeAndroid: glPolygonMode
07-28 10:38:14.372 12220 12220 E ZgeAndroid: glPopAttrib
07-28 10:38:14.372 12220 12220 E ZgeAndroid: glPushAttrib
07-28 10:38:14.372 12220 12220 E ZgeAndroid: glRasterPos2f
07-28 10:38:14.372 12220 12220 E ZgeAndroid: glTexCoord2f
07-28 10:38:14.372 12220 12220 E ZgeAndroid: glVertex2f
07-28 10:38:14.372 12220 12220 E ZgeAndroid: glVertex3f
07-28 10:38:14.372 12220 12220 E ZgeAndroid: glPointSize
07-28 10:38:14.372 12220 12220 E ZgeAndroid: glPopMatrix
07-28 10:38:14.372 12220 12220 E ZgeAndroid: glPushMatrix
07-28 10:38:14.372 12220 12220 E ZgeAndroid: glRotatef
07-28 10:38:14.372 12220 12220 E ZgeAndroid: glScalef
07-28 10:38:14.372 12220 12220 E ZgeAndroid: glShadeModel
07-28 10:38:14.372 12220 12220 E ZgeAndroid: glTexCoordPointer
07-28 10:38:14.372 12220 12220 E ZgeAndroid: glTexGeni
07-28 10:38:14.372 12220 12220 E ZgeAndroid: glTranslatef
07-28 10:38:14.372 12220 12220 E ZgeAndroid: glVertexPointer
07-28 10:38:14.372 12220 12220 E ZgeAndroid: glColor4f
07-28 10:38:14.373 12220 12220 E ZgeAndroid: glClientActiveTexture
07-28 10:38:14.373 12220 12220 E ZgeAndroid: glTexImage2DMultisample
07-28 10:38:14.373 12220 12220 E ZgeAndroid: Non-implemented GL function called
Re: Bitmap composed of Noise + Expression crashes on Android
Posted: Wed Jul 28, 2021 3:07 pm
by VilleK
I think that log is filtered somehow. It should at least show some kind of info from the Android OS when it crashes. Can you check the log filter settings? I don't remember the details but I think there is some start up parameter to filter the output.
Re: Bitmap composed of Noise + Expression crashes on Android
Posted: Wed Jul 28, 2021 3:56 pm
by Ats
Oh all right, so here's the new log whici is quite long, so I filtered it with:
adb logcat ActivityManager:I ZgeAndroid:I *:S
Code: Select all
--------- beginning of crash
--------- beginning of system
07-28 17:40:43.394 1618 1709 I ActivityManager: Start proc 3051:com.txori.debug_background/u0a478 for top-activity {com.txori.debug_background/org.zgameeditor.ZgeActivity}
07-28 17:40:44.708 1618 2153 I ActivityManager: Process com.txori.debug_background (pid 3051) has died: cch CRE
07-28 17:40:46.289 1618 2141 W ActivityManager: Background start not allowed: service Intent { act=Orca.PERSISTENT_KICK_SKIP_PING cmp=com.facebook.katana/com.facebook.mqttlite.MqttService (has extras) } to com.facebook.katana/com.facebook.mqttlite.MqttService from pid=30885 uid=10146 pkg=com.facebook.katana startFg?=false
07-28 17:40:52.104 1618 1709 I ActivityManager: Start proc 3217:com.google.android.calendar/u0a123 for service {com.google.android.calendar/com.google.android.calendar.widget.CalendarAppWidgetService}
07-28 17:40:52.507 1618 1709 I ActivityManager: Start proc 3257:com.android.providers.calendar/u0a26 for content provider {com.android.providers.calendar/com.android.providers.calendar.CalendarProvider2}
07-28 17:41:06.340 1618 1709 I ActivityManager: Start proc 3377:com.instagram.android/u0a149 for broadcast {com.instagram.android/com.instagram.analytics.uploadscheduler.AnalyticsUploadAlarmReceiver}
07-28 17:41:08.161 1618 2098 W ActivityManager: Background start not allowed: service Intent { act=Orca.START cmp=com.instagram.android/com.facebook.rti.push.service.FbnsService (has extras) } to com.instagram.android/com.facebook.rti.push.service.FbnsService from pid=3377 uid=10149 pkg=com.instagram.android startFg?=false
07-28 17:41:08.186 1618 2098 W ActivityManager: Background start not allowed: service Intent { act=Orca.START cmp=com.instagram.android/com.facebook.rti.push.service.FbnsService (has extras) } to com.instagram.android/com.facebook.rti.push.service.FbnsService from pid=3377 uid=10149 pkg=com.instagram.android startFg?=false
07-28 17:41:14.662 1618 2158 I ActivityManager: Killing 30481:com.google.android.webview:webview_service/u0a96 (adj 985): empty #33
07-28 17:41:33.935 1618 1708 I ActivityManager: Force stopping com.txori.debug_background appid=10478 user=-1: installPackageLI
07-28 17:41:34.060 1618 1805 I ActivityManager: Force stopping com.txori.debug_background appid=10478 user=0: pkg removed
07-28 17:41:34.297 1618 1709 W ActivityManager: Slow operation: 60ms so far, now at startProcess: done updating battery stats
07-28 17:41:34.297 1618 1709 W ActivityManager: Slow operation: 60ms so far, now at startProcess: building log message
07-28 17:41:34.298 1618 1709 I ActivityManager: Start proc 3683:com.txori.debug_background/u0a478 for pre-top-activity {com.txori.debug_background/org.zgameeditor.ZgeActivity}
07-28 17:41:34.298 1618 1709 W ActivityManager: Slow operation: 60ms so far, now at startProcess: starting to update pids map
07-28 17:41:34.298 1618 1709 W ActivityManager: Slow operation: 60ms so far, now at startProcess: done updating pids map
07-28 17:41:35.064 1618 3406 I ActivityManager: Process com.txori.debug_background (pid 3683) has died: fg TOP
07-28 17:41:35.111 1618 3758 W ActivityManager: Ignoring remove of inactive process: ProcessRecord{e533643 0:com.txori.debug_background/u0a478}
07-28 17:41:43.580 1618 2141 W ActivityManager: Background start not allowed: service Intent { act=Orca.PERSISTENT_KICK_SKIP_PING cmp=com.facebook.katana/com.facebook.mqttlite.MqttService (has extras) } to com.facebook.katana/com.facebook.mqttlite.MqttService from pid=30885 uid=10146 pkg=com.facebook.katana startFg?=false
07-28 17:41:43.703 1618 1709 I ActivityManager: Start proc 3782:com.google.android.cellbroadcastreceiver/u0a283 for broadcast {com.google.android.cellbroadcastreceiver/com.android.cellbroadcastreceiver.CellBroadcastReceiver}
07-28 17:41:44.841 1618 4122 W ActivityManager: Background start not allowed: service Intent { act=Orca.START cmp=com.instagram.android/com.facebook.rti.push.service.FbnsService (has extras) } to com.instagram.android/com.facebook.rti.push.service.FbnsService from pid=3377 uid=10149 pkg=com.instagram.android startFg?=false
07-28 17:41:47.173 1618 1708 I ActivityManager: Force stopping com.txori.debug_background appid=10478 user=-1: installPackageLI
07-28 17:41:47.287 1618 1805 I ActivityManager: Force stopping com.txori.debug_background appid=10478 user=0: pkg removed
07-28 17:41:47.581 1618 1709 W ActivityManager: Slow operation: 72ms so far, now at startProcess: done updating battery stats
07-28 17:41:47.581 1618 1709 W ActivityManager: Slow operation: 72ms so far, now at startProcess: building log message
07-28 17:41:47.581 1618 1709 I ActivityManager: Start proc 3842:com.txori.debug_background/u0a478 for pre-top-activity {com.txori.debug_background/org.zgameeditor.ZgeActivity}
07-28 17:41:47.581 1618 1709 W ActivityManager: Slow operation: 72ms so far, now at startProcess: starting to update pids map
07-28 17:41:47.581 1618 1709 W ActivityManager: Slow operation: 72ms so far, now at startProcess: done updating pids map
07-28 17:41:48.348 1618 4126 I ActivityManager: Process com.txori.debug_background (pid 3842) has died: fg TOP
07-28 17:42:17.332 1618 1707 I ActivityManager: Killing 32752:com.google.android.apps.authenticator2/u0a171 (adj 985): empty #33
07-28 17:42:47.793 1618 7294 I ActivityManager: Killing 31598:com.google.android.configupdater/u0a51 (adj 975): empty #33
07-28 17:42:55.100 1618 1708 W ActivityManager: Stopping service due to app idle: u0a153 -2m3s455ms com.whatsapp/.messaging.MessageService
07-28 17:44:52.073 1618 7294 I ActivityManager: Killing 31913:com.google.android.tts/u0a106 (adj 975): empty #33
07-28 17:44:52.190 1618 4126 W ActivityManager: Scheduling restart of crashed service com.google.android.tts/com.google.android.apps.speech.tts.googletts.service.GoogleTTSService in 1000ms for connection
07-28 17:44:52.483 1618 1709 I ActivityManager: Start proc 3964:com.google.android.webview:webview_service/u0a96 for service {com.google.android.webview/org.chromium.android_webview.services.VariationsSeedServer}
07-28 17:44:52.580 1618 1709 I ActivityManager: Start proc 3986:com.google.android.webview:sandboxed_process0:org.chromium.content.app.SandboxedProcessService0:0/u0i892 for {com.fitbit.FitbitMobile/org.chromium.content.app.SandboxedProcessService0:0}
07-28 17:44:53.066 1618 7294 I ActivityManager: Killing 31674:com.google.android.dialer/u0a47 (adj 985): empty #33
07-28 17:44:53.585 1618 4123 I ActivityManager: Killing 31587:com.google.android.apps.tips/u0a73 (adj 985): empty #33
07-28 17:45:10.982 1618 3404 I ActivityManager: Killing 3986:com.google.android.webview:sandboxed_process0:org.chromium.content.app.SandboxedProcessService0:0/u0a345i892 (adj 0): isolated not needed
07-28 17:45:26.855 1618 1891 W ActivityManager: Slow operation: 67ms so far, now at getContentProviderImpl: after updateOomAdj
07-28 17:45:26.855 1618 1891 W ActivityManager: Slow operation: 67ms so far, now at getContentProviderImpl: done!
07-28 17:45:35.752 1618 7294 W ActivityManager: Background start not allowed: service Intent { act=Orca.PERSISTENT_KICK_SKIP_PING cmp=com.facebook.katana/com.facebook.mqttlite.MqttService (has extras) } to com.facebook.katana/com.facebook.mqttlite.MqttService from pid=30885 uid=10146 pkg=com.facebook.katana startFg?=false
07-28 17:45:36.923 1618 2153 W ActivityManager: Background start not allowed: service Intent { act=Orca.START cmp=com.instagram.android/com.facebook.rti.push.service.FbnsService (has extras) } to com.instagram.android/com.facebook.rti.push.service.FbnsService from pid=3377 uid=10149 pkg=com.instagram.android startFg?=false
07-28 17:45:49.266 1618 1708 I ActivityManager: Force stopping com.txori.debug_background appid=10478 user=-1: installPackageLI
07-28 17:45:49.390 1618 1805 I ActivityManager: Force stopping com.txori.debug_background appid=10478 user=0: pkg removed
07-28 17:45:49.616 1618 4127 W ActivityManager: Slow operation: 102ms so far, now at startProcess: done updating battery stats
07-28 17:45:49.616 1618 4127 W ActivityManager: Slow operation: 102ms so far, now at startProcess: building log message
07-28 17:45:49.616 1618 4127 I ActivityManager: Start proc 4172:com.txori.debug_background/u0a478 for pre-top-activity {com.txori.debug_background/org.zgameeditor.ZgeActivity}
07-28 17:45:49.616 1618 4127 W ActivityManager: Slow operation: 102ms so far, now at startProcess: starting to update pids map
07-28 17:45:49.617 1618 4127 W ActivityManager: Slow operation: 102ms so far, now at startProcess: done updating pids map
07-28 17:45:50.389 1618 4123 I ActivityManager: Process com.txori.debug_background (pid 4172) has died: fg TOP
07-28 17:46:50.860 1618 1709 I ActivityManager: Start proc 4346:com.google.android.apps.turbo:aab/u0a32 for service {com.google.android.apps.turbo/com.google.android.libraries.smartbattery.appusage.library.InferAppBucketsJob}
07-28 17:46:52.380 1618 2158 I ActivityManager: Killing 31268:com.google.android.gm/u0a107 (adj 985): empty #33
07-28 17:47:44.592 1618 3394 W ActivityManager: Background start not allowed: service Intent { act=Orca.PERSISTENT_KICK_SKIP_PING cmp=com.facebook.katana/com.facebook.mqttlite.MqttService (has extras) } to com.facebook.katana/com.facebook.mqttlite.MqttService from pid=30885 uid=10146 pkg=com.facebook.katana startFg?=false
--------- beginning of main
07-28 17:48:26.857 1618 3406 W ActivityManager: Slow operation: 71ms so far, now at getContentProviderImpl: after updateOomAdj
07-28 17:48:26.857 1618 3406 W ActivityManager: Slow operation: 71ms so far, now at getContentProviderImpl: done!
07-28 17:48:34.341 1618 4114 W ActivityManager: Background start not allowed: service Intent { act=Orca.PERSISTENT_KICK_SKIP_PING cmp=com.facebook.katana/com.facebook.mqttlite.MqttService (has extras) } to com.facebook.katana/com.facebook.mqttlite.MqttService from pid=30885 uid=10146 pkg=com.facebook.katana startFg?=false
07-28 17:48:37.061 1618 4114 W ActivityManager: Background start not allowed: service Intent { act=Orca.START cmp=com.instagram.android/com.facebook.rti.push.service.FbnsService (has extras) } to com.instagram.android/com.facebook.rti.push.service.FbnsService from pid=3377 uid=10149 pkg=com.instagram.android startFg?=false
07-28 17:48:42.220 1618 1708 I ActivityManager: Force stopping com.txori.debug_background appid=10478 user=-1: installPackageLI
07-28 17:48:42.343 1618 1805 I ActivityManager: Force stopping com.txori.debug_background appid=10478 user=0: pkg removed
07-28 17:48:42.633 1618 1709 W ActivityManager: Slow operation: 84ms so far, now at startProcess: returned from zygote!
07-28 17:48:42.644 1618 1709 W ActivityManager: Slow operation: 95ms so far, now at startProcess: done updating battery stats
07-28 17:48:42.645 1618 1709 W ActivityManager: Slow operation: 95ms so far, now at startProcess: building log message
07-28 17:48:42.645 1618 1709 I ActivityManager: Start proc 4502:com.txori.debug_background/u0a478 for pre-top-activity {com.txori.debug_background/org.zgameeditor.ZgeActivity}
07-28 17:48:42.645 1618 1709 W ActivityManager: Slow operation: 95ms so far, now at startProcess: starting to update pids map
07-28 17:48:42.645 1618 1709 W ActivityManager: Slow operation: 96ms so far, now at startProcess: done updating pids map
07-28 17:48:42.879 4502 4502 E ZgeAndroid: /storage/emulated/0
07-28 17:48:42.880 4502 4502 E ZgeAndroid: /data/user/0/com.txori.debug_background/files/
07-28 17:48:42.880 4502 4502 E ZgeAndroid: /data/user/0/com.txori.debug_background/lib/
07-28 17:48:42.881 4502 4502 E ZgeAndroid: JNI_OnLoad
07-28 17:48:42.881 4502 4502 E ZgeAndroid: glColorPointer
07-28 17:48:42.881 4502 4502 E ZgeAndroid: glDepthRange
07-28 17:48:42.881 4502 4502 E ZgeAndroid: glDisableClientState
07-28 17:48:42.881 4502 4502 E ZgeAndroid: glEnableClientState
07-28 17:48:42.881 4502 4502 E ZgeAndroid: glGenLists
07-28 17:48:42.881 4502 4502 E ZgeAndroid: glMateriali
07-28 17:48:42.881 4502 4502 E ZgeAndroid: glIndexMask
07-28 17:48:42.881 4502 4502 E ZgeAndroid: glLightModelf
07-28 17:48:42.881 4502 4502 E ZgeAndroid: glLightModelfv
07-28 17:48:42.881 4502 4502 E ZgeAndroid: glLightfv
07-28 17:48:42.881 4502 4502 E ZgeAndroid: glListBase
07-28 17:48:42.881 4502 4502 E ZgeAndroid: glLoadIdentity
07-28 17:48:42.881 4502 4502 E ZgeAndroid: glLoadMatrixf
07-28 17:48:42.881 4502 4502 E ZgeAndroid: glMaterialf
07-28 17:48:42.882 4502 4502 E ZgeAndroid: glMaterialfv
07-28 17:48:42.882 4502 4502 E ZgeAndroid: glMatrixMode
07-28 17:48:42.882 4502 4502 E ZgeAndroid: glNormal3f
07-28 17:48:42.882 4502 4502 E ZgeAndroid: glNormalPointer
07-28 17:48:42.882 4502 4502 E ZgeAndroid: glOrthof
07-28 17:48:42.882 4502 4502 E ZgeAndroid: glFrustumf
07-28 17:48:42.882 4502 4502 E ZgeAndroid: glBegin
07-28 17:48:42.882 4502 4502 E ZgeAndroid: glCallList
07-28 17:48:42.882 4502 4502 E ZgeAndroid: glColor3f
07-28 17:48:42.882 4502 4502 E ZgeAndroid: glColor3fv
07-28 17:48:42.882 4502 4502 E ZgeAndroid: glColor4fv
07-28 17:48:42.882 4502 4502 E ZgeAndroid: glEnd
07-28 17:48:42.882 4502 4502 E ZgeAndroid: glColorMaterial
07-28 17:48:42.882 4502 4502 E ZgeAndroid: glDeleteLists
07-28 17:48:42.882 4502 4502 E ZgeAndroid: glDrawBuffer
07-28 17:48:42.882 4502 4502 E ZgeAndroid: glGetTexImage
07-28 17:48:42.882 4502 4502 E ZgeAndroid: glPolygonMode
07-28 17:48:42.882 4502 4502 E ZgeAndroid: glPopAttrib
07-28 17:48:42.882 4502 4502 E ZgeAndroid: glPushAttrib
07-28 17:48:42.882 4502 4502 E ZgeAndroid: glRasterPos2f
07-28 17:48:42.882 4502 4502 E ZgeAndroid: glTexCoord2f
07-28 17:48:42.882 4502 4502 E ZgeAndroid: glVertex2f
07-28 17:48:42.882 4502 4502 E ZgeAndroid: glVertex3f
07-28 17:48:42.882 4502 4502 E ZgeAndroid: glPointSize
07-28 17:48:42.882 4502 4502 E ZgeAndroid: glPopMatrix
07-28 17:48:42.882 4502 4502 E ZgeAndroid: glPushMatrix
07-28 17:48:42.882 4502 4502 E ZgeAndroid: glRotatef
07-28 17:48:42.883 4502 4502 E ZgeAndroid: glScalef
07-28 17:48:42.883 4502 4502 E ZgeAndroid: glShadeModel
07-28 17:48:42.883 4502 4502 E ZgeAndroid: glTexCoordPointer
07-28 17:48:42.883 4502 4502 E ZgeAndroid: glTexGeni
07-28 17:48:42.883 4502 4502 E ZgeAndroid: glTranslatef
07-28 17:48:42.883 4502 4502 E ZgeAndroid: glVertexPointer
07-28 17:48:42.883 4502 4502 E ZgeAndroid: glColor4f
07-28 17:48:42.883 4502 4502 E ZgeAndroid: glClientActiveTexture
07-28 17:48:42.883 4502 4502 E ZgeAndroid: glTexImage2DMultisample
07-28 17:48:42.883 4502 4502 E ZgeAndroid: Non-implemented GL function called
07-28 17:48:43.414 1618 4115 I ActivityManager: Process com.txori.debug_background (pid 4502) has died: fg TOP
07-28 17:50:00.238 1618 1708 I ActivityManager: Force stopping com.txori.debug_background appid=10478 user=-1: installPackageLI
07-28 17:50:00.370 1618 1805 I ActivityManager: Force stopping com.txori.debug_background appid=10478 user=0: pkg removed
07-28 17:50:00.552 1618 1709 W ActivityManager: Slow operation: 52ms so far, now at startProcess: done updating battery stats
07-28 17:50:00.552 1618 1709 W ActivityManager: Slow operation: 52ms so far, now at startProcess: building log message
07-28 17:50:00.552 1618 1709 I ActivityManager: Start proc 4642:com.txori.debug_background/u0a478 for top-activity {com.txori.debug_background/org.zgameeditor.ZgeActivity}
07-28 17:50:00.552 1618 1709 W ActivityManager: Slow operation: 52ms so far, now at startProcess: starting to update pids map
07-28 17:50:00.552 1618 1709 W ActivityManager: Slow operation: 53ms so far, now at startProcess: done updating pids map
And then it goes on and on about ZgeAndroid: Non-implemented GL function called and ActivityManager: Slow operation
Re: Bitmap composed of Noise + Expression crashes on Android
Posted: Thu Jul 29, 2021 7:28 am
by VilleK
The log still doesn't give anything useful, sadly.
But lets try to figure out where the problem could be.
Please try comment out line 169 in ZBitmap (the call to GLESPixelsFromTexture) and then rebuild Android binary.
Re: Bitmap composed of Noise + Expression crashes on Android
Posted: Thu Jul 29, 2021 7:57 am
by Ats
Now it is a black screen, but it is not crashing either:
Log stops at E ZgeAndroid: glTexImage2DMultisample
One weird thing I noticed is that if I exit the app by simply returning to the main screen, then go back to the app, the clouds appears
Re: Bitmap composed of Noise + Expression crashes on Android
Posted: Thu Jul 29, 2021 9:53 am
by VilleK
Right, we need some good old printf-debugging.
Please re-enable the call to GLESPixelsFromTexture.
Then:
1. Add "ZPlatform" to the uses list in ZBitmap
2. Find the GLESPixelsFromTexture function at line 101 in ZBitmap.pas
3. Add "Platform_Error" calls after each line inside GLESPixelsFromTexture. Platform_Error will write to the Android log.
Something like this:
Code: Select all
glPushAttrib(GL_ALL_ATTRIB_BITS);
Platform_Error('1');
glMatrixMode(GL_PROJECTION);
Platform_Error('2');
glLoadIdentity;
Platform_Error('3');
glMatrixMode(GL_MODELVIEW);
Platform_Error('4');
So you have a separate Platform_Error line with unique message for each line.
Then rebuild and see what is the last number you notice in the log. That will point us to the line that crashes.
Re: Bitmap composed of Noise + Expression crashes on Android
Posted: Thu Jul 29, 2021 11:29 am
by VilleK
Kjell reminded me that this is GL ES 2. I've tried to make changes here to fix it. Please try this version of ZBitmap.
Re: Bitmap composed of Noise + Expression crashes on Android
Posted: Thu Jul 29, 2021 4:52 pm
by Ats
Back on a computer
So there are 4 errors in this new ZBitmaps.pas
Code: Select all
ZBitmap.pas(138,23) Error: Identifier not found "GL_FRAMEBUFFER"
ZBitmap.pas(141,28) Error: Identifier not found "GL_FRAMEBUFFER"
ZBitmap.pas(141,44) Error: Identifier not found "GL_COLOR_ATTACHMENT0"
ZBitmap.pas(145,23) Error: Identifier not found "GL_FRAMEBUFFER"
Re: Bitmap composed of Noise + Expression crashes on Android
Posted: Thu Jul 29, 2021 7:21 pm
by VilleK
Aha, please change those lines to GL_FRAMEBUFFER_EXT and GL_COLOR_ATTACHMENT0_EXT.
Re: Bitmap composed of Noise + Expression crashes on Android
Posted: Thu Jul 29, 2021 7:42 pm
by Ats
Now everything is working perfectly. Thanks !