Jump to content

SRanipal eye tracking does not reach 120 Hz sampling frequency


Recommended Posts

Hi everyone,

I'm struggling with reaching the specified sampling rate of 120 Hz (8.33 ms) on a VIVE Pro Eye HMD.
We use the SRanipal eye callback:

SRanipal_Eye_v2.WrapperRegisterEyeDataCallback()

in a script, derived from MonoBehaviour. The registered callback is only called every 14~16 ms, which leads to approx. 62 Hz. Way below the targeted 120 Hz.

I think the PC specs are quite decent and should allow for 120 Hz sampling:

  • Windows 10Pro
  • Intel i7-10750H (specs can be found here)
  • 32GB Ram
  • GeForce RTX 2070 with Max-Q Design

Following tool versions are used:

  • SRanipal SDK & Runtime 1.3.1.1
  • Unity 2019.4.18f1

Pleas note that I am aware of these threads and articles, but did not find a explanation/solution that fits for me:
Getting VerboseData at the fastest rate possible. - Vive Eye Tracking SDK - Community Forum
Assessing Saccadic Eye Movements With Head-Mounted Display Virtual Reality Technology (nih.gov)

Already many thanks,
Scot

 

Link to comment
Share on other sites

Thanks for the answer @Corvus.
Here's a code snippet, really basic. Note that I also checked without writing to the csv file in the callback method. Instead, I simply increased a counter in the callback method and logged the time at every 120th call.

using System.Collections;
using System.Runtime.InteropServices;
using UnityEngine;
using UnityEngine.Rendering.HighDefinition;
using UnityEngine.XR;
using System;
using System.IO;
using ViveSR.anipal.Eye;
using ViveSR.anipal;
using ViveSR;
using Helpers;

public class TestTracker : MonoBehaviour
{
    private static EyeMeasureDataWriter _eyeMeasureDataWriter;
    private static string _eyeMeasureDataFilename;
    
    /// <summary>
    /// Scene start: called once scene is loaded
    /// </summary>
    void Start()
    {
        // create the necessary stream writer instances for measure data & meta data
        _eyeMeasureDataFilename = DateTime.Now.ToString("yyyyMMdd_HHmm") + _suffixMeasureData + ".csv";
        _eyeMeasureDataWriter = new EyeMeasureDataWriter(_eyeMeasureDataFilename);

        SRanipal_Eye_v2.WrapperRegisterEyeDataCallback(Marshal.GetFunctionPointerForDelegate((SRanipal_Eye_v2.CallbackBasic)eyeCallback));
    }
    
    /// <summary>
    /// Cleanup data writer and SRanipal.
    /// </summary>
    void OnApplicationQuit()
    {
        _eyeMeasureDataWriter.Close();
        _eyeMetaDataWriter.Close();

        SRanipal_Eye_v2.WrapperUnRegisterEyeDataCallback(Marshal.GetFunctionPointerForDelegate((SRanipal_Eye_v2.CallbackBasic)eyeCallback));
    }

    /// <summary>
    /// Callback for SRanipal eye tracking data
    /// </summary>
    /// <param name="eyeData">The SRanipal eye tracking data</param>
    private static void eyeCallback(ref EyeData_v2 eyeData)
    {
        EyeParameter eyeParameter = new EyeParameter();
        SRanipal_Eye_API.GetEyeParameter(ref eyeParameter);

        // append the new data to the csv file
        _eyeMeasureDataWriter.AppendRow(DateTime.Now, TargetDot, TargetEye, eyeData, eyeParameter);
    }
}

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...