Howdy, Stranger!

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

Supported by

EDF messages lost during eye tracking recordings

Hi all,

In a bistable motion experiment we are currently running, we're experiencing a problem with logging specific events to the EDF file. We log messages to the EDF using exp.pygaze_eyetracker.log(). To log the start and end of a trial, we send the messages:
exp.pygaze_eyetracker.log(‘trial %d started at %f’ %(count_block, self.time()))
exp.pygaze_eyetracker.log(‘trial %d stopped at %f’ %(count_block, self.time()))

In dummy mode, all the trial start/stop messages are neatly printed in the Opensesame terminal. However, when we run the experiment recording eye measurements as well, specific trial start or stop messages are not properly send to the EDF file, as becomes clear when inspecting the EDF .msg file:

As suggested by Daniel, we've tried to add clock.sleep(10) inside our code to decrease the number of EDF messages that are being sent after each other, however this did not solve our problem.

The error always occurs when we send the stop message for trial 2, but sometimes other trial start/stop messages are lost as well...

I am hoping someone could have a look at our experiment or give us advice about possible solutions to this problem!
I've added the experimental script of one of our sessions. The experiment can be run after changing the directory variable location to a local directory.

Thanks a lot!!



  • Hi Joanne,

    As suggested by Daniel, we've tried to add clock.sleep(10) inside our code to decrease the number of EDF messages that are being sent after each other

    Right, that's basically the solution. Messages are dropped when they are sent in very rapid succession--a nasty property of the EyeLink. What a sufficient delay is depends on the system, but 10 ms between messages should fix it, even on very slow systems.

    however this did not solve our problem.

    Your example data and experiment shows that the messages are sent without any delay between them. Did you insert the delay between sending of the messages? Do you have data where there is a delay of say 10 ms between each MSG line, and still message are being dropped?


    There's much bigger issues in the world, I know. But I first have to take care of the world I know.

  • Hi Sebastiaan,

    Oh, yes your right about that; the example files I added to the forum do not contain these modifications. However, we did insert them prior to the trial started/stopped messages in the version we are currently running. One thing we can still try is to insert this message prior to all EDF message we are sending?

  • Hi Joanne, I would just start with adding these delays only before the messages that don't, or incorrectly, appear in the eyelink log file. Judging from the screenshot from you edf file, it looks like there is no delay between the sending of the messages at all: 2 are being sent at 7630107 ms and 6 at 7630108 ms. I don't know if this is also a screenshot you made from the old version of your experiment, but if it is not then the delays you have placed in your code are not honored. Otherwise could you post the latest version of your experiment here again?

  • Hi guys,

    Thanks for your tips and the comment of Jarik. The problem seems to be solved: I've added a clock.sleep(10) (outside of the loop where we draw the stimulus on the screen) prior and after exp.pygaze_eyetracker.log(‘trial %d stopped at %f’ %(count_block, self.time())). The bug seemed to be caused by our trial stop message being sent out briefly before exp.pygaze_eyetracker.stop_recording(), which resulted in the trial stop message not to be recorded to the EDF file.


Sign In or Register to comment.