Skip to main content

Eye calibration software automatic exit?



  • Lauren Domingo

    Hey Marijan - you make a great point!  We cannot share the source code currently but-

    We will be releasing an updated version of ETCal that has an auto-timeout feature.    You can try it out today by downloading this .pak file and placing it in C:\Program Files\HP\HP Omnicept\HP Omnicept Eye Tracking Calibration\ETCal\Content\Paks

    With this new version, you will see that after ETCal completes, a countdown timer starts that will auto-close the app.   Let us know if you think this should be implemented differently (i.e. shorter countdown).

  • Marijan

    Hi Lauren, thank you so much for this solution!

    It does save us from serious trouble. It is pretty much exactly what is needed and if we could choose, we would make the exit instantaneous just after the green checkmark or after the red x. For now, we can live with 20 second countdown but it would be nice to have another build with quicker exit. The reason for that is that in our application, different users are using the headset and we want to have the calibration as smooth and quick as possible.

    Kind regards!

  • Marijan

    Hello everyone!

    I have developed whole of the application and our customer is extremely pleased with the whole thing and so are we. But now I am stuck on this last bug I cannot fix no matter what I try. So the problem is the Calibration function which under certain conditions cannot exit back to Unity application. 

    What the code does is once the calibration button on keyboard is pressed, it sets a flag and in the Update(), the Calibration function gets called if the flag is set. The flag get's reset so I am 100% sure it gets called only once. This also happens only in certain conditions. If the Calibration is called from the Start() then it gets executed correctly only once and exits as expected. If it is called in the editor it also exits correctly. If it gets executed while the application has been started manually,  also works great. It only doesn't work in the actual application which is a standalone system where there is no other monitors attached to the computer, just the headset and the Unity application is automatically started from a batch file. It also doesn't work correctly if I start it manually and unplug the monitor. In this condition, the HP Calibration function just enters an endless loop. It starts correctly, then you do the calibration then it has the 20 second timeout, then it briefly enters Windows mixed reality portal and then instead of going back to Unity application, the calibration procedure starts all over again on it's own. 

    Can anyone shed any light on this or suggest any ideas please? It seems like it is something to do with the existence of the external monitor but it is so hard to verify that. I just know I am completely out of ideas as absolutely nothing has worked and I can't even think of a workaround.

    Kind regards

  • Sergi Tortosa


    Thanks for sharing all the details are you able to reproduce this by launching manually the calibration app? Or it's just happening when you are opening it from Unity?

    Any hint of what code are you using will be helpful for us and try to reproduce this so we can try and get some insight and what could be happening. 

  • Marijan

    Hello Sergi and thanks for your suggestion.

    I have tested your suggestion and it turned out I could not reproduce it with a manual launch so it was definitively something to do with Unity.

    Now the way I have fixed it was by setting a flag upon keypress that would start a timer. After the timer would then expire a second later, it would launch the Calibration() and this cured the issue. It seems to me like it had to do something with button press, possibly something within UnityRawInput method as the regular Input.GetKeyDown just didn't work for me due to application needing to be in focus for this to work. 

    Another problem I have discovered which I need to share with the community is what seems to be a bug in Unity/Microsoft mixed reality portal. It would cause the application to not return back from Mixed reality portal every second time. This was also visible if launching the application from the Editor. It wouldn't start on the headset every second time and you would just see the Mixed reality environment. 
    This was cured by implementing a CoRoutine that checked if the XR environment has been started. Seems like a somewhat known issue. It also required a slight modification to the HP recommended Calibration() code as follows:

    public void Calibration() //Eye tracking calibration function modified from HP example
            string omniPath = System.Environment.GetEnvironmentVariable("HP_OMNICEPT_INSTALL");
          Process eyeCalProcess = new Process();
            eyeCalProcess.StartInfo.UseShellExecute = false;
            eyeCalProcess.StartInfo.FileName = $"C:\\Program Files\\HP\\HP Omnicept\\HP Omnicept Eye Tracking Calibration\\ETCal\\Binaries\\Win64\\ETCal-Win64-Shipping.exe"; //Hard coded as the path stopped working at some point
            eyeCalProcess.StartInfo.CreateNoWindow = true;
            string text = File.ReadAllText($"C:\\Users\\{Environment.UserName}\\AppData\\Local\\ETCal\\Saved\\etcallog.log");
            bool ok = text.Contains("Tobii Eye Calibration finished successfully");

    public IEnumerator InitXR()
            yield return XRGeneralSettings.Instance.Manager.InitializeLoader();
            if (XRGeneralSettings.Instance.Manager.activeLoader == null)
                Debug.LogError("Initializing XR Failed. Check Editor or Player log for details.");
                Debug.Log("Starting XR...");
              calibration_finished = false; //Reset only once it has actually finished starting XR
                yield return null;

    And then else in the code bit that actually triggers the Calibration:

    if(something){ *** code with the timer and all which gets triggered by the keypress ***

                calibration_finished = true;

            if (calibration_finished == true)

    I hope this helps someone out here!


  • Sergi Tortosa

    Awesome to see that you found the issue!

    On the second half i will reference this post and change the suggested calibration launch code to reflect your fix.

    Thank you so much 😊


Please sign in to leave a comment.

Powered by Zendesk