Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[open] pygaze_log lagging problem

edited June 2016 in PyGaze

Hi all!

I am having an issue with the pygaze plugin for Opensesame. I programmed an antisaccade task wherein there are 5 blocks of trials with the pygaze_log plugin at the end of each block. The trial begins fine, but when the target appears, there is substantial lag. The target is only supposed to appear for 750 ms, but it instead appears for about 5 or 6 seconds. When I remove the pygaze_log plugin, the lag is corrected.

Any insight as to why this is happening? I was having this difficulty with a dot-probe task I programmed. I tried to put one pygaze_log at the end of the whole task, which fixed the timing problem, but the program crashed when it was writing up the log file. I have since reprogrammed the task and now it works fine.

Thank you!

Sarah

Comments

  • edited 5:54AM

    Hi Sarah,

    Sorry to hear about your issue. Would you mind sharing an example log message? Are you logging a lot of information?

    In addition, sharing a minimal demo of your issue would also be a big help. (That's a short experiment in which the problem occurs; it doesn't have to be your specific experiment.)

    Cheers,

    Edwin

  • edited 5:54AM

    Hi Edwin,

    Thank you for your reply. I am logging a message every 2 ms, and I have "automatically log all variables" checked. In the log message I have:
    [image_set]
    [subject_nr]
    [task_type]
    [target_position]

    Here is a mini version of the prosaccade task. There are two blocks of 30 trials, but the problem is noticeable immediately. I originally made one block, and the lag wasn't there. However, with the second block it lags.

    https://www.dropbox.com/s/ijj7tpyokjyneps/test anti.osexp?dl=0

    Please let me know if the link works and if you need other documentation.

    I tried to solve the problem by making two loggers: one at the end of the whole block (which logs all variables), and one at the end of the trial which only logs the stimulus parameters). I will test this out to see if the lag persists.

    Thank you and I look forward to your reply!

    Sarah

  • edited 5:54AM

    Hi Sarah,

    You're logging every two milliseconds?! What is it that you're logging at such a high frequency? In general, an something should only be logged to the gaze data file when 1) A new trial starts (to log trial parameters, or 2) When an event happens in your experiment (e.g. a new screen flip, or a participant's response).

    If it is not crucial to log a message every two milliseconds, I'd suggest only logging messages for trial specs and on-screen events. Otherwise, the lag is kinda to be expected. (Although it should still not necessarily happen, so I will give it a closer look!)

    Cheers,

    Edwin

  • edited 5:54AM

    Hi Edwin,

    Thank you for your hasty reply! In this experiment, each trial is composed of 4 slides that are presented for 750 ms. If I understand correctly, I need to log every 750 ms in that case? I just want to be sure I understand. For this particular task we are interested in time to first fixation and whether they are looking in the right direction.

    Thank you!

    Sarah

  • edited 5:54AM

    I just changed the log rate to 750 ms, and it lags even more.

  • edited 5:54AM

    Hi

    Maybe this answer also helps with your problem: http://forum.cogsci.nl/index.php?p=/discussion/comment/7606#Comment_7606

    Jarik

  • edited 5:54AM

    Hi Jarik,

    Thank you very much for linking me to this. I tried to put a blank slide after the target, and although it looks better, it still lags quite a bit. I may end up sticking with this if the problem can't be fixed.

    Thank you!

    Sarah

  • edited 5:54AM

    Hi Sarah,

    When you say you are logging every 750ms (was every 2 ms) you don't mean the "pause between messages" (on the pygaze_log pane) is set to 750ms do you? This is by default set to 2ms, but doesn't determine how often the log file is written.

    Just thought I'd check as this could be an easy mistake to make.

    Best wishes,

    Neon

  • edited 5:54AM

    Hi Neon,

    Oh shoot, yes that is what I did. I changed the pause between messages to 750 ms. I don't think I understand how to change how often the log file is written. Is it just a matter of how many times I put in pygaze_log? Sorry, I am confused!

    Thank you!

    Sarah

  • edited 5:54AM

    Good catch, @neon!

    @s_mcilw: The log happens every time the pygaze_log is inserted, and if you chose to log all variables, there might be a lot of logging going on, which can cause lag. Usually, that's quite inefficient, and not necessarily what you want. If I were you, I'd log a single line with only the information that is actually useful to you in the gaze data file.

    Cheers,

    Edwin

  • edited 5:54AM

    Hi Edwin,

    Thank you! Okay, I will see if that helps. Right now we have someone versed in Python and who has worked with eyetracking before taking a look at integrating the eyetracker with inline_script. So perhaps we won't have this issue after all!

    Thank you all for the help!

    Best,
    Sarah

Sign In or Register to comment.