VBL (vertical retrace) syncing problem

Please could you advise on trouble with VBL syncing on Psychtoolbox v3-common:

I am running Dell customised version Ubuntu 18.04.5 LTS
Matlab version R2020b for Linux

Memory 3.7 GiB
Processor: Intel Pentium R CPU 5405U @2.30GH x4
Graphics: Intel UHD Graphics 610 (WHL GT1)
GNOME: 3.28.2
OS type 64-bit
120.2GB

Error message:

PTB-WARNING: Couldn’t even collect one single valid flip interval sample! Sanity range checks failed!
PTB-WARNING: Could be a system bug, or a temporary timing problem. Retrying the procedure might help if the latter is the culprit.

WARNING: VBL Calibration run No. 1 failed. Retrying…
PTB-WARNING: Couldn’t even collect one single valid flip interval sample! Sanity range checks failed!
PTB-WARNING: Could be a system bug, or a temporary timing problem. Retrying the procedure might help if
PTB-WARNING: the latter is the culprit.

WARNING: VBL Calibration run No. 2 failed. Retrying…
WARNING: Will enable VBL busywait-workaround before trying final VBL Calibration run No. 3.
WARNING: This will hopefully work-around graphics driver bugs of the GPU sync-to-retrace mechanism. Cross your fingers!
PTB-WARNING: Couldn’t even collect one single valid flip interval sample! Sanity range checks failed!
PTB-WARNING: Could be a system bug, or a temporary timing problem. Retrying the procedure might help if
PTB-WARNING: the latter is the culprit.

PTB-INFO: OpenGL-Renderer is Intel Open Source Technology Center :: Mesa DRI Intel® UHD Graphics 610 (WHL GT1) :: 3.0 Mesa 20.0.8
PTB-INFO: VBL startline = 1080 , VBL Endline = -1
PTB-INFO: Will try to use OS-Builtin OpenML sync control support for accurate Flip timestamping.
PTB-INFO: Measured monitor refresh interval from VBLsync = 0.000000 ms [inf Hz]. (0 valid samples taken, stddev=10000000.000000 ms.)
PTB-INFO: Reported monitor refresh interval from operating system = 16.663056 ms [60.013000 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?!?

WARNING: Mismatch between measured monitor refresh interval and interval reported by operating system.
This indicates massive problems with VBL sync.

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

Extract from error:

Could be a system bug, or a temporary timing problem. Retrying the procedure might help if the latter is the culprit.<<
Retrying the procedure does not fix it.

Summary of relevant parts of SyncTrouble for Psychtoolbox:
‘inability of the gfx hardware to properly synchronize buffer swaps to the vertical retrace’. but the solutions did not appear to apply in this case given recently purchased computer with Linux and single monitor laptop.
Stimuli are being presented in full screen window.
Plan is to present stimuli on a projector in the scanner and therefore would a possible solution be setting to sync with external display only (currently testing has occurred on laptop only when error message occurs)?
Resolution of the laptop screen is 1920 x 1080 (16:9).
Wifi and bluetooth off when running script. No pop up notifications.

Reviewing http://psychtoolbox.org/requirements:
“…AMD GPUs are strongly recommended over NVidia GPUs on Linux and macOS…”
“…Modern Intel HD-Series graphics cards should work reliably for medium complexity workloads on Linux…”

I would be very grateful if anyone has suggestions for how to optimise my laptop for precise timing.

Thanks and safe holidays!
@cclark (St George’s University, London)

Hi, this would be a case for priority support, as your configuration is generally known to work fine under Linux + Intel. Please also provide the specific Psychtoolbox version you are using and ask your lab to purchase some, following the process described under the following link, so i can help you:

http://psychtoolbox.org/prioritysupport.html

thanks,
-mario

Dear Mario,

Thank you so much for your swift reply. I will need to raise a purchase order and therefore how much is this likely to be (even a rough estimate) and do I sign up to being a community member or the special functionality option?

Best wishes

Camilla

As described under the link, for priority support on our user forum or on our GitHub issue tracker, buy a “community membership with priority support”. That’s currently 150 Euros + VAT or other applicable sales tax, depending on your country. This is what we want labs to get, to make a meaningful contribution to PTB’s general upkeep etc.

The “community only” option for 30 Euros is essentially just a “donation”, without any expectation of additional support provided by us.

-mario

YYS4YZNF-202012191411:ad57c50201ce763c5f2e4faa5f06e2597213bc084e39f0badccc0e4593f6dc76

Psychtoolbox version
‘3.0.17 - Flavor: beta - Corresponds to SVN Revision 11605
For more info visit:
https://github.com/Psychtoolbox-3/Psychtoolbox-3

In addition when I loaded matlab today this message came up in the terminal window
"failed to load module “canberra-gtk-module”
This previously was present, however I thought I had fixed it and it had stopped appearing.

Thanks Mario
@cclark

Ok, thanks for your financial support :slight_smile:

Two things to test:

What happens if you execute Screen('Preference','VisualDebuglevel', 3); before running any script - Apart from a black startup screen instead of the usual logo?

What is the output of Matlab when running with Screen('Preference','Verbosity', 10) ?

I released a new PTB 3.0.17 beta a few minutes ago, which based on your problem description contains some performance optimizations to help with lower end Intel graphics chips. This may improve your problem, so a UpdatePsychtoolbox is probably the first thing to try.

-mario

Thanks Mario! The update seems to have fixed the problem. Next I need to try it in the scanner. Really appreciate the help. Hope you get a break over Christmas.

Great. The way you would do this for a dual-display setup for scanner use would be to plug in the external display, then run XOrgConfCreator, when it asks if you want a multi-X-Screen setup, answer ‘m’ for that, then let the assistant script guide you into setting up two X-Screens: X-Screen 0 assigned to your laptops internal display, and a separate 2nd X-Screen 1 assigned to the externally connected monitor. This will write a suitable config file. Then you can use XOrgConfSelector to select/switch between regular mode (Select option 0) and this dual-display optimized configurations (the config file will probably show up as option 1). Logout + Login again, to switch between both configs. The dual-X-Screen setup can then do visual stimulation on screen 1 for the scanner with optimal performance and timing/timestamping precision. Your desktop GUI will only show on X-Screen 0 == internal laptop panel, and X-Screen 1 will be reserved for the scanners stimulus display.

The fact, that the update to the new PTB with performance optimized startup tests helped, suggests that the onboard graphics chip in your laptop is one of the a bit slower ones, so I’d probably recommend not running any unnecessary graphics / GUI applications in the dual-display scanner configuration, to not overtax the chip. Keep it lightweight and you should be good.

Best,
-mario

Dear Mario,

Thank you for your advice above. The projector HDMI connection to the laptop is picking up the presentation, but the presentation becomes bigger than the screen width. The image displays on both the laptop and the projector. Whereas when I run the paradigm on my laptop alone the presentation size is a correct fit for the screen.

I have tried to troubleshoot online and found posts referring to ‘overscan’ when tvs are connected to computers related to the resolution (my laptop is currently set at 1920 x 1080 (16:9)). I presume I would need to establish whether my screen resolution matches my projectors native resolution by trial and error with adjustments of the resolution?

There was advice relating to adjusting overscan in the intel graphics command centre in windows but I am unable to find how to adjust the Intel Graphics Command centre in Linux (recommended General>Scale>Custom for Windows).

Advice on correcting the screen display size when connected to HDMI external display (projector) would be very much appreciated.

Thanks
@cclark

Hi again and happy new year!

That sounds like it is still set up as a single X-Screen setup (Screen('Screens') reports only 0 for screen 0). The window would size itself to cover both video outputs / displays.

What you need is a dual-X-Screen setup, where each of both displays is treated completely separately:

  1. Connect the projector to the HDMI output. Or outside the scanner, just connect any HDMI display to the HDMI output, just matters that the HDMI output will display something.

  2. Run XOrgConfCreator, and when it asks if you want a (m)ulti-X-Screen setup or (s)ingle X-Screen setup, answer ‘m’ for multi-X-Screen, then let the assistant script guide you into setting up two X-Screens: X-Screen 0 assigned to your laptops internal display (Probably named eDP or the like) and a separate 2nd X-Screen 1 assigned to the externally connected monitor, probably named “HDMI something”, e.g., HDMI-1. When it asks if you want to do “advanced settings” you can answer (n)o.

This will write a suitable config file under a suitable filename, but you can give it any name as long as the path and extension stays the same (e.g., DualDisplayconfig_fMRIScanner.conf).

  1. Then whenever you go to the scanner, plugin the projector, run XOrgConfSelector and choose the config file created in step 2, logout, login again. Now Screen('Screens') would report two screens 0 and 1, and screenId 1 will display on the external HDMI output / projector, whereas screenId 0 would display on the laptops internal panel.
    This will treat the laptop panel with the desktop GUI completely separate from the externally HDMI connected display, for reliable and precise visual stimulation timing on the projector, etc.

  2. When your’re done, run XOrgConfSelector again, select 0 to revert back to the standard mode of operation, logout/login again and you are back to a “normal” laptop behaviour.

This should do the trick.

If you don’t have the projector or any other HDMI monitor at hand, you can also send me the output of the xrandr command executed in a terminal window. It will list the name of the HDMI output, reporting it as disconnected and one can create a xorg.conf file manually “offline” instead of using step 2.

-mario

Dear Mario,

Thank you for your swift response.

I followed the steps you suggested and the image simultaneously presents on the projector and my laptop, however it is as if the presented image has shifted to the right along the x axis of my laptop to the extent that the midline of my previous screen has become the right border of the computer (the right half of the image is ‘off screen’). The size of the image appears correct.

There still seems to be a delay in the button presses being registered despite the TTLs being registered. I presume if I’m using a projector I couldn’t remove the display on the laptop to improve processing speed?

Best wishes,

Camilla

Hi Camilla,

something must have gone wrong on your side if you still see images on your laptop screen? What you should see with our typical demos like PerceptualVBLSyncTest, LinesDemo, DotDemo etc., which all select screenId = max(Screen('Screens')); for Screen('Openwindow, screenId,...); is the normal desktop GUI with Matlab on the laptop display, and the PTB visuals on the HDMI projector or monitor.

Can you post the output of ResolutionTest in Matlab, and/or xrandr --screen 0 and xrandr --screen 1 in a terminal window? Also what’s the Matlab output of type /etc/X11/xorg.conf.d/90-ptbxorg.conf ?

You did run XOrgConfSelector and logged out / logged in again, right? The logout/login is when the freshly created config file is read and the display server configured accordingly, switching from single X-Screen to dual-X-Screen mode. The HDMI display must be plugged in at that time.

Oh and yes, you can disable the laptop panel from the command line, or with the display settings GUI of your desktop while the projector is plugged in, so this XOrgConfCreator/Selector/logout/login dance is not needed. The laptop will then switch between panel and HDMI projector, depending if HDMI is plugged in or not. This would increase performance slightly if needed. But often that is a bit impractical in a scanner setup, where experimenter laptop and scanner projector are in different rooms.

-mario

ResolutionTest

SCREEN 0: CURRENT COMBINED RESOLUTION:
width: 1920
height: 1080
pixelSize: 24
hz: 60

SCREEN 0 - Output 0: CURRENT RESOLUTION:
width: 1920
height: 1080
pixelSize: 24
hz: 60
xStart: 0
yStart: 0
name: ‘eDP-1’
outputHandle: 64
displayWidthMM: 344
displayHeightMM: 193

SCREEN 0: AVAILABLE COMBINED RESOLUTIONS:
1920 x 1080
1680 x 1050
1600 x 1024
1400 x 1050
1600 x 900
1280 x 1024
1440 x 900
1400 x 900
1280 x 960
1440 x 810
1368 x 768
1360 x 768
1280 x 800
1152 x 864
1280 x 720
1024 x 768
960 x 720
928 x 696
896 x 672
1024 x 576
960 x 600
960 x 540
800 x 600
840 x 525
864 x 486
800 x 512
700 x 525
800 x 450
640 x 512
720 x 450
700 x 450
640 x 480
720 x 405
684 x 384
680 x 384
640 x 400
576 x 432
640 x 360
512 x 384
512 x 288
480 x 270
400 x 300
432 x 243
320 x 240
360 x 202
320 x 180

SCREEN 0: AVAILABLE COMBINED DETAILED RESOLUTIONS:
1920 x 1080 60 Hz 24 bits
1920 x 1080 120 Hz 24 bits
1920 x 1080 47 Hz 24 bits
1680 x 1050 60 Hz 24 bits
1600 x 1024 60 Hz 24 bits
1400 x 1050 60 Hz 24 bits
1600 x 900 120 Hz 24 bits
1600 x 900 60 Hz 24 bits
1280 x 1024 60 Hz 24 bits
1440 x 900 60 Hz 24 bits
1400 x 900 60 Hz 24 bits
1280 x 960 60 Hz 24 bits
1440 x 810 120 Hz 24 bits
1368 x 768 60 Hz 24 bits
1360 x 768 60 Hz 24 bits
1280 x 800 120 Hz 24 bits
1280 x 800 60 Hz 24 bits
1152 x 864 60 Hz 24 bits
1280 x 720 120 Hz 24 bits
1280 x 720 60 Hz 24 bits
1024 x 768 120 Hz 24 bits
1024 x 768 60 Hz 24 bits
960 x 720 120 Hz 24 bits
928 x 696 120 Hz 24 bits
896 x 672 120 Hz 24 bits
1024 x 576 120 Hz 24 bits
1024 x 576 60 Hz 24 bits
960 x 600 120 Hz 24 bits
960 x 540 120 Hz 24 bits
960 x 540 60 Hz 24 bits
800 x 600 120 Hz 24 bits
800 x 600 60 Hz 24 bits
800 x 600 56 Hz 24 bits
840 x 525 120 Hz 24 bits
864 x 486 60 Hz 24 bits
800 x 512 120 Hz 24 bits
700 x 525 120 Hz 24 bits
800 x 450 120 Hz 24 bits
640 x 512 120 Hz 24 bits
720 x 450 120 Hz 24 bits
700 x 450 120 Hz 24 bits
640 x 480 120 Hz 24 bits
640 x 480 60 Hz 24 bits
720 x 405 60 Hz 24 bits
720 x 405 59 Hz 24 bits
684 x 384 120 Hz 24 bits
680 x 384 120 Hz 24 bits
640 x 400 120 Hz 24 bits
576 x 432 120 Hz 24 bits
640 x 360 120 Hz 24 bits
640 x 360 60 Hz 24 bits
640 x 360 59 Hz 24 bits
512 x 384 120 Hz 24 bits
512 x 288 120 Hz 24 bits
480 x 270 119 Hz 24 bits
480 x 270 120 Hz 24 bits
400 x 300 121 Hz 24 bits
400 x 300 113 Hz 24 bits
432 x 243 120 Hz 24 bits
432 x 243 119 Hz 24 bits
320 x 240 120 Hz 24 bits
360 x 202 119 Hz 24 bits
360 x 202 118 Hz 24 bits
320 x 180 120 Hz 24 bits
320 x 180 119 Hz 24 bits

SCREEN 0 - OUTPUT 0: AVAILABLE PER OUTPUT DETAILED RESOLUTIONS:
1920 x 1080 60 Hz 32 bits
1920 x 1080 60 Hz 32 bits
1920 x 1080 60 Hz 32 bits
1920 x 1080 60 Hz 32 bits
1920 x 1080 60 Hz 32 bits
1920 x 1080 47 Hz 32 bits
1680 x 1050 60 Hz 32 bits
1680 x 1050 60 Hz 32 bits
1600 x 1024 60 Hz 32 bits
1400 x 1050 60 Hz 32 bits
1600 x 900 60 Hz 32 bits
1600 x 900 60 Hz 32 bits
1600 x 900 60 Hz 32 bits
1600 x 900 60 Hz 32 bits
1280 x 1024 60 Hz 32 bits
1440 x 900 60 Hz 32 bits
1400 x 900 60 Hz 32 bits
1400 x 900 60 Hz 32 bits
1280 x 960 60 Hz 32 bits
1440 x 810 60 Hz 32 bits
1440 x 810 60 Hz 32 bits
1368 x 768 60 Hz 32 bits
1368 x 768 60 Hz 32 bits
1360 x 768 60 Hz 32 bits
1360 x 768 60 Hz 32 bits
1280 x 800 60 Hz 32 bits
1280 x 800 60 Hz 32 bits
1280 x 800 60 Hz 32 bits
1280 x 800 60 Hz 32 bits
1152 x 864 60 Hz 32 bits
1280 x 720 60 Hz 32 bits
1280 x 720 60 Hz 32 bits
1280 x 720 60 Hz 32 bits
1280 x 720 60 Hz 32 bits
1024 x 768 60 Hz 32 bits
1024 x 768 60 Hz 32 bits
960 x 720 60 Hz 32 bits
928 x 696 60 Hz 32 bits
896 x 672 60 Hz 32 bits
1024 x 576 60 Hz 32 bits
1024 x 576 60 Hz 32 bits
1024 x 576 60 Hz 32 bits
1024 x 576 60 Hz 32 bits
960 x 600 60 Hz 32 bits
960 x 600 60 Hz 32 bits
960 x 540 60 Hz 32 bits
960 x 540 60 Hz 32 bits
960 x 540 60 Hz 32 bits
960 x 540 60 Hz 32 bits
800 x 600 60 Hz 32 bits
800 x 600 60 Hz 32 bits
800 x 600 56 Hz 32 bits
840 x 525 60 Hz 32 bits
840 x 525 60 Hz 32 bits
864 x 486 60 Hz 32 bits
864 x 486 60 Hz 32 bits
800 x 512 60 Hz 32 bits
700 x 525 60 Hz 32 bits
800 x 450 60 Hz 32 bits
800 x 450 60 Hz 32 bits
640 x 512 60 Hz 32 bits
720 x 450 60 Hz 32 bits
700 x 450 60 Hz 32 bits
700 x 450 60 Hz 32 bits
640 x 480 60 Hz 32 bits
640 x 480 60 Hz 32 bits
720 x 405 60 Hz 32 bits
720 x 405 59 Hz 32 bits
684 x 384 60 Hz 32 bits
684 x 384 60 Hz 32 bits
680 x 384 60 Hz 32 bits
680 x 384 60 Hz 32 bits
640 x 400 60 Hz 32 bits
640 x 400 60 Hz 32 bits
576 x 432 60 Hz 32 bits
640 x 360 60 Hz 32 bits
640 x 360 60 Hz 32 bits
640 x 360 60 Hz 32 bits
640 x 360 59 Hz 32 bits
512 x 384 60 Hz 32 bits
512 x 288 60 Hz 32 bits
512 x 288 60 Hz 32 bits
480 x 270 60 Hz 32 bits
480 x 270 60 Hz 32 bits
400 x 300 60 Hz 32 bits
400 x 300 56 Hz 32 bits
432 x 243 60 Hz 32 bits
432 x 243 60 Hz 32 bits
320 x 240 60 Hz 32 bits
360 x 202 60 Hz 32 bits
360 x 202 59 Hz 32 bits
320 x 180 60 Hz 32 bits
320 x 180 59 Hz 32 bits

SCREEN 1: CURRENT COMBINED RESOLUTION:
width: 1024
height: 768
pixelSize: 24
hz: 60

SCREEN 1 - Output 0: CURRENT RESOLUTION:
Error in function ConfigureDisplay: Usage error
Invalid output index provided! No such output for this screen!
Error using Screen
Usage:

oldSettings = Screen(‘ConfigureDisplay’, setting, screenNumber, outputId [, newwidth][, newheight][, newHz][, newX][,
newY]);

Error in ResolutionTest (line 45)
disp(Screen(‘ConfigureDisplay’, ‘Scanout’, screenNumber, outputId));

<<

xrandr --screen 0

Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
eDP-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 193mm
1920x1080 60.01*+ 60.01 59.97 59.96 59.93 47.10
1680x1050 59.95 59.88
1600x1024 60.17
1400x1050 59.98
1600x900 59.99 59.94 59.95 59.82
1280x1024 60.02
1440x900 59.89
1400x900 59.96 59.88
1280x960 60.00
1440x810 60.00 59.97
1368x768 59.88 59.85
1360x768 59.80 59.96
1280x800 59.99 59.97 59.81 59.91
1152x864 60.00
1280x720 60.00 59.99 59.86 59.74
1024x768 60.04 60.00
960x720 60.00
928x696 60.05
896x672 60.01
1024x576 59.95 59.96 59.90 59.82
960x600 59.93 60.00
960x540 59.96 59.99 59.63 59.82
800x600 60.00 60.32 56.25
840x525 60.01 59.88
864x486 59.92 59.57
800x512 60.17
700x525 59.98
800x450 59.95 59.82
640x512 60.02
720x450 59.89
700x450 59.96 59.88
640x480 60.00 59.94
720x405 59.51 58.99
684x384 59.88 59.85
680x384 59.80 59.96
640x400 59.88 59.98
576x432 60.06
640x360 59.86 59.83 59.84 59.32
512x384 60.00
512x288 60.00 59.92
480x270 59.63 59.82
400x300 60.32 56.34
432x243 59.92 59.57
320x240 60.05
360x202 59.51 59.13
320x180 59.84 59.32
<<

xrandr --screen 1

Screen 1: minimum 320 x 200, current 1024 x 768, maximum 16384 x 16384
HDMI-1 disconnected primary (normal left inverted right x axis y axis)
<<

type /etc/X11/xorg.conf.d/90-ptbxorg.conf

Auto generated xorg.conf - Created by Psychtoolbox XOrgConfCreator.

Section “ServerLayout”
Identifier “PTB-Hydra”
Screen 0 “Screen0” 0 0
Screen 1 “Screen1” RightOf “Screen0”
EndSection

Section “Monitor”
Identifier “eDP-1”
EndSection

Section “Monitor”
Identifier “HDMI-1”
EndSection

Section “Device”
Identifier “Card0”
Driver “modesetting”
Option “ZaphodHeads” “eDP-1”
Option “Monitor-eDP-1” “eDP-1”
Screen 0
EndSection

Section “Device”
Identifier “Card1”
Driver “modesetting”
Option “ZaphodHeads” “HDMI-1”
Option “Monitor-HDMI-1” “HDMI-1”
Screen 1
EndSection

Section “Screen”
Identifier “Screen0”
Device “Card0”
Monitor “eDP-1”
EndSection

Section “Screen”
Identifier “Screen1”
Device “Card1”
Monitor “HDMI-1”
EndSection
<<

Thanks again

Hmm. Config file and other output looks fine.

It just reports the HDMI output on screen 1 as disconnected, which would normally mean nothing plugged into the HDMI video output of your laptop at the time you logged in again? Was that projector/display connected, on and displaying a picture at the time you were logging out and in again? If so, maybe some unusual weird glitch? Try again, or try rebooting the machine for extra measure?

If that doesn’t help, you could post the X log file stored under then name ~/.local/share/xorg/Xorg.0.log, and the dmesg.txt file created as result of sudo dmesg > dmesg.txt in a terminal window.

-mario

Dear all,
after installing the last version of PBT i tried to run the PerceptualVBLSyncTest and another script but i get a sync error.
I have windows 10, intel core i7 7700HQ, nvidia GTX1050.

here the error. Hope you can help me, thanks in advance and happy new year!

PTB-INFO: This is Psychtoolbox-3 for Microsoft Windows, under Matlab 64-Bit (Version 3.0.17 - Build date: Dec 16 2020).
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 priority support, community membership and 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 GTX 1050/PCIe/SSE2 :: 4.6.0 NVIDIA 451.48
PTB-INFO: VBL startline = 1080 , VBL Endline = 1080
PTB-INFO: Measured monitor refresh interval from beamposition = 16.662192 ms [60.016114 Hz].
PTB-INFO: Will use beamposition query for accurate Flip time stamping.
PTB-INFO: Measured monitor refresh interval from VBLsync = 16.634034 ms [60.117708 Hz]. (50 valid samples taken, stddev=0.467509 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.
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.

have you read help SyncTrouble and tried all the steps in there?

Dear Mario,

What does seem to be fixed is that with the correct order of screen0 eDP and screen1 HDMI when PTB is running on the laptop it displays the programme in the centre of the screen which is good. However, I am having problems displaying the matlab GUI on the laptop and the paradigm on the projector simultaneously.

I exited not only from matlab and the terminal, but logging out of the computer after selecting the XOrgConf.

I am then in multi screen display mode as I can either display the paradigm on my laptop to run it or alternatively if I switch screens with XOrgConfCreat so that screen0 is hdmi and screen1 is eDP then the projector is displaying the screen only (reversed as it should be). My laptop screen is then blank.

I have included the outputs that you requested:

Output of xrandr for screen 0

Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
eDP-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 193mm
1920x1080 60.01*+ 60.01 59.97 59.96 59.93 47.10
1680x1050 59.95 59.88
1600x1024 60.17
1400x1050 59.98
1600x900 59.99 59.94 59.95 59.82
1280x1024 60.02
1440x900 59.89
1400x900 59.96 59.88
1280x960 60.00
1440x810 60.00 59.97
1368x768 59.88 59.85
1360x768 59.80 59.96
1280x800 59.99 59.97 59.81 59.91
1152x864 60.00
1280x720 60.00 59.99 59.86 59.74
1024x768 60.04 60.00
960x720 60.00
928x696 60.05
896x672 60.01
1024x576 59.95 59.96 59.90 59.82
960x600 59.93 60.00
960x540 59.96 59.99 59.63 59.82
800x600 60.00 60.32 56.25
840x525 60.01 59.88
864x486 59.92 59.57
800x512 60.17
700x525 59.98
800x450 59.95 59.82
640x512 60.02
720x450 59.89
700x450 59.96 59.88
640x480 60.00 59.94
720x405 59.51 58.99
684x384 59.88 59.85
680x384 59.80 59.96
640x400 59.88 59.98
576x432 60.06
640x360 59.86 59.83 59.84 59.32
512x384 60.00
512x288 60.00 59.92
480x270 59.63 59.82
400x300 60.32 56.34
432x243 59.92 59.57
320x240 60.05
360x202 59.51 59.13
320x180 59.84 59.32
<<

xrandr output for screen 1

Screen 1: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
HDMI-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 1028mm x 579mm
1920x1080 60.00*+ 50.00 59.94
1920x1200 59.95
1920x1080i 60.00 50.00 59.94
1600x1200 60.00
1680x1050 59.88
1400x1050 59.95
1280x1024 60.02
1440x900 59.90
1360x768 59.95
1280x800 59.91
1280x720 60.00 50.00 59.94
1440x576 50.00
1024x768 60.00
1440x480 60.00 59.94
800x600 60.32
720x576 50.00
720x576i 50.00
720x480 60.00 59.94
720x480i 60.00 59.94
640x480 60.00 59.94
720x400 70.08
<<

file 90-ptbxorg.conf. These are the outputs where it is set up to be different outputs for the two screens as we require.

Auto generated xorg.conf - Created by Psychtoolbox XOrgConfCreator.

Section “ServerLayout”
Identifier “PTB-Hydra”
Screen 0 “Screen0” 0 0
Screen 1 “Screen1” RightOf “Screen0”
EndSection

Section “Monitor”
Identifier “eDP-1”
EndSection

Section “Monitor”
Identifier “HDMI-1”
EndSection

Section “Device”
Identifier “Card0”
Driver “modesetting”
Option “ZaphodHeads” “eDP-1”
Option “Monitor-eDP-1” “eDP-1”
Screen 0
EndSection

Section “Device”
Identifier “Card1”
Driver “modesetting”
Option “ZaphodHeads” “HDMI-1”
Option “Monitor-HDMI-1” “HDMI-1”
Screen 1
EndSection

Section “Screen”
Identifier “Screen0”
Device “Card0”
Monitor “eDP-1”
EndSection

Section “Screen”
Identifier “Screen1”
Device “Card1”
Monitor “HDMI-1”
EndSection <<

A second issue when running the paradigm on my laptop is that it does not seem to be syncing correctly with the TTLs and button presses with the stimulus presentation in that it appears to freeze stochastically as it progresses through ie after a button press there is a delay with moving onto the next image as if the press is not being registered. The paradigm will however run to completion with no error messages. I have tried running the same paradigm across a PC, a MAC and now Linux and it is the same issue across all 3. Is there a way of examining if PTB is detecting any issues or delays with inputs or can I presume if it launches with no error messages there should be no anticipated problems from PTB with timings and synchronisation between button presses and TTLs, flipping screen etc? I know the paradigm ran successfully at Sussex University on a Linux machine a few years ago.

Thanks

Best wishes,

Camilla

Posted output looks good.

You only need the xorg config file which assigns screen 0 to eDP (laptop display) and screen 1 to HDMI (projector/external monitor), which will give you the xrandr output you posted and displays the stimulus image correctly on the projector and Matlab GUI on the laptop screen. Then in your script, during the Screen('Openwindow', screenId, ...); or PsychImaging('Openwindow', screenId, ...); call, you can set the variable screenId = 0 if you want to display stimuli on screen 0, the laptops display, or screenId = 1 if you want to display on screen 1, the external HDMI projector. This is just like on macOS or windows, where you select the monitor via screenId. For screenId=0 the laptop panel will alternate between Desktop/Matlab GUI and PTB display as usual.

Regular GUI applications or the desktop GUI only display on screen 0 by default, the other screen 1 stays black if PTB isn’t stimulating.

Is this what you meant with your Matlab display problem and does this resolve it?

That suggests some coding error in your script or other configuration error in your hardware setup, if it also happens across all OS’es.

I think you will have to explain in way more detail what you’re doing and also show the code snippets that you use to emit (or receive) TTL triggers, check keyboards etc. Describe the hardware used and so on. At least on Linux timing etc. should be excellent with appropriate equipment and correct coding.

Btw. it would be good if your lab bought another license key for priority support. At this point you’ve used up 2 out of max 3 support incidents, but over 80 Minutes of the max 60 Minutes of the contracted work time on my side, so technically the key is “used up”.

Thanks,
-mario

Hi,
I am having a trouble running SimpleMovieDemo.m with VBL syncing on Psychtoolbox v3. I have installed the latest gstreamer MSVC v1.18.3 runtime installer 64 bit. However, the movie doesn’t run and the screen crashes. VBLSyncTest also fails.

I am running on Dell XPS 15 7590 Win 10
Matlab version R2020b
Memory 15.7GB(usable)
Processor: Intel® Core™i7-9750H CPU @2.60GHz 2.59GHz
Graphics: Intel UHD Graphics 630 and Nvidia GTX 1650 (Driver version: 27.21.14.5241)
Display Resolution: 3840x2160 (16:9, 4K)
OS type 64-bit
512GB

PsychtoolboxVersion

ans =

'3.0.17 - Flavor: beta - Corresponds to SVN Revision 11735
 For more info visit:
 https://github.com/Psychtoolbox-3/Psychtoolbox-3'

Error message:

SimpleMovieDemo

PTB-INFO: This is Psychtoolbox-3 for Microsoft Windows, under Matlab 64-Bit (Version 3.0.17 - Build date: Dec 16 2020).
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 priority support, community membership and commercial services, please type
PTB-INFO: ‘PsychPaidSupportAndServices’.

PTB-INFO: Double-Scan video mode detected as active on display for this window.
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 GTX 1650/PCIe/SSE2 :: 4.6.0 NVIDIA 452.41
PTB-INFO: VBL startline = 2160 , VBL Endline = 2160
PTB-INFO: Measured monitor refresh interval from beamposition = 16.681329 ms [59.947264 Hz].
PTB-INFO: Beamposition queries are supported, but disabled. Using basic timestamping as fallback:
PTB-INFO: Timestamps returned by Screen(‘Flip’) will be therefore less robust and accurate.
PTB-INFO: Measured monitor refresh interval from VBLsync = 16.668397 ms [59.993771 Hz]. (167 valid samples taken, stddev=0.999832 ms.)
PTB-INFO: Reported monitor refresh interval from operating system = 16.949153 ms [59.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 Screen
See error message printed above.

Error in SimpleMovieDemo (line 46)
win = Screen(‘OpenWindow’, screenid, 0, windowrect);

When we run VBLSyncTest, the following error comes:

VBLSyncTest

ans =

 0

PTB-INFO: This is Psychtoolbox-3 for Microsoft Windows, under Matlab 64-Bit (Version 3.0.17 - Build date: Dec 16 2020).
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 priority support, community membership and commercial services, please type
PTB-INFO: ‘PsychPaidSupportAndServices’.

PTB-INFO: Double-Scan video mode detected as active on display for this window.
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 GTX 1650/PCIe/SSE2 :: 4.6.0 NVIDIA 452.41
PTB-INFO: VBL startline = 2160 , VBL Endline = 2160
PTB-INFO: Measured monitor refresh interval from beamposition = 16.681145 ms [59.947924 Hz].
PTB-INFO: Beamposition queries are supported, but disabled. Using basic timestamping as fallback:
PTB-INFO: Timestamps returned by Screen(‘Flip’) will be therefore less robust and accurate.
PTB-INFO: Measured monitor refresh interval from VBLsync = 16.699978 ms [59.880318 Hz]. (50 valid samples taken, stddev=0.961107 ms.)
PTB-INFO: Reported monitor refresh interval from operating system = 16.949153 ms [59.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 Screen
See error message printed above.

Error in PsychImaging (line 2357)
[win, winRect] = Screen(‘OpenWindow’, screenid, clearcolor, winRect, pixelSize, numbuffers,
stereomode, multiSample, imagingMode, specialFlags, clientRect, fbOverrideRect, vrrParams);

Error in VBLSyncTest (line 297)
w=PsychImaging(‘OpenWindow’,screenNumber, 0, [],[],[], stereo);

Any help would be greatly appreciated!
Thanks,
Kritika Lohia
Indian Institute of Technology, Delhi