syncing problem

hey everyone,
first of all, i know there are several posts regarding the sync issue, but i can't reply for some reason so i'm force to start a new topic, sorry.

i was using the psychtoolbox and it was fine, until today i added the CRS toolbox and since then i get an error when i use Screen, that says i have sync problem.

after trying all the suggestions in the forum and nothing helped, i uninstalled the CRs, PTB and MATLAB, and re-installed MATLAB with PTB only, but that didn't helped either.

i'm using MATLAB r2012b, windos 8, my laptop is asus U30S and i have integrated graphic card by intel and a nvidia geforce GT 520m, i set MATLAB to work with the nvidia.

Inline image 1

any suggestions what can i do??

the error i get:
" PTB-INFO: This is Psychtoolbox-3 for Microsoft Windows, under Matlab 64-Bit (Version 3.0.11 - Build date: Jul 9 2013).
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: Will disable DWM because a regular fullscreen onscreen window is opened -> We want best timing and performance.
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 ConserveVRAM', section 'kPsychUseBeampositionQueryWorkaround'.


PTB-INFO: OpenGL-Renderer is NVIDIA Corporation :: GeForce GT 520M/PCIe/SSE2 :: 4.3.0
PTB-INFO: VBL startline = 768 , VBL Endline = 768
PTB-INFO: Measured monitor refresh interval from beamposition = 16.664656 ms [60.007239 Hz].
PTB-INFO: Will use beamposition query for accurate Flip time stamping.
PTB-INFO: Measured monitor refresh interval from VBLsync = 16.676707 ms [59.963875 Hz]. (298 valid samples taken, stddev=0.367668 ms.)
PTB-INFO: Reported monitor refresh interval from operating system = 16.666667 ms [60.000000 Hz].
PTB-INFO: Small deviations between reported values are normal and no reason to worry.

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."

thanks,
Ran
I assume you only use this machine for development, not for actual running of timing critical experiments? If so, you're fine, don't worry about it. If you run experiments, you better chance to another machine.
Basically, don't use windows 8. Its DWM cannot be switched off, and although it should gracefully retire to the background when a fullscreen window (like PTB's) is opened, we're not really sure how well it does so. This DWM will definitely interfere with timing, and in any case make any returned timestamps of flips useless.
Use windows 7 on your experiment machine (which works for me, but I might simply be lucky), or better yet, Linux (e.g. neurodebian).
Best,
Dee


On Fri, Jul 26, 2013 at 4:13 AM, Ran Berzon <berzoran@...> wrote:

hey everyone,
first of all, i know there are several posts regarding the sync issue, but i can't reply for some reason so i'm force to start a new topic, sorry.

i was using the psychtoolbox and it was fine, until today i added the CRS toolbox and since then i get an error when i use Screen, that says i have sync problem.

after trying all the suggestions in the forum and nothing helped, i uninstalled the CRs, PTB and MATLAB, and re-installed MATLAB with PTB only, but that didn't helped either.

i'm using MATLAB r2012b, windos 8, my laptop is asus U30S and i have integrated graphic card by intel and a nvidia geforce GT 520m, i set MATLAB to work with the nvidia.

Inline image 1

any suggestions what can i do??

the error i get:
" PTB-INFO: This is Psychtoolbox-3 for Microsoft Windows, under Matlab 64-Bit (Version 3.0.11 - Build date: Jul 9 2013).
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: Will disable DWM because a regular fullscreen onscreen window is opened -> We want best timing and performance.
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 ConserveVRAM', section 'kPsychUseBeampositionQueryWorkaround'.


PTB-INFO: OpenGL-Renderer is NVIDIA Corporation :: GeForce GT 520M/PCIe/SSE2 :: 4.3.0
PTB-INFO: VBL startline = 768 , VBL Endline = 768
PTB-INFO: Measured monitor refresh interval from beamposition = 16.664656 ms [60.007239 Hz].
PTB-INFO: Will use beamposition query for accurate Flip time stamping.
PTB-INFO: Measured monitor refresh interval from VBLsync = 16.676707 ms [59.963875 Hz]. (298 valid samples taken, stddev=0.367668 ms.)
PTB-INFO: Reported monitor refresh interval from operating system = 16.666667 ms [60.000000 Hz].
PTB-INFO: Small deviations between reported values are normal and no reason to worry.

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."

thanks,
Ran


hay,
thanks for the tips, i'll try them, and hope they would do the trick.
and yes, i use this configuration only for the development process.

in any case, i did followed the "help SyncTrouble" and tried to set everything the right way, but i'll give it another try.

i am not using any external monitor, only the built-in monitor on my laptop, so it is set to primary, but i'll check it again.


what's most weird to me is that until a month or two, the PTB worked just fine on the same laptop with the same configurations, so i have no idea what happened (beside the CRS and Diablo 3 which i uninstalled both).


i just uninstalled my nvidia driver and re-installed it, but that didn't worked either

i ran the commands:
Screen('Preference', 'SkipSyncTests', 1);
>> PerceptualVBLSyncTest

at the begining, i had this red flashing warning sign, then i got a gray rectangle in the middle and yellow lines flickring mostly at the top of the screen but also randomaly everywher.
this is the output i got,
" Perceptual synchronization test for synchronization of Screen('Flip') and
Screen('WaitBlanking') to the vertical retrace.
Arguments:
'screen' Either a single screen handle, or none (in which case the
display with the maximum id will be used), or a vector of two handles in
stereomode 10, e.g., [0 1] if you want to output to screens 0 and 1. You
can also pass a vector of two screens when stereomode is not set to 10.
In this case two separate (non-stereo) onscreen windows will be opened on
both displays and they will get flipped in multiflip mode 2. That means
that the first display (first element of 'screen') is synced to VBL, but
the 2nd one is synced to bufferswaps of the first one. This is a
straightforward test to check if two displays of a stereosetup run with a
synchronized retrace cycle (good!) or if they are phase-shifted or
drifting against each other (not good!).
'stereomode' Which stereomode to use? Defaults to zero, ie. no stereo.
'fullscreen' Fullscreen presentation? Defaults to 1 ie. yes. In
non-fullscreen mode, no proper synchronization of bufferswaps can be
expected.
'doublebuffer' Single- or double-buffering (1). Defaults to 1. In single
buffer mode there is no sync to retrace, so this is a good way to
simulate the tearing artifacts that would happen on sync failure, just to
get an impression.
'maxduration' Maximum runtime of test: Runs until keypress or maxduration
seconds have elapsed (Default is 10 seconds).
'vblSync' If 1, synchronize bufferswaps to vertical retrace of monitor,
otherwise (setting 0) swap immediately without sync, ie., usually with tearing.
'testdualheadsync' If 1, and 'vblSync' is zero, manually wait until the video
scanout position reaches half the height of the display, then swap. If this
is done on a multi-display setup and the video scanout cycles of all the
participating displays are properly synchronized, you should see a "static"
crack line roughly at half the height of the display, maybe a bit lower. If
you see a wandering crack line, at least on some displays, or you see vertical
offsets of the position of the crack line between displays, then the displays
are not properly synchronized, ie., not suitable for artifact free binocular
stimulation. Caveat: This logic has been developed and tested specifically
for testing on Linux with a single X-Screen spanning multiple displays. It may
or may not be suitable to assess other operating systems or display configurations.
After starting this test, you should see a flickering greyish background
that flickers in a homogenous way - without cracks or weird moving patterns
in the flickering area. If you see an imhogenous flicker, this means that
synchronization of stimulus onset to the vertical retrace doesn't work due
to some serious bug or limitation of your graphics hardware or its driver.
If you don't know what this means, you can test this script with parameter
doublebuffer == 0 to artificially create a synchronization failure.
On many systems you should also see some emerging pattern of yellow horizontal lines.
These lines should be tightly concentrated/clustered in the topmost area of
the screen. Lots of yellow lines in the middle or bottom area or even
randomly distributed lines indicate some bug in the driver of your graphics
hardware. This is a common problem of all ATI graphics adapters on MacOS-X
versions earlier than OS-X 10.4.3 when running a dual-display setup...
A second reason for distributed yellow lines could be bad timing on your
machine, e.g., due to background activity by virus scanners or the Spotlight
indexing service on OS-X. Turn these off for conducting your studies!

Press ENTER key to start the test. The test will stop after 10 seconds
or any keypress...



PTB-INFO: This is Psychtoolbox-3 for Microsoft Windows, under Matlab 64-Bit (Version 3.0.11 - Build date: Jul 9 2013).
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: Will disable DWM because a regular fullscreen onscreen window is opened -> We want best timing and performance.
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 ConserveVRAM', section 'kPsychUseBeampositionQueryWorkaround'.


PTB-INFO: OpenGL-Renderer is NVIDIA Corporation :: GeForce GT 520M/PCIe/SSE2 :: 4.3.0
PTB-INFO: VBL startline = 768 , VBL Endline = 768
PTB-INFO: Measured monitor refresh interval from beamposition = 17.343589 ms [57.658192 Hz].
PTB-INFO: Will use beamposition query for accurate Flip time stamping.
PTB-INFO: Measured monitor refresh interval from VBLsync = 16.660417 ms [60.022506 Hz]. (59 valid samples taken, stddev=0.309825 ms.)
PTB-INFO: Reported monitor refresh interval from operating system = 16.666667 ms [60.000000 Hz].
PTB-INFO: Small deviations between reported values are normal and no reason to worry.

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.


PTB-INFO: Support for fast OffscreenWindows enabled.


PTB-ERROR: Screen('Flip'); beamposition timestamping computed an *impossible stimulus onset value* of 2334.610282 secs, which would indicate that
PTB-ERROR: stimulus onset happened *before* it was actually requested! (Earliest theoretically possible 2334.615422 secs).

PTB-ERROR: Some more diagnostic values (only for experts): rawTimestamp = 2334.617202, scanline = 318
PTB-ERROR: Some more diagnostic values (only for experts): line_pre_swaprequest = 233, line_post_swaprequest = 239, time_post_swaprequest = 2334.615527
PTB-ERROR: Some more diagnostic values (only for experts): preflip_vblcount = 0, preflip_vbltimestamp = -1.000000
PTB-ERROR: Some more diagnostic values (only for experts): postflip_vblcount = 0, postflip_vbltimestamp = -1.000000, vbltimestampquery_retrycount = 0

PTB-ERROR: This error can be due to either of the following causes (No way to discriminate):
PTB-ERROR: Either something is broken in your systems beamposition timestamping. I've disabled high precision
PTB-ERROR: timestamping for now. Returned timestamps will be less robust and accurate, but if that was the culprit it should be fixed.

PTB-ERROR: An equally likely cause would be that Synchronization of stimulus onset (buffer swap) to the
PTB-ERROR: vertical blank interval VBL is not working properly.
PTB-ERROR: Please run the script PerceptualVBLSyncTest to check this. With non-working sync to VBL, all stimulus timing
PTB-ERROR: becomes quite futile. Also read 'help SyncTrouble' !


INFO: PTB's Screen('Flip', 10) command seems to have missed the requested stimulus presentation deadline
INFO: a total of 4 times out of a total of 601 flips during this session.

INFO: This number is fairly accurate (and indicative of real timing problems in your own code or your system)
INFO: if you provided requested stimulus onset times with the 'when' argument of Screen('Flip', window [, when]);
INFO: If you called Screen('Flip', window); without the 'when' argument, this count is more of a ''mild'' indicator
INFO: of timing behaviour than a hard reliable measurement. Large numbers may indicate problems and should at least
INFO: deserve your closer attention. Cfe. 'help SyncTrouble', the FAQ section at www.psychtoolbox.org and the
INFO: examples in the PDF presentation in PsychDocumentation/Psychtoolbox3-Slides.pdf for more info and timing tips.



WARNING: This session of your experiment was run by you with the setting Screen('Preference', 'SkipSyncTests', 1).
WARNING: This means that some internal self-tests and calibrations were skipped. Your stimulus presentation timing
WARNING: may have been wrong. This is fine for development and debugging of your experiment, but for running the real
WARNING: study, please make sure to set Screen('Preference', 'SkipSyncTests', 0) for maximum accuracy and reliability."

and unfortunately i have no idea what to do with the errors (only experts, which i'm not)

if you have any idea, i'll be happy to hear

Ran


--- In psychtoolbox@yahoogroups.com, Ran Berzon <berzoran@...> wrote:
>
> hay,
> so i tried what you suggested, and still it won't work.
> sometimes when i run "PerceptualVBLSyncTest" i get the flickering screen
> and sometimes not.
>

What do you get if you don't get the flickering screen?

> i have no idea what more can i do and getting frustrated.
>
> please help if you have any suggestion. also, if you know what are the
> expert errors in my previous reply mean maybe the answer lies there (but as
> i said i'm no expert and have no clue about them...)
>

The error messages indicate that either the desktop compositor is interfering, or the NVidia Optimus hybrid graphics hack is interfering, given that we can rule out the primary display setting if you are only using one display.

If Optimus is at fault, maybe you can disable the NVidia gpu via some setting, so it is forced to always use the slower Intel gpu? That would solve the timing problems on internal display - and replace them by potential performance problems ;) - If you run your stuff on an external monitor it might also work, as some Optimus laptops have (only) the NVidia card wired to the external display output connector, so on external monitor it would always use the NVidia not only for rendering but also for driving the actual display. This would allow you to still use the laptop for experiments with external monitor. One indication of such a setup would be if you force the system to only use the intel gpu via some setting, but as soon as you connect an external monitor, it will switch to the NVidia anyway, because that's the only way to actually drive the external monitor. However, here you'd have to be careful to possibly *only* enable the external display, as a dual display setup on Windows-8 is prone to cause increased problems with interference the DWM compositor.

Other than that i don't know. Maybe Diabolo (the video game?) changed some graphics driver settings behind your back during its installation?

Or you ignore all these problems and just tell PTB to shut up / ignore all problems and pretend everything is fine, e.g., by adding these two lines to the to of your script, or maybe to your startup.m file,

Screen('Preference', 'VBLTimestampingMode', -1);
Screen('Preference', 'SkipSyncTests', 2);

This would be bad for running real data collection, but as you're just using your Laptop for development it might be good enough.

As i mention quite often: Windows-Vista/7/8 or Optimus by themselves are already bad ideas, but both combined open up new worlds of potentially unresolvable trouble.

-mario
The "Intel only" result looks like something went wrong with your setup, given it only uses software rendering.

The hybrid graphics result looks just hopeless.

You could try to run ptb on only an external monitor if that helps, or simply disable all timing tests and timestamping as i mentioned before, given that you use your laptop only for development, not for running real experiments on it.

Defragmenting windows or such things would not help, this is essentially a problem of the design of your laptop graphics hardware and drivers.

Nothing more one could do.
-mario


--- In psychtoolbox@yahoogroups.com, Ran Berzon <berzoran@...> wrote:
>
> hay,
> when i don't get the flickering screen i get the following error:
> "PerceptualVBLSyncTest(screen, stereomode, fullscreen, doublebuffer,
> maxduration, vblSync, testdualheadsync)
>
> Perceptual synchronization test for synchronization of Screen('Flip') and
> Screen('WaitBlanking') to the vertical retrace.
>
> Arguments:
> 'screen' Either a single screen handle, or none (in which case the
> display with the maximum id will be used), or a vector of two handles in
> stereomode 10, e.g., [0 1] if you want to output to screens 0 and 1. You
> can also pass a vector of two screens when stereomode is not set to 10.
> In this case two separate (non-stereo) onscreen windows will be opened on
> both displays and they will get flipped in multiflip mode 2. That means
> that the first display (first element of 'screen') is synced to VBL, but
> the 2nd one is synced to bufferswaps of the first one. This is a
> straightforward test to check if two displays of a stereosetup run with a
> synchronized retrace cycle (good!) or if they are phase-shifted or
> drifting against each other (not good!).
>
> 'stereomode' Which stereomode to use? Defaults to zero, ie. no stereo.
>
> 'fullscreen' Fullscreen presentation? Defaults to 1 ie. yes. In
> non-fullscreen mode, no proper synchronization of bufferswaps can be
> expected.
>
> 'doublebuffer' Single- or double-buffering (1). Defaults to 1. In single
> buffer mode there is no sync to retrace, so this is a good way to
> simulate the tearing artifacts that would happen on sync failure, just to
> get an impression.
>
> 'maxduration' Maximum runtime of test: Runs until keypress or maxduration
> seconds have elapsed (Default is 10 seconds).
>
> 'vblSync' If 1, synchronize bufferswaps to vertical retrace of monitor,
> otherwise (setting 0) swap immediately without sync, ie., usually with
> tearing.
>
> 'testdualheadsync' If 1, and 'vblSync' is zero, manually wait until the
> video
> scanout position reaches half the height of the display, then swap. If
> this
> is done on a multi-display setup and the video scanout cycles of all the
> participating displays are properly synchronized, you should see a
> "static"
> crack line roughly at half the height of the display, maybe a bit lower.
> If
> you see a wandering crack line, at least on some displays, or you see
> vertical
> offsets of the position of the crack line between displays, then the
> displays
> are not properly synchronized, ie., not suitable for artifact free
> binocular
> stimulation. Caveat: This logic has been developed and tested specifically
> for testing on Linux with a single X-Screen spanning multiple displays.
> It may
> or may not be suitable to assess other operating systems or display
> configurations.
>
> After starting this test, you should see a flickering greyish background
> that flickers in a homogenous way - without cracks or weird moving
> patterns
> in the flickering area. If you see an imhogenous flicker, this means that
> synchronization of stimulus onset to the vertical retrace doesn't work due
> to some serious bug or limitation of your graphics hardware or its driver.
> If you don't know what this means, you can test this script with parameter
> doublebuffer == 0 to artificially create a synchronization failure.
>
> On many systems you should also see some emerging pattern of yellow
> horizontal lines.
> These lines should be tightly concentrated/clustered in the topmost area
> of
> the screen. Lots of yellow lines in the middle or bottom area or even
> randomly distributed lines indicate some bug in the driver of your
> graphics
> hardware. This is a common problem of all ATI graphics adapters on MacOS-X
> versions earlier than OS-X 10.4.3 when running a dual-display setup...
>
> A second reason for distributed yellow lines could be bad timing on your
> machine, e.g., due to background activity by virus scanners or the
> Spotlight
> indexing service on OS-X. Turn these off for conducting your studies!
>
>
> Press ENTER key to start the test. The test will stop after 10 seconds
> or any keypress...
>
>
>
> PTB-INFO: This is Psychtoolbox-3 for Microsoft Windows, under Matlab 64-Bit
> (Version 3.0.11 - Build date: Jul 9 2013).
> 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: Will disable DWM because a regular fullscreen onscreen window is
> opened -> We want best timing and performance.
> 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
> ConserveVRAM', section 'kPsychUseBeampositionQueryWorkaround'.
>
>
> PTB-INFO: OpenGL-Renderer is NVIDIA Corporation :: GeForce GT
> 520M/PCIe/SSE2 :: 4.3.0
> PTB-INFO: VBL startline = 768 , VBL Endline = 768
> PTB-INFO: Measured monitor refresh interval from beamposition = 22.786029
> ms [43.886542 Hz].
> PTB-INFO: Will use beamposition query for accurate Flip time stamping.
> PTB-INFO: Measured monitor refresh interval from VBLsync = 16.667941 ms
> [59.995413 Hz]. (270 valid samples taken, stddev=0.267082 ms.)
> PTB-INFO: Reported monitor refresh interval from operating system =
> 16.666667 ms [60.000000 Hz].
> PTB-INFO: Small deviations between reported values are normal and no reason
> to worry.
>
> 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."
>
> i also tried to diable my nVIDIA in the display adaptors as suggested, so
> the laptop will only use the intel HD graphics 3000 card i have, i get the
> following error (after updating it's driver via intel website):
> "
>
> Perceptual synchronization test for synchronization of Screen('Flip') and
> Screen('WaitBlanking') to the vertical retrace.
>
> Arguments:
> 'screen' Either a single screen handle, or none (in which case the
> display with the maximum id will be used), or a vector of two handles in
> stereomode 10, e.g., [0 1] if you want to output to screens 0 and 1. You
> can also pass a vector of two screens when stereomode is not set to 10.
> In this case two separate (non-stereo) onscreen windows will be opened on
> both displays and they will get flipped in multiflip mode 2. That means
> that the first display (first element of 'screen') is synced to VBL, but
> the 2nd one is synced to bufferswaps of the first one. This is a
> straightforward test to check if two displays of a stereosetup run with a
> synchronized retrace cycle (good!) or if they are phase-shifted or
> drifting against each other (not good!).
>
> 'stereomode' Which stereomode to use? Defaults to zero, ie. no stereo.
>
> 'fullscreen' Fullscreen presentation? Defaults to 1 ie. yes. In
> non-fullscreen mode, no proper synchronization of bufferswaps can be
> expected.
>
> 'doublebuffer' Single- or double-buffering (1). Defaults to 1. In single
> buffer mode there is no sync to retrace, so this is a good way to
> simulate the tearing artifacts that would happen on sync failure, just to
> get an impression.
>
> 'maxduration' Maximum runtime of test: Runs until keypress or maxduration
> seconds have elapsed (Default is 10 seconds).
>
> 'vblSync' If 1, synchronize bufferswaps to vertical retrace of monitor,
> otherwise (setting 0) swap immediately without sync, ie., usually with
> tearing.
>
> 'testdualheadsync' If 1, and 'vblSync' is zero, manually wait until the
> video
> scanout position reaches half the height of the display, then swap. If
> this
> is done on a multi-display setup and the video scanout cycles of all the
> participating displays are properly synchronized, you should see a
> "static"
> crack line roughly at half the height of the display, maybe a bit lower.
> If
> you see a wandering crack line, at least on some displays, or you see
> vertical
> offsets of the position of the crack line between displays, then the
> displays
> are not properly synchronized, ie., not suitable for artifact free
> binocular
> stimulation. Caveat: This logic has been developed and tested specifically
> for testing on Linux with a single X-Screen spanning multiple displays.
> It may
> or may not be suitable to assess other operating systems or display
> configurations.
>
> After starting this test, you should see a flickering greyish background
> that flickers in a homogenous way - without cracks or weird moving
> patterns
> in the flickering area. If you see an imhogenous flicker, this means that
> synchronization of stimulus onset to the vertical retrace doesn't work due
> to some serious bug or limitation of your graphics hardware or its driver.
> If you don't know what this means, you can test this script with parameter
> doublebuffer == 0 to artificially create a synchronization failure.
>
> On many systems you should also see some emerging pattern of yellow
> horizontal lines.
> These lines should be tightly concentrated/clustered in the topmost area
> of
> the screen. Lots of yellow lines in the middle or bottom area or even
> randomly distributed lines indicate some bug in the driver of your
> graphics
> hardware. This is a common problem of all ATI graphics adapters on MacOS-X
> versions earlier than OS-X 10.4.3 when running a dual-display setup...
>
> A second reason for distributed yellow lines could be bad timing on your
> machine, e.g., due to background activity by virus scanners or the
> Spotlight
> indexing service on OS-X. Turn these off for conducting your studies!
>
>
> Press ENTER key to start the test. The test will stop after 10 seconds
> or any keypress...
>
>
>
> PTB-INFO: This is Psychtoolbox-3 for Microsoft Windows, under Matlab 64-Bit
> (Version 3.0.11 - Build date: Jul 9 2013).
> 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: Will disable DWM because a regular fullscreen onscreen window is
> opened -> We want best timing and performance.
> PTB-WARNING: Created onscreen window on screenid 0 will probably not be
> able to use GPU pageflipping for
> PTB-WARNING: Screen('Flip')! May cause tearing artifacts and unreliable or
> wrong visual stimulus onset timestamping!
> PTB-WARNING: Could not bind wglChoosePixelFormat - Extension. Some features
> will be unavailable, e.g., Anti-Aliasing and high precision framebuffers.
> PTB-WARNING: Created onscreen window on screenid 0 will probably not be
> able to use GPU pageflipping for
> PTB-WARNING: Screen('Flip')! May cause tearing artifacts and unreliable or
> wrong visual stimulus onset timestamping!
> PTB-WARNING: Your graphics driver doesn't allow me to control if
> bufferswaps should be synchronized to the vertical retrace!
> PTB-WARNING: This can cause massive stimulus timing problems, failure of
> the sync tests and calibrations and severe visual tearing artifacts!
> PTB-WARNING: Please update your display graphics driver as soon as possible
> to fix this and make sure this functionality is not disabled in
> PTB-WARNING: the display settings control panel of your graphics card.
> PTB-WARNING: If everything else fails, you can usually manually enable
> synchronization to vertical retrace somewhere in the display settings
> PTB-WARNING: control panel of your machine.
>
>
>
>
> PTB-WARNING: Seems that Microsofts OpenGL software renderer is active! This
> will likely cause miserable
> PTB-WARNING: performance, lack of functionality and severe timing and
> synchronization problems.
> PTB-WARNING: Most likely you do not have native OpenGL vendor supplied
> drivers (ICD's) for your graphics hardware
> PTB-WARNING: installed on your system.Many Windows machines (and especially
> Windows Vista) come without these preinstalled.
> PTB-WARNING: Go to the webpage of your computer vendor or directly to the
> webpage of NVidia/AMD/ATI/3DLabs/Intel
> PTB-WARNING: and make sure that you've download and install their latest
> driver for your graphics card.
> PTB-WARNING: Other causes, after you've ruled out the above:
> PTB-WARNING: Maybe you run at a too high display resolution, or the system
> is running out of ressources for some other reason.
> PTB-WARNING: Another reason could be that you disabled hardware
> acceleration in the display settings panel: Make sure that
> PTB-WARNING: in Display settings panel -> Settings -> Advanced ->
> Troubleshoot -> The hardware acceleration slider is
> PTB-WARNING: set to 'Full' (rightmost position).
>
> PTB-WARNING: Actually..., it is pointless to continue with the software
> renderer, that will cause more trouble than good.
> PTB-WARNING: I will abort now. Read the troubleshooting tips above to fix
> the problem. You can override this if you add the following
> PTB-WARNING: command: Screen('Preference', 'ConserveVRAM', 64); to get a
> functional, but close to useless window up and running"
>
> if you have any idea what can i do it will be awesome.
>
> in any case, thank you very much for your help and patience.
>
> my last ideas were to refresh my windows or defragmenting.
> the defragmenting is currently running and i'll have it done soon i hope,
> and hopefully that will solve it (a bit sceptic). as for the refresh, i
> don't really want to do that, because i'll lose all my installed programs,
> but maybe that would solve it (if i'll give it a try and it will work i'll
> update)
>
> Ran
>
well, i will use it with warnings disabled for now

thanks for your help

Ran
I imagine it depends what you want to do. I've run PTB on Win7 machines with absolutely no problems.

However it is hard to predict for every eventuality. You might just have to do some work and test it for your application. See if it meets your needs.

Peter

--- In psychtoolbox@yahoogroups.com, "ptbmin" <ptbmin@...> wrote:
>
> Hi Mario,
>
> It seems the choice of operating system for PTB is Ubuntu > OSX > Win XP > Win 7 > Win 8. So for users that have to stick on Windows (e.g. some devices are supported only by Windows operating systems because the manufacturers don't provide drivers for other operating systems), the best choice is Win XP.
>
> Unfortunately, Win XP has been discarded by Intel's latest CPU, e.g. I7-4770. I heard Win7 still worked well with Intel's Haswell processors, but haven't got a chance to test it. Is there any chance to improve the performance of Win7? I was very concerned when you said "In practice this never worked reliably on Windows Vista or Windows-7"...
>
> Min
>
> --- In psychtoolbox@yahoogroups.com, "Mario" <mario.kleiner@> wrote:
> >
> >
> >
> > That's true, with the qualification that *if* the DWM interferes that's game over, but we don't know if it interferes. There is no way on Windows-8 for us to disable the DWM, or to directly check if the DWM is active, as Microsoft changed the relevant operating system functions to do nothing, but lie to us, pretending to do the right thing. A sync failure would be an indirect indication of DWM interference, but not a clear cut one, as "DWM active" implies a high likelihood of sync failure or of other timing error messages if ptb makes it through the startup tests, but the same error messages can be caused by various other causes.
> >
> > Theoretically the DWM should disable itself on displays where a fullscreen onscreen window is active. In practice this never worked reliably on Windows Vista or Windows-7, but maybe it works on Windows-8.
> >
> > Another problem on your system is that it is a hybrid graphics laptop. Depending on how hybrid graphics is implemented, that can completely trash timing in subversive ways as well. Sync failure et al. can be an indication of that, but again not 100% reliable. If your Laptop has a hardware multiplexer it is safe, otherwise not. Unfortunately this info is usually not available in the product spec sheets. Linux wouldn't help in this specific case either, as the current implementation for NVidia cards is the same on Windows and Linux as far as i know. There is some effort underway to improve that situation on Linux, but this is a long term goal - results might be easily months to years away. The advice is to avoid hybrid graphics laptops. Apple Laptops are ok on OSX and Linux, as so far all models use hardware graphics multiplexers to implement graphics switching.
> >
> > There are various other sources of timing trouble. Make sure to read the advice in "help SyncTrouble", as the error messages you posted already told you to do. Especially selection of the "primary display" deserves some attention in your case.
> >
> > Another diagnostic thing to try is to use the skipsynctest setting 1 to get over the failing tests and run PerceptualVBLSyncTest and check if the yellow lines behave as the help text describes they should, or if other error messages show up during runtime.
> >
> > -mario
> >
> >
> >
> > --- In psychtoolbox@yahoogroups.com, "Diederick C. Niehorster" <dcnieho@> wrote:
> > >
> > > I assume you only use this machine for development, not for actual running
> > > of timing critical experiments? If so, you're fine, don't worry about it.
> > > If you run experiments, you better chance to another machine.
> > >
> > > Basically, don't use windows 8. Its DWM cannot be switched off, and
> > > although it should gracefully retire to the background when a fullscreen
> > > window (like PTB's) is opened, we're not really sure how well it does so.
> > > This DWM will definitely interfere with timing, and in any case make any
> > > returned timestamps of flips useless.
> > >
> > > Use windows 7 on your experiment machine (which works for me, but I might
> > > simply be lucky), or better yet, Linux (e.g. neurodebian).
> > >
> > > Best,
> > > Dee
> > >
> > >
> > > On Fri, Jul 26, 2013 at 4:13 AM, Ran Berzon <berzoran@> wrote:
> > >
> > > > **
> > > >
> > > >
> > > > hey everyone,
> > > > first of all, i know there are several posts regarding the sync issue, but
> > > > i can't reply for some reason so i'm force to start a new topic, sorry.
> > > >
> > > > i was using the psychtoolbox and it was fine, until today i added the CRS
> > > > toolbox and since then i get an error when i use Screen, that says i have
> > > > sync problem.
> > > >
> > > > after trying all the suggestions in the forum and nothing helped, i
> > > > uninstalled the CRs, PTB and MATLAB, and re-installed MATLAB with PTB only,
> > > > but that didn't helped either.
> > > >
> > > > i'm using MATLAB r2012b, windos 8, my laptop is asus U30S and i have
> > > > integrated graphic card by intel and a nvidia geforce GT 520m, i set
> > > > MATLAB to work with the nvidia.
> > > >
> > > > [image: Inline image 1]
> > > >
> > > > any suggestions what can i do??
> > > >
> > > > the error i get:
> > > > " PTB-INFO: This is Psychtoolbox-3 for Microsoft Windows, under Matlab
> > > > 64-Bit (Version 3.0.11 - Build date: Jul 9 2013).
> > > > 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: Will disable DWM because a regular fullscreen onscreen window is
> > > > opened -> We want best timing and performance.
> > > > 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
> > > > ConserveVRAM', section 'kPsychUseBeampositionQueryWorkaround'.
> > > >
> > > >
> > > > PTB-INFO: OpenGL-Renderer is NVIDIA Corporation :: GeForce GT
> > > > 520M/PCIe/SSE2 :: 4.3.0
> > > > PTB-INFO: VBL startline = 768 , VBL Endline = 768
> > > > PTB-INFO: Measured monitor refresh interval from beamposition = 16.664656
> > > > ms [60.007239 Hz].
> > > > PTB-INFO: Will use beamposition query for accurate Flip time stamping.
> > > > PTB-INFO: Measured monitor refresh interval from VBLsync = 16.676707 ms
> > > > [59.963875 Hz]. (298 valid samples taken, stddev=0.367668 ms.)
> > > > PTB-INFO: Reported monitor refresh interval from operating system =
> > > > 16.666667 ms [60.000000 Hz].
> > > > PTB-INFO: Small deviations between reported values are normal and no
> > > > reason to worry.
> > > >
> > > > 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."
> > > >
> > > > thanks,
> > > > Ran
> > > >
> > > >
> > > >
> > >
> >
>
Please search the forum to obtain more information, as discussion of sync issues has came up many times. In short, you are running Windows 8, which is essentially the worst choice possible for obtaining good timing. You are also using the onboard screen of your laptop, which will provide poorer timing than compared to say a external CRT monitor. 
As I understand it, there is no fix for the Windows 8 problems (search the forum for much more info). 
Maybe try connecting to an external monitor to see if that is any better. 
If the laptop is for development and not actually running the experiment then you can force PTB to ignore the timing problems (search the forum). This will allow you to develop code, but is just hiding, NOT fixing the problem. 
You might also not need good timing for your needs at all. So all the above might be ok. 
Anyhow, lots more information is available by searching the forum. 
Peter