ValveSoftware / unity-xr-plugin

OpenVR plugin for Unity's XR API
BSD 3-Clause "New" or "Revised" License
309 stars 64 forks source link

Trouble getting SteamVR Input to work with OpenVR XR Plugin #9

Closed ll-M-ll closed 3 years ago

ll-M-ll commented 4 years ago

Apparently SteamVR-XRPlugin beta doesn't work at all, Or maybe i dont know how to use it, Because when I finally got everything to work I've noticed that none of my input were working, I have switched the input system twice trying to figure out why but in the end I've come to the conclusion either SteamVR input doesn't work as long as XR plugin is active or I just am not using it right.... the Old code that used to move the player using SteamVR is no longer detecting anything.

things I've tried : 1 - removing and disabling components. 2- I used Debug.log approach to see where the rabbit hole in my code. 3- steamVR live input, it wasn't detecting anything. 4- I switched between the new and the old Input system, Neither of them worked.

On the other hand when I used XR INPUT DEBUGGER with the new input system everything I did was working was being detected correctly

zite commented 4 years ago

The current versions of the OpenVR Unity XR Plugin do not support the unity input system. For input you'll need to use SteamVR Input via the SteamVR Unity Plugin. We hope this will be consolidated with OpenXR.

ll-M-ll commented 4 years ago

The current versions of the OpenVR Unity XR Plugin do not support the unity input system. For input you'll need to use SteamVR Input via the SteamVR Unity Plugin. We hope this will be consolidated with OpenXR.

I know that is what I used, Even with the script it didn't read any input, all my SteamVR input weren't working, I hope you guys either give us a full tutorial on how to do this on a video ( 2 mins ) or please fix it with an update, because this is crucial to the deveopment workflow.

zite commented 4 years ago

Can you provide an editor.log when steamvr input is not working? What kind or errors are you seeing? You can find the editor.log in %localappdata%/Unity/Editor/Editor.log

totalschaden commented 4 years ago

Cant get Input to work with Unitys New Input Manager, when the Plugin was still in Branch, Prev. 2, it was working just fine. Was it dropped ? Will it be available again in a later version ? I moved back to Prev. 2 for now.

zite commented 4 years ago

I'm going to assume the original issue was resolved by an update. @totalschaden please see this issue: https://github.com/ValveSoftware/unity-xr-plugin/issues/16

ll-M-ll commented 4 years ago

@zite there is no log, i have 2 players.. steam code is there on the player it just doesn't detect anything, I've tried the live input of steam to make sure that it's not anything with the code. there is no input there.

zite commented 4 years ago

@ll-M-ll I'm not sure I understand. You have an external player (not yourself) that isn't getting input? You should be able to get logs from builds as well. https://docs.unity3d.com/Manual/LogFiles.html

ll-M-ll commented 4 years ago

ok I dont why it's hard to understand but its simply not working:

when I use steamVR 2.5 I can move the player using the controllers once I install steamVR2.6beta it nothing happens , no errors , no input , nothing... players is in the spawned location doing nothing.

zite commented 4 years ago

I'm trying to troubleshoot the issue with you so we can get your scenario working again. For that I need more information about your scenario. A log would be very helpful in determining why input is failing for you and not for other scenarios.

Have you enabled the OpenVR Loader in the XR Management settings window?

ll-M-ll commented 4 years ago

@zite i keep getting this error every now and then static Void PreferencesGUI() does not match UnityEditor.SettingsProviderAttribute expected signature. Use static UnityEditor.SettingsProvider signature() UnityEditor.SettingsWindow:OnEnable()

I can still clear it by clicking -clear its not a compiler issue.

I static Void PreferencesGUI() does not match UnityEditor.SettingsProviderAttribute expected signature. Use static UnityEditor.SettingsProvider signature() UnityEditor.SettingsWindow:OnEnable()`

and yes I have enabled OpenVRLoader and steamVR launched normally... I will try again tomorrow with preview10 ... I guess I have to delete XR and steamVR folder then install steamVRbeta3 , right ?

zite commented 4 years ago

I'm not sure what that error is unfortunately. Yeah, deleting and reinstalling is what I'd recommend. There will be a beta4 and preview 12 up by tomorrow that you should use. And if it doesn't work this time please send a log.

zite commented 4 years ago

Preview 12 is up along with beta4 of the steamvr unity plugin. I'd recommend deleting the SteamVR folder and reinstalling with this: https://github.com/ValveSoftware/steamvr_unity_plugin/releases/tag/2.6.0b4

If it still doesn't work, make sure preview-12 of the OpenVR XR Plugin is installed, and try restarting unity a couple times. Sometimes unity seems to have issues releasing the DLLs.

ll-M-ll commented 4 years ago

@zite ok I've deleted the SteamVR folder from the Assets folder then removed OpenVR DeskTop from the package Manger. then I've installed 2.6.0b4 using the installer I was greeted by this error on the console static Void PreferencesGUI() does not match UnityEditor.SettingsProviderAttribute expected signature. Use static UnityEditor.SettingsProvider signature() UnityEditor.SettingsWindow:OpenProjectSettings()

then I've attempted to install XR plugin manager from the project Settings . there was a message that poped I think it was talking about builtIn XR and it wanted to replace it - I had 2 options yes and cancel ... I've tried the cancel . open VR Loader was not there SO I've checked OpenVR Desktop from the package Manager it was installed

Also worst mentioning that I couldn't find any of the preview tools. also I had this on my log [SteamVR Setup] Installing OpenVR package... UnityEngine.Debug:Log(Object) Valve.VR.SteamVR_AutoEnableVR:Update() (at Assets/SteamVR/Editor/SteamVR_AutoEnableVR.cs:219) UnityEditor.EditorApplication:Internal_CallUpdateFunctions(

so I've deleted the SteamVR folder again and removed OpenVR Desktop and attempted to reinstall the package again. image that is the end of it I guess.. no openVR Loader

ll-M-ll commented 4 years ago

SO I've notice that 2.6.0b4 is for 2020.1 and 2.6.0b3 is for 2019.3/4 .. since that is what I'm using I have went to that link {https://github.com/ValveSoftware/unity-xr-plugin/releases/tag/installer} after installing 2.6.0b4 that got me the OpenVR loader.

/Library/PackageCache/com.valvesoftware.unity.openvr@1.0.0-preview.12/Runtime/x64/XRSDKOpenVR.dll' with error 'The specified procedure could not be found. '. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) maybe that was because SteamVR was not on .. so I turned it on and cleared the message , it didn't pop back on my console again.

I'll test the game and come bak

zite commented 4 years ago

FYI, OpenVR Desktop is a unity made package that is for Unity 2019.4 and below. It uses the old VR interfaces that they depreciated. OpenVR XR Plugin is what you'll need for 2020.1 and above. Thanks for doing all this troubleshooting. I think we're all trying to get to an SDK abstraction that's easy to use, but that can be a struggle at times.

ll-M-ll commented 4 years ago

@zite I got those issues on Running > (2 times) Plugins: Failed to load ....../Library/PackageCache/com.valvesoftware.unity.openvr@1.0.0-preview.12/Runtime/x64/XRSDKOpenVR.dll' with error 'The specified procedure could not be found. '. UnityEngine.XR.Management.XRGeneralSettings:AttemptInitializeXRSDKOnLoad() ( 1 )time only Failed to load '....../Library/PackageCache/com.valvesoftware.unity.openvr@1.0.0-preview.12/Runtime/x64/XRSDKOpenVR.dll' with error 'The specified procedure could not be found. '. Unity.XR.OpenVR.OpenVRLoader:Initialize() (at Library/PackageCache/com.valvesoftware.unity.openvr@1.0.0-preview.12/Runtime/OpenVRLoader.cs:183) UnityEngine.XR.Management.XRGeneralSettings:AttemptInitializeXRSDKOnLoad() ( 1 )time DllNotFoundException: XRSDKOpenVR Unity.XR.OpenVR.OpenVRLoader.Initialize () (at Library/PackageCache/com.valvesoftware.unity.openvr@1.0.0-preview.12/Runtime/OpenVRLoader.cs:183) UnityEngine.XR.Management.XRManagerSettings.InitializeLoaderSync () (at Library/PackageCache/com.unity.xr.management@3.2.13/Runtime/XRManagerSettings.cs:169) UnityEngine.XR.Management.XRGeneralSettings.InitXRSDK () (at Library/PackageCache/com.unity.xr.management@3.2.13/Runtime/XRGeneralSettings.cs:175) UnityEngine.XR.Management.XRGeneralSettings.AttemptInitializeXRSDKOnLoad () (at Library/PackageCache/com.unity.xr.management@3.2.13/Runtime/XRGeneralSettings.cs:148) `

zite commented 4 years ago

That seems crazy. Can you verify that the package installed the dll correctly? Go to your project directory, then /Library/PackageCache/com.valvesoftware.unity.openvr@1.0.0-preview.12/Runtime/x64/ and let me know what the filesize of XRSDKOpenVR.dll

ll-M-ll commented 4 years ago

image

ok I have some compiler erros now but it's based on my code issue because I'm testing it on an older version I will test it again and I'll let u know when I'm done but all I've done is upgrading this from 2.1.2 to 2.1.4 image

or maybe because I relaunched the program.

ll-M-ll commented 4 years ago

I got the [cameraRig] prefab to work finally ... but it was lagging so badly and I had 2 errors Screen position out of view frustum (screen pos 0.000000, 0.000000, 1000.000000) (Camera rect 0 0 1440 1792) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Screen position out of view frustum (screen pos 1440.000000, 0.000000, 1000.000000) (Camera rect 0 0 1440 1792) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

the position of the rig was 0,0.8,0

zite commented 4 years ago

Were there any warnings? Were those errors being repeated? Those errors are a known issue we're working through on start, but shouldn't cause lag.

kajbeugels commented 4 years ago

@zite I am having trouble getting Input to work for OpenVR hardware, the documentation and information about this subject is very limited, so I might misunderstand, but if I understand it correctly the OpenXR package for Unity is only rendering, there currently is no way for detecting (button!) input using only the OpenXR package?

I am trying to avoid using SteamVRs input, and instead handle all Input through Unitys Input system, but it seems this isn't possible at the moment.

And if button Input for OpenVR devices is indeed not working through OpenXR, can you say when/if it's going to come?

zite commented 4 years ago

Just to be clear, we're spending a lot of time internally on OpenXR so we will have a spec compliant runtime. Other game engines are in the process of supporting OpenXR. Unity has named their proprietary input abstraction "Unity XR", which is not directly OpenXR compatible. All the XR VR AR namings of things has unfortunately been confusing for everyone (including the people making them). To directly answer your question, the OpenVR Unity XR plugin only does rendering, not input. Currently you must use the SteamVR Unity Plugin (SteamVR Input) to get vr input in unity 2020.1+. If you're on 2019 or earlier you can still use the old stuff.

On Thu, Aug 27, 2020 at 12:45 PM kajbeugels notifications@github.com wrote:

@zite https://github.com/zite I am having trouble getting Input to work for OpenVR hardware, the documentation and information about this subject is very limited, so I might misunderstand, but if I understand it correctly the OpenXR package for Unity is only rendering, there currently is no way for detecting (button!) input using only the OpenXR package?

I am trying to avoid using SteamVRs input, and instead handle all Input through Unitys Input system, but it seems this isn't possible at the moment.

And if button Input for OpenVR devices is indeed not working through OpenXR, can you say when/if it's going to come?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ValveSoftware/unity-xr-plugin/issues/9#issuecomment-682154290, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABQQMBV5IPO7XGAC6UAJ3DSC2ZVBANCNFSM4O23UXHQ .

kajbeugels commented 4 years ago

Alright thanks for getting back, you are totally right about the current state of development for VR being confusing, I hope OpenXR will unify all of the platforms for us developers.

I will stick to SteamVR for now then, thanks for the quick response!

ROBYER1 commented 4 years ago

The current versions of the OpenVR Unity XR Plugin do not support the unity input system. For input you'll need to use SteamVR Input via the SteamVR Unity Plugin. We hope this will be consolidated with OpenXR.

Is there any roadmap or timeline for this?

Immersive-Matthew commented 4 years ago

I have read all the comments and cannot believe this issue is even a thing. How on earth was this even missed? Is this a Unity issue or Valve or both and like @ROBYER1 said, what is the timeline to get this addressed as I too need this fixed. As a Unity VR developer it is hard enough to make everything work without missing and critical parts in the stack.

stevenjj commented 4 years ago

To directly answer your question, the OpenVR Unity XR plugin only does rendering, not input. Currently you must use the SteamVR Unity Plugin (SteamVR Input) to get vr input in unity 2020.1+. If you're on 2019 or earlier you can still use the old stuff.

Thank you for clarifying this. The example interaction scene in SteamVR/InteractionSystem/Samples/Interactions_Example.unity works perfectly fine. So I was wondering why the HTC Pro Vive headset and controller tracking works but not the inputs when this plugin is tested with the example XR interactions package https://github.com/Unity-Technologies/XR-Interaction-Toolkit-Examples (Tested with Unity 2020.1.3f1).

The simple workaround is to continue using the SteamVR input scripts, which shouldn't be an issue for those who have been developing with SteamVR but want to render via the latest Unity XR plugin.

Echoing @ROBYER1 's question is there a timeline or plan for integrating both the Unity and SteamVR input managers as a single API?

Thanks for your time.

ceitel commented 4 years ago

For anyone wondering, here is a list of the Device usages available through the UnityXR-Input system for the following loaders (running a WMR HMD)

OpenVR Loader: DevicePosition, DeviceRotation, DeviceVelocity, DeviceAngularVelocity, TrackingState, IsTracked

WMR Loader: TrackingState, IsTracked, DevicePosition, DeviceRotation, DeviceVelocity, DeviceAngularVelocity, BatteryLevel, Primary2DAxis, Primary2DAxisTouch, Primary2DAxisClick, Secondary2DAxis, Secondary2DAxisClick, Trigger, TriggerButton, Grip, GripButton, MenuButton, PointerPosition, PointerRotation, SourceLossRisk, SourceMitigationDirection

Seems strange to me that they were able to expose the select few common device usages that they did but chose(?) not to expose the others?

Is also frustrating that the Unity docs seem to tell another story of what usages are available: https://docs.unity3d.com/2020.1/Documentation/Manual/xr_input.html

Echoing @ROBYER1 's question Is there any roadmap or timeline for this?

Thanks for your time

ROBYER1 commented 4 years ago

@ceitel Thanks for sharing, others will find that useful. I found those out the hard way unfortunately!

Again asking for a timeline or roadmap, even if it's vague.

pollumi commented 3 years ago

Hello @zite

Could you please give us some answers here? It is very annoying thing that we can't use Unity Interaction toolkit in 2020.x with Valve.

zite commented 3 years ago

Closing as duplicate of #16