Skip to main content
March 25, 2019

TestSubmitFramesWhenNotVisible failing on Unity

I am writing an oculus app and running the oculus validator. It is my understanding that the app needs to stop outputting frames when it looses vr focus: https://developer.oculus.com/documentation/unity/latest/concepts/unity-lifecycle/

However, I am not clear if I am supposed to be doing this manually. From what I can tell on old forum posts, unity is supposed to handle this automatically for me. From what I see, when the the app loses focus, it's mirror window on the computer screen goes black, but the TestSubmitFramesWhenNotVisible fails anyway with 2 frames submitted. Is there some code that I should be calling in my unity scripts in response to OVRManager.hasVrFocus?

I find it interesting though, that the number of ovr_CommitTextureSwapChain goes down from 36 to 2.

'''

"c:\Program Files\Oculus\Support\oculus-diagnostics\OculusVRCValidator" --path build/game/game.exe --test TestSubmitFramesWhenNotVisible

 

 22/03 23:46:57.299 {INFO}    [Kernel:Default] [CAPI] LibOVR module is located at C:\Program Files\Oculus\Support\oculus-runtime\LibOVRRT64_1.dllStarting TestSubmitFramesWhenNotVisible

 

 22/03 23:46:57.306 {INFO}    [Client] Connected to the server running version (prod = 1).1.36.0(build = 215623) feature version = 0. Client runs version (prod = 1).1.36.0(build = 0) feature version = 0

 Waiting for the application to run for 5 seconds before testing begins...

 Starting test...

 Requesting the void...

 Number of texture swap chains committed when visible 36

 Number of texture swap chains committed when not visible 2

 ERROR: Committed a texture swap chain (called ovr_CommitTextureSwapChain) when application not visible

 Please refer to VRC Guidelines: https://developer.oculus.com/distribute/latest/concepts/vrc-pc-input-1/

 Cleaning up...

 Test FAILED

'''

    This topic has been closed for replies.

    2 replies

    March 25, 2019
    You're better off posting this in the developer's forum mate. There's a drop-down list box at the top of this page on the right that currently should say Community. Click on it and select Developer and it'll take you there.
    New Participant
    May 7, 2019
    I passed it once by disiabling camera, I attached this script to a gameobject in the first scene and dragged the camera from the ovr gameobject into the array for the script.  I then failed again so getting inconsitent results is my new challenge.  Here's a starting point at least.

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;

    public class HMDCheck : MonoBehaviour
    {
        public Camera[] cameras;
         // Update is called once per frame
        void Update()
        {
            if (!OVRManager.isHmdPresent)
            {
                foreach (Camera item in cameras)
                {
                    item.enabled = false;
                }
                Time.timeScale = 0f;
                Debug.Log("Freeze");
            }
            else
            {
                foreach(Camera item in cameras)
                {
                    item.enabled = true;
                }
                Time.timeScale = 1f;
                Debug.Log("Unfreeze");
            }
        }
    }