Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Unity 2018.3 is now released.
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Application Hang on Resume

Discussion in 'Xiaomi' started by moldywarpe, Jan 26, 2019.

  1. moldywarpe

    moldywarpe

    Joined:
    Jan 18, 2017
    Posts:
    23
    Hi,
    I'm hoping that someone has encountered this error previously and may have some tips on how to avoid or fix.
    Our MiVR Standalone application is built with Unity 2018.2.1 using the MIVR_Unity_SDK_1.8.7.

    The issue relates to resuming the application when continue is selected after VrManager.Instance.ReturnToLauncher() has been used to exit the application using the back button (or when the home button is used which does the same thing).

    After continue is selected the application effectively hangs and a blank screen is seen although application sound can still be heard.
    The problem appears to be related to losing the GL context after resuming the application (based on the log snippet below).

    The application pause/resume process should be handled by the MiVR NativePluginEvents so is external to the application code. If so this issue may be related to the application configuration settings??

    Settings that may be relevant include:
    • Color Space is Linear (have tried using Gamma)
    • Graphics API is OPENGLES3
    • Texture Compression is ETC2(GLES3)
    • MultiThreaded Rendering is not used
    • Minimum API level is 4.4
    The same application running on Oculus platform resumes fine.
    So does anyone have any ideas or suggestions ... @unityjingyao

    Cheers.


    Logcat output
    01-25 20:09:25.839 851 867 I Unity : 20:09:25 OnResume: start
    01-25 20:09:25.839 851 867 I Unity :
    01-25 20:09:25.839 851 867 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
    01-25 20:09:25.839 851 867 I Unity :
    01-25 20:09:25.844 966 979 D ActivityTrigger: ActivityTrigger activityStopTrigger
    01-25 20:09:25.848 851 867 W VrApi : vrapi_GetPredictedDisplayTime: ovr->Destroyed
    01-25 20:09:25.848 851 867 W VrApi : vrapi_GetPredictedTracking: ovr->Destroyed
    01-25 20:09:25.848 851 867 W VrApi_Input: vrapi_GetInputTrackingState: ovr->Destroyed
    01-25 20:09:25.848 851 867 I OCVrApiWrapper: Controller disconnected, ID = 0
    01-25 20:09:25.877 851 867 W VrApi : vrapi_GetPredictedDisplayTime: ovr->Destroyed
    01-25 20:09:25.877 851 867 W VrApi : vrapi_GetPredictedTracking: ovr->Destroyed
    01-25 20:09:25.877 851 867 W VrApi_Input: vrapi_GetInputTrackingState: ovr->Destroyed
    01-25 20:09:25.877 851 867 I OCVrApiWrapper: Controller disconnected, ID = 4294967295
    01-25 20:09:25.900 851 867 W VrApi : vrapi_GetPredictedDisplayTime: ovr->Destroyed
    01-25 20:09:25.900 851 867 W VrApi : vrapi_GetPredictedTracking: ovr->Destroyed
    01-25 20:09:25.900 851 867 W VrApi_Input: vrapi_GetInputTrackingState: ovr->Destroyed
    01-25 20:09:25.900 851 867 I OCVrApiWrapper: Controller disconnected, ID = 4294967295
    01-25 20:09:25.900 851 867 I Unity :
    01-25 20:09:25.900 851 867 I Unity : 20:09:25 OnResume: StartVrMode()
    01-25 20:09:25.900 851 867 I Unity :
    01-25 20:09:25.900 851 867 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
    01-25 20:09:25.900 851 867 I Unity :
    01-25 20:09:25.901 851 867 I mivr : DoVRResume() tid: 867
    01-25 20:09:25.901 851 867 D VrLib : VrLib.getDeviceModel Build.MODEL: v1o
    01-25 20:09:25.905 26852 26865 I AppSdkProvider : query
    01-25 20:09:25.905 26852 26865 I AppSdkProvider : platform uri matched, result=2
    01-25 20:09:25.907 851 867 D VrLib : VrLib.getDeviceModel return: 2
    01-25 20:09:25.907 851 867 D VrLib : Registering battery receiver
    01-25 20:09:25.910 851 867 I VrApi : ---------- vrapi_EnterVrMode [start] ----------
    01-25 20:09:25.910 851 867 D InputHooksJava: Enabling Java Input Hooks
    01-25 20:09:25.910 851 867 I InputDeviceManager: ovrInputDeviceManager::Initialize
    01-25 20:09:25.910 851 867 D VrApi : getControllerHandedness
    01-25 20:09:25.910 851 867 D VrManagerNative: getControllerHandedness
    01-25 20:09:25.911 851 851 D VrLib : OnReceive BATTERY_ACTION_CHANGED
    01-25 20:09:25.911 851 867 W VrManagerNative: getControllerHandedness could not read the handedness
    01-25 20:09:25.911 851 867 W VrManagerNative: java.util.NoSuchElementException
    01-25 20:09:25.911 851 867 W VrManagerNative: at android.os.BinderProxy.transactNative(Native Method)
    01-25 20:09:25.911 851 867 W VrManagerNative: at android.os.BinderProxy.transact(Binder.java:615)
    01-25 20:09:25.911 851 867 W VrManagerNative: at com.oculus.os.IVrApiService$Stub$Proxy.getDeviceProperty(IVrApiService.java:403)
    01-25 20:09:25.911 851 867 W VrManagerNative: at com.oculus.vrapi.VRManagerNative.getControllerHandedness(VRManagerNative.java:309)
    01-25 20:09:25.911 851 867 W VrManagerNative: at com.oculus.vrapi.VrApi.getControllerHandedness(VrApi.java:446)
    01-25 20:09:25.911 851 867 W VrManagerNative: at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
    01-25 20:09:25.911 851 867 W VrManagerNative: at com.unity3d.player.UnityPlayer.c(Unknown Source)
    01-25 20:09:25.911 851 867 W VrManagerNative: at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source)
    01-25 20:09:25.911 851 867 W VrManagerNative: at android.os.MessageQueue.next(MessageQueue.java:392)
    01-25 20:09:25.911 851 867 W VrManagerNative: at android.os.Looper.loop(Looper.java:136)
    01-25 20:09:25.911 851 867 W VrManagerNative: at com.unity3d.player.UnityPlayer$e.run(Unknown Source)
    01-25 20:09:25.911 851 867 I ScreenCapture: GetScreenCaptureFlagFromVrHelper
    01-25 20:09:25.911 851 867 E VrManagerNative: getProviderPropertyString not supported
    01-25 20:09:25.911 851 867 D TrackingServiceConnectionNative: onClientConnect
    01-25 20:09:25.911 851 851 I mivr : nativeBatteryEvent(5, 100, 320)
    01-25 20:09:25.911 851 867 D BinderConnection: Connecting to TrackingService
    01-25 20:09:25.911 851 867 D TrackingServiceConnectionNative: onConnected
    01-25 20:09:25.913 1238 1776 I TrackingService: TrackingService::getSharedMemoryFileDescriptor
    01-25 20:09:25.913 851 867 I TrackingServiceClient: OVR::TrackingService::ClientSetInterface
    01-25 20:09:25.913 851 867 I TrackingServiceClient: TrackingService client: roFd(67)
    01-25 20:09:25.914 851 867 I TrackingServiceClient: TrackingService client: connected to interface version 5.
    01-25 20:09:25.914 851 867 I TrackingServiceClient: TrackingService client: last prediction time is 0.001383 seconds old
    01-25 20:09:25.914 851 867 I TrackingServiceClient: TrackingService client: provided by pid=1238
    01-25 20:09:25.914 1238 1273 I TrackingService: TrackingService::registerClient
    01-25 20:09:25.914 1238 1273 I TrackingService: Registering client with TrackingServiceHost
    01-25 20:09:25.914 1238 1273 I TrackingService: Notifying client pid 851 of new remote 3ec39034b8beda0b
    01-25 20:09:25.914 851 867 D TrackingServiceClient: TrackingServiceClient onRemoteConnected 4522617006922324491
    01-25 20:09:25.914 851 867 I InputDeviceManager: ovrInputDeviceManager::SetRemoteConnected - hardwareID = 4522617006922324491, modelID = 6
    01-25 20:09:25.914 851 867 I InputDeviceManager: ovrInputDeviceManager::CreateDevice - hardwareID = 4522617006922324491, modelID = 6
    01-25 20:09:25.914 851 867 I InputDeviceManager: ovrInputDeviceManager::AllocDevice - hardwareID = 4522617006922324491, modelID = 6
    01-25 20:09:25.914 851 867 I InputDeviceManager: ovrControllerType_TrackedRemote
    01-25 20:09:25.914 851 867 I InputDeviceManager: ovrInputDeviceManager::SetRemoteConnected - hardwareId = 4522617006922324491 controller type = 4
    01-25 20:09:25.914 1238 1273 I TrackingService: TrackingServiceHost GetSharedMemoryFileDescriptor for client pid 851
    01-25 20:09:25.914 1238 1273 I TrackingService: TrackingServiceHost registered common client; there are 0 secure clients
    01-25 20:09:25.915 851 867 I TrackingServiceClient: ClientConnectComplete
    01-25 20:09:25.916 851 867 D VrApi : targetSDKVersion 26
    01-25 20:09:25.917 851 867 I VrApi : DEVICE MODEL NUMBER = v1o
    01-25 20:09:25.917 851 867 I VrApi : DEVICE HARDWARE = pacific
    01-25 20:09:25.917 851 867 I VrApi : DEVICE BUILD NAME = N2G48H
    01-25 20:09:25.917 851 867 I VrApi : DEVICE BUILD TYPE = user
    01-25 20:09:25.917 851 867 I VrApi : DEVICE OS VERSION = 7.1.2
    01-25 20:09:25.917 851 867 I VrApi : VRAPI VERSION = 1.1.14.3-109978416-109978416 May 23 2018 18:12:40 Development RELEASE
    01-25 20:09:25.917 851 867 I VrApi : VRAPI LOADER VERSION = 1.1.14.0
    01-25 20:09:25.917 851 867 I VrApi : APP NAME = application_Name
    01-25 20:09:25.917 851 867 I VrApi : APP VERSION = 1.2 versionCode 52 internalVersionName <none>
    01-25 20:09:25.917 851 867 I VrApi : APP VR TYPE = <none>
    01-25 20:09:25.917 851 867 I VrApi : APP PACKAGE NAME = com.application.name
    01-25 20:09:25.917 851 867 I VrApi : APP ACTIVITY CLASS = com.mi.dlabs.vr.sdk.plugins.unity.MiVRUnityPlayerActivity
    01-25 20:09:25.917 851 867 I VrApi : ovrModeParms::VRAPI_MODE_FLAG_ALLOW_POWER_SAVE = 0
    01-25 20:09:25.917 851 867 I VrApi : ovrModeParms::VRAPI_MODE_FLAG_RESET_WINDOW_FULLSCREEN = 0
    01-25 20:09:25.917 851 867 I VrApi : ovrModeParms::VRAPI_MODE_FLAG_NATIVE_WINDOW = 0
    01-25 20:09:25.917 851 867 I VrApi : ovrModeParms::VRAPI_MODE_FLAG_FRONT_BUFFER_PROTECTED = 0
    01-25 20:09:25.917 851 867 I VrApi : ovrModeParms::VRAPI_MODE_FLAG_FRONT_BUFFER_565 = 0
    01-25 20:09:25.917 851 867 I VrApi : ovrModeParms::VRAPI_MODE_FLAG_FRONT_BUFFER_SRGB = 0
    01-25 20:09:25.917 851 867 I VrApi : ovrModeParms::VRAPI_MODE_FLAG_CREATE_CONTEXT_NO_ERROR = 0
    01-25 20:09:25.917 851 867 I VrApi : HMD sensor attached.
    01-25 20:09:25.918 578 741 D VrApiService: refresh-rate changed to 72Hz
    01-25 20:09:25.918 851 867 I VrApi : Set Display(0) Refresh Rate = 72.000000
    01-25 20:09:25.918 851 867 D BatteryReceiver: Registering battery receiver
    01-25 20:09:25.920 851 867 D HeadsetReceiver: getCurrentHeadsetState: false
    01-25 20:09:25.920 851 867 I DeviceStatus_Android: nativeHeadsetEvent(0)
    01-25 20:09:25.921 851 867 I DeviceStatus_Android: nativeGamepadListener(0)
    01-25 20:09:25.921 851 867 I VrApi : OVR::Clocks thread started
    01-25 20:09:25.921 851 867 I TimeWarp: ---------------- TimeWarpLocal() ----------------
    01-25 20:09:25.922 851 867 I TimeWarp: DisplayParms.ScanoutDirection = 0
    01-25 20:09:25.922 851 867 I TimeWarp: DisplayParms.ShutterType = 1
    01-25 20:09:25.922 851 867 I TimeWarp: DisplayParms.timing = 0.600000 0.600000
    01-25 20:09:25.922 851 867 I TimeWarp: DisplayParms.prediction = (2.000000 2.000000) (2.000000 2.000000)
    01-25 20:09:25.922 851 867 I TimeWarp: forceNumScreenSlices = 1
    01-25 20:09:25.922 851 867 I Vsync : ---------------- Vsync::Init ----------------
    01-25 20:09:25.922 851 867 I Vsync : Using VsyncModel 0
    01-25 20:09:25.922 851 867 I Vsync : Opened /sys/class/graphics/fb0/vsync_event
    01-25 20:09:25.922 851 867 I TimeWarp: TimeWarpAllocatedFrontBuffer = 0
    01-25 20:09:25.922 851 867 I TimeWarp: Application context EGL_CONTEXT_CLIENT_VERSION = 3
    01-25 20:09:25.922 851 867 E libEGL : eglQuerySurface:641 error 300d (EGL_BAD_SURFACE)
    01-25 20:09:25.922 851 867 E libEGL : eglQuerySurface:641 error 300d (EGL_BAD_SURFACE)

    01-25 20:09:25.922 851 867 I TimeWarp: frontBufferWidth = 0
    01-25 20:09:25.922 851 867 I TimeWarp: frontBufferHeight = 0
    01-25 20:09:25.922 851 867 I TimeWarp: frontBufferIsProtected = 0
    01-25 20:09:25.922 851 867 I TimeWarp: frontBufferIs565 = 0
    01-25 20:09:25.922 851 867 I TimeWarp: warpMeshClipMode = 1
    01-25 20:09:25.922 851 999 I TimeWarp: WarpThreadInit()
    01-25 20:09:25.924 851 999 I TimeWarp: Context is EGL_CONTEXT_PRIORITY_HIGH_IMG
    01-25 20:09:25.925 851 999 E libEGL : eglMakeCurrent:787 error 300d (EGL_BAD_SURFACE)
    01-25 20:09:25.925 851 999 F TimeWarp: eglMakeCurrent front buffer failed: EGL_BAD_SURFACE
    01-25 20:09:25.925 851 999 E CRASH : signal 6 (SIGABRT), code -6 (?), fault addr --------

    01-25 20:09:25.925 851 999 E CRASH : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    01-25 20:09:25.925 851 999 E CRASH : Build fingerprint: 'mi/v1o/pacific:7.1.2/N2G48H/331:user/dev-keys'
    01-25 20:09:25.925 851 999 E CRASH : Revision: '0'
    01-25 20:09:25.926 851 999 E CRASH : pid: 851, tid: 999, name: OVR::TimeWarp >>> com.application.name <<<
    01-25 20:09:25.926 851 999 E CRASH : r0 00000000 r1 000003e7 r2 00000006 r3 00000008
    01-25 20:09:25.926 851 999 E CRASH : r4 c740c978 r5 00000006 r6 c740c920 r7 0000010c
    01-25 20:09:25.926 851 999 E CRASH : r8 c4e69c40 r9 c4e72040 sl 00000004 fp c740c70c
    01-25 20:09:25.926 851 999 E CRASH : ip 00000000 sp c740c200 lr f02e0cd3 pc f02e35ec cpsr c740be90
     
  2. moldywarpe

    moldywarpe

    Joined:
    Jan 18, 2017
    Posts:
    23
    Ok - the issue is due to the fact that Unity 2018+ is not supported when using MIVR_Unity_SDK.
    The documentation states :
    We recommend developers to use Unity v5.5.5 and later version, using other version may have incompatibility problem.
    The application was rebuilt under Unity 2017.4 (after fixing all the issues related to reverting to older Unity versions.... broken prefabs anyone...) and the issue related to the hang on resume was resolved.