|
Another Android Thread |
Evert
Member #794
November 2000
|
I'd been meaning to take a look at the Android port, and so I took the trouble of installing the NDK and SDK yesterday. Following the instructions in the README file, I got Allegro to compile and install (I had to install freetype separately, using the instructions here, and then I had to manually point CMake to the library and header files; guess I need to familiarise myself more with how to do that properly for android), so far so good. I ran into a few stumbling blocks compiling the test project though. Anyway, next was to run ant debug which went fine. So, I fired up the emulator, ran "ant debug install" and started "AllegroActivity" - which crashed immediately. Output from adb logcat below. Am I missing something? I/allegro ( 601): android D 601: android_system.c:233 Java_org_liballeg_app_AllegroActivity_nativeOnCreate [ 0.00000] data_dir: /mnt/sdcard/Android/data/org.liballeg.app/files I/allegro ( 601): android D 601: android_system.c:234 Java_org_liballeg_app_AllegroActivity_nativeOnCreate [ 0.00000] apk_path: /data/app/org.liballeg.app-1.apk I/allegro ( 601): android D 601: android_system.c:236 Java_org_liballeg_app_AllegroActivity_nativeOnCreate [ 0.00000] creating ALLEGRO_SYSTEM_ANDROID struct I/allegro ( 601): android D 601: android_system.c:240 Java_org_liballeg_app_AllegroActivity_nativeOnCreate [ 0.00000] get system pointer I/allegro ( 601): android D 601: android_system.c:242 Java_org_liballeg_app_AllegroActivity_nativeOnCreate [ 0.00000] get system interface I/allegro ( 601): android D 601: android_system.c:245 Java_org_liballeg_app_AllegroActivity_nativeOnCreate [ 0.00000] init display vector I/allegro ( 601): android D 601: android_system.c:248 Java_org_liballeg_app_AllegroActivity_nativeOnCreate [ 0.00000] init time I/allegro ( 601): android D 601: android_system.c:251 Java_org_liballeg_app_AllegroActivity_nativeOnCreate [ 0.00004] strdup app_name I/allegro ( 601): android D 601: android_system.c:270 Java_org_liballeg_app_AllegroActivity_nativeOnCreate [ 0.00292] load user lib: /data/data/org.liballeg.app/lib/liballegro-example.so I/allegro ( 601): android D 601: android_system.c:278 Java_org_liballeg_app_AllegroActivity_nativeOnCreate [ 0.00379] grab user main I/allegro ( 601): android D 601: android_system.c:286 Java_org_liballeg_app_AllegroActivity_nativeOnCreate [ 0.00391] creating trampoline for app thread I/allegro ( 601): android D 601: android_system.c:290 Java_org_liballeg_app_AllegroActivity_nativeOnCreate [ 0.00434] waiting for app trampoline to signal running I/Choreographer( 259): Skipped 60 frames! The application may be doing too much work on its main thread. I/allegro ( 601): android D 615: android_system.c:145 android_app_trampoline [ 0.01814] signaling running I/allegro ( 601): android D 601: android_system.c:297 Java_org_liballeg_app_AllegroActivity_nativeOnCreate [ 0.01855] setup done. returning to dalvik. I/allegro ( 601): android D 601: android_system.c:411 Java_org_liballeg_app_AllegroActivity_nativeOnOrientationChange [ 0.01878] got orientation change! D/AllegroActivity( 601): onCreate end D/AllegroActivity( 601): onStart. D/AllegroActivity( 601): onResume I/allegro ( 601): android D 615: android_system.c:152 android_app_trampoline [ 0.03445] entering app's main function I/allegro ( 601): main D 615: main.c:72 main [ 0.03463] init allegro! I/allegro ( 601): android D 615: android_system.c:465 android_initialize [ 0.03593] android_initialize I/allegro ( 601): system I 615: system.c:274 al_install_system [ 0.03608] Allegro version: 5.1.4 (GIT) I/allegro ( 601): main D 615: main.c:77 main [ 0.03684] init primitives I/allegro ( 601): main D 615: main.c:80 main [ 0.03703] init image addon I/allegro ( 601): main D 615: main.c:83 main [ 0.03764] init touch input I/allegro ( 601): main D 615: main.c:86 main [ 0.03784] init keyboard I/allegro ( 601): main D 615: main.c:89 main [ 0.03804] creating display I/allegro ( 601): display D 615: android_display.c:474 android_create_display [ 0.03832] begin D/AllegroActivity( 601): postCreateSurface I/allegro ( 601): display D 615: android_display.c:519 android_create_display [ 0.03919] waiting for surface onChange I/allegro ( 601): android D 601: android_system.c:338 Java_org_liballeg_app_AllegroActivity_nativeOnResume [ 0.04303] resume activity I/allegro ( 601): android D 601: android_system.c:351 Java_org_liballeg_app_AllegroActivity_nativeOnResume [ 0.04315] got display: 0x2a11a2f8 D/AllegroActivity( 601): postCreateSurface D/AllegroActivity( 601): onResume end D/AllegroActivity( 601): createSurface D/AllegroSurface( 601): PixelFormat=4 D/AllegroSurface( 601): ctor D/AllegroSurface( 601): ctor end D/AllegroActivity( 601): createSurface end D/AllegroActivity( 601): createSurface D/AllegroSurface( 601): PixelFormat=4 D/AllegroSurface( 601): ctor D/AllegroSurface( 601): ctor end D/AllegroActivity( 601): createSurface end V/PhoneStatusBar( 201): setLightsOn(true) D/AllegroSurface( 601): surfaceCreated I/allegro ( 601): display D 601: android_display.c:50 Java_org_liballeg_app_AllegroSurface_nativeOnCreate [ 0.13519] nativeOnCreate I/allegro ( 601): display D 601: android_display.c:57 Java_org_liballeg_app_AllegroSurface_nativeOnCreate [ 0.13532] AllegroSurface_nativeOnCreate D/AllegroSurface( 601): Grabbing focus D/AllegroSurface( 601): surfaceCreated end D/AllegroSurface( 601): surfaceChanged (width=480 height=800) I/allegro ( 601): display D 601: android_display.c:119 Java_org_liballeg_app_AllegroSurface_nativeOnChange [ 0.13623] on change! I/allegro ( 601): display D 601: android_display.c:120 Java_org_liballeg_app_AllegroSurface_nativeOnChange [ 0.13633] sys: 0x40040791 I/allegro ( 601): display D 601: android_display.c:294 _al_android_init_display [ 0.13652] calling egl_Init D/AllegroSurface( 601): egl_Init D/libEGL ( 601): Emulator without GPU support detected. Fallback to software renderer. D/libEGL ( 601): loaded /system/lib/egl/libGLES_android.so D/AllegroSurface( 601): egl_Init end I/allegro ( 601): display D 601: android_display.c:303 _al_android_init_display [ 0.15174] updating visuals I/allegro ( 601): display D 601: android_display.c:459 _al_android_update_visuals [ 0.15196] calling egl_setConfigAttrib(17, 0) I/allegro ( 601): display D 601: android_display.c:460 _al_android_update_visuals [ 0.15238] calling egl_setConfigAttrib(18, 0) I/allegro ( 601): display D 601: android_display.c:305 _al_android_init_display [ 0.15261] done updating visuals I/allegro ( 601): display D 601: android_display.c:316 _al_android_init_display [ 0.15271] calling egl_createContext D/AllegroSurface( 601): egl_createContext D/AllegroSurface( 601): egl_attribs[0] = 12338 D/AllegroSurface( 601): egl_attribs[1] = 0 D/AllegroSurface( 601): egl_attribs[2] = 12337 D/AllegroSurface( 601): egl_attribs[3] = 0 D/AllegroSurface( 601): egl_attribs[4] = 12352 D/AllegroSurface( 601): egl_attribs[5] = 1 D/AllegroSurface( 601): EGL context created D/AllegroSurface( 601): egl_createContext end I/allegro ( 601): display D 601: android_display.c:328 _al_android_init_display [ 0.17103] calling egl_createSurface D/gralloc_goldfish( 601): Emulator without GPU emulation detected. D/AllegroSurface( 601): created new surface: com.google.android.gles_jni.EGLSurfaceImpl@2a13eac8 I/allegro ( 601): display D 601: android_display.c:336 _al_android_init_display [ 0.19096] initialize ogl extensions I/allegro ( 601): opengl D 601: extensions.c:709 _al_ogl_manage_extensions [ 0.19115] OpenGL Extensions: I/allegro ( 601): opengl D 601: extensions.c:202 print_extensions [ 0.19134] GL_EXT_debug_marker I/allegro ( 601): opengl D 601: extensions.c:202 print_extensions [ 0.19143] GL_OES_byte_coordinates I/allegro ( 601): opengl D 601: extensions.c:202 print_extensions [ 0.19151] GL_OES_fixed_point I/allegro ( 601): opengl D 601: extensions.c:202 print_extensions [ 0.19159] GL_OES_single_precision I/allegro ( 601): opengl D 601: extensions.c:202 print_extensions [ 0.19166] GL_OES_read_format I/allegro ( 601): opengl D 601: extensions.c:202 print_extensions [ 0.19174] GL_OES_compressed_paletted_texture I/allegro ( 601): opengl D 601: extensions.c:202 print_extensions [ 0.19181] GL_OES_draw_texture I/allegro ( 601): opengl D 601: extensions.c:202 print_extensions [ 0.19189] GL_OES_matrix_get I/allegro ( 601): opengl D 601: extensions.c:202 print_extensions [ 0.19196] GL_OES_query_matrix I/allegro ( 601): opengl D 601: extensions.c:202 print_extensions [ 0.19204] GL_OES_EGL_image I/allegro ( 601): opengl D 601: extensions.c:202 print_extensions [ 0.19212] GL_OES_EGL_sync I/allegro ( 601): opengl D 601: extensions.c:202 print_extensions [ 0.19219] GL_OES_compressed_ETC1_RGB8_texture I/allegro ( 601): opengl D 601: extensions.c:202 print_extensions [ 0.19227] GL_ARB_texture_compression I/allegro ( 601): opengl D 601: extensions.c:202 print_extensions [ 0.19234] GL_ARB_texture_non_power_of_two I/allegro ( 601): opengl D 601: extensions.c:202 print_extensions [ 0.19242] GL_ANDROID_user_clip_plane I/allegro ( 601): opengl D 601: extensions.c:202 print_extensions [ 0.19250] GL_ANDROID_vertex_buffer_object I/allegro ( 601): opengl D 601: extensions.c:202 print_extensions [ 0.19259] GL_ANDROID_generate_mipmap I/allegro ( 601): opengl I 601: extensions.c:680 fill_in_info_struct [ 0.19278] Assumed OpenGL version: 0.0.0.0 I/allegro ( 601): opengl I 601: extensions.c:885 _al_ogl_manage_extensions [ 0.19723] Use of non-power-of-two textures enabled. I/allegro ( 601): opengl I 601: extensions.c:895 _al_ogl_manage_extensions [ 0.19734] Use of FBO to draw to textures disabled. I/allegro ( 601): opengl D 601: ogl_display.c:540 _al_ogl_create_backbuffer [ 0.19747] Creating backbuffer I/allegro ( 601): display I 601: ogl_display.c:565 _al_ogl_create_backbuffer [ 0.19763] Deduced format ABGR_8888_LE for backbuffer. I/allegro ( 601): opengl D 601: ogl_display.c:574 _al_ogl_create_backbuffer [ 0.19786] Creating backbuffer bitmap I/allegro ( 601): display I 601: ogl_display.c:592 _al_ogl_create_backbuffer [ 0.19839] Created backbuffer bitmap (actual format: ABGR_8888_LE) D/AllegroSurface( 601): egl_clearCurrent D/AllegroSurface( 601): egl_clearCurrent done I/allegro ( 601): display D 615: android_display.c:524 android_create_display [ 0.19994] done waiting for surface onChange I/allegro ( 601): display D 615: android_display.c:536 android_create_display [ 0.20010] display: 0x2a11a2f8 480x800 D/AllegroSurface( 601): egl_clearCurrent D/AllegroSurface( 601): egl_clearCurrent done I/allegro ( 601): display D 615: android_display.c:271 _al_android_setup_opengl_view [ 0.20187] setup opengl view d->w=480 d->h=800 E/libEGL ( 601): called unimplemented OpenGL ES API I/allegro ( 601): display D 615: android_display.c:546 android_create_display [ 0.20474] end E/libEGL ( 601): called unimplemented OpenGL ES API I/allegro ( 601): main D 615: main.c:24 print_standard_paths [ 0.21126] ALLEGRO_RESOURCES_PATH: /data/data/org.liballeg.app/files/ I/allegro ( 601): main D 615: main.c:25 print_standard_paths [ 0.21147] ALLEGRO_TEMP_PATH: /mnt/sdcard/Android/data/org.liballeg.app/files/ I/allegro ( 601): main D 615: main.c:26 print_standard_paths [ 0.21166] ALLEGRO_USER_DATA_PATH: /mnt/sdcard/Android/data/org.liballeg.app/files/ I/allegro ( 601): main D 615: main.c:27 print_standard_paths [ 0.21184] ALLEGRO_USER_HOME_PATH: /mnt/sdcard/Android/data/org.liballeg.app/files/ I/allegro ( 601): main D 615: main.c:28 print_standard_paths [ 0.21203] ALLEGRO_USER_SETTINGS_PATH: /mnt/sdcard/Android/data/org.liballeg.app/files/ I/allegro ( 601): main D 615: main.c:29 print_standard_paths [ 0.21222] ALLEGRO_USER_DOCUMENTS_PATH: /mnt/sdcard/Android/data/org.liballeg.app/files/ I/allegro ( 601): main D 615: main.c:30 print_standard_paths [ 0.21239] ALLEGRO_EXENAME_PATH: /data/app/org.liballeg.app-1.apk D/AllegroActivity( 601): decodeBitmap begin D/AllegroSurface( 601): surfaceChanged end I/Choreographer( 601): Skipped 41 frames! The application may be doing too much work on its main thread. D/AllegroActivity( 601): done waiting for decodeStream D/AllegroActivity( 601): decodeBitmap end I/allegro ( 601): android D 615: android_system.c:672 _al_android_load_image [ 0.29809] bitmap dimensions: 128, 128 I/allegro ( 601): opengl D 615: ogl_bitmap.c:411 ogl_upload_bitmap [ 0.29862] Created new OpenGL texture 1 (128x128, format ABGR_8888_LE) I/allegro ( 601): dtor D 615: dtor.c:184 _al_register_destructor [ 0.30085] added dtor for object 0x2a118dc8, func 0x4a293df1 I/allegro ( 601): opengl D 615: ogl_bitmap.c:660 ogl_lock_region_old [ 0.30115] Locking non-backbuffer WRITEONLY E/libEGL ( 601): called unimplemented OpenGL ES API I/allegro ( 601): opengl D 615: ogl_bitmap.c:943 ogl_unlock_region_old [ 0.30598] Unlocking non-backbuffer with conversion E/libEGL ( 601): called unimplemented OpenGL ES API I/allegro ( 601): opengl D 615: ogl_bitmap.c:669 ogl_lock_region_old [ 0.30713] Locking non-backbuffer READWRITE E/libEGL ( 601): called unimplemented OpenGL ES API I/allegro ( 601): opengl D 615: ogl_display.c:269 setup_fbo [ 0.30733] Created FBO: 0 F/libc ( 601): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 615 (rg.liballeg.app) I/ActivityManager( 146): Displayed org.liballeg.app/.AllegroActivity: +1s364ms I/DEBUG ( 34): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** I/DEBUG ( 34): Build fingerprint: 'generic/sdk/generic:4.1.1/JRO03E/403059:eng/test-keys' I/DEBUG ( 34): pid: 601, tid: 615, name: UNKNOWN >>> org.liballeg.app <<< I/DEBUG ( 34): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad I/DEBUG ( 34): r0 00000027 r1 deadbaad r2 4006faec r3 00000000 I/DEBUG ( 34): r4 00000000 r5 4a48987c r6 2a0d8aa8 r7 4a4898c8 I/DEBUG ( 34): r8 4a33eb21 r9 00100000 sl 2a0d8aa8 fp 00000001 I/DEBUG ( 34): ip 4a356dc8 sp 4a489878 lr 40041c09 pc 4003e2a6 cpsr 60000030 I/DEBUG ( 34): d0 000000036b7aa25d d1 3fd3333340000000 I/DEBUG ( 34): d2 3fd3ab606b7aa25d d3 4024000000000000 I/DEBUG ( 34): d4 3fdffffffffeda00 d5 3dc00c5800000000 I/DEBUG ( 34): d6 3fe0000000040316 d7 3fdffffffff7f9d4 I/DEBUG ( 34): d8 0000000000000000 d9 0000000000000000 I/DEBUG ( 34): d10 0000000000000000 d11 0000000000000000 I/DEBUG ( 34): d12 0000000000000000 d13 0000000000000000 I/DEBUG ( 34): d14 0000000000000000 d15 0000000000000000 I/DEBUG ( 34): scr 20000010 I/DEBUG ( 34): I/DEBUG ( 34): backtrace: I/DEBUG ( 34): #00 pc 000182a6 /system/lib/libc.so I/DEBUG ( 34): #01 pc 0000dbd4 /system/lib/libc.so (abort+4) I/DEBUG ( 34): #02 pc 000b562f /data/data/org.liballeg.app/lib/liballegro-debug.so I/DEBUG ( 34): I/DEBUG ( 34): stack: I/DEBUG ( 34): 4a489838 00000000 I/DEBUG ( 34): 4a48983c 00000000 I/DEBUG ( 34): 4a489840 00000000 I/DEBUG ( 34): 4a489844 3f800000 I/DEBUG ( 34): 4a489848 00000000 I/DEBUG ( 34): 4a48984c 00000000 I/DEBUG ( 34): 4a489850 4006a754 /system/lib/libc.so I/DEBUG ( 34): 4a489854 4006fcf0 I/DEBUG ( 34): 4a489858 00000000 I/DEBUG ( 34): 4a48985c 40041c09 /system/lib/libc.so (_fwalk+32) I/DEBUG ( 34): 4a489860 00000001 I/DEBUG ( 34): 4a489864 4a48987c I/DEBUG ( 34): 4a489868 2a0d8aa8 [heap] I/DEBUG ( 34): 4a48986c 4a4898c8 I/DEBUG ( 34): 4a489870 df0027ad I/DEBUG ( 34): 4a489874 00000000 I/DEBUG ( 34): #00 4a489878 4a489880 I/DEBUG ( 34): 4a48987c fffffbdf I/DEBUG ( 34): 4a489880 4a489888 I/DEBUG ( 34): 4a489884 2a118dc8 [heap] I/DEBUG ( 34): 4a489888 4a48989c I/DEBUG ( 34): 4a48988c 2a11a2f8 [heap] I/DEBUG ( 34): 4a489890 2a139db8 [heap] I/DEBUG ( 34): 4a489894 4a33b111 /data/data/org.liballeg.app/lib/liballegro-debug.so I/DEBUG ( 34): 4a489898 4a33eb21 /data/data/org.liballeg.app/lib/liballegro-debug.so I/DEBUG ( 34): 4a48989c 40033bd8 /system/lib/libc.so (__pthread_clone) I/DEBUG ( 34): #01 4a4898a0 00000000 I/DEBUG ( 34): 4a4898a4 4a33b633 /data/data/org.liballeg.app/lib/liballegro-debug.so I/DEBUG ( 34): #02 4a4898a8 4a351d8c /data/data/org.liballeg.app/lib/liballegro-debug.so I/DEBUG ( 34): 4a4898ac 2a118ec0 [heap] I/DEBUG ( 34): 4a4898b0 00000080 I/DEBUG ( 34): 4a4898b4 00000000 I/DEBUG ( 34): 4a4898b8 4077d741 /system/lib/libdvm.so I/DEBUG ( 34): 4a4898bc 4072d47d /system/lib/libdvm.so I/DEBUG ( 34): 4a4898c0 4a33eb21 /data/data/org.liballeg.app/lib/liballegro-debug.so I/DEBUG ( 34): 4a4898c4 2a0d8aa8 [heap] I/DEBUG ( 34): 4a4898c8 00000080 I/DEBUG ( 34): 4a4898cc 00000000 I/DEBUG ( 34): 4a4898d0 00000000 I/DEBUG ( 34): 4a4898d4 2a118dc8 [heap] I/DEBUG ( 34): 4a4898d8 4077d747 /system/lib/libdvm.so I/DEBUG ( 34): 4a4898dc 4072d47d /system/lib/libdvm.so I/DEBUG ( 34): 4a4898e0 00000000 I/DEBUG ( 34): 4a4898e4 00000004 I/DEBUG ( 34):
|
Elias
Member #358
May 2000
|
Is that the android example? I think it requires some strange framebuffer_OES extension right now. My device doesn't have it either... as a work-around I just removed all occurences of "_OES" from Allegro sources. Don't have a good solution yet - but somehow we have to make it work, at runtime, with (for very old devices?) and without that extension. [edit:] Just a guess though, since it looks similar (but not identical) to the problem I solved with that. -- |
Evert
Member #794
November 2000
|
Yes, it's the android example. This is with the emulator rather than an actual device, so it should (hopefully?) be easier to reproduce. Or does Allegro not work (for some reason) on the emulator? EDIT: EDIT2: |
Thomas Fjellstrom
Member #476
June 2000
|
I've not tested it on the emulator, and I fully expect it to not work at all. -- |
Elias
Member #358
May 2000
|
Evert said: I do need to force-quit the app in the emulator I think that's expected, yes. You need to listen to those events to know when the home button is pressed and call exit(0) in response. Or otherwise it will just go into the background (and crash if you draw anything) and send you another event when you are supposed to wake up again. (So basically, a typical Android app might never ever quit, just go to background mode and (hopefully) use 0% CPU while in background mode.) -- |
Thomas Fjellstrom
Member #476
June 2000
|
Pretty much. Android apps's live on. Or at least their process does. The activity lifecycle means that the process itself can stay on long term, but the "activity" itself can be paused, or stopped. In allegro's case, it's bg (user main()) thread can live on as long as the process lives on, and stay running. Allegro will try its best to pick up the pieces, if its still running. Basically you want to pause the execution in your main() thread when you get a switch out. You can do stuff if you want, like download files or something. After you get the halt drawing event, you HAVE to stop drawing. The surface and OES context is likely to be completely invalid. Any access to GLES or EGL would likely crash horribly. That said, it seems like some devices support multiple ES contexts now which is something I admit I didn't expect. Its the only way I can explain that an app can still render in the background, behind the launcher. Or it might be that ICS and JB are doing some magic compositing, and will still render in our background thread under the launcher. Seems strange though, I'd still expect the context to be invalidated, just so that sort of thing doesn't happen. -- |
|