VRApp works in the Editor but not in built using Linux
Hydran00 opened this issue ยท 6 comments
Hi, I am currently trying to build a VR application for Linux using this plugin.
I loaded the Interactions_Example
scene and it runs perfectly fine in the Editor: head movements are tracked perfectly together with controllers.
The problem is that I cannot see my controllers and also buttons do not work in the built Linux application. The only thing that works is the head movement tracking, so I am able to look around but I cannot do anything else.
Setup:
- VR Headset: Meta Quest Pro connected through SteamVR using ALVR
- Unity version: 22.3.21f1 ( I also tried with 2021.3.36f1 and I get the same result)
- Linux OS: Ubuntu 22.04
Step to reproduce:
- Launch ALVR and connect your headset using SteamVR
- Open a new 3D Core Project in Unity
- Import the steam_vr custom package following #1107
- Toggle
Initialize XR on Startup
andOpenVR Loader
inEdit -> Project Settings -> XR Plugin Management
- Set
Stereo Rendering Module
toMultipass
andMirror View Mode
toOpen VR
inEdit -> Project Settings -> OpenVR
- Switch Graphics API to Vulkan for Linux in
Edit -> Project Settings -> Player -> Rendering
- Generate SteamVR Inputs through
Window -> SteamVR Input -> Save and generate
- Press play -> it works correctly
- Build app with
File -> Build Settings -> Add Open Scenes
then selectLinux
asTarget Platform
- Launch compiled AppImage -> head movement is tracked but no controllers appear
Update:
I managed to isolate the problem but still no solution: if I run the app built in debug mode and open the generated log file I find:
...
Editor App Name :
[XR] Editor App Key :
[XR] Action Manifest Path : /home/nardi/Build/VRTest2_Data/StreamingAssets/SteamVR/actions.json
[XR] Stereo Rendering Mode : Multi Pass
[XR] Initialization Type : Scene
[XR] Mirror View Mode : OpenVR View
[XR] [OpenVR] [path] /home/nardi/VRTest2
[XR] [OpenVR] [Error] Action manifest file does not exist at path (/home/nardi/VRTest2/Assets//home/nardi/Build/VRTest2_Data/StreamingAssets/SteamVR/actions.jsonore)
[XR] [OpenVR] startupInfo: {
"action_manifest_path": "/home/nardi/VRTest2/Assets//home/nardi/Build/VRTest2_Data/StreamingAssets/SteamVR/actions.jsonore"
}
...
And I noticed the incorrect path that seems to be a concatenation of two paths. It should be only /home/nardi/Build/VRTest2_Data/StreamingAssets/SteamVR/actions.jsonore
. But I did not find a way to change this.
This seems to be the main issue because after some not-interesting debug lines there is a list of failures that probably are the reason why controllers are not spawning in the scene:
<b>[SteamVR]</b> GetInputSourceHandle (/unrestricted) error: NoData
UnityEngine.StackTraceUtility:ExtractStackTrace () (at /home/bokken/build/output/unity/unity/Runtime/Export/Scripting/StackTrace.cs:37)
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:LogError (object)
Valve.VR.SteamVR_Input_Source:Initialize () (at /home/nardi/VRTest2/Assets/SteamVR/Input/SteamVR_Input_Source.cs:70)
Valve.VR.SteamVR_Input:Initialize (bool) (at /home/nardi/VRTest2/Assets/SteamVR/Input/SteamVR_Input.cs:163)
Valve.VR.SteamVR:CreateInstance () (at /home/nardi/VRTest2/Assets/SteamVR/Scripts/SteamVR.cs:226)
Valve.VR.SteamVR:Initialize (bool) (at /home/nardi/VRTest2/Assets/SteamVR/Scripts/SteamVR.cs:122)
Valve.VR.SteamVR_Behaviour:InitializeSteamVR (bool) (at /home/nardi/VRTest2/Assets/SteamVR/Scripts/SteamVR_Behaviour.cs:119)
Valve.VR.SteamVR_Behaviour:Awake () (at /home/nardi/VRTest2/Assets/SteamVR/Scripts/SteamVR_Behaviour.cs:100)
...
other errors
After several tests I finally managed to make it work.
The issue seems to be related to the generation of SteamVR inputs (step 7 of previous comment).
WORKAROUND:
I generated the inputs before opening the Interactions_Example
and pressing Play
.
If you directly press Play
and then you accept the prompt for generating inputs you may face my issue.
My thought is that maybe there is a bug in the way paths to the actions.json
are generated.
Hi, thanks for the report. Do you mind giving this a try with the latest beta? https://github.com/ValveSoftware/steamvr_unity_plugin/releases
I tested the last beta (v2.8.3) and indeed I faced no issue, furthermore the issue #1107 seems to be solved.
For anyone working in linux that is facing some problems, you can try following my steps:
My setup:
- Unity 22.3.21f1
- Ubuntu 22.04
- SteamVR version 2.7.4 (beta)
- ALVR v20.8.1
Steps:
- Launch ALVR and connect your headset using SteamVR
- Open a new 3D Core Project in Unity
- Import the steam_vr custom package v2.8.3
- Toggle Initialize XR on Startup and OpenVR Loader in Edit -> Project Settings -> XR Plugin Management
- Set Stereo Rendering Module to Multipass and Mirror View Mode to Open VR in Edit -> Project Settings -> OpenVR
- Switch Graphics API to Vulkan for Linux in Edit -> Project Settings -> Player -> Rendering
- Generate SteamVR Inputs through Window -> SteamVR Input -> Save and generate
- Press play and check if the scene enter VR mode
- Build app with File -> Build Settings -> Add Open Scenes then select Linux as Target Platform
- Launch compiled AppImage
Hey @Hydran00 , how did you manage to even let it run at all? After importing SteamVR (from assets store), it warns me that recommended platform is windows (but I leave it at linux), when I hit play in the editor it crashes
Hi @SinanAkkoyun. I have the same warning obviously, but I ignored it. Are you able to enter play mode without connecting the headset? Did you follow each of my steps in the previous comment? I need more details to be able to help you! ๐
Hi @Hydran00 , acutally you already helped me out, I just had a problem with switching to Vulkan but now it works ๐ Thank you!