SteamVR

SteamVR

SteamVR + Unity + OpenXR with Vive Trackers and Haptic out on POGO -- What is the proper way?
(cross-post from a Vive Forum Post[forum.htc.com] (mods there asked me to repost here, but not certain whether falls into Bug/OpenXR/SteamVR/Dev))

I've been struggling with getting the Vive Trackers (2.0 and 3.0) haptic POGO output pins working with Unity for AGES.

We're using 5 and sometimes 6 trackers to capture motion and render body parts for VR physical therapy games built in Unity, and we need at least four of the trackers to appropriately output the vibration signal on the POGO pins for our games to work. We can only get the signal on up to two trackers, when they're set to Held In Hand > [Right/Left] Hand. I've gotten everything else with the games working with two different combinations of XR frameworks in Unity (with 2022.3.21f1+ and also with 2019, 2020, 2021 over the last couple years):

#1:
- Unity 2019.4 -> 2022.3.5f1: OpenXR + OpenVR Loader + SteamVR Asset and Camera Rig in Unity, with old Unity Input system (or "Both" in PlayerSettings)
- Vibrating successfully thru SteamVR on controllers and outputting a voltage on up to two trackers' POGO pins (only when set to L/R Hand) with:
SteamVR_Actions.default_Haptic[SteamVR_Input_Sources.RightHand].Execute(secondsFromNow, duration, freq, amp);

#2:
- Unity 2022.3: OpenXR + New Unity Input System , with a modified HTC Tracker Profile (no SteamVR Asset in Unity project, no OpenVR)
- With action bindings setup with OpenXR controller/tracker profiles (with official controller profiles, with previously shared online unofficial HTCTrackerProfile.cs found here[forum.unity.com], and with my modified profile HTCTrackerHapticProfile.cs (linked below))
- With devicePosition and deviceRotation action settings (could not get working work with devicePose for pos/rot) just as shown in: https://www.youtube.com/watch?v=Tw5LbNLW9Q4
- Vibrating successfully only on controllers (Vive, Valve Index, etc.) not on trackers with:
OpenXRInput.SendHapticImpulse(RightHandHapticAction, amplitude, duration)
Where RightHandHapticAction is a haptic action setup for the specific controller/tracker in the use case.

But in neither case have we been able to get more than two tracker vibration/haptic pins working. We've been able to get the pogo pins to output a voltage on only up to two trackers, only when using the #1 framework combo with OpenVR, and only when those two trackers are set to Held in Hand > [Right/Left] Hand. We've primarily tested the POGO haptic out on the ViveTracker 3.0s using a multimeter or oscilloscope, but the device position and rotations do work the same with both #1 and #2 framework combos on v2.0 and v3.0s.

Following the newer OpenXR way #2, I've also tried to add a haptic path to the trackers by modifying the HTCTrackerProfile.cs previously shared online (and linked above), modeling the official vive controller profile (HTCViveControllerProfile.cs) (my edited script is on github here[github.com]).

This *seems like it should work* or does at least allow me to create a HapticAction for each vive tracker and thus should (?) be sending a haptic action to the tracker. I even tried to trick OpenXR/SteamVR into thinking it's a full controller by changing the type of the tracker from TrackedDevice to XRControllerWithRumble and all of the `InputDeviceCharacteristics` to `.Controller` instead of `.TrackedDevice`, but still didn't see a haptic option in the SteamVR bindings nor get on the POGO pin so reverted to TrackedController. In my Input Analysis tab I see the haptic field showing the same value as my vibrating valve controller, and I am triggering the tracker's haptic action (in this case the LeftFoot) in the same manner as with the RightHand (with the function shown in #2 above).

Reference images:
  1. https://github.com/mbennett12/ViveTrackerHapticOpenXR/blob/main/images/left_foot_haptic.jpg
  2. https://github.com/mbennett12/ViveTrackerHapticOpenXR/blob/main/images/Input%20Analysis%20values.PNG

This method at least gets to the point where in my SteamVR Controller Bindings Settings I see "Suggested: haptic" but yet still no actual haptic values or options to set one. Pose is there, though.

Reference images:
  1. https://github.com/mbennett12/ViveTrackerHapticOpenXR/blob/main/images/haptic_suggested_tracker.jpg
  2. https://github.com/mbennett12/ViveTrackerHapticOpenXR/blob/main/images/no_haptic_option_available.PNG
  3. https://github.com/mbennett12/ViveTrackerHapticOpenXR/blob/main/images/devicepose_works.jpg
  4. https://github.com/mbennett12/ViveTrackerHapticOpenXR/blob/main/images/unity2022OpenXRVersions.PNG

Is there a way for me to edit the SteamVR binding directly to add in the haptic out path that Unity/OpenXR is sending?

It seems like either you can only use up to two trackers for haptic out when set as the hands through SteamVR/OpenVR/Old Unity Input System, and maybe none thru OpenXR and the new Unity Input System? I'd love to be totally wrong and there to be an official working solution, but if you can only use haptics in up to two trackers I hope that could be made clear!

I've made a repo with my script edit and these references images: https://github.com/mbennett12/ViveTrackerHapticOpenXR. Note that this haptic profile script `HTCViveTrackerHapticProfile.cs` exports the same OpenXR extensionName "HTC Vive Tracker Profile" as the other vive tracker profile script, so if you already have `HTCViveTrackerProfile.cs` in your project I recommend removing this before adding the haptic profile edit. Thank you to anyone who can help!
Last edited by maxwellbbennett; Apr 23, 2024 @ 8:06pm
< >
Showing 1-15 of 15 comments
Smart Apr 24, 2024 @ 9:38am 
Unity isn´t suitable for such things. Especially NOT if you try to run this on a modern processor. Unity wants the MOST powerful singlecore-processor you can throw at it (and mind you, but AMD/INtel aren´t strong in singlecore today, those days are long over).

Modern AMD/Intels are made for strong multicore-purposes. Which Unity cannot use.

If youw ant to use MORE than what your processor can chew, you need to use a different platform. PC simply doesn´t support this as long as it´s using standard AMD/Intel-chips.

A certain platform which is SUITABLE for VR-future tasks can handle up to ~10 different I/O-signals at once. This means you can set up to 10 different controllers. Or whatever you want.

But PC simply isn´t capable of doing this, and this is why Unity 2019 doesn´t support it. This only works on OLD Unity-versions. And not with PC-Unity-versions.
Last edited by Smart; Apr 24, 2024 @ 9:42am
maxwellbbennett Apr 24, 2024 @ 3:31pm 
Hmm, I definitely do think Unity + PC can handle this, as I can get 6+ trackers all working at the same time perfectly in VR (Play mode and in builds) with Position/Rotation (with framerate, ~60fps (even post-processing graphics with bloom etc.!)), but just can't get more than 2 trackers' Haptic out pin working, which I strongly believe is related to the path / OpenXR/VR frameworks of this haptic out value, and not to compute/processing. Thank you for the response though!
Smart Apr 25, 2024 @ 4:47am 
Originally posted by maxwellbbennett:
Hmm, I definitely do think Unity + PC can handle this, as I can get 6+ trackers all working at the same time perfectly in VR (Play mode and in builds) with Position/Rotation (with framerate, ~60fps (even post-processing graphics with bloom etc.!)), but just can't get more than 2 trackers' Haptic out pin working, which I strongly believe is related to the path / OpenXR/VR frameworks of this haptic out value, and not to compute/processing. Thank you for the response though!


Yes. But like you should have find out 6 trackers wih simple Position/Rotation isn´t the same like having 10 or just 6 haptic outputs. See? There´s a huge difference in the type of input here (and the amount of input which counts for calculation).

There is a system which can handle up to ~10 haptic feedbacks if you program Unity with this. But like i said: Amd/Intel-systems aren´t suitable for this. This is why Unity doesn´t support it. Only OLD Unity supports this.

They took this out from modern Unity, because PC cannot support it. So forget Unity 2017/2019/2021.

Btw:

No. The number of haptic feedback your processor can handle is depending on it´s bandwidth. And not on it´s calculation (Gflops).

Modern processors have low bandwidth.

For comparison:

A PS4 has a cpu-bandwith of 30 Gbytes/second (custom bus-system).

Which means it´s faster in this regard than a PS5 here (because AMD Ryzen cpu-bus is SLOWER than AMD Jaguar!) and faster than a PC. Sony gave the PS4-chip a custom cpu-bus. It´s not a standard-cpu bus, so you cannot have this on PC.

So it can handle stuff like this. However bandwidth isn´t all, since there need also to be made some calculations and the latency is another point which limits your Input-signals.

But like i said. The more modern your processor gets, the lower bandwidth you have = not suitable for VR in general. Becaus your input will be very limited. Which means in your case you can only handle 2 haptic inputs/outputs and that´s with max. load then.

But like i said: Another system was made. It also has a CUSTOM cpu-bus (it has 10 cpu-buses, very similar to that of PS4) and it allows you to if you want it run 10 haptic input/outputs at once. Or even more because it has a lot lower latency, which is what limits your input-signals next, when your bandwidth is allready at its limit.

Each input/output-track/task is then assigned a seperate cpu-bus for this to work. and there´s a priority-system.
Last edited by Smart; Apr 25, 2024 @ 5:00am
grzegorz77 Apr 25, 2024 @ 5:02am 
I've just found the end of the internet.

I have to turn off these notifications, I read it, then I look at the topics next to it.
And my brain is rotting.
Smart Apr 26, 2024 @ 6:15am 
Originally posted by grzegorz77:
I've just found the end of the internet.

I have to turn off these notifications, I read it, then I look at the topics next to it.
And my brain is rotting.

Why are you here, when you get brainrot reading this?
Smart Apr 29, 2024 @ 8:09am 
Originally posted by maxwellbbennett:
Hmm, I definitely do think Unity + PC can handle this, as I can get 6+ trackers all working at the same time perfectly in VR (Play mode and in builds) with Position/Rotation (with framerate, ~60fps (even post-processing graphics with bloom etc.!)), but just can't get more than 2 trackers' Haptic out pin working, which I strongly believe is related to the path / OpenXR/VR frameworks of this haptic out value, and not to compute/processing. Thank you for the response though!


Did you understand what i told you?
maxwellbbennett May 1, 2024 @ 1:49pm 
Originally posted by Smart:
Originally posted by maxwellbbennett:
Hmm, I definitely do think Unity + PC can handle this, as I can get 6+ trackers all working at the same time perfectly in VR (Play mode and in builds) with Position/Rotation (with framerate, ~60fps (even post-processing graphics with bloom etc.!)), but just can't get more than 2 trackers' Haptic out pin working, which I strongly believe is related to the path / OpenXR/VR frameworks of this haptic out value, and not to compute/processing. Thank you for the response though!


Did you understand what i told you?

Hi there, I do kind of follow what you're saying, but as I mentioned I disagree that this is the cause of the issue in this case.

We can successfully output haptic values on the trackers on Two Trackers, ONLY when they are set to Right Hand and Left Hand, with SteamVR asset in Unity project and using the old Unity input system. If I set those two trackers to Right Foot and Left Foot (so, still ONLY two trackers and therefore should be absolutely no difference in CPU bandwidth limits), I can no longer get haptic output on those trackers. This is why I strongly believe it has to do with the controller bindings, and the Unity -> SteamVR haptic out path to a specific controller binding, and not to do with CPU bandwidth issue.

Thanks for the response though! This is still an ongoing issue.
Smart May 4, 2024 @ 7:03am 
Originally posted by maxwellbbennett:
Originally posted by Smart:


Did you understand what i told you?

Hi there, I do kind of follow what you're saying, but as I mentioned I disagree that this is the cause of the issue in this case.

We can successfully output haptic values on the trackers on Two Trackers, ONLY when they are set to Right Hand and Left Hand, with SteamVR asset in Unity project and using the old Unity input system. If I set those two trackers to Right Foot and Left Foot (so, still ONLY two trackers and therefore should be absolutely no difference in CPU bandwidth limits), I can no longer get haptic output on those trackers. This is why I strongly believe it has to do with the controller bindings, and the Unity -> SteamVR haptic out path to a specific controller binding, and not to do with CPU bandwidth issue.

Thanks for the response though! This is still an ongoing issue.


No. It seems you didn´t understand it. I said above: Forget Unity 2017, 2019 or Unity 2021 as they do no longer support this!

Only Unity ~2015 or even 2013 supported this. But i don´t know if the PC-version even supported this. I just know they had this system once and then it was taken out because it costed too many ressources which AMD/Intel-chips cannot give as they do NOT have seperate cpu-buses to allow demanding bandwidth/IO-stuff like this. A PS4 has a different (Custom) Cpu-bussystem just like WiiU. These custom systems allow such stuff as running 10 controllers at once. Or allow running many 360°-tracking devices at once.

And i gave you the reasons why this is:

Because modern processors have FEWER bandwdith than 2015-processors. Even a PS5 processor (AMD Ryzen) has FEWER bandwidth than the custom AMD Jaguar-cpu in PS4!

So they simply had to adopt to modern standards in newest Unity-versions (such as 2017, 2019 or 2021 or newer), which means you lost this feature but other features were build in instead. Modern processors try to do more things (more complex commands) with fewer bandwidth. Unity doesn´t support complex commands though.

Processors today come with fewer and fewer bandwidth. Not with more.

And Unity is an outdated system for oldschool-type of programming, not suitable for VR or PC in general as it´s also tied to SINGLECORE.

You cannot use a 32-core CPU in Unity. Unity will allways be limited to using a singlecore (Oldschool-programming).

So 31 cores will idle around in a Unity-game..

Unity simply demands the most-powerful singlecore processor ever build.

And you do not have this chip in any modern AMD/INtel, ARM or even Apple Chip, as those chips were made to run multiple cores, not single cores. Especially valid for newest processors with E/P-cores (Efficiency/Performance-cores).

Those chips which are most-powerful singlecore-chips are typically CUSTOM chips.

A chip exists which supports ~10 cpu-buses.

10 independent programable cpu-buses.

Which means you can easily have 10 such trackers with left and right hand. Or even 100 if you program it to split up the tasks and run 10 on each cpu-bus. Or you can connect 100 controllers to that system if you want to.

You know what the problem is?

The programming of this chip! Because the programming of such a thing is of course complex.

Because when you have 10 independent cpu-buses on a singlecore-processor this also means you need to split up your tasks that way. Since that custom processor has to know which of your tasks has priority over other tasks.

So there is an "affinity"-setting. and there is a priority-setting.

And to do this you need to have an RTOS which controls this. A Realtime-operating-system.

So this system doesn´t use a standard-OS to begin with.
A timed-programming-language is required (such as Java, Python...) in order to tell the RTOS to program this.

This is also how its done in Unity of old versions.


Btw: I also told you above it´s a thing of latency as well. Modern chips have HIGH latency.

Unity doesn´t like high latency-chips. Old-design chips have LOW latency.

Unity was made for LOW Latency (Oldschool)-chips. Not for modern HIGH-Latency chips.
danw May 6, 2024 @ 3:32pm 
Hi,
This was fixed in the latest SteamVR beta update: 2.5.4.

Let us know if it works for you.
maxwellbbennett May 6, 2024 @ 6:29pm 
Originally posted by danwillm:
Hi,
This was fixed in the latest SteamVR beta update: 2.5.4.

Let us know if it works for you.

Hi @danwillm, I do now see the haptic output path on the vive tracker controller profiles in SteamVR with this beta update! Thank you! We will do a test of the pogo pins tomorrow with a multimeter to actually confirm things are working as expected.

Do you know if this should fix the haptic-output in both framework combinations posted above (Combo #1: SteamVR Asset in Unity, OpenVR Loader, OpenXR, Old Unity Input System; and combo #2: OpenXR, New Unity Input System (no SteamVR asset in project, no OpenVR))?

Or, perhaps you all only support path #1? That would be my assumption, but have never seen any confirmation.

Will report back with our findings tomorrow, but thank you again
maxwellbbennett May 7, 2024 @ 6:24pm 
Confirmed that this beta update did fix the haptic out on the pogo pin for the vive trackers! We tested with RHand/LHand/RFoot/LFoot/Waist and all produced appropriate pogo out voltage (all with frameworks from path #1 listed in original post).

Would still really love to hear an answer to the question of which frameworks you all support/suggest developing with in Unity, but thank you Valve + Vive team for the fixes.
danw May 8, 2024 @ 11:18am 
Thanks for letting us know. This change should apply to all the combinations you listed above on SteamVR's side.
Smart May 13, 2024 @ 9:31am 
such things cannot be magically fixed.

Another update will come sooner or later which will break it then. Because updates are needed and they cost bandwidth as well. Nothing lasts forever!

So it´s only a workaround. See Windows 11-issues. None of their bugs could ever be really fixed...
Hey I'm assuming this thread may be long dead but I'm encountering a similar issue with not being able to detect anything with a multimeter on vive tracker POGO pins when sending haptics.

I've currently been testing with one tracker assigned right shoulder but even if I use any I get nothing. I can confirm haptics if I connect a controller but get nothing with any trackers.

hapticAction.Execute(0f, 0.1f, 150f, 0.5f, SteamVR_Input_Sources.Any);

I've tried so many variations of this, including incremental increases in frequency while continuously sending haptics. I'm fairly close to my wits end at this point xD
danw Feb 5 @ 4:56pm 
We have a couple extra updates for vive tracker openxr bindings to fix some of the remaining issues. Keep an eye on the release notes and let me know if the changes work for you when released. Thanks.
< >
Showing 1-15 of 15 comments
Per page: 1530 50

Date Posted: Apr 23, 2024 @ 5:34pm
Posts: 15