Jump to content

Unable to start eye tracking using wave sdk


savan

Recommended Posts

Hi, I am working on a unity VR project and i need to track eye data using focus 3. The eye tracking icon is white while app runs but the IsEyeTrackingAvailable always returns false. The steps i have followed to enable eye tracking in project are :

(https://hub.vive.com/storage/app/doc/en-us/UnityXR/UnityXREyeTracking.html#gaze-raycast)

1) installed waveXR plugin , essence packages and enabled waveXR, eye tracking in waveXR settings and added eye gaze interaction profile.

2) added eye manager to scene and used this script to track eye data:
 

using System.Collections;
using System.IO;
using UnityEngine;
using Wave.Essence.Eye;

public class EyeTrackingDataCollector : MonoBehaviour
{
    private string filePath;
    private StreamWriter writer;
    private EyeQoEMetricsLogger eyeQoEMetricsLogger;

    void Start()
    {
        eyeQoEMetricsLogger = gameObject.AddComponent<EyeQoEMetricsLogger>();
        eyeQoEMetricsLogger.StartLoggingEverySecond();

        if (EyeManager.Instance != null) { EyeManager.Instance.EnableEyeTracking = true; }
        
        // Initialize file path and writer
        filePath = Path.Combine(Application.persistentDataPath, "EyeTrackingData.csv");
        writer = new StreamWriter(filePath, true);

        // Write CSV header
        writer.WriteLine("Timestamp,LeftEyeOriginX,LeftEyeOriginY,LeftEyeOriginZ,RightEyeOriginX,RightEyeOriginY,RightEyeOriginZ,CombinedEyeOriginX,CombinedEyeOriginY,CombinedEyeOriginZ,LeftEyeDirectionX,LeftEyeDirectionY,LeftEyeDirectionZ,RightEyeDirectionX,RightEyeDirectionY,RightEyeDirectionZ,CombinedEyeDirectionX,CombinedEyeDirectionY,CombinedEyeDirectionZ,LeftEyeOpenness,RightEyeOpenness,LeftEyePupilDiameter,RightEyePupilDiameter,LeftEyePupilPositionX,LeftEyePupilPositionY,RightEyePupilPositionX,RightEyePupilPositionY");

        // Enable Eye Tracking
        if (EyeManager.Instance != null)
        {
            Debug.Log("----->>>>>> EyeManager is available.");
            EyeManager.Instance.EnableEyeTracking = true;

            EyeManager.Instance.GetLeftEyeOrigin(out Vector3 leftOrigin);
            EyeManager.Instance.GetRightEyeOrigin(out Vector3 rightOrigin);
            EyeManager.Instance.GetCombinedEyeOrigin(out Vector3 combinedOrigin);
            Debug.Log($"----->>>>>> Left Eye Origin: {leftOrigin}");
            Debug.Log($"----->>>>>> Right Eye Origin: {rightOrigin}");
            Debug.Log($"----->>>>>> Combined Eye Origin: {combinedOrigin}");

            
            
        }
        else
        {
            Debug.LogError("----->>>>>> EyeManager is not available.");
        }
    }

    void Update()
    {
        if (EyeManager.Instance != null)
        {
            // Log the eye tracking status
            EyeManager.EyeTrackingStatus status = EyeManager.Instance.GetEyeTrackingStatus();
            Debug.Log("----->>>>>> Eye Tracking Status: " + status);

            // Check if eye tracking data is available
            bool hasData = EyeManager.Instance.HasEyeTrackingData();
            Debug.Log("----->>>>>> Eye Tracking Data Available: " + hasData);

            if (EyeManager.Instance.IsEyeTrackingAvailable())
            {
                Vector3 leftOrigin, rightOrigin, combinedOrigin;
                Vector3 leftDirection, rightDirection, combinedDirection;
                float leftOpenness, rightOpenness;
                float leftPupilDiameter, rightPupilDiameter;
                Vector2 leftPupilPosition, rightPupilPosition;

                EyeManager.Instance.GetLeftEyeOrigin(out leftOrigin);
                EyeManager.Instance.GetRightEyeOrigin(out rightOrigin);
                EyeManager.Instance.GetCombinedEyeOrigin(out combinedOrigin);

                EyeManager.Instance.GetLeftEyeDirectionNormalized(out leftDirection);
                EyeManager.Instance.GetRightEyeDirectionNormalized(out rightDirection);
                EyeManager.Instance.GetCombindedEyeDirectionNormalized(out combinedDirection);

                EyeManager.Instance.GetLeftEyeOpenness(out leftOpenness);
                EyeManager.Instance.GetRightEyeOpenness(out rightOpenness);

                EyeManager.Instance.GetLeftEyePupilDiameter(out leftPupilDiameter);
                EyeManager.Instance.GetRightEyePupilDiameter(out rightPupilDiameter);

                EyeManager.Instance.GetLeftEyePupilPositionInSensorArea(out leftPupilPosition);
                EyeManager.Instance.GetRightEyePupilPositionInSensorArea(out rightPupilPosition);

                string timestamp = Time.time.ToString();
                string line = $"{timestamp},{leftOrigin.x},{leftOrigin.y},{leftOrigin.z},{rightOrigin.x},{rightOrigin.y},{rightOrigin.z},{combinedOrigin.x},{combinedOrigin.y},{combinedOrigin.z},{leftDirection.x},{leftDirection.y},{leftDirection.z},{rightDirection.x},{rightDirection.y},{rightDirection.z},{combinedDirection.x},{combinedDirection.y},{combinedDirection.z},{leftOpenness},{rightOpenness},{leftPupilDiameter},{rightPupilDiameter},{leftPupilPosition.x},{leftPupilPosition.y},{rightPupilPosition.x},{rightPupilPosition.y}";

                writer.WriteLine(line);
            }
            else
            {
                if (EyeManager.Instance == null)
                {
                    Debug.LogError("----->>>>>> EyeManager is not available.");
                }
                else
                {
                    Debug.LogError("----->>>>>> Eye Tracking is not available.");
                }
            }

            if (EyeManager.Instance != null)
            {
                Debug.Log("----->>>>>>  Test2: EyeManager is available.");
                EyeManager.Instance.EnableEyeTracking = true;
                if (EyeManager.Instance.IsEyeTrackingAvailable())
                {
                    Debug.Log("----->>>>>> Test2: Eye Tracking is available.");
                    EyeManager.Instance.GetLeftEyeOrigin(out Vector3 leftOrigin);
                    EyeManager.Instance.GetRightEyeOrigin(out Vector3 rightOrigin);
                    EyeManager.Instance.GetCombinedEyeOrigin(out Vector3 combinedOrigin);
                    Debug.Log($"----->>>>>> Test2: Left Eye Origin: {leftOrigin}");
                    Debug.Log($"----->>>>>> Test2: Right Eye Origin: {rightOrigin}");
                    Debug.Log($"----->>>>>> Test2: Combined Eye Origin: {combinedOrigin}");
                }
                else
                {
                    Debug.LogError("----->>>>>> Test2: Eye Tracking is not available.");
                }
            }

            if (EyeManager.Instance != null)
            {
                try
                {
                    EyeManager.EyeTrackingStatus status2 = EyeManager.Instance.GetEyeTrackingStatus();
                    Debug.Log("----->>>>>> Test2: Eye Tracking Status: " + status2);
                }
                catch (System.Exception e)
                {
                    Debug.LogError("----->>>>>> Test2: Eye Tracking Status attempt error: " + e);
                }
            }
        }
    }

    void OnApplicationQuit()
    {
        // Close the writer
        writer.Close();
    }
}

i keep getting the following logs :
Eye Tracking Status: NOT_START
 Eye Tracking Data Available: False
Eye Tracking is not available.
 EyeManager is available.

Am i missing any step to enable eye tracking using unity, wave essence, focus 3?

also when will the eye icon be white(in use/enabled) in app? Initially even though i have the eye manager and eye tracking scripts in the scene the eye icon isnt white.

Than you

 

com.unity.linuxEyeTest-logcat.txt

Link to comment
Share on other sites

Posted (edited)
2024/06/29 06:23:07.155 14478 14511 Error AndroidBitmapFactory Error: Overlay context is null
2024/06/29 06:23:07.157 14478 14511 Error CRASH *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2024/06/29 06:23:07.157 14478 14511 Error CRASH Version '2022.3.34f1 (4886f5360533)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
2024/06/29 06:23:07.157 14478 14511 Error CRASH Build fingerprint: 'HTC/kona/kona:10/QKQ1.210528.001/5101:user/release-keys'
2024/06/29 06:23:07.157 14478 14511 Error CRASH Revision: '0'
2024/06/29 06:23:07.157 14478 14511 Error CRASH ABI: 'arm64'
2024/06/29 06:23:07.157 14478 14511 Error CRASH Timestamp: 2024-06-29 06:23:07.157984897+0000
2024/06/29 06:23:07.157 14478 14511 Error CRASH pid: 14478, tid: 14511, name: UnityMain  >>> com.unity.linuxEyeTest <<<
2024/06/29 06:23:07.158 14478 14511 Error CRASH uid: 10149
2024/06/29 06:23:07.158 14478 14511 Error CRASH signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr --------
2024/06/29 06:23:07.158 14478 14511 Error CRASH Cause: null pointer dereference
2024/06/29 06:23:07.158 14478 14511 Error CRASH     x0  00000071b39d9fe0  x1  0000000000000000  x2  0000000000000004  x3  0000000000000003
2024/06/29 06:23:07.158 14478 14511 Error CRASH     x4  0000000000000000  x5  0000000000000018  x6  fefeff71dabb671f  x7  7f7f7f7fffff7f7f
2024/06/29 06:23:07.158 14478 14511 Error CRASH     x8  0000000000004be0  x9  00000071b39d5400  x10 0000000000000001  x11 0000000000000000
2024/06/29 06:23:07.158 14478 14511 Error CRASH     x12 0000000000000018  x13 ffffffffffffffff  x14 0000000000000004  x15 ffffffffffffffff
2024/06/29 06:23:07.158 14478 14511 Error CRASH     x16 00000072e56b42f8  x17 00000073d0cee8c8  x18 0000000000000003  x19 0000000000000000
2024/06/29 06:23:07.158 14478 14511 Error CRASH     x20 0000000000004ad8  x21 00000072dbbbb5c8  x22 00000071b39d79f0  x23 00000071b39d9260
2024/06/29 06:23:07.158 14478 14511 Error CRASH     x24 0000000000009458  x25 0000000000000002  x26 00000000000062d8  x27 0000000000007ad8
2024/06/29 06:23:07.158 14478 14511 Error CRASH     x28 00000000000092d8  x29 00000072dbbbb490
2024/06/29 06:23:07.158 14478 14511 Error CRASH     lr  00000072e50d4e50  sp  00000072dbbbb490  pc  00000072e50ec770  pst 0000000060001000
2024/06/29 06:23:07.158 14478 14511 Error CRASH 
2024/06/29 06:23:07.158 14478 14511 Error CRASH backtrace:
2024/06/29 06:23:07.158 14478 14511 Error CRASH       #00 pc 00000000004c8770  /data/data/com.unity.linuxEyeTest/code_cache/wavevr/client/lib/libwvr_runtime.so (BuildId: f63448bc2cce90831eb861157db2689c26d5e3ee)
2024/06/29 06:23:07.158 14478 14511 Error CRASH       #01 pc 00000000004b0e4c  /data/data/com.unity.linuxEyeTest/code_cache/wavevr/client/lib/libwvr_runtime.so (BuildId: f63448bc2cce90831eb861157db2689c26d5e3ee)
2024/06/29 06:23:07.158 14478 14511 Error CRASH       #02 pc 00000000004b118c  /data/data/com.unity.linuxEyeTest/code_cache/wavevr/client/lib/libwvr_runtime.so (WVR_GetCurrentNaturalHandModel+372) (BuildId: f63448bc2cce90831eb861157db2689c26d5e3ee)
2024/06/29 06:23:07.158 14478 14511 Error CRASH       #03 pc 00000000032e5a20  /data/app/com.unity.linuxEyeTest-MinXvhhU5pJkj37uj4MP8w==/lib/arm64/libil2cpp.so (BuildId: 76b57b1e2a364b4b71cdefc7ee5b134118c2d5d4)
2024/06/29 06:23:07.158 14478 14511 Error CRASH       #04 pc 0000000003243ea4  /data/app/com.unity.linuxEyeTest-MinXvhhU5pJkj37uj4MP8w==/lib/arm64/libil2cpp.so (BuildId: 76b57b1e2a364b4b71cdefc7ee5b134118c2d5d4)
2024/06/29 06:23:07.158 14478 14511 Error CRASH       #05 pc 00000000032498a4  /data/app/com.unity.linuxEyeTest-MinXvhhU5pJkj37uj4MP8w==/lib/arm64/libil2cpp.so (BuildId: 76b57b1e2a364b4b71cdefc7ee5b134118c2d5d4)
2024/06/29 06:23:07.158 14478 14511 Error CRASH       #06 pc 00000000032494b4  /data/app/com.unity.linuxEyeTest-MinXvhhU5pJkj37uj4MP8w==/lib/arm64/libil2cpp.so (BuildId: 76b57b1e2a364b4b71cdefc7ee5b134118c2d5d4)
2024/06/29 06:23:07.158 14478 14511 Error CRASH       #07 pc 00000000017b63d8  /data/app/com.unity.linuxEyeTest-MinXvhhU5pJkj37uj4MP8w==/lib/arm64/libil2cpp.so (BuildId: 76b57b1e2a364b4b71cdefc7ee5b134118c2d5d4)
2024/06/29 06:23:07.158 14478 14511 Error CRASH       #08 pc 00000000017b6324  /data/app/com.unity.linuxEyeTest-MinXvhhU5pJkj37uj4MP8w==/lib/arm64/libil2cpp.so (BuildId: 76b57b1e2a364b4b71cdefc7ee5b134118c2d5d4)
2024/06/29 06:23:07.158 14478 14511 Error CRASH       #09 pc 00000000005c3568  /data/app/com.unity.linuxEyeTest-MinXvhhU5pJkj37uj4MP8w==/lib/arm64/libunity.so (BuildId: 6e3ffc66d1069813)
2024/06/29 06:23:07.158 14478 14511 Error CRASH       #10 pc 00000000005d3040  /data/app/com.unity.linuxEyeTest-MinXvhhU5pJkj37uj4MP8w==/lib/arm64/libunity.so (BuildId: 6e3ffc66d1069813)
2024/06/29 06:23:07.158 14478 14511 Error CRASH       #11 pc 00000000005e0e18  /data/app/com.unity.linuxEyeTest-MinXvhhU5pJkj37uj4MP8w==/lib/arm64/libunity.so (BuildId: 6e3ffc66d1069813)
2024/06/29 06:23:07.158 14478 14511 Error CRASH       #12 pc 000000000042e480  /data/app/com.unity.linuxEyeTest-MinXvhhU5pJkj37uj4MP8w==/lib/arm64/libunity.so (BuildId: 6e3ffc66d1069813)
2024/06/29 06:23:07.158 14478 14511 Error CRASH       #13 pc 00000000004e8430  /data/app/com.unity.linuxEyeTest-MinXvhhU5pJkj37uj4MP8w==/lib/arm64/libunity.so (BuildId: 6e3ffc66d1069813)
2024/06/29 06:23:07.158 14478 14511 Error CRASH       #14 pc 00000000004e8470  /data/app/com.unity.linuxEyeTest-MinXvhhU5pJkj37uj4MP8w==/lib/arm64/libunity.so (BuildId: 6e3ffc66d1069813)
2024/06/29 06:23:07.158 14478 14511 Error CRASH       #15 pc 00000000004e8704  /data/app/com.unity.linuxEyeTest-MinXvhhU5pJkj37uj4MP8w==/lib/arm64/libunity.so (BuildId: 6e3ffc66d1069813)
2024/06/29 06:23:07.158 14478 14511 Error CRASH       #16 pc 0000000000655794  /data/app/com.unity.linuxEyeTest-MinXvhhU5pJkj37uj4MP8w==/lib/arm64/libunity.so (BuildId: 6e3ffc66d1069813)
2024/06/29 06:23:07.158 14478 14511 Error CRASH       #17 pc 000000000066cd78  /data/app/com.unity.linuxEyeTest-MinXvhhU5pJkj37uj4MP8w==/lib/arm64/libunity.so (BuildId: 6e3ffc66d1069813)
2024/06/29 06:23:07.158 14478 14511 Error CRASH       #18 pc 000000000000561c  /data/app/com.unity.linuxEyeTest-MinXvhhU5pJkj37uj4MP8w==/oat/arm64/base.odex

After building this scene and trying in the headset i get this error in logcat and the app immediatly crashes. The same happens if i try the eyetracking demo scene in wave essence. This is only happening in linux, when i try the eye tracking scene build for focus 3 using windows unity i get this error and the tracking is not enabled although the eye icon is white  :image.thumb.png.e26064e7d46ff96236da6d1cb3e063ad.png

2024/06/29 06:27:38.047 15129 15152 Debug Settings SettingsGetInt(EyeTrackingStatus, v=0)=0
2024/06/29 06:27:38.047 15129 15152 Info chatty uid=10150(com.unity.windowsEyeQoe) UnityMain identical 1 line
2024/06/29 06:27:38.047 15129 15152 Debug Settings SettingsGetInt(EyeTrackingStatus, v=0)=0
2024/06/29 06:27:38.059 15129 15212 Warn OverlayManagerImpl updateImage wait time out for 20 ms
2024/06/29 06:27:38.059 15129 15152 Debug Settings SettingsGetInt(EyeTrackingStatus, v=0)=0
2024/06/29 06:27:38.061 15129 15152 Debug Settings SettingsGetInt(EyeTrackingStatus, v=0)=0
  
// Errror:
2024/06/29 06:27:38.062 15129 15152 Error Unity AndroidJavaException: java.lang.ClassNotFoundException: com.htc.vr.unity.WVRUnityVRActivity$OEMConfigCallback
2024/06/29 06:27:38.062 15129 15152 Error Unity java.lang.ClassNotFoundException: com.htc.vr.unity.WVRUnityVRActivity$OEMConfigCallback
2024/06/29 06:27:38.062 15129 15152 Error Unity 	at java.lang.Class.classForName(Native Method)
2024/06/29 06:27:38.062 15129 15152 Error Unity 	at java.lang.Class.forName(Class.java:454)
2024/06/29 06:27:38.062 15129 15152 Error Unity 	at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
2024/06/29 06:27:38.062 15129 15152 Error Unity 	at com.unity3d.player.UnityPlayer.-$$Nest$mnativeRender(Unknown Source:0)
2024/06/29 06:27:38.062 15129 15152 Error Unity 	at com.unity3d.player.UnityPlayer$F$a.handleMessage(Unknown Source:122)
2024/06/29 06:27:38.062 15129 15152 Error Unity 	at android.os.Handler.dispatchMessage(Handler.java:103)
2024/06/29 06:27:38.062 15129 15152 Error Unity 	at android.os.Looper.loop(Looper.java:214)
2024/06/29 06:27:38.062 15129 15152 Error Unity 	at com.unity3d.player.UnityPlayer$F.run(Unknown Source:24)
2024/06/29 06:27:38.062 15129 15152 Error Unity Caused by: java.lang.ClassNotFoundException: com.htc.vr.unity.WVRUnityVRActivity$OEMConfigCallback
2024/06/29 06:27:38.062 15129 15152 Error Unity 	... 8 more
2024/06/29 06:27:38.062 15129 15152 Error Unity   at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in <00000000000000000000000000000000>:0 
2024/06/29 06:27:38.062 15129 15152 Error Unity   at UnityEngine.AndroidJNISafe.FindClass (System.String name) [0x00000] in <00000000000000000000000000000000>:0 
2024/06/29 06:27:38.062 15129 15152 Error Unity   at UnityEngine.AndroidJavaClass._

After deleting each script and object from scenes, i realized the Interaction Mode Manager script from wave.essence.interaction.mode is causing this crash in linux. (in windows i get the class not found error). 
To summarize my issue :
when only using eye Manager script in scene the eye icon in headset while app runs is not white, when including other eye tracking input modules or script the eye icon is white but the eye tracking is not enabled and even after using the RestartTracking from EyeManager script it doesnt start. the isTrackingStatus returns NOT_START. i have run another unity app installed in the headset and it logs the eye data successfully so the issue is with my unity project setup, but even after trying out different combinations in scene and settings i am unable to find out why the eye tracking is not enabled.

Unity : 2022.3.34 (linux) and 2022.3.25 (windows)

wave essence:5.6.0-r.10.2

unity sdks: 31,32

android minimum API:25, target API level: 29

i have decompiled the apk and check the manifest to confirm that eye tracking permission is included/ i also allowed permissions for the app in headset storage settings.

 

Edited by savan
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...