psychopy.org | Reference | Downloads | Github

Sync between 2 different screens

I want to present different stimuli in 2 different monitors.

I have read that the way to do this is using:

win1.flip()
win2.flip()

at the end of the loop.

Do both monitors should have the same refresh rate, right?

In that case, I guess the driver always release the buffers in sync for both monitors, so there is no lost time between the 2 flip calls?

The only way for you to be confident in situations like this is to test, test, test.

e.g.

timer = core.Clock()

for _ in range(60):
    win1.flip()
    win2.flip()

print(timer.getTime())

If your view is correct, this should take 1 second with 60 Hz displays.

I would predict that it would take 2 seconds. This is because, unless you tell it otherwise, .flip() pauses the execution of your code until the monitor actually refreshes. So putting two .flip() calls in series like this would drop your effective drawing rate on each screen to 30 Hz, while still drawing to a screen at 60 Hz.

I’m not too familiar with this, but I guess you could set the first (and only the first) .flip() to have waitBlanking = False and then you might get what you are after (i.e. there won’t be much of a pause between the first and second call). But you should also log the time of each monitor refresh to see what the interval is between them (and in an ideal world, use a hardware test to verify performance).

Just a note, future version of PsychoPy will have builtin support for multi-view rendering on extended desktops. We’ve added the necessary support to the rendering pipeline as part of the VR stuff, but it will be generalized to monitors soon. Extended desktops should provide the best synchronization on for multiple displays.

For the time being, you can use two windows, but you should disable waitBlanking on one of them and have your application fully synchronize with a single display. Calling the flip function on the window with v-sync last.