Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VRApp works in the Editor but not in built using Linux #1110

Closed
Hydran00 opened this issue Mar 13, 2024 · 6 comments
Closed

VRApp works in the Editor but not in built using Linux #1110

Hydran00 opened this issue Mar 13, 2024 · 6 comments

Comments

@Hydran00
Copy link

Hydran00 commented Mar 13, 2024

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:

  1. Launch ALVR and connect your headset using SteamVR
  2. Open a new 3D Core Project in Unity
  3. Import the steam_vr custom package following com.valvesoftware.unity.openvr-1.2.1.tgz missing meta files #1107
  4. Toggle Initialize XR on Startup and OpenVR Loader in Edit -> Project Settings -> XR Plugin Management
  5. Set Stereo Rendering Module to Multipass and Mirror View Mode to Open VR in Edit -> Project Settings -> OpenVR
  6. Switch Graphics API to Vulkan for Linux in Edit -> Project Settings -> Player -> Rendering
  7. Generate SteamVR Inputs through Window -> SteamVR Input -> Save and generate
  8. Press play -> it works correctly
  9. Build app with File -> Build Settings -> Add Open Scenes then select Linux as Target Platform
  10. 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

@Hydran00
Copy link
Author

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.

@zite
Copy link
Collaborator

zite commented Jul 22, 2024

Hi, thanks for the report. Do you mind giving this a try with the latest beta? https://github.com/ValveSoftware/steamvr_unity_plugin/releases

@kisak-valve kisak-valve added the Need Retest This is an old or potentially fixed issue. It needs confirmation that it still exists label Jul 22, 2024
@Hydran00
Copy link
Author

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:

  1. Launch ALVR and connect your headset using SteamVR
  2. Open a new 3D Core Project in Unity
  3. Import the steam_vr custom package v2.8.3
  4. Toggle Initialize XR on Startup and OpenVR Loader in Edit -> Project Settings -> XR Plugin Management
  5. Set Stereo Rendering Module to Multipass and Mirror View Mode to Open VR in Edit -> Project Settings -> OpenVR
  6. Switch Graphics API to Vulkan for Linux in Edit -> Project Settings -> Player -> Rendering
  7. Generate SteamVR Inputs through Window -> SteamVR Input -> Save and generate
  8. Press play and check if the scene enter VR mode
  9. Build app with File -> Build Settings -> Add Open Scenes then select Linux as Target Platform
  10. Launch compiled AppImage

@kisak-valve kisak-valve removed the Need Retest This is an old or potentially fixed issue. It needs confirmation that it still exists label Jul 31, 2024
@SinanAkkoyun
Copy link

SinanAkkoyun commented Oct 7, 2024

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

@Hydran00
Copy link
Author

Hydran00 commented Oct 7, 2024

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! 😀

@SinanAkkoyun
Copy link

Hi @Hydran00 , acutally you already helped me out, I just had a problem with switching to Vulkan but now it works 😊 Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants