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

SteamVR haptics failing in Unity 2022.3.+ #1096

Open
Giantbean opened this issue Jun 30, 2023 · 11 comments
Open

SteamVR haptics failing in Unity 2022.3.+ #1096

Giantbean opened this issue Jun 30, 2023 · 11 comments

Comments

@Giantbean
Copy link

I have been trying to get Steam VR to work with open XR for far too long I have Hurricane VR with Steam VR implementation on an XR rig and it was working in an older unity build however I recently updated a project to Unity 2022.3.1 LTS but ever since I have had terrible frame rates and I am getting an error that I have no idea how to fix.

[SteamVR] TriggerHapticVibrationAction (/actions/HVR/out/Haptics) error: NoData handle: 1152950504226030324
UnityEngine.Debug:LogError (object)
Valve.VR.SteamVR_Action_Vibration_Source:Execute (single,single,single,single) (at Assets/SteamVR/Input/SteamVR_Action_Vibration.cs:207)
Valve.VR.SteamVR_Action_Vibration:Execute (single,single,single,single,Valve.VR.SteamVR_Input_Sources) (at Assets/SteamVR/Input/SteamVR_Action_Vibration.cs:49)
HurricaneVR.Framework.SteamVR.HVRSteamVRController:Vibrate (single,single,single) (at Assets/HurricaneVR/Framework/Scripts/SteamVR/HVRSteamVRController.cs:146)
HurricaneVR.Framework.Components.HVRHandImpactHaptics:Vibrate (single,single,single) (at Assets/HurricaneVR/Framework/Scripts/Components/HVRHandImpactHaptics.cs:45)
HurricaneVR.Framework.Components.HVRImpactHapticsBase:OnCollisionEnter (UnityEngine.Collision) (at Assets/HurricaneVR/Framework/Scripts/Components/HVRImpactHapticsBase.cs:57)
UnityEngine.Physics:OnSceneContact (UnityEngine.PhysicsScene,intptr,int)

With a matching error (likely for the other hands haptics)
[SteamVR] TriggerHapticVibrationAction (/actions/HVR/out/RightHaptics) error: NoData handle: 1152950504226030325
UnityEngine.Debug:LogError (object)

I have tried updating to the newer 2022 LTS but have had many issues.

Please advise.
Thank you.

@Giantbean Giantbean changed the title SteamVR OpenXR haptics failing in Unity 2022.3.+ SteamVR haptics failing in Unity 2022.3.+ Jul 4, 2023
@Giantbean
Copy link
Author

Giantbean commented Jul 4, 2023

I am using a character rig that has worked prior to the new Unity versions so the action inputs should all be the same.
Also the HTTP in some code needs to update to HTTPS in the repo for ease of use.
image
image

@zite
Copy link
Collaborator

zite commented Jul 5, 2023

Heya, not sure why this isn't working. Can you provide a full unity log?

@Giantbean
Copy link
Author

Editor.log
Thanks. Hope the log helps.

@zite
Copy link
Collaborator

zite commented Jul 5, 2023

Unfortunately I'm not seeing anything super obvious in the logs. It looks like its failing during initialization, which is pretty odd. I've got a few suggestions but its hard to guess what's wrong with an existing project. If you can give repro steps I could debug further. As to my guesses though:
Maybe disable the OpenXR loader? If that tries to initialize first that could break things.
Are you running a super old version of SteamVR itself?
Also try saving and regenerating actions in the SteamVR Input window.

@Giantbean
Copy link
Author

I'm using SteamVR 1.16.8; the current OpenXR runtime is SteamVR. Unity Project Settings are set to OpenXR Play mode runtime SteamVR and I have tried using just OpenVR. Things work in Unity 2020 and 2021 versions so I think this is a Unity 2022 issue. I have made 8 test projects and updated three projects from 2021 to 2022 and all of them have issues. I have uninstalled all Unity versions and Hub and reinstalled just LTS versions and every time I get errors, crashes, and terrible frame rates. Projects that were getting steady 90+ fps drop to 30- as soon as I bring them into 2022 Even Unity's own XR framework example bounces between just 40 and 70 fps.

@zite
Copy link
Collaborator

zite commented Jul 6, 2023

The SteamVR Unity Plugin will not function if you try to use OpenXR. It is made exclusively to work with OpenVR. I'd recommend removing the OpenXR package and then we can take a look at the editor log again.

@Giantbean
Copy link
Author

Giantbean commented Jul 6, 2023

Will do.
I have an older project with both in it and it works fine

image

but if I have to choose one or the other I will use SteamVR so long as I can get it working in Unity 2022.

It seems one trick to making it work with both is to not fix the input system

image

At least in older versions of Unity. So the OpenXR is likely redundant and doing nothing but adding the project's file size. :P

@OberProGamerY
Copy link

Sorry for necroing this issue, but I have run into the exact same problem with the Hurricane VR Asset, SteamVR and Unity 2022 versions.

I have tried multiple setups with different 2022 versions of Unity, always ONLY installing the bare minimum SteamVR setup (no OpenXR stuff), but it results in the same errors as shown by Giantbean:
image

Any Unity 2021 version is fine; I also tested the Unity 6 preview, but it has the same errors as 2022.

Weirdly enough, the haptic feedback works fine when you ignore the two errors by unpausing the editor.

@zite
Copy link
Collaborator

zite commented Sep 30, 2024

Heya, have you tried with the latest beta here: https://github.com/ValveSoftware/steamvr_unity_plugin/releases/tag/2.8.3b2

@OberProGamerY
Copy link

OberProGamerY commented Sep 30, 2024

Hi, I made a new 2022 project with the 2.8.3b2 beta and it sadly results in the same errors being thrown:

[SteamVR] TriggerHapticVibrationAction (/actions/HVR/out/Haptics) error: NoData handle: 1153031816546878148
UnityEngine.Debug:LogError (object)
Valve.VR.SteamVR_Action_Vibration_Source:Execute (single,single,single,single) (at Assets/SteamVR/Input/SteamVR_Action_Vibration.cs:247)
Valve.VR.SteamVR_Action_Vibration:Execute (single,single,single,single,Valve.VR.SteamVR_Input_Sources) (at Assets/SteamVR/Input/SteamVR_Action_Vibration.cs:49)
HurricaneVR.Framework.SteamVR.HVRSteamVRController:Vibrate (single,single,single) (at Assets/HurricaneVR/Framework/Scripts/SteamVR/HVRSteamVRController.cs:146)
HurricaneVR.Framework.Components.HVRHandImpactHaptics:Vibrate (single,single,single) (at Assets/HurricaneVR/Framework/Scripts/Components/HVRHandImpactHaptics.cs:45)
HurricaneVR.Framework.Components.HVRImpactHapticsBase:OnCollisionEnter (UnityEngine.Collision) (at Assets/HurricaneVR/Framework/Scripts/Components/HVRImpactHapticsBase.cs:57)
UnityEngine.Physics:OnSceneContact (UnityEngine.PhysicsScene,intptr,int)

[SteamVR] TriggerHapticVibrationAction (/actions/HVR/out/RightHaptics) error: NoData handle: 1153031816546878149
UnityEngine.Debug:LogError (object)
Valve.VR.SteamVR_Action_Vibration_Source:Execute (single,single,single,single) (at Assets/SteamVR/Input/SteamVR_Action_Vibration.cs:247)
Valve.VR.SteamVR_Action_Vibration:Execute (single,single,single,single,Valve.VR.SteamVR_Input_Sources) (at Assets/SteamVR/Input/SteamVR_Action_Vibration.cs:49)
HurricaneVR.Framework.SteamVR.HVRSteamVRController:Vibrate (single,single,single) (at Assets/HurricaneVR/Framework/Scripts/SteamVR/HVRSteamVRController.cs:146)
HurricaneVR.Framework.Components.HVRHandImpactHaptics:Vibrate (single,single,single) (at Assets/HurricaneVR/Framework/Scripts/Components/HVRHandImpactHaptics.cs:45)
HurricaneVR.Framework.Components.HVRImpactHapticsBase:OnCollisionEnter (UnityEngine.Collision) (at Assets/HurricaneVR/Framework/Scripts/Components/HVRImpactHapticsBase.cs:57)
UnityEngine.Physics:OnSceneContact (UnityEngine.PhysicsScene,intptr,int)

EDIT: not related to the issue described here, but the SteamVR 2.8.3b2 plugin causes the player to be 3-4m above the ground.

@OberProGamerY
Copy link

I have been testing a bit more and I think I have found a workaround and possible "source" of the issue:
It seems like the Hurricane VR toolkit is sending a haptic action right at scene startup, just before something in the SteamVR or OpenVR environment is fully initialized. Disabling the haptic feedback in the assets settings, starting the scene and then re-enabling it doesnt throw any errors and makes haptics work flawlessly, as far as I can tell.

This issue doesnt seem to exist with the SteamVR sample scenes, but those dont appear to send a haptic action right at scene startup.

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

3 participants