Unclear how to change configuration settings after Psych toolbox synchronization failure

9 ビュー (過去 30 日間)
Grace Barnhart
Grace Barnhart 2021 年 12 月 31 日
編集済み: Zhan Anya 2023 年 4 月 8 日
Following failed sync tests for Demo files of the EyeLink II system, the first solution offered on the "SyncTrouble" help page (see below) is to reconfigure settings. I am unsure where/how to reconfigure the settings included in the below recommendations. I assume these setting changes are done directly on the computer and not through MATLAB? I am working from a PC and running MATLAB 2017b. Does anyone have recommendations for how to go about trying these troubleshooting steps?
>> help SyncTrouble
SyncTrouble -- Causes and solutions for synchronization problems.
You most probably arrived at this help page because Psychtoolbox
aborted with "SYNCHRONIZATION FAILURE" or a similar error message and
asked you to read this page.
BACKGROUND: Why proper synchronization to retrace is important.
When executing Screen('OpenWindow'), Psychtoolbox executes different
calibration routines to find out if back- and frontbuffer swaps (what
Screen('Flip') does) are properly synchronized to the vertical retrace
signal (also known as VBL) of your display. At the same time, it measures
the real monitor video refresh interval - the elapsed time between two
VBL signals. It is crucial for flicker free, tear free, properly timed
visual stimulus presentation that buffer swaps only happen during the VBL
period of the display. The VBL (vertical blank) is the small gap in time
that occurs when the display has updated its last scanline and before it
starts redrawing its display surface starting at the first scanline
again. This small gap is a neccessity for CRT displays and it is
preserved for compatibility reasons or other technical reasons on flat
panels and video beamers. After issuing the Screen('Flip') command, the
graphics hardware finalizes all pending drawing- and imageprocessing
operations in the backbuffer of an onscreen window to make sure that the
final stimulus image is ready in the backbuffer for presentation. Then it
waits for onset of the next VBL interval before flipp'ing the back- and
frontbuffer of the onscreen window: The previous backbuffer with your
newly drawn stimulus becomes the frontbuffer, so it will get scanned out
and displayed to the subject, starting with the next refresh cycle of
your display device and on all consecutive refresh cycles, until you draw
a new stimulus to the onscreen window and update the display again via
Screen('Flip').
On a properly working system, this double buffer swap happens in less
than a microsecond, synchronized to VBL onset with an accuracy of better
than a microsecond. All change of visual content therefore only happens
during the VBL period when the display is not updating, thereby avoiding
any kind of visual flicker or tearing that would be caused by a mixup of
an old stimulus and a new (incompletely drawn) stimulus when changing
image content during the scanout cycle of the display. The exact point in
time when this buffer swap happened, is returned as timestamp by the
Screen('Flip') command. It is the most well defined timestamp of visual
stimulus onset, and it allows to define stimulus onset of future stims
relative to this accurate baseline, using the 'when' argument of
Screen('Flip').
Without proper synchronization, you would see very strong visual flicker
and tearing artifacts in animated (movie / moving) stimuli, you would not
have any well defined stimulus onset for sequences of static stimuli or
rapid stimulus presentation, and no means of synchronizing visual
stimulus presentation to any external stimulation- or acquisition devices
like fMRI, EEG, sound, ... You also would not have any accurate way of
getting a stimulus onset timestamp.
However, if you have very special needs, you can disable either Matlabs /
Octaves synchronization of execution to the vertical retrace or you can
disable synchronization of stimulus onset to the vertical retrace
completely by setting the 'dontsync' flag of Screen('Flip') accordingly.
For more infos about tearing, see Wikipedia articles about "Tearing",
"Double buffering", "Vertical Synchronization" and the info pages on
www.psychtoolbox.org
TESTS: How Psychtoolbox tests for proper synchronization to retrace.
After opening an onscreen window, Psychtoolbox executes a measurement
loop, where it issues Screen('Flip') commands and measures the time
elapsed between execution of two consecutive flip commands, getting one
refresh sample per loop iteration. Each sample is checked for validity:
Duration must be longer than 4 milliseconds and shorter than 40
milliseconds, because we assume that none of the available display
devices updates slower than 25 Hz or faster than 250 Hz. Each sample is
also tested against the expected value provided by the operating system,
e.g., if the operating system reports a nominal refresh rate of 100 Hz,
then a sample should have a duration of roughly 1000 ms / 100 Hz == 10
milliseconds. We accept any sample in a range of +/- 20% around this
expected value as valid, because timing jitter present in any computer
system can cause some deviation from the expected value. Samples that
don't pass this basic test are rejected. Valid samples are used to update
a mean value, standard deviation of the mean is also calculated: The
measurement loop ends when at least 50 valid samples have been taken and
the standard deviation from the mean is less than 200 microseconds. If it
is not possible to satisfy this criteria during a five second measurement
interval, then the calibration is aborted and repeated for up to three
times. Failure to get a valid measurement during up to three calibration
runs is indicating massive timing problems or the inability of the
gfx-hardware to properly synchronize buffer swaps to the vertical
retrace. This leads to abortion with the "SYNCHRONIZATION FAILURE" error
message. Assuming that this calibration loop did provide a valid mean
measurement of monitor refresh, the value is checked against the value
reported by the operating system and - on MacOS-X - against the result of
an independent measurement loop that uses direct queries of rasterbeam
positions to measure the monitor refresh interval. Only if all available
measurements yield similar results, the test is finally rated as PASSED,
Psychtoolbox continues execution and the computed monitor refresh
interval is used internally for all built-in timing checks and for
properly timed stimulus presentation.
REASONS FOR FAILING THE SYNC TESTS AND HOW TO FIX THEM:
There are multiple classes of possible causes for sync failure. Work down
this list of causes and solutions down until your problem is resolved or
you hit the bottom of the list:
1. Wrong configuration settings: This usually only affects MS-Windows
systems, where the display settings control panel for your graphics card
allows to customize a couple of graphics driver parameters. Some of these
settings can cause sync failure if they are wrong:
-> Make sure the "Synchronize bufferswaps to the vertical retrace" option
is set to "Application controlled" or "Application controlled, default to
on". The wording of the option differs between different graphics cards,
search for something like that. Examples of other names: "Wait for
vertical sync", "Wait for vertical refresh" ... If this setting is forced
to off and *not* application controlled, then the sync tests will fail
because the hardware doesn't synchronize its image onset (bufferswap) to
the video refresh cycle of your display.
-> Make sure the "Triple buffering" setting is off, or if you can select
some "Multibuffering" setting, that it is set to "double buffering" or
"wait for 1 video refresh" or "swap every refresh". This option may not
exist, but if it does, any other setting will cause the sync tests to
possibly succeed, but later stimulus onset timestamping to fail with
errors.
-> If there is an option "Buffer swap mode" or "Bufferswap strategy", it
should be set to "Auto select" or "Page flipping" or "Exchange buffers".
The so called "Copy buffers" or "Blitting" option would result in lower
performance and inaccurate timing.
-> On dual/multi display setups MS-Windows allows you to assign one
monitor the role of the "primary monitor" or "primary display". It is
important that the display device which you use for stimulus presentation
is the "primary display", otherwise random things may go wrong wrt. sync
tests and timing.
-> If you have the choice to set your multi-monitor configuration to
either "dual display mode"/"dual display performance mode"/"separate
displays" or instead to "extended desktop mode" or "horizontal spanning",
you should choose "extended desktop mode" or "horizontal spanning" modes
for best timing and stimulus quality. Please note that this choice
doesn't exist anymore on Windows-Vista and later.
-> On all operating systems in dual display or multi display mode it is
important that you configure both displays for exactly the same color
depths, resolution and refresh rate if you want to present stimuli across
multiple displays, e.g., for binocular stereoscopic presentation on a
dual-display setup. If there is some option you can choose for "genlocked
modes" or "genlocked modes only", choose or enable that one. Failing to
configure dual display setups like this will cause massive timing
problems or tearing artifacts on one of the display if you do dual
display stimulation. It may also cause failures in timetamping.
  2 件のコメント
Walter Roberson
Walter Roberson 2021 年 12 月 31 日
"the display settings control panel for your graphics card"
Zhan Anya
Zhan Anya 2023 年 4 月 8 日
編集済み: Zhan Anya 2023 年 4 月 8 日
Hi, I also encountered the same problem. Hope my answer helps (though it has passed 2 years).
For the first three, I will use "Synchronize bufferswaps to the vertical retrace" as an example, as the three are displayed on the same page.
If you want to set the "Synchronize bufferswaps to the vertical retrace" option to 'application controlled' in MATLAB, you will need to access the graphics card driver settings. The specific steps to access the settings may vary depending on your graphics card and operating system. Here are some general steps that may help:
  1. Right-click on the desktop and select "Graphics Properties" or "NVIDIA Control Panel" (or similar).
  2. Navigate to the "3D Settings" or "Display" section.
  3. Look for an option related to vertical synchronization, vertical refresh rate, or buffer swaps. Depending on your graphics card and driver version, the option may be called "Vertical Sync," "Vertical Refresh," "Buffer Swap," or similar.
  4. Set the option to "Application Controlled" or a similar value that allows the application (in this case, MATLAB) to control the buffer swaps.
For 'dual/multi display' in Windows, please follow the steps below:
  1. Connect your additional monitor(s) to your computer.
  2. Right-click on the desktop and select "Display settings" from the dropdown menu.
  3. Scroll down to the "Multiple displays" section and select the option that best fits your needs, such as "Extend desktop" to use your additional display(s) as an extension of your primary display or "Duplicate desktop" to duplicate your primary display on all connected displays.
  4. Adjust the resolution and orientation of each display as needed using the dropdown menus and settings available under the "Multiple displays" section.
  5. Click "Apply" and then "Keep changes" to save your display settings.
Although I tried these steps, none worked for my computer. I think that may be the hardware issues.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeTiming and presenting 2D and 3D stimuli についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by