FOVE SUPPORT CENTER

Dropping frames?

Comments

5 comments

  • Official comment
    Avatar
    Jeff

    Hi Stephanie,

    How are you tracking the frame rate? The eye tracker prints it's internal framerate every 10 seconds to the log:

    Eye tracker loop: 1191 frames in 10.001004 seconds: 119 fps

    If the eye tracker is printing 119/120 then it's running ok, and there's something on the application side. For example, applications that render to the headset (including those built with Unity) will fetch eye tracking data from the game loop, which runs at the headset monitor framerate, and thus will generally miss eye tracker frames, since the eye tracker runs at a higher framerate.

    Our Unity Data Recorder script for example has a 70hz mode which samples from the game loop, and a 120hz mode that shifts the sampling to another thread.

     

    If the eye tracker itself is dropping below 120hz, then the most likely culprit it lack of CPU power. The eye tracker runs mostly single threaded, though some portions are offloaded onto a secondary thread. This means that it (mostly) only uses up to one full CPU core at a time. This is nice in the sense that other cores are reserved for other tasks, but it also means that you can have the eye tracker maxing out a CPU and missing frames, but still be at low CPU (since other cores may be idle).

    The best way to check that is to go to the performance tab in the Windows Task Manager, right click CPU -> and show logical processors. If any of them are fully maxed out, it could be the eye tracker. If this is the case, we may be able to advise you on some steps to speed up the eye tracker, but overall it would be ideal to try it on a more powerful PC.

     

    Another possibility is a bad USB connection which is dropping bandwidth. This could happen via use of USB hubs, damaged cables/ports, or plugging into a USB 2 port instead of USB 3. You should at least try a few different USB ports on your motherboard, or if you have another PC, try that. And definitely skip any USB hubs while testing.

    There are some config options to enable skipping frames intentionally, however these are newish and not currently documented publicly so it's very unlikely to be the problem in you case.

     

    If none of the above seems to help, we may want to take a look at your setup specifically and dig in a bit to what's happening over a quick call.

    Comment actions Permalink
  • Avatar
    Watanabe Takehiro

    Hello Jeff.

    I`m facing with the same issue.
    In my project, I`d like to repeat the trials which record the gaze data for 2 sec.

    It's works good in 70hz.
    In 120hz, the first trial returns me 120rows of data and looks good, however, the rows getting fewer and fewer (roughly half)by the trial goes on.

    I tried the project with another computer, but couldn't fix it.

    Could you give me advice for me?

    T. Watanabe

    0
    Comment actions Permalink
  • Avatar
    Jeff

    Hi Watanabe-san,

    That sounds like some performance regression over time for some reason.

    Can you check the FOVE Log and see if the eye tracker is running at 120hz? If the eye tracker is running at the correct frame rate, then we need to investigate the Unity side.

    Inside `DataRecorder.cs`  you can see the following line:

    var result = FoveManager.Headset.WaitAndFetchNextEyeTrackingData();

    This is what synchronizes the thread loop to the eye tracker framerate. If this loop is not running at 120hz then maybe something in `RecordDatum()` is slowing down the thread (possibly upon `flushData()` would be my guess). You can add some checks against the system timer to check this. (Eg. print every 1 second how many iterations of the loop were completed).

    You can also check `result.value.id` which will increment by once each frame, assuming frames are not missed. If it increments by more than one, it means that the eye tracker exposed multiple frames but the thread was too slow and did not catch them all.

    0
    Comment actions Permalink
  • Avatar
    Watanabe Takehiro

    Hello Jeff.

    I put simple code in while loop and run GazeRecorder for 1 sec repeatedly.

    while(collectThreadShouldLive)
    {
    RecordDatum(true);
    frameCount += 1;
    Debug.Log(frameCount);
    var result = FoveManager.Headset.WaitAndFetchNextEyeTrackingData();
    }

    In the first trial, loopCounter is from 97(when starting record) to 212(when stopping record).
    Second, from 37 to 97, third from 25 to 65.
    The variation of loopCounter matches the rows of csv data.
    And I found that loopCounter keeps increasing after stopping the recorder.

    0
    Comment actions Permalink
  • Avatar
    Watanabe Takehiro

    Hello Jeff-san.
    I solve this problem.
    I'm using following method to stop GazeRecorder

    void StopRecording()
    {
    shouldRecord = false;
    Debug.Log("Stopping data recording...");
    }

    and adding following code under shouldRecord = false;  solves the problem.

    collectThreadShouldLive = false;

    Thank you so much for the reply!

    0
    Comment actions Permalink

Please sign in to leave a comment.