steamvr_unity_plugin
steamvr_unity_plugin copied to clipboard
OpenVR XR plugin works in Editor but not in Build
Hi, My project was initially using just the Oculus Loader, and it was working correctly in my system. I' ve now removed the oculus loader and added the beta OpenVR loader. When I press play in editor, it works correctly.
But when I open the build, steamVR opens to the blank screen (the screen that comes between apps). The game opens a mirror window, but its a static screen, there is no tracking.
Here are the log files Player.log
SteamVR report while running build SteamVR System Report.txt
SteamVR report while playing within Unity Editor SteamVR-2020-05-13-PM_08_51_49.txt
Thank you!
Just want to add the application name is "tvmagicvr"
Was this 32-bit build? For me the 64-bit builds straight up crash. 32-bit builds do not crash but doesn't work in VR either. I mentioned this as additional note here: https://github.com/ValveSoftware/steamvr_unity_plugin/issues/704#issuecomment-622277232
Yes, It was a 32 bit build. I'm using Unity's standard shaders, no URP/HDRP. Really cant figure out why it seems to be working in editor (although with an added offset to the controllers)
@amartainment The issue of the plugin not working in a packaged build has been reported and will be updated when resolved here #716
Hi - just a note this doesnt appear to be related to #716. We've certainly tested builds with a number of different headsets and also went through functional tests with Unity.
@amartainment - can you try removing/disabling the Oculusplugin from the XR list prior to the builld?
@1runeberg ah, I misunderstood then. Thanks for the clarification.
@1runeberg ah, I misunderstood then. Thanks for the clarification.
no prob @mfoda-acer ... plugin is fairly new and in beta so bound to get issues mixed up, just want to make sure we keep this ticket open so it can be tracked separately.
really do appreciate the help though :)
@1runeberg It was already disabled when making that build.
Just wanted to add that I also tried completely removing the Oculus plugin through the plugin manager.
Hi @amartainment - just coordinating with Unity on this, it seems to happen very early in the process and our plugin hasnt had time to even start yet. For some reason we're unable to hook in to the main and graphics threads.
can you try with a fresh project please and see if you can replicate this on your end?
Hey, sorry for the delay. Tried with an empty scene, just two cubes as controllers and camera, same result.
I am also getting this behavior. Question: has anyone been able to run a SteamVR build with the OpenVR XR plugin under any circmstances?
Here is another repro.
SteamVR-2020-05-21-PM_12_15_30.txt
I'm experiencing the same symptoms Unity 2019.3.13f1 Followed the testing instructions on the plugin's GitHub page. Built a simple scene with camera, 2 cubes and tracked pose drivers. Works in Unity Editor. When built for SteamVR, I get: Steam VR Launches in headset and goes to "default SteamVR scene" (mountains in background). Mirror Window displays on PC and looks correct. But, no tracking. Cubes are not moving. Headset never leaves "default SteamVR scene". I tried with different combinations of Single Pass / Multi Pass, Mirror View: Open VR / None Same Result.
I have the same problem running any of the Unity XR samples from here - https://github.com/Unity-Technologies/XR-Interaction-Toolkit-Examples/tree/master/VR/Assets/Scenes
They work perfectly in the editor. When I build and run I get a black screen before even the "made with unity" splash and nothing works. It also sits there consuming lots of CPU.
I've tried different versions of unity (2020 beta, 2019.3.4), different rendering modes, different color spaces, different APIs (direct X, vulcan, open GL).
Nothing seems to fix it.
Interestingly building x86 does render the splash screen and the opening scene for my game on the desktop, but then is unresponsive.
Building 64-bit just sits on a black screen forever on the desktop.
Neither displays anything in VR, it stays in the steam menu.
Hey @1runeberg Could you share a configuration with which you've been able to build successfully?
Hey @amartainment I had also faced a similar build issue with this OpenVR XR plugin which used to not load my game in the HMD and used to only load a static Mirror screen when built with 32-bit and rendered a black screen with the 64-bit build as mentioned by @hookmanuk too...
After struggling for a few days thinking it was some configuration issue in my setup, I stumbled upon this post #713 which helped me in resolving my 64-bit build issue and now I am able to build and run my VR game on my Vive...
For me, the issue was due to some missing code in SettingsCopier.cs file which is part of the Open VR XP plugin which is detailed in this link https://github.com/ValveSoftware/steamvr_unity_plugin/issues/713#issuecomment-634241004. I hope this helps someone...
The developer did mention that this will get fixed in the next release of the plugin... Attaching my Player.log file for reference...
Hey @amartainment I had also faced a similar build issue with this OpenVR XR plugin which used to not load my game in the HMD and used to only load a static Mirror screen when built with 32-bit and rendered a black screen with the 64-bit build as mentioned by @hookmanuk too...
After struggling for a few days thinking it was some configuration issue in my setup, I stumbled upon this post #713 which helped me in resolving my 64-bit build issue and now I am able to build and run my VR game on my Vive...
For me, the issue was due to some missing code in SettingsCopier.cs file which is part of the Open VR XP plugin which is detailed in this link https://github.com/ValveSoftware/steamvr_unity_plugin/issues/713#issuecomment-634241004. I hope this helps someone...
The developer did mention that this will get fixed in the next release of the plugin... Attaching my Player.log file for reference...
Thank you so much. That did work! Building a 64bit build after changing the settings seems to solve the problem. Although while testing with the Oculus Link, there is an additional offset to the hand models, waaay easier problem to have :)
Leaving the issue open as 32 bit builds still don't work.
The fix mentioned by @jeffrey97 didn't work for me. I'm still getting the black screen with 64bit build.
Interestingly, I noticed that my "StreamingAssets/SteamVR" folder already had a file named "OpenVRSettings.asset" which is slightly different than "Open VR Settings.asset". (no spaces). Anyway, I found the one in "Assets" with spaces in the name and copied that there as well. (The content is identical). But, no joy. Still Black Screen.
Also, I looked in my Player Log and did not find the "Unable to submit eye texture" error.
However, I did find this error which I now suspect is the real issue:
`NotSupportedException: IL2CPP does not support marshaling delegates that point to instance methods to native code. The method we're attempting to marshal is: Unity.XR.OpenVR.OpenVRLoader::TickCallback at Unity.XR.OpenVR.OpenVRLoader.Initialize () [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.XR.Management.XRManagerSettings.InitializeLoaderSync () [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.XR.Management.XRGeneralSettings.InitXRSDK () [0x00000] in <00000000000000000000000000000000>:0
(Filename: currently not available on il2cpp Line: -1)
Initializing input.
Input initialized.
Initialized touch support.
XR display is not ready. Skip XR rendering. UnityEngine.Logger:Log(LogType, Object) UnityEngine.Debug:Log(Object) UnityEngine.Rendering.Universal.UniversalRenderPipeline:Render(ScriptableRenderContext, Camera[]) UnityEngine.Rendering.RenderPipelineManager:DoRenderLoop_Internal(RenderPipelineAsset, IntPtr)`
Fixed it !
Based on this thread: https://forum.unity.com/threads/monopinvokecallback-in-unity.132510/
I modified : steamvr_unity_plugin-UnityXRPlugin\Runtime\OpenVRLoader.cs
by making "TickCallback" static and adding the MonoPInvokeCallback attribute:
[AOT.MonoPInvokeCallback(typeof(TickCallbackDelegate))]
private static void TickCallback(int value)
{
OpenVREvents.Update();
}
Now it works (with MirrorMode: None)
And it also now works with MirrorMode: Open VR
I am also having the offset issue mentioned by others.
The headset tracks lower in build version than it does when running in the Editor.
But, that's a much easier problem to deal with.
@KenLange314 that's awesome! I'll try it out and see if it works for me as well. Additionally, just wanted to check which headset you're testing with? Is the offset present across devices? Im using Oculus touch controllers with A Quest + Link.
@amartainment I am also using Quest + Link with touch controllers & GeForce RTX 2070
Check your Player log and see if you have the same error message. "NotSupportedException ... OpenVRLoader::TickCallback:
My co-developer was using a Vive Cosmos w. Radeon and he had both issues:
NotSupportedException ... OpenVRLoader::TickCallback: and Unable to submit eye texture
we were able to get our game working on his machine by using both work-arounds.
(I only had the TickCallback issue on my machine)
Fixed it !
Based on this thread: https://forum.unity.com/threads/monopinvokecallback-in-unity.132510/
I modified : steamvr_unity_plugin-UnityXRPlugin\Runtime\OpenVRLoader.cs
by making "TickCallback" static and adding the MonoPInvokeCallback attribute:
[AOT.MonoPInvokeCallback(typeof(TickCallbackDelegate))] private static void TickCallback(int value) { OpenVREvents.Update(); }
This fixed it for me too. Thank you! @KenLange314
I'm experiencing this same issue with Unity 2019.4.26f1 and OpenVR XR plugin 1.1.4. The above mentioned work-arounds appear to have already been integrated into the version I have and thus have not resolved the issue.
Everything works fine in-editor, but when I make a Win64 build and run it, I get the standard Unity splash screen (instead of the VR splash), no HMD tracking, and in the HMD it just sits in the compositor with the floating window that says "Up Next
I've tried removing all other XR plugins. That did get rid of some Oculus-related errors in the log. But now there are no errors in the log that would point to what is going wrong, but it still won't render to, or track, the HMD.
Replying to https://github.com/ValveSoftware/steamvr_unity_plugin/issues/724#issuecomment-889783171
@Punchey Wonder if you get an error like
"[XR] [OpenVR] [Error] Unsupported application type: 0 The referenced script on this Behaviour (Game Object 'EventSystem') is missing!"
in "C:\Users\Username\AppData\LocalLow\CompanyName\ProductName\Player.log"
I just replace the abovementioned OpenVRSettings.asset
file in the StreamAssets\SteamVR
with a new project generated asset
OpenVRSettings.zip then run the build and it works well.
Replacing the OpenVRSettings.asset worked for me.