Search Unity

GearVR/Unity app crashes under Lollipop

Discussion in 'AR/VR (XR) Discussion' started by Cosmodrome, May 7, 2015.

  1. Cosmodrome

    Cosmodrome

    Joined:
    Aug 3, 2012
    Posts:
    6
    Hi, I created a GearVR app for Expo 2015, an immersive tour for a big cruises company, here's some information about it:

    http://samsung.hdblog.it/2015/04/30/Samsung-ed-MSC-Crociere-in-realta-virtuale/

    I developed it with Unity Pro 4.6.4, Android 4.4.4, and it worked very well. Unfortunately, after the automatic upgrade to Lollipop the app crashes when loading the 3D rooms, with this logcat dump:

    ...........

    E/Adreno-GSL( 9864): : GSL MEM ERROR: kgsl_sharedmem_alloc ioctl failed

    W/Adreno-GSL( 9864): : ioctl fd 40 code 0x40040921 (IOCTL_KGSL_SHAREDMEM_FREE) failed: errno 22 Invalid argument

    W/Adreno-GSL( 9864): : sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory

    E/Adreno-GSL( 9864): : GSL MEM ERROR: kgsl_sharedmem_alloc ioctl failed

    W/Adreno-GSL( 9864): : ioctl fd 40 code 0x40040921 (IOCTL_KGSL_SHAREDMEM_FREE) failed: errno 22 Invalid argument

    W/Adreno-GSL( 9864): : sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory

    E/Adreno-GSL( 9864): : GSL MEM ERROR: kgsl_sharedmem_alloc ioctl failed

    W/Adreno-GSL( 9864): : ioctl fd 40 code 0x40040921 (IOCTL_KGSL_SHAREDMEM_FREE) failed: errno 22 Invalid argument

    F/libc ( 9864): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x4 in tid 10002 (Thread-7021)

    I/DEBUG ( 2059): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***

    I/DEBUG ( 2059): Build fingerprint: 'samsung/trltexx/trlte:5.0.1/LRX22C/N910FXXU1BOC5:user/release-keys'

    I/DEBUG ( 2059): Revision: '12'

    I/DEBUG ( 2059): ABI: 'arm'

    I/DEBUG ( 2059): pid: 9864, tid: 10002, name: Thread-7021 >>> com.Axed.MSC_Room3D <<<

    I/DEBUG ( 2059): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4

    I/DEBUG ( 2059): r0 00000000 r1 00000029 r2 9ec4cac0 r3 00000008

    I/DEBUG ( 2059): r4 00000008 r5 9ec4a000 r6 00000000 r7 000000fb

    I/DEBUG ( 2059): r8 00000001 r9 9ec4c0c0 sl 9ec4c800 fp 00000001

    I/DEBUG ( 2059): ip 00000041 sp 9d5ff820 lr a9063203 pc a906323e cpsr 200f0030

    I/DEBUG ( 2059):

    I/DEBUG ( 2059): backtrace:

    I/DEBUG ( 2059): #00 pc 0013923e /system/vendor/lib/egl/libGLESv2_adreno.so (A4xContext::WriteFsFboLinkage(EsxCmdBufType)+93)

    I/DEBUG ( 2059): #01 pc 0013e055 /system/vendor/lib/egl/libGLESv2_adreno.so (A4xContext::ValidateState(EsxDrawDescriptor const*)+1028)

    I/DEBUG ( 2059): #02 pc 0013e411 /system/vendor/lib/egl/libGLESv2_adreno.so (A4xContext::HwValidateGfxState(EsxDrawDescriptor const*)+4)

    I/DEBUG ( 2059): #03 pc 0010aad5 /system/vendor/lib/egl/libGLESv2_adreno.so (EsxContext::ValidateGfxState(EsxDrawDescriptor const*)+472)

    I/DEBUG ( 2059): #04 pc 0010dddd /system/vendor/lib/egl/libGLESv2_adreno.so (EsxContext::DrawElementsInstanced(EsxPrimType, unsigned int, EsxPixType, void const*, unsigned int)+276)

    I/DEBUG ( 2059): #05 pc 000b21cd /system/vendor/lib/egl/libGLESv2_adreno.so (EsxContext::GlDrawElements(unsigned int, int, unsigned int, void const*)+48)

    I/DEBUG ( 2059): #06 pc 000defa1 /system/vendor/lib/egl/libGLESv2_adreno.so (EsxGlApiParamValidate::GlDrawElements(EsxDispatch*, unsigned int, int, unsigned int, void const*)+52)

    I/DEBUG ( 2059): #07 pc 000aa6a1 /system/vendor/lib/egl/libGLESv2_adreno.so (glDrawElements+40)

    I/DEBUG ( 2059): #08 pc 003a68cc /data/app/com.Axed.MSC_Room3D-1/lib/arm/libunity.so

    I/DEBUG ( 2059): #09 pc 001f80f0 /data/app/com.Axed.MSC_Room3D-1/lib/arm/libunity.so

    I/DEBUG ( 2059): #10 pc 0038734c /data/app/com.Axed.MSC_Room3D-1/lib/arm/libunity.so

    I/DEBUG ( 2059): #11 pc 0038531c /data/app/com.Axed.MSC_Room3D-1/lib/arm/libunity.so

    I/DEBUG ( 2059): #12 pc 003192ec /data/app/com.Axed.MSC_Room3D-1/lib/arm/libunity.so

    I/DEBUG ( 2059): #13 pc 000137bb /system/lib/libc.so (__pthread_start(void*)+30)

    I/DEBUG ( 2059): #14 pc 0001189b /system/lib/libc.so (__start_thread+6)

    ............

    If I change the Unity "Graphics Level" build setting from "Force Open GL ES 2.0" to "3.0" the app works again but the frame rate becomes very low, making it useless. Moreover, sometimes there's a problem with the right eye camera, a sort of noise with random pixels flickering.

    Anyway, to momentarily solve the problem I made a downgrade to KitKat on the devices.

    Have you any suggestions?

    Thank you for the attention,

    Riccardo
     
  2. Cosmodrome

    Cosmodrome

    Joined:
    Aug 3, 2012
    Posts:
    6
    After a lot of testing I found the app crashes simply because in Android 5 there's less memory available.
    To solve the problem I'd to reduce the textures' size approximately by a third. Before that, an assetbundle containng a room was about 25-30 Mb, now is 15-18 Mb.
     
    Dance_M likes this.