SteamVR Developer Hardware

SteamVR Developer Hardware

Cue Nov 9, 2016 @ 2:46pm
Temporarily shutting down OpenVR in a Unity application to allow another application to take hold
For the context of this issue, let's imagine a 3D environment to launch games from.

Now, if this launched is using the compositor, then the game it launches can't. But then the launcher needs the compositor again when the user quits out of the game.

Has anyone managed to successfully shutdown OpenVR within Unity and then start it again? I've tried using SafeDispose(), Shutdown() and setting SteamVR.enabled to false without any luck. Seems to outright crash Unity a lot too which I suspect is related to this issue: https://github.com/ValveSoftware/openvr/issues/242 so I may try updating my DLL and see what happens


Anyone?

UPDATE: SOLVED
Last edited by Cue; Nov 10, 2016 @ 6:09am
< >
Showing 1-3 of 3 comments
Balderick Nov 9, 2016 @ 3:15pm 
i use bigscreen beta for 3d environment akin to steamvr dashboard/steamvr compositor. Launching games from extended virtual desktop kill bigscreen beta.

It would appear shutting down the unity app before launching another is the work around to getting two apps to launch from one openvr session.

Last edited by Balderick; Nov 9, 2016 @ 3:16pm
Cue Nov 10, 2016 @ 2:01am 
That was what I was wondering if I'd have to do, was hoping I wouldn't have to though as switching scenes would be a much cleaner route.

Just tried to swap out the OpenVR DLL for an updated version without any luck unfortunately, so that's a no-go.
Last edited by Cue; Nov 10, 2016 @ 2:02am
Cue Nov 10, 2016 @ 6:05am 
Cracked it!

It's all in the timing of how you enable/disable things. Solution is below for anyone who's stuck.

I did this using Unity 5.5 beta, so YMMV with 5.4.

IEnumator SwitchToInGame(Process proc) { // proc is a Process to launch a game/app VRSettings.LoadDeviceByName("none"); yield return new WaitForSeconds(2); // Wait for it to shutdown. SteamVR.SafeDispose(); // Just to be sure. SceneManager.LoadScene("SceneForWhenInGame"); proc.Start(); // Launch the game/app } IEnumator SwitchToLauncher() { VRSettings.enabled = true; VRSettings.LoadDeviceByName("OpenVR"); yield return new WaitForSeconds(2); // Give it time to init VRSettings.enabled = true; // Again just to be sure... SteamVR.enabled = true; SceneManager.LoadScene("LauncherScene"); }

Make sure you have "None" in your supported VR list, but make it second in the list.

This also works if you want to start not in VR, just switch the None and OpenVR around in the list and launch your non-VR scene first.
< >
Showing 1-3 of 3 comments
Per page: 1530 50

Date Posted: Nov 9, 2016 @ 2:46pm
Posts: 3