Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

Trouble with TestSubmitFramesWhenNotVisible / vrc-pc-input-1

kauffmarkauffmar Posts: 3 Oculus Start Member
I am a relatively new developer, working to finalize my first Oculus Store submission (working in Unity Game Engine: 2018.3.0f2, Oculus Utilities Version:1.31.0). It has been relatively smooth sailing with the exception of the Application Lifecycle Handling requirements. Specifically, my application is failing the TestSubmitFramesWhenNotVisible check in the VRC Validator. The log file appears below:
Starting TestSubmitFramesWhenNotVisible
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 72
Number of texture swap chains committed when not visible 4
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
I believe that I have correctly addressed Input Focus using the following code (called every frame):
void Update () {
		OVRManager.InputFocusLost += GamePause;
		OVRManager.InputFocusAcquired += GameResume;
		OVRManager.VrFocusLost += VRFocusLost;
		OVRManager.VrFocusAcquired += VRFocusFound;
.
.
.
	}
	void GamePause (){
		contrL.SetActive(false);
		contrR.SetActive(false);
		musicBG.Pause();
		warning.Pause();
		Time.timeScale = 0.0f;
	}
	void GameResume (){
		Time.timeScale = 1.0f;
		musicBG.UnPause();
		warning.UnPause ();
		contrL.SetActive(true);
		contrR.SetActive(true);
	}
	void VRFocusLost (){
		renderCam.stereoTargetEye = StereoTargetEyeMask.None;
		UnityEngine.XR.InputTracking.disablePositionalTracking = true;
		contrL.SetActive(false);
		contrR.SetActive(false);
		musicBG.Pause();
		warning.Pause();
		Time.timeScale = 0.0f;
	}
	void VRFocusFound (){
		renderCam.stereoTargetEye = StereoTargetEyeMask.Both;
		UnityEngine.XR.InputTracking.disablePositionalTracking = false;
		Time.timeScale = 1.0f;
		musicBG.UnPause();
		warning.UnPause ();
		contrL.SetActive(true);
		contrR.SetActive(true);
	}
This code is included in both Unity scenes. I have added both OVRManager and OVRPlatform script files to my scene. I am fairly certian that my problem is in how I am handling the instruction to stop submitting frames. My best search efforts on the Unity and Oculus forums have not yielded an example to work from, nor was I able to discern relevant examples in the Oculus Sample Framework. Other strategies I have tried include making the camera inactive (activeCam.SetActive(false);) and setting the target frame rate to 0 (Application.targetFrameRate = 0;), neither of which yielded better results.
I am guessing I am overlooking the obvious, but at a loss for where to proceed next. As this results in a failure of a VRC Validator check, I don't currently have a build uploaded to the submission system, but would be happy to do so if that would be helpful.
Thanks in advance for any insights you can offer.

Comments

  • PAaltoPAalto Posts: 87 Oculus Start Member
    edited January 1
    Hi kauffmar, welcome to the forums!
    Sorry I am not able to help with the actual VRC validation issue (I haven't yet tried to submit a store build, I only have an alpha build at the moment, so I haven't looked into the VRC validation stuff), I just wanted to point out that you should not re-attach the events every frame. Attach them once in Start/Awake, they will then get called when the event occurs. I'm not sure what happens if you attach them every frame (as the attachment ADDS a new event handler every time it is called)...
    In case you just simplified the code snippet and actually attach the events already outside the Update method, ignore this. :)
    Good luck, hope you get that sorted out!

  • kauffmarkauffmar Posts: 3 Oculus Start Member
    Thanks, PAalto! I appreciate you pointing me in the right direction on the use of events. I'm still working on sorting out the Validator check, but this is definitely helpful. Best of luck on LineWars VR.
  • Raj_OOIRaj_OOI Posts: 6
    NerveGear
    @kauffmar Any luck on this? I am also failng this test as of yesterday, first time I ran the Validator and I don't know how to proceed, googling does not yield any results, only unanswered questions such as yours. We have thought about the RnInBackground and disabling it, but this would break our game as we need to send Network messages
  • kauffmarkauffmar Posts: 3 Oculus Start Member
    @Raj_OOI I'm still working on (or rather taking a break from working on) this. Dev is a side gig for me (I'm an academic) so my progress is a bit slow going during the academic year. Top on my list of next things to try is making sure I get my project updated to a supported version of Unity for the Oculus Integration (2018.3.3f1), as I had inadvertently been using a version known to suffer some bugs. If I make any headway I will be sure to post an update and tag you.
Sign In or Register to comment.