Intermittent synchronization failure

I’ve been trying to set up a new PC in one of our labs and am quite frequently, but not always, getting a ‘synchronization failure’ error when using Psychtoolbox to run MATLAB demos, or when typing the command ‘VBLSyncTest’.

>> VBLSyncTest

PTB-INFO: This is Psychtoolbox-3 for Microsoft Windows, under Matlab 64-Bit (Version 3.0.18 - Build date: Jun 27 2022).

PTB-INFO: OS support status: Windows 10 (Version 10.0) supported and tested to some limited degree.

PTB-INFO: Type ‘PsychtoolboxVersion’ for more detailed version information.

PTB-INFO: Most parts of the Psychtoolbox distribution are licensed to you under terms of the MIT License, with

PTB-INFO: some restrictions. See file ‘License.txt’ in the Psychtoolbox root folder for the exact licensing conditions.

PTB-INFO: For information about paid support, support memberships and other commercial services, please type

PTB-INFO: ‘PsychPaidSupportAndServices’.

PTB-INFO: The detected endline of the vertical blank interval is equal or lower than the startline. This indicates

PTB-INFO: that i couldn’t detect the duration of the vertical blank interval and won’t be able to correct timestamps

PTB-INFO: for it. This will introduce a very small and constant offset (typically << 1 msec). Read ‘help BeampositionQueries’

PTB-INFO: for how to correct this, should you really require that last few microseconds of precision.

PTB-INFO: Btw. this can also mean that your systems beamposition queries are slightly broken. It may help timing precision to

PTB-INFO: enable the beamposition workaround, as explained in ‘help ConserveVRAMSettings’, section ‘kPsychUseBeampositionQueryWorkaround’.

PTB-INFO: OpenGL-Renderer is NVIDIA Corporation :: GeForce 8600 GT/PCIe/SSE2 :: 3.3.0

PTB-INFO: VBL startline = 1024 , VBL Endline = 1023

PTB-INFO: Measured monitor refresh interval from beamposition = 11.761086 ms [85.026164 Hz].

PTB-INFO: Will use beamposition query for accurate Flip time stamping.

PTB-INFO: Measured monitor refresh interval from VBLsync = 11.761320 ms [85.024473 Hz]. (51 valid samples taken, stddev=0.998062 ms.)

PTB-INFO: Reported monitor refresh interval from operating system = 11.764706 ms [85.000000 Hz].

PTB-INFO: Small deviations between reported values are normal and no reason to worry.

PTB-INFO: ==============================================================================================================================

PTB-INFO: WINDOWS DWM DESKTOP COMPOSITOR IS ACTIVE. On this Windows-10 or later system, Psychtoolbox can no longer reliably detect if

PTB-INFO: this will cause trouble for timing and integrity of visual stimuli or not. You might be just fine, or you could be in trouble.

PTB-INFO: Use external measurement equipment and independent procedures to verify reliability of timing if you care about proper timing.

PTB-INFO: ==============================================================================================================================

WARNING: Couldn’t compute a reliable estimate of monitor refresh interval! Trouble with VBL syncing?!?

----- ! PTB - ERROR: SYNCHRONIZATION FAILURE ! -----

One or more internal checks (see Warnings above) indicate that synchronization

of Psychtoolbox to the vertical retrace (VBL) is not working on your setup.

This will seriously impair proper stimulus presentation and stimulus presentation timing!

Please read ‘help SyncTrouble’ for information about how to solve or work-around the problem.

You can force Psychtoolbox to continue, despite the severe problems, by adding the command

Screen(‘Preference’, ‘SkipSyncTests’, 1); at the top of your script, if you really know what you are doing.

Error using PsychImaging (line 2339)

Error using Screen

See error message printed above.

Error in VBLSyncTest (line 295)

w = PsychImaging('OpenWindow',screenNumber, 0, \[\], \[\], \[\], stereo);

>>

The PC is running Windows 10 22H2, with MATLAB 2021b, Psychtoolbox 3.0.18 and GStreamer 1.18.6 (1.18 is the version recommended for Psychtoolbox 3.0.18 and ‘help GStreamer’ gives a link for 1.18.5, but this link is broken and only 1.18.6 is currently available for download). The monitor is a CRT (HP P1130 Trinitron), connected via a DVI to VGA adapter. I have read the ‘help SyncTrouble’ information that lists some possible causes and fixes, mainly to do with display settings and drivers, but these settings seem to be correct and the drivers are up to date. I have also noted that some forum posts recommend the use of Linux rather than Windows, but we have a PC in a different lab with similar specs that does not get ‘synchronization failure’ errors. (It does still give the ‘WINDOWS DWM DESKTOP COMPOSITOR IS ACTIVE’ warning.) This PC is running Windows 10 22H2, with MATLAB 2021b, Psychtoolbox 3.0.18 and GStreamer 1.18.5. One difference between these PCs is the graphics card: the new PC has an NVIDIA GeForce 8600 GT, while the PC that is not giving ‘synchronization failure’ errors has an NVIDIA GTX 1660 Ti. A logical step at this point would be to try a different graphics card in the new PC, but this could be an expensive process of trial and error. Another difference is the monitor, but trying out several combos suggests that the monitor is not the issue (e.g. the new PC still gives sync errors when attached to the LCD monitor that the good PC is attached to; and an older PC running Windows 7 and older versions of MATLAB and PTB does not give sync errors when attached to the same CRT monitor via a DVI to VGA adapter). Any suggestions would be welcome!

As I understand it, the sync test takes measurements of the refresh interval and reports the standard deviation in these measurements. A cut-off SD value of 0.2 ms is used to determine whether or not there is a synchronization failure. On the new PC, the SD values vary a lot from one sync test to the next and I think the easiest way to describe them is with a graph showing the results of successive sync tests using the ‘VBLSyncTest’ command. The figure below compares the new PC with two existing PCs that are not giving ‘synchronization failure’ errors.

It can be seen that the standard deviation quite often exceeds the cut-off by a few tenths of a millisecond (the worst I’ve seen is 0.998 ms). I’m not sure how much of a concern this level of variability is. It presumably depends on what sort of data the new PC will be collecting. It is going to be used in an eye-tracking lab. An opinion on whether the performance that I’m seeing is acceptable or not would also be helpful, although I realise this might be like asking ‘how long is a piece of string’. I’m a technician and I don’t collect or analyse data myself.

Thanks,

Richard

Hi there,

the first thing to check would be the graphs that VBLsyncTest shows you. The help gives some explanation how to interpret the graphs. Basically, it will show you how much time it actually took for the individual frames to be produced. When you are running into more sporadic issues you might want to increase the duration, i.e. measure for more frames. This is the first option of the test.

This should at least tell you which of the three following situations you are in:

  • there is overall substantial variability in the measured times, i.e. the sync just does not really work. This would mean that something relatively low level is not working right. Look through drivers, psych toolbox setup etc.
  • You drop frames sometimes, i.e. sometimes you don’t hit the sync you wanted but one or two later. This would show up as precise timing for most frames and some which are multiples of all the others. This is your best case scenario, because you just need to find the other thing that sometimes occupies the computer for 10-20ms or puts some general load on the computer.
  • Finally, you can have a huge spike in delay which may or may not be a multiple of frames. This would mean your computer hangs a bit from time to time. Here you also need to hunt for some other running program that interferes, but it cannot be general load. It would be some kind of special event in that other program.

I hope this helps. Good luck!

Unfortunately, your system is definitely broken. How sync tests work, and that failure almost always means a system unfit for any precisely timed stimulus presentation, has been explained many times by myself, and also in our help texts, e.g., ‘help SyncTrouble’.

In a nutshell:

  1. First upgrade to the latest PTB version, the latest has the most/best workarounds for machine problems, so the highest chance of diagnosing or auto-fixing issues. That you even report a problem with a totally outdated PTB 3.0.18 is a pointless exercise. 3.0.22.1 is the latest.

  2. The stddev reported is not what you’d observe once the sync tests pass successfully because PTB’s high precision timestamping can drastically reduce timestamp variability on a known working system to the low microsecond range, a unique feature that to my knowledge no other vision science toolkit has. This provides the best baseline for precise stimulus timing. Of course too complex stimuli on an underpowered system, or a system that technically “works correctly” but has bad general timing behaviour could still drop frames, but at least the timestamps would report that faithfully.

  3. The reported stddev, together with others indicators and tests is only meant for PTB to evaluate if stimulus presentation timing of your machine is not totally broken, and the thresholds for this and other indicators are selected based on experience to rather reliably detect a totally broken system. Your numbers clearly indicate that that system won’t provide any frame accurate timing or timestamping, errors in the range of +/- multiple video refresh cycles, e.g., +/- 50 msecs are to be expected. I wouldn’t use your broken system for anything that needs better than 50 msecs visual onset timing precision, certainly not for most eye tracking tasks, if they require any precise correlation of eye gaze samples with presented content.

On MS-Windows, the last good Window version was Windows-7 SP1, as up to that version, Psychtoolbox could automatically and reliably disable the DWM desktop compositor for any fullscreen window presentation, removing the main cause of timing problems during a PTB session. The ability to do that was removed by Microsoft in Windows-8 and later, and so PTB has to rely on the OS DWM compositor hopefully doing the right thing, e.g., auto-disable itself when it thinks that is appropriate. There are various conditions that can prevent that, the instructions in our help files try to guide you into nudging the DWM to play nicely, but success is not guaranteed. Our sync tests are the best we have to at least detect when the DWM and other actors break timing.

So in general you’d find that timing on Windows-7 and earlier was much more reliable/trustworthy, but those times are gone and even Windows-10 is on the way out.

Your troublesome GeForce 8600 GT graphics card is very old, requiring older NVidia drivers, which were written for probably Windows Vista or Windows 7, and are no longer optimized or maintained for modern Windows versions. I think modern drivers only support GTX 1600 seriess and later, aka NVidia Turing gpu family or later. So there’s a good chance it is the old graphics card or drivers causing extra trouble.

In general, Linux/X11 with appropriate AMD and Intel gpu’s should provide best timing, followed by Linux/X11 with NVidia - but already more shaky. For non-Linux it is generally much less reliable and depends a lot on the specific OS, OS version, graphics hardware, display configuration (single display vs. multi-display, HiDPI/Retina vs. non-Retina, and various other delicate factors) and drivers.

That’s why I recommend Linux + AMD or Intel graphics, and Linux + AMD for the most high performance and feature rich experience.

@HeikoSchutt, thank you for your helpful advice. The graphs seem to show normal values on most attempts to measure the refresh interval, but with an occasional very large spike, which matches the third situation that you describe. However, I can’t see anything in Task Viewer > Processes or Event Viewer that correlates in time with running the sync test in Psychtoolbox. I’ll speak with our IT support about this. I’m also going to try replacing the GPU, following the advice of @mariokleiner (see below).

@mariokleiner, thank you for these comments, which are really helpful. It’s useful just to confirm that this is something we need to be concerned about. The reason for using an old version of PTB is something that is currently out of my control – I’m a technician and the department is not currently paying for access to 3.0.20 and later, although this may change. It is very helpful to know that the graphics card is likely contributing to the problem and I’ll follow this up with our IT support right away. We have another set-up that is working well with Windows 10 and a GTX 1660 Ti GPU, which is consistent with your recommendation of using a GTX 1600 series card or later. If this fails, then reverting to Windows 7 might perhaps be an option. Last week I tried installing MATLAB 2021b and PTB 3.0.18 on a Windows 7 machine as a back-up (this is an old PC that we are hoping to replace) and PTB appears to be working fine on it, i.e. VBLSyncTest does not report any synchronisation failures. Although I understand from the PTB hardware requirements page (http://psychtoolbox.org/requirements) that versions later than 3.0.18 will not work with Windows 7 and that there could be some issues with 3.0.18 as well. It would be great if we could switch to Linux, but the computers in our eye tracking labs need to support SR Research’s Experiment Builder, which unfortunately does not run on Linux.