openvr icon indicating copy to clipboard operation
openvr copied to clipboard

OpenVR can't initialize when running in a Windows Store App

Open LibreVR opened this issue 9 years ago • 8 comments

When trying to use OpenVR in a Windows Store App calling VR_Init() results in several errors due to the UWP sandbox.

The first error is VRInitError_Init_PathRegistryNotFound, which is caused by the fact that OpenVR looks for the openvr\openvrpaths.vrpath file in the data directory of the Windows App package at AppData\Local\Packages\<package>\AC\openvr\openvrpaths.vrpath while it's actually located at AppData\Local\openvr\openvrpaths.vrpath. Simply copying this file to the right location works around this error.

The second error is VRInitError_IPC_ServerInitFailed, which seems to be caused by an IPC failure to detect whether the server is running. And the sandbox doesn't allow OpenVR to simply create the server process. I haven't found a workaround for this error yet.

LibreVR avatar Aug 18 '16 15:08 LibreVR

As a workaround to the second issue couldn't you just make a wrapper support application through App Services or LaunchUriForResultsAsync? I don't have the time at present to download the code and have a look myself however I used a similar workaround for another, unfortunately, NDA'ed project I have done recently so I could get access to an existing service. In our case we just ported the code to an App Service if memory serves me right (I lucked out and worked on more interesting stuff) as it gave better results but hopefully it's a pointer in the right direction. Man UWP coding is a pain.

AndyAdshead avatar Aug 19 '16 16:08 AndyAdshead

@AndyAdshead I've considered using a support application, but things like submitting rendered frames would become quite difficult. It would also be redundant, because OpenVR already communicates to a support application, namely the VR server.

It would be a lot more convenient if OpenVR could simply communicate with the VR server from within the UWP sandbox. This is something the Oculus Runtime can already do, though it's not officially supported yet.

LibreVR avatar Aug 19 '16 18:08 LibreVR

Any update on that downvote @LibreVR? Is there a reason it's not working?

AndyAdshead avatar Sep 01 '16 15:09 AndyAdshead

@AndyAdshead It seemed like @jimx78 was giving an upvote for the issue by adding a comment instead of just using an upvote reaction.

LibreVR avatar Sep 01 '16 17:09 LibreVR

@JoeLudwig It seems the latest Oculus SDK adds a missing sample called OculusRoomTiny (UWP+DX11). So while it's not officially supported yet, it does seem that they have internally developed support for it.

LibreVR avatar Sep 05 '16 11:09 LibreVR

Any news?

TheModdersDen avatar Mar 13 '17 04:03 TheModdersDen

I'm porting our old 3D engine opengl 3.0 features to DirectX12. We also make some VR based on openvr for Vive and Rift. I develop an UWP app arround this engine and I need to port the VR part too. But as I can see so far, this is impossible. I haven't found any solution.

Have you found any solution ?

Mayhem50 avatar May 07 '18 15:05 Mayhem50

Tried calling the API in a C++/WinRT UWP app. Same problem. May have to resort to app-services, or drop back to WPF.

Works fine in c++/winrt console app.

NuShrike avatar Feb 16 '22 19:02 NuShrike