Hi !
I followed the documentation but I don’t succeed to bind my HTC Vive Cosmos Controller with my application. The compilation return an error with the code below :
You can see that you need to call xrStringToPath for the interaction profile path itself, populate an array of suggested bindings, then fill in your XrInteractionProfileSuggestedBinding structure. This part of the API is not very type-safe so I’m surprised you hit a compiler error - it would be more likely to e.g. forget to initialize the type field of the structure causing a runtime/validation error.
In fact, it’s not a compiler error but an error window which is displaying.
I’m using the SDK sources from github and more precisely, the hello_xr sample.
With breakpoints, I can see with CHECK_XRCMD a XR_ERROR_PATH_UNSUPPORTED.
However, I wrote the same path that it is written in the doc :
/interaction_profiles/htc/vive_cosmos_controller
I see.
Thanks.
I used xrEnumerateInstanceExtensionProperties to get the extensions that I can use and my headset doesn’t appear in the list.
However, the HP MR Controller appears. I enabled its extension and it works. I have no more Debug Error or Exceptions.
But the binding failed :
Wed Mar 02 2022 09:28:27.565 - Failed to load binding file. We'll wait and try again when CRC or load count changes( computed CRC=0, old CRC=0, shared CRC=0, load count=0, shared load count=2
That log message does not seem relevant to this. Neither OpenXR or the hello_xr template use binding files, and googling that exact message brings up SteamVR logs. If you are using the SteamVR runtime, it may be checking if it has user modified bindings for your application.
Are the binding working otherwise when the headset is worn?
I only use the SteamVR runtime.
Yes, the application is transitionning into XR_SESSION_STATE_FOCUSED.
I only test the hello_xr sample and input doesn’t work in it.
Sounds like it could possibly be an issue with your setup. It might be a good idea to verify whether the input works correctly in SteamVR as well as other OpenXR applications.
From what I understand, if an OpenXR application doesn’t use the Cosmos controller extension, the runtime should fall back to the closest matching interaction profile in the core spec and still allow input.
Good, sounds that your setup works correctly then, and it’s an issue with the application.
The hello_xr template should print out the bindings for each action once the session comes into focus and the runtime attaches the action sets. Does it print out anything?
[12:07:01.484][Info ] XrEventDataSessionStateChanged: state XR_SESSION_STATE_VISIBLE->XR_SESSION_STATE_FOCUSED session=2365491969200 time=3984926473600
Thu Mar 03 2022 12:07:01.484 - Failed to load binding file. We'll wait and try again when CRC or load count changes( computed CRC=0, old CRC=0, shared CRC=0, load count=0, shared load count=2
[12:07:01.494][Info ] Grab action is bound to nothing
[12:07:01.495][Info ] Quit action is bound to nothing
[12:07:01.495][Info ] Pose action is bound to nothing
[12:07:01.495][Info ] Vibrate action is bound to nothing
Maybe I was wrong about that error message being irrelevant. Looking at it, SteamVR generates binding files even for OpenXR applications under \Steam\config\openxr\ with names like system.generated.hello_xr.exe_vive_controller_0_binding.json. Maybe it’s failing to write the file. Looking at the SteamVR logs might also help. They’re available from the the menu in the SteamVR window under Developer → Web Console.
Another thing to check is whether the runtime has managed to attach an interaction profile to the controllers, using xrGetCurrentInteractionProfile().
Okay, I take notes of that.
After your advice, I uninstall and reinstall Vive apps, Steam and SteamVR and it works well :
The sample associates my controller to the cosmos controller and to the hp mr controller.
I bound a button to the quit action and it works.