'Eye gaze data at a fixed rate using Holographic Remoting

I'm trying to obtain the eye tracking data at a fixed frame rate (30 Hz, as provided by the eye tracker in HoloLens2) and not tied to the Update() function of Unity because the rendering frame rate of my application is not stable. It seems that if I use EyeGazeProvider, some gaze samples are missed because it outputs the gaze data not at a fixed rate but depending on the rendering frame rate, even though I check for new gaze data asynchronously (every 10ms) using a timer. Using Windows.UI.Input.Spatial.SpatialPointerPose I could get the gaze samples at a fixed rate on a deployed HL2 app but I need to use the Remoting due to high rendering load of my scene.

However, I'm a bit confused about the usage of UWP APIs in Holographic Remoting (in play mode or standalone app) for HoloLens 2. Is it possible to use the class SpatialPointerPose to obtain the eye tracking data with Remoting? Or is it mandatory to use the MRTK interface EyeGazeProvider, for the case of a non-UWP app (editor or standalone) as in the case of holographic remoting?



Solution 1:[1]

The easiest way to get eye gaze data at a fixed rate from a non-UWP app (editor or standalone) would be using Mixed Reality OpenXR Plugin. The code would be similar to FollowEyeGaze.cs. But instead of using "Update()" method, we can use a timer to get the data at a fixed rate.

While using Unity OpenXR Plugin, we can use the InputDevice.TryGetFeatureUsages method to get a list of every InputFeatureUsage that a device provides. For the EyeTracking device, there is no time related feature usage. So, OpenXR Plugin also can't provide the eye gaze sample timestamp.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jay Zuo