Howdy, Stranger!

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

Supported by

Gazepoint Control Version 4.2.0 used with PyGaze and Opensesame - Calibration Error

edited May 31 in PyGaze

Hi there,

We have been using a GazePoint eyetracker with version 4.1 of the Controller, Opensesame 3.1.9, and the latest release of the PyGaze package on Windows 7 and Windows 10 machine without incurring into any major trouble. I have been helped by @moreno and @alisdt to set it up.

However, we wanted to update the Gazepoint Control to their latest release, which is 4.2.0. The reason is that it implements a new "P" mode for tracking difficult eyes, and we are often dealing with elderly and clinical populations which are actually harder to track.

But, when we try to run the Gazepoint Version 4.2.0, we got the following error during the calibration phase:

Starting experiment as ExperimentProcess-3
openexp._canvas.legacy.init_display(): enabling hardware surface
openexp._canvas.legacy.init_display(): enabling double buffering
openexp._canvas.legacy.init_display(): video mode ok
openexp.sampler._legacy.init_sound(): sampling freq = 48000, buffer size = 1024
openexp.sampler._legacy.init_sound(): mixer already initialized, closing experiment started at Thu May 31 15:06:43 2018 disabling garbage collection
Exception in thread PyGaze_OpenGazeConnection_incoming:
Traceback (most recent call last):
  File "C:\Program Files (x86)\OpenSesame\lib\", line 801, in __bootstrap_inner
  File "C:\Program Files (x86)\OpenSesame\lib\", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pygaze\_eyetracker\", line 428, in _process_incoming
    command, msgdict = self._parse_msg(msg)
  File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pygaze\_eyetracker\", line 350, in _parse_msg
    e = lxml.etree.fromstring(xml)
  File "src\lxml\etree.pyx", line 3213, in lxml.etree.fromstring
  File "src\lxml\parser.pxi", line 1876, in lxml.etree._parseMemoryDocument
  File "src\lxml\parser.pxi", line 1764, in lxml.etree._parseDoc
  File "src\lxml\parser.pxi", line 1126, in lxml.etree._BaseParser._parseDoc
  File "src\lxml\parser.pxi", line 600, in lxml.etree._ParserContext._handleParseResultDoc
  File "src\lxml\parser.pxi", line 710, in lxml.etree._handleParseResult
  File "src\lxml\parser.pxi", line 639, in lxml.etree._raiseParseError
XMLSyntaxError: attributes construct error, line 1, column 30 (line 1)

@moreno and I suspect that in this latest 4.2.0 of the Gazepoint Control, something in the API must have been changed and consequently PyGaze cannot parse the XML.
As we really are not that familiar with the implementation of PyGaze, we would have to ask PyGaze experts here, as well as you @Edwin, whether you have encountered a similar problem before; and especially whether you would be so kind to help us resolve this issue.

Thank you very much for your precious time.


  • Heya!

    Thanks for the elaborate description and for posting the full traceback, those are very useful! I hope you don't mind, but I changed your post ever so slightly by putting the traceback info between ~~~ flags to make it render as code. This makes it slightly more readable :)

    As for the actual issue: It sounds like your analysis is correct. I haven't tried the new API yet, so haven't run into the issue myself, but your error message is from the lxml library (which is native Python; not something that we concocted!), and seems to indicate that the xml message that it tried to parse was malformed. For example, this can happen when a space is missing from the message, or a closing quotation is forgotten.

    Whether this malformed message came directly from the GP tracker is something that is hard to say. It could well be, but it could also be that the message was partly lost along the way someplace. One thing you could try is to ask GazePoint about this specific point, as they will know whether they might have changed anything that could have introduced malformed xml.

    In the meantime, if I have some time (which is not likely to be very soon - especially not this week or the next), I'll have a look at whether I can reproduce the error, and whether I can find a workaround.

    Good luck!

    Thanked by 1moreno
  • edited June 5

    Hi there,

    we have been in touch with Gazepoint developers and apparently, a potential source of conflict was that in Gazepoint 4.2 there was a bug

    <ACK ID="USER_DATA" VALUE="0"DUR="0" /> 

    Basically, a missing space ...

    So, they gave us today an updated version (4.3) to be released very soon wherein such bug was fixed.
    I do not know whether that was the true cause of the problem, but we seem now to be able to track just fine using PyGaze and Opensesame, and their latest 4.3 version ... so, at least for now ... problem solved!


    Thanked by 1Edwin
  • Hi Moreno,

    Amazing, thanks for the update! That missing space is very likely to have been the cause of the lxml hickup, as it would fail to understand that VALUE="0"DUR="0" actually means VALUE="0" AND DUR="0".


    PS: I totes called it :sunglasses:

    [...] this can happen when a space is missing from the message [...]

Sign In or Register to comment.