Psychtoolbox beta updated


Psychtoolbox 3.0.19 Beta update “Bitty Bits” was released at 26th March 2024. As usual, the complete development history can be found in our GitHub repository. The release tag is “”, with the full tree and commit logs under the URL:

Compatibility changes wrt. Psychtoolbox

  • None.


  • None, just bug fixes and minor improvements, and Octave 9.1 on macOS support.


  • PropixxImageUndistortionThrowaway.m: Fix stupid bug. Don’t close the onscreen window and then try use it again afterwards!

  • Fix wrong definition of glPathGlyphIndexRangeNV().

  • Sound input demos: Allow specification of number of input channels. For BasicSoundInputDemo and DelayedSoundFeedbackDemo, allow to specify the number of inputs, to also deal with sound cards which only provide one mono input channel. Continue to default to 2 stereo channels.

  • Various internal cleanups with no immediate user facing benefit.


  • Psychtoolbox was built and lightly tested against Matlab R2023b.

  • Screen: Fix idiotic bug in Screen('GetFlipInfo') there since day 1! If a query for a flip info struct was made, but no new struct was available, the function errored out, instead of returning an empty [] return argument!

    This was not ever noticed due to the way our only test scripts for this PerceptualVBLSyncTestFlipInfo2 had try-catch-end statement placed just so that the error was swallowed and never showed up!

    Fix this properly by returning an empty [] return argument in this case, as expected.


  • Psychtoolbox was built and lightly tested against Matlab R2023b.


  • Psychtoolbox was built and lightly tested against Matlab R2023b and Octave 8.4 from HomeBrew. It also works on the new Octave 9.1 from HomeBrew

  • Enable use with the brand-new Octave 9.1.0 from HomeBrew.


Psychtoolbox beta updated


Psychtoolbox 3.0.19 Beta update “Tag games” was released at 16th March 2024. As usual, the complete development history can be found in our GitHub repository. The release tag is “”, with the full tree and commit logs under the URL:

Compatibility changes wrt. Psychtoolbox

  • None


  • Apriltags fiducial marker tracking support on Linux.


  • New helper function PsychCamIntrinsicsToGLProjectionMatrix(). Given camera intrinsic parameters from some camera calibration software, and the desired zNear and zFar clipping planes of the view frustum, compute and return a projection matrix for use as GL_PROJECTION_MATRIX for OpenGL rendering with a virtual pinhole camera that approximates the properties of the real camera.


  • Psychtoolbox was built and lightly tested against Matlab R2023b.

  • (Re-)add PsychCV() mex file for Octave and Matlab, with support for vision based tracking of AprilTag fiducial markers (aka tags) by use of the apriltag library. This PsychCV mex file will only work on Ubuntu 22.04-LTS and later, not on Ubuntu 20.04-LTS anymore.


  • Psychtoolbox was built and lightly tested against Matlab R2023b.


  • Psychtoolbox was built and lightly tested against Matlab R2023b and Octave 8.4 from HomeBrew.


Psychtoolbox beta updated


Psychtoolbox 3.0.19 Beta update “CamJam” was released at 14th March 2024. As usual, the complete development history can be found in our GitHub repository. The release tag is “”, with the full tree and commit logs under the URL:

Some of this Psychtoolbox release was sponsored by Mathworks under the year 2023/2024 contract., and our partner SR-Research, makers of the Eyelink gaze trackers.

Compatibility changes wrt. Psychtoolbox

  • dontOpenExisting non-zero flag in Eyelink('OpenFile') now error aborts, instead of trying to implement something unsupportable.


  • None. Mostly a small refinement release.


  • Eyelink('OpenFile'): Error out if optional dontOpenExisting flag is set to a non-zero value. Update help text. According to feedback from SR-Research this is simply not supportable with all current and past Eyelink runtimes and tracker host software. Game over for this feature, just warn users about it.

  • Gamepad() / Joystick() et al.: Improve docs, help, setup instructions. Especially for proper choice of joystick driver on Ubuntu 20.04/22.04-LTS.

  • Downloaders/Updaters etc.: Update again for final SVN death on GitHub. In combo with website updates, to make clear that functions DownloadPsychtoolbox and UpdatePsychtoolbox and DownloadAdditionsForLinux are currently dead.

  • SetupPsychtoolbox(): Dead code removal, cleanup, docs updates.


  • Psychtoolbox was built and lightly tested against Matlab R2023b.

  • XOrgConfSelector: Add error handling and error resolution tips. There wasn’t error handling in case of delete() or copyfile() failure. Add something, and try to give some helpful feedback and advice, e.g., running PsychLinuxConfiguration().

  • Allow selection of a different clock to be used as the general GetSecs clock for (almost) all timing and timestamping, e.g., by GetSecs, WaitSecs, PsychPortAudio, Screen, etc. Since the year 2007, the so called wall clock, or gettimeofday() clock, or Posix CLOCK_REALTIME clock was used for this, and it continues to be the default. But now one can use the new PsychTweak function PsychTweak('GetSecsClock', clockid); at the beginning of a script (before any other calls to Psychtoolbox mex files!) to select a clock with a different clockid. A clockid setting of 0 uses the default CLOCK_REALTIME clock, as in the past. A clockid setting of 1 uses CLOCK_MONOTONIC instead. CLOCK_MONOTONIC, as opposed to default CLOCK_REALTIME, does not maintain time in seconds since 1st January 1970 0:00:00 UTC, but has an unspecified zero point, but usually 0 denotes time of operating system boot. CLOCK_MONOTONIC is always guaranteed to be monotonically increasing, not subject to step adjustments by the system administrator, NTP, PTP, or other external clock reference sources. This prevents synchronization to other computer on the network/setup, but may avoid clock trouble caused by time jumping in certain situations. CLOCK_MONOTONIC behaves like the GetSecs clocks for Psychtoolbox on MS-Windows and macOS. For now the new monotonic mode is only lightly tested, and only available on Psychtoolbox for Intel processors, not yet for RaspberryPi - this will follow in a future release.

    This improvement was sponsored by a Mathworks sponsored support incident under our 2023/2024 contract.


  • Psychtoolbox was built and lightly tested against Matlab R2023b.


  • Psychtoolbox was built and lightly tested against Matlab R2023b and Octave 8.4 from HomeBrew.

  • Detect futile attempt of running under native Matlab for Apple Silicon / ARM, ie. not under Rosetta2 emulation and bail with more enlightening messages.


End of year 2023 announcements.


  • I am now on vacation throughout December and much of January 2024, as my employer wants me to use up some good chunk of the unused vacation days I have left over from the years 2022 and 2023 to reduce liability to the business. After that I’ll be busy with catching up on important (=as in actually paid for, or critical) work that will fall behind due to the vacation. Therefore all paid user support from support memberships for new support requests after this point in time is suspended until sometimes in the first half of February 2024.

  • GitHub announced that they will permanently disable the Subversion (SVN) frontend to their services at 8th January 2024. Our installer DownloadPsychtoolbox and updater UpdatePsychtoolbox depend on that SVN frontend. This means DownloadPsychtoolbox and UpdatePsychtoolbox will cease to function at or after 8th January 2024. The current installer and updater as of PTB will simply abort with a hopefully helpful error message, older versions will error-out with less helpful error messages. Multiple brownouts of the service have been scheduled by GitHub throughout December as a heads-up, so temporary hour-long or day-long failure of the installer and updater leading to 8th January are expected. If that happens, just retry a few hours or a day later. Due to the lack of financial funding by the vast majority of our users, I couldn’t afford the time to work on a suitable replacement or alternative solution at the moment, so these scripts will stay dysfunctional for the time being.

    • Linux users can continue to use the conveniently installable packages from NeuroDebian (reasonably up to date), or the Debian/Ubuntu/RaspberryPi OS distributions (usually outdated).

    • People knowledgeable in the use of Git can obviously use Git to access our repository on Github.

    • For everybody else there is the less convenient and child proof alternative download via zip file, as described in the downloads section of our website.

    Of course you still have to follow the operating system specific setup steps as you had to do with the automatic downloader and installer.

  • This year we won’t do a discounted sale of paid support memberships, as that was an utter failure, nor will we beg you into buying such memberships, as we consider the paid support memberships to be yet another business failure. After trying this for over 3 years now, with various tweaks to make it as attractive and easy as possible for our users, we conclude that this will not ever be the way to have a sustainable funding model around Psychtoolbox. In fact, we think nothing that is based on any kind of even partially voluntary financial contributions, not even in exchange for paid support - an actual practical benefit for our users, be it out of decency, or be it due to an actual mid- to long-term thinking ability in our users, will ever work. Carrots do work elsewhere, but they don’t work with the vast majority of brain scientists. The income generated through the last year pays for less than ~ 2 months of current operating costs, despite me working absurdly long hours at an unsustainable low salary. It would not even pay for 1 month at a half-way appropriate and long-term sustainable salary. The same story applied for the two years before. Not surprising, given that estimated way less than 1% of all labs contribute. Anyhow, after the carrots come the sticks, but that’s something for next year.

Merry christmas and a happy new year! - I’d say it can only get better next year, but ofc. that would be way too optimistic, given how the world evolves.


Psychtoolbox beta updated


Psychtoolbox 3.0.19 Beta update “Christmas looks” was released at 16th December 2023. As usual, the complete development history can be found in our GitHub repository. The release tag is “”, with the full tree and commit logs under the URL:

This Psychtoolbox release was sponsored to a large degree by Mathworks under the year 2023/2024 contract., and to some degree by our partner SR-Research, makers of the Eyelink gaze trackers.

Compatibility changes wrt. Psychtoolbox



  • Further refinement to the performance improvements for hardware accelerated movie playback via GStreamer and gpu hardware video decoders on Linux and MS-Windows, with only very minor benefit to macOS.

  • Eyelink mex file improvements.

  • Usability improvements for macOS.


  • Screen: Allow dynamic, per-movie, enable and disable of hardware accelerated video decoding when using GStreamer 1.18 or later, iow. on MS-Windows, macOS, RaspberryPi OS, and Ubuntu 22.04-LTS and later. Only on older GStreamer versions, e.g., Ubuntu 20.04, will a hardware decoding disable last for the remainder of a session, ie. until Octave/Matlab is quit, once the disable flag for hardware decoding has been given once in a session. Also some minor robustness improvements to movie playback if special flags are given, which could cause some trouble sometimes.

  • Eyelink: New and improved Eyelink mex files with some contributions by SR-Research, specifically from Brian Richardson, Marcus Johnson, and Kurt Debono. Thanks!

    • A new subfunction ‘EDKVersion’ provides version information about the Eyelink software core library runtime in use.

    • A new subfunction ‘EyelinkSendFile’ to send a file to the Eyelink tracker computer. Using this function, an image or video can be uploaded from the display PC to the host Tracker PC.

    • Eyelink(‘OpenFile’): Another attempt to fix the ‘dontOpenExisting’ flag.

      ‘dontOpenExisting’ functionality was broken from day 1, but nobody bothered to ever give us feedback about this, not even the person who requested that functionality! As a new attempt at a fix by myself, lets try the following untested fix:

      Assume that create_path() is a way to find out if a file already exists on the tracker computer, given that file_exists() actually operates on the stimulation computer, contrary to what anybody expected. The Eyelink programmers manual is very unclear about these file utility functions.

      This may be wrong as well, no feedback from SR-Research yet. Let’s see…

    • Eyelink(‘ImageTransfer’): Restore my version of it, but also add some bug fixes by SR-Research, so that it hopefully now finally works as intended.

    • Fix regression for potential buffer overflow in ‘EyelinkGetQueuedData’, and generally make ‘EyelinkGetQueuedData’ and ‘EyelinkGetFloatDataRaw’ more robust and memory-safe.

    • Minor other improvements and cleanups to Eyelink mex.

  • Simplify OS type and 64-Bit detection functions, ie. IsWin(), IsLinux(), IsOSX(), IsARM(), Is64Bit(), IsWindows(), IsWinVista(), IsWinMatlabR11Style().

  • IsARM(): Try to detect running on 64-Bit ARM or on native Apple Silicon Matlab/Octave.

  • DownloadPsychtoolbox and UpdatePsychtoolbox: Prepare for EOL at 8-Jan-2024.

    GitHub will shut down and permanently remove its Subversion frontend that day, so our current SVN based downloader and updater methods will fail completely.

    There may be, and already have been, temporary brownouts in the service, as a heads up by GitHub about what’s coming.

    Inform users, and about their inconvenient alternatives, so they are less stumped by what is happening, assuming an ability to read. Due to the severe lack of financial support by the vast majority of our users, we didn’t have and don’t have the time right now to deal with this and find new solutions or workarounds for this problem. Finally people get what they pay for.

  • Merge in some new GitHub actions, contributed by Mathworks open-source team, which allow auto-building of zip files of the Psychtoolbox folder and of a corresponding MTLBX file for each tagged release. This is preliminary and needs more work and refinement, but may help a bit to work around imminent failure of DownloadPsychtoolbox and UpdatePsychtoolbox for MS-Windows and Apple macOS users. Thanks to Bensingh Pancras from Mathworks for this work!


  • Psychtoolbox was built and lightly tested against Matlab R2023b.


  • Psychtoolbox was built and lightly tested against Matlab R2023b.


  • Psychtoolbox was built and lightly tested against Matlab R2023b and Octave 8.4 from HomeBrew.

  • IsARM(): Try to detect running on 64-Bit ARM or on native Apple Silicon Matlab/Octave.

  • PsychtoolboxPostInstallRoutine(): Detect and reject native Apple Silicon Matlab/Octave. Point to Intel variants under Rosetta 2 emulation instead. Untested so far.


Psychtoolbox beta updated


Psychtoolbox 3.0.19 Beta update “Raspberry cake” was released at 12th December 2023. As usual, the complete development history can be found in our GitHub repository. The release tag is “”, with the full tree and commit logs under the URL:

This Psychtoolbox release was sponsored to a large degree by Mathworks under the year 2023/2024 contract., and to some degree by Cambridge Research Systems.

Compatibility changes wrt. Psychtoolbox

  • Psychtoolbox is now tested and supported on Matlab R2023b, instead of R2022b. It is expected to continue to work on older releases than R2023b, but no longer developed or tested against them.

  • Slight behavioral changes in IOPort BreakBehaviour settings on MS-Windows, and generally a few IOPort config options. Not expected to affect (m)any user scripts.


  • This release was tested for compatibility with Matlab R2023b on Linux and Windows, specifically Ubuntu 22.04.3-LTS with AMD RavenRidge (AMD Ryzen 5 2400G processor integrated graphics) and AMD Polaris graphics, and on Microsoft Windows 10 22H2 with AMD RavenRidge and NVidia GeForce GTX 1650 graphics, and to a lesser degree on Ubuntu 20.04.6-LTS and Windows 11 22H2 with Intel Kabylake (GT2) “UHD 620” integrated graphics. Testing with some onboard sound chips was also performed. The testing led to various smaller improvements, and various workarounds on MS-Windows for AMD OpenGL and Vulkan graphics driver bugs, and for some NVidia driver bugs, as well as some bugs in Matlab wrt. backwards compatibility and OS compatibility. Most improvements in this release are due to that.

    This was done as part of out Mathworks 2023/2024 contract for ensuring compatibility with recent Matlab releases, spending over 65 work hours. Due to not even remotely sufficient funding for this work, no significant testing beyond some very quick touch and go spot testing was performed for macOS.

  • Substantial movie playback performance improvements in pixelFormat 11 for HDR and WCG movies when hardware video decoding is used on Linux and MS-Windows. A small fraction of this work was sponsored as part of the Mathworks contract.

  • 10 bit deep color framebuffer and HDMI output for the RaspberryPi 4/400 by improvements to Psychtoolbox and to the Mesa 23.3.1 OpenGL graphics drivers for RaspberryPi’s VideoCore 6+ gpu. Mostly paid for by Cambridge Research Systems.


  • Screen: Optimize storage format for LUMINANCE16 textures for texture normalization. If a 16 bpc luminance texture is turned into an offscreen window, or drawn into, the needed normalization / conversion to RGBA format now converts into RGBA16 format instead of RGBA32 float format. This retains full precision of the original image content, but at half the memory consumption.

  • Screen: In DrawTexture(s), always filter planar textures via nearest neighbour sampling instead of any of the other filtering/sampling modes, as any sampling other than nearest neighbour will cause massive artifacts.

  • Screen: Improve performance of HDR movie playback by more efficient use of hardware video decoding. Enable the GStreamer movie playback engine in HDR mode (aka pixelFormat 11) to accept and handle typical semi-planar YUV formats used for HDR movies when gpu hardware accelerated video decoding is in use. This allows GStreamer to avoid cpu expensive frame format conversions from semi-planar frames provided by the gpu hardware decoders to planar formats previously accepted by PTB’s texture creation code, leading to way higher performance when such hardware decoders are used. Software decoding still works via the previous path, whenever that is wanted or needed. Software decoding can also be enforced by disabling of hardware decoding by passing in specialFlags1 flag +4 in Screen('OpenMovie', ...). One limitation of the disable is that hardware decoding will stay off for the remainder of the whole session, ie. until Octave/Matlab is quit, once the disable flag for hardware decoding has been given once in a session. This could be fixed by requiring GStreamer 1.20+ as minimum requirement, ie. Ubuntu 22.04 and later.

    Note that I’ve repurposed/redefined specialFlags1 flag +4 as hw accel disable, from previously “draw 2D flow vectors on content for debugging/visualisation”. This is ok, as the feature was probably never used by anybody, and also because this feature is deprecated and unsupported in all supported GStreamer versions since quite a while.

    The following new formats are supported for efficient handling:

    • Y42B = YUV planar 4:2:2 with 8 bpc.
    • NV16 = YUV semi-planar 4:2:2 with 8 bpc, aka P208.

    • P0xx formats of YUV semi-planar 4:2:0 sampling with 8, 10, 12 and 16 bpc, ie. NV12, P010_10LE, P012, P016. These are the relevant ones for typical HDR-10 hardware decoding from H265/HEVC, AV1, and from VP9.

    So far this has been tested on MS-Windows 10 with NVidia GeForce GTX1650 and AMD Raven Ridge / Vega as part of a Ryzen 5 2400G processor. On NVidia it shows a 2x speedup in decoding speed, to allow playback of 4k HDR at 60 fps with stable framerate and none to minimal frame dropping. This typically uses NVCODEC on NVidia hardware or Direct3D11/DXVA decoding on NVidia, AMD and Intel gpus.

    Tests on Ubuntu 20.04.6-LTS + Intel Kabylake + GStreamer 1.16, and on two Ubuntu 22.04.3-LTS machines with GStreamer 1.20.3, once with AMD Polaris11 and once with AMD Raven Ridge, also showed 2x performance improvements. This uses VAAPI for hardware accelerated video decoding on AMD and Intel, and maybe on NVidia, but NVidia is untested so far on Linux.

    Note that while AMD and NVidia worked well in my testing, at pixelFormat 11, Intel Kabylake produced some visual decoding artifacts under Ubuntu 20.04, and massive visual artifacts in decoded video on Windows 11. May or may not be general Intel bugs, or may just be a problem on my specific old Intel iGPU.

    Additional successful testing was performed by a user under Windows-10 with a NVidia GeForce RTX 3080 with H265 and AV1 4k HDR 60 fps content.

    As a general guideline, as of November 2023, these video codec formats are generally hardware accelerated on Linux and Windows with typical recent hardware from AMD, NVidia and Intel:

    • MPEG2, VC1, H264, VP8: YUV 4:2:0, 8 bpc.
    • H265, VP9: YUV 4:2:0, 10 bpc HDR.

    • Sometimes also MPEG4, and AV1, the latter only on latest gpu’s from NVidia, AMD and Intel, specifically NVidia Ampere+ RTX3000+, or AMD RDNA2 Navi 2nd gen, or Intel Xe+/Arc+ or macOS 14 on Apple M3+.

    For best cross-platform, cross-vendor compatibility and with older hardware, the safest choices for high performance playback are probably H264 and H265 at the moment.

    None of this applies to Apple macOS, as macOS too primitive OpenGL implementation currently does not allow use of pixelFormat 11 playback.

  • PlayMoviesDemo.m: Optimize further for fast playing movies. Suppress costly text drawing for any fps >= 30. Skip wait for flip complete for non-HDR playback. Ths way the demo also serves as a real-world performance test.

  • help GetChar: Update wrt. OS+GUI+Matlab/Octave support, internationalization.

  • PerceptualVBLSyncTest[FlipInfo2]: Add optimizations, especially for RaspberryPi. Avoid redundant stimulus draw in non-stereo mono-mode. Do clear the backbuffer after each flip, as that seems to give a substantial performance boost for the VideoCore gpu’s - See speculation in code comments - probably related to it being a tiled renderer, or a split gpu + display engine design at least for VideoCore 6+ of RaspberryPi 4 and later. I haven’t checked the driver source for the more likely reason yet.

    Another thing that can really help sync tests on the Pi is Priority(1), because then gamemode daemon chooses a more aggressive cpu governor. This only matters at high display refresh rates though, e.g., on a RPi 400 with a 1920x1080 120 Hz display. At somewhat lower refresh rates, e.g., 60 Hz, it isn’t needed.

  • IOPort: Fix ‘OpenSerialPort’ bugs where default settings override user settings.

    As GitHub user @qx1147 found out during a code review, there is a flaw in the handling of serial port options, where default serial port options may override user provided configuration options, so the wrong settings are silently applied! This only happens if the user script provides different settings in IOPort('OpenSerialPort', ..., settings), ie. on initial port open. Calls to IOPort('ConfigureSerialPort', ..., settings) are not affected.

    Luckily (dumb luck!), only a few options were mishandled, and most of these are rarely changed by user scripts, specifically:

    ProcessingMode=Cooked would get ignored, and raw mode used instead. Rarely used on Linux/macOS and not supported on Windows anyways. Low impact.

    BreakBehaviour=Ignore would be used instead of Flush or Zero. Not a problem on Windows, as that is the only supported option. The fact that this went unnoticed on Linux/macOS suggests not much use of Flush or Zero by users scripts. No use by PTB itself. Low expected impact. Note that the implementation of ‘Flush’ on the Unixes is of questionable use, as Flush would not only flush read/write buffers, but also send a SIGINT, which may end in unexpected ways on Unix, as we don’t handle SIGINT specifically.

    StopBits=2 would get ignored and the default of 1 stop bits would be used. Unclear how many devices want 2 stop bits, but I haven’t ever seen one, so probably low expected impact.

    DataBits=16 would get ignored on MS-Windows only and replaced by 8 bits, whereas other settings are fine, and 16 bits is unsuported on Linux/macOS, so probably rarely if ever used. Low expected impact.

    FlowControl=None will be used instead of hardware or software flow control. This can be a real bummer with potential real impact, as some devices do support or recommend active flow control! In the case of PTB, the CedrusResponseBox() driver for Cedrus response box devices would have liked that setting.

    Audit of Psychtoolbox internal user of IOPort, and of the demos, only shows one bad case where things went sideways: CedrusResponseBox.m This driver requested hardware flow control, but silently got instead NO flow control! This is interesting, because during my testing I found communication with Cedrus boxes always rather unreliable, and now I have to wonder if this was because of the accidental lack of hardware flow control? I can’t find out, as I lost access to Cedrus devices long ago.

    This whole parameter handling is somewhat fragile, and could do with an improved implementation, but due to the severe lack of financial funding for PTB, this is not an option in the foreseeable future. Not even code review or testing of 3rd party contributions, if there were any. Luckily this part of the driver is mostly static since years, so I guess we can drag our feet longer and sit it out.

    Another problem pointed out by @qx1147 is indeed that wrong options, e.g., due to typos in users experiment scripts, would not lead to an error abort or warning, but would get silently ignored in many cases. Not great at all, but lack of funding will leave this problems also unsolved in the near- to midterm, possibly forever. Life sucks…

    See also PR #821 for discussion. Thanks to @qx1147 for catching this!

  • psychrange(): Make fallback trigger robust against Matlab R2023b if statistics toolbox is not installed.

  • help PsychDemos, MovieDemos: Some fixes so Matlabs help system can cope.

  • Snd(): Minimal compatibility fix for older Matlab releases. E.g., R2018b may need this fix, as reported on the forum.

  • FlipTimingWithRTBoxPhotoDiodeTest: Fix useXR flag.

  • Cone fundamentals fitting tests: Fix plotting to be usable on different displays. Old plot positioning caused UI awkwardness on most monitors. Also fix use of savefig() function, which was broken due to incompatible changes in Matlab over the years as far as I understand.

  • LosslessMovieWritingTest.m: Switch default codec for encoding. From long non-existent huffyuv to supported avenc_huffyuv. Update help texts.

  • Delete ScreenTest.m the most useless test ever.

  • ComputePhotopigmentBleaching(): Fix some bug in example. By David Brainard.

  • Minor bug fixes, documentation updates and improvements.


  • Psychtoolbox was built and lightly tested against Matlab R2023b.

  • PsychHID: Work around latest Matlab R2023b internationalization bugs.

    Matlab R2023b, at least on Ubuntu 20.04-LTS and Ubuntu 22.04-LTS, has a new compatibility bug, where it provides its own deficient libX11 that defines a wrong path to the locale configuration directories. This causes failure of international keyboard handling, ie. calls to XSupportsLocale(), XSetLocaleModifiers() and XOpenIM() fail. As a consequence, only U.S. keyboard layouts get properly handled whenever our our PsychHID/keyboard queue based GetChar() implementation is in use, but not other keyboard layouts!

    It also triggers a warning each time KbQueueCreate() is called, regardless if in the context of GetChar/CharAvail/ListenChar, or just for keyboard queue operation.

    Try to detect and work around this Matlab bug, by detecting the failure and then setting the XLOCALEDIR environment variable to override Matlabs broken path to a path that is correct at least for Ubuntu 20.04/22.04 and for similar Debian(-based) systems. Also try to detect user interference, e.g., the user setting a unsuitable XLOCALEDIR, and give troubleshooting tips in that case as well.

    This fixes the problem with R2023b on at least Ubuntu 20.04 and 22.04. The problem could also have been present in R2023a already, but this was not ever tested by myself, and I am not aware of any bug reports against either R2023a or R2023b.

  • Add support to XOrgConfCreator, XOrgConfSelector and PsychLinuxConfiguration to allow to enable 10 bpc / 30 bit deep color framebuffers and display over HDMI on suitable displays with the RaspberryPi 4 and 400, and likely also the RaspberryPi 5. This was only tested on the RaspberryPi 400 under RaspberryPi OS versions 11 “Bullseye” (legacy) and 12 “Bookworm” (most recent one) 32-Bit editions. Note that current Psychtoolbox from us currently only works on RaspberryPi OS 11, ie. what is now called the “legacy” edition, not yet on the “current” OS version 12. Psychtoolbox, shipping with OS version 12 will work of course, but it does not have this setup code. However, it would work with a manually created xorg.conf file.

    Note that 10 bit framebuffers do not work on current versions of RaspberryPi OS out of the box. You need to manually install Mesa version 23.3.1 stable or later, which was released as stable source code at 13th December 2023. An automated build script can be found under the link below. You can download it, make it executable, and run it to auto-build and install a Mesa local build in /usr/local/lib/ compatible with RaspberryPi 4 and 400, possibly RaspberryPi 5. Use this hacked build and install script at your own risk! If it totally breaks your system you get to keep all the pieces:

    My enablement work for OpenGL 10 bpc / color depth 30 bit / deep color framebuffer support for Mesa 23.3.1+ on the RaspberryPi 4+ was sponsored by a contract from Cambridge Research Systems Ltd. Thank you!

  • Other smaller refinements to RaspberryPi support.


  • Psychtoolbox was built and lightly tested against Matlab R2023b.

  • For Vulkan on Windows, reenable fullscreen exclusive support on current AMD drivers for proper timing. now works again on AMD gpu’s with the latest AMD display drivers, version 23.11.1 from November 2023, as tested successfully in both SDR mode and HDR-10 mode on Windows 10 22H2 with AMD Raven Ridge iGPU of AMD Ryzen 5 2400G APU, aka DCN-1 display engine and Vega 11 graphics. Hurray!

    Some earlier driver versions might work as well, but this is the only confirmed one by testing, so reenable fullscreen exclusive starting with the 23.11.1 release.

  • IOPort: Fix wrong break condition handling. Ignore break conditions completely (BreakBehaviour=Ignore), rather than treating them as errors without further handling them in a useful way. Do validate BreakBehaviour parameter to be the only currently supported setting. Contributed by GitHub user @qx1147.

  • PsychPortAudio: Update libportaudio for MS-Windows with latest from upstream Git main development branch. This way we get my bug fixes to WASAPI audio capture/input timestamping. Testing on MS-Windows 10 and 11 still shows some fragility and oddity in audio input capture timestamping, e.g., for voice onset timestamping, or sound based timing measurements like KeyboardLatencyTest.m or AudioFeedbackLatencyTest.m. These tests may not be very trustworthy on MS-Windows with WASAPI sound backend.

  • Screen: Rewrite CRS clut update function RenderClutBits++ as a workaround.

    Switch from using point rendering via glVertex2i() of the clut T-Lock update pattern to instead using glRasterPos2i + glDrawPixels().

    Why? Because the proprietary AMD OpenGL driver on Windows has bugs in glVertex2i positioning when rendering to the OpenGL system backbuffer. The most easy way to work around this atm. is to use glRasterPos2i + glDrawPixels() to avoid the glVertex2i AMD bugs. This has the added benefit that we now use this glRasterPos2i + glDrawPixels() combo consistently for all CRS T-Lock rendering, ie. FE1 stereo driving and DIO codes, and for identity pixel passthrough tests and gamma table tweaking in PsychGPUTestAndTweakGammaTables(). At least we only have to think about one potentially broken function (glRasterPos2i()) in the future, not two separate ones.

    This was found on AMD RavenRidge Vega11 under Windows 10 with AMD driver 23.11.1. No such problem happened with the same hardware on Linux during my testing.

  • AdditiveBlendingForLinearSuperpositionTutorial.m: Fix clut overlay text, and cleanups. Apply same fix as for BitsPlusIdentityClutTest.m for AMD Windows OpenGL driver bugs, so text rendering via the Mono++ / M16 clut hardware overlay works.

  • BitsPlusIdentityClutTest.m: Work around MS-Windows AMD OpenGL driver bug. AMD’s current OpenGL driver version 23.11.1 from November 2023 for MS-Windows has a bug in that glTexImage2D() does not accept GL_BITMAP texture specs. This breaks non-anti-aliased text rendering mode in the drawtext plugin.

    Work around this by enabling anti-aliased rendering for the plugin via Screen(‘Preference’, ‘TextAntiAliasing’, 1); However, we don’t want anti-aliasing, as it potentially interferes with clut overlays on CRS and VPixx devices, so use Screen(‘Preference’, ‘TextAlphaBlending’, 1); to apply Screen(‘Blendfunction’) settings during text rendering, but don’t actually use Screen(‘Blendfunction’). Instead leave alpha-blending at defaults, which is alpha-blending disabled. This effectively brings back aliased text rendering which works with the clut overlays.

  • Screen(‘ColorRange’): Add workaround for color clamping OpenGL driver bugs.

    Turns out the recent proprietary AMD OpenGL driver on MS-Windows has a broken color clamping query implementation, which does not report clamp state for GL_CLAMP_VERTEX_COLOR_ARB or GL_CLAMP_FRAGMENT_COLOR_ARB.

    As such, we get reported failure to change color clamping on Windows 10 + AMD, whereas the same code works fine on Windows 10 NVidia or Intel.

    Work around this by detecting the failure and auto-selecting our own internal GLSL shader based fallback path. This should fix it - at a performance penalty, as vertex color clamping can be handled by our fallback shader, fragment color clamping has proper default behaviour of clamping on for fixed point unorm framebuffers, and clamping off for floating point framebuffers. Only readback clamping needs to be controlled via glClampColorARB, but luckily readback clamping is supported by glClampColor() as well, in a backwards compatible way, so we should be good. Famous last words…

    Note that this bug is so far only present on AMD on Windows, so we can get away with only rebuilding Screen() for MS-Windows for the moment.

    Also note that because it is the query that is broken, not the setting, our response of selecting the fallback path may be not necessary. However, it is unlikely to hurt, and we can not know, so better safe than sorry.


  • Psychtoolbox was built and lightly tested against Matlab R2023b and Octave 8.4 from HomeBrew. It should likely continue to work on older versions of Octave 8.x, possibly 7.x or 6.x., although none of these was tested.


Psychtoolbox beta updated


The Psychtoolbox v3.0.19.5 update “Eye to eye” was released on 17th November 2023. As usual, the complete development history can be found in our GitHub repository. The release tag is “”, with the full tree and commit logs under the URL:

This Psychtoolbox release was fully sponsored by Mathworks under the year 2023/2024 contract.

This is the last release built and tested with Matlab R2022b. Future development and user support will immediately switch to Matlab R2023b after this announcement, as we no longer have access to earlier Matlab releases, but Psychtoolbox is expected to continue to work just fine on older Matlab versions.


  • Eye gaze tracking support for OpenXR supported devices via PsychVRHMD(), ie. Virtual Reality (VR) / Augmented Reality (AR) / Mixed Reality (MR) Headsets with built in eye trackers and suitable eye tracking runtimes!

    This release should support monocular “cyclops eye” eye gaze tracking on HMDs with monocular eye trackers and binocular eye trackers (typically reporting a fused gaze vector for noise reduction, based on sensor fusion between both eyes tracking data) on all hardware and OpenXR runtimes which support the XR_EXT_eye_gaze_interaction OpenXR extension. Data reporting is very limited due to the limited functionality provided by that extension: Only a binary confidence value (eye tracked / not tracked) and a 3D eye gaze vector aka gaze ray aka eye position and looking direction, usable for determining the looking direction in a 3D VR scene and hit testing with 3D scene geometry, as well as remapped 2D pixel coordinates of where the user is looking inside the Psychtoolbox onscreen window, both for monoscopic mode and stereoscopic mode. Demos which demonstrate 3D gaze are VRInputStuffTest.m if the optional withGazeTracking flag is set to 2, or just 2D position for flag setting 1. 2D gaze reporting is demonstrated - if the proper flags are set - by the following demos and tests: VRHMDemo.m - simple mono/stereo view reporting, GazeContingentDemo.m - monoscopic display, “foveated area” is moved via gaze, and VREyetrackingTest.m for extensive demo and testing.

    The API / how to use and description of features and limitations is in the help PsychVRHMD where one would expect VR/AR/MR/XR related functionality.

    Setup instructions can be found under help OpenXR.

    For VR HMDs with builtin eyetrackers from HTC, e.g., HTC Vive Pro Eye, on MS-Windows only, a second more feature rich eyetracking mechanism via use of HTC’s proprietary Windows-only SRanipal eyetracking runtime is used. It additionally to the above “cyclops eye” reporting allows for binocular eyetracking, more precise gaze sample timestamps, and estimates reported for “eye openess” aka how much are the eyelids open, and pupil diameter.

    Due to lack of other equipment, time and funding, this functionality was only tested under Microsoft Windows 10 with a rented HTC Vive Pro Eye HMD under SteamVR 1.26, and to a lesser extent, the new SteamVR 2.0.10 runtime from Valve. The monocular “cyclops” eye gaze tracking should work on any other HMD with OpenXR compliant eye tracking though, also on Linux. And binocular tracking should work on other HTC HMDs under Windows as well. Theory and practice, we will see…

    Performance and precision is reasonably good, although functionality wise there is a lot of room for improvement. Further funding would be needed to do that work. This OpenXR eye gaze tracking was sponsored by Mathworks as the main new sponsored improvement under the 2023/2024 contract. As so often though, the funding was insufficient to fully cover our costs up to this point, so future development of this eyetracking support will be mostly dependent on future funding or contract work from interested labs or users.

    Given that the HTC Vive Pro Eye used for developing and testing this support is only rented, and due to the lack of funding, we will likely have to give the HMD back before christmas, so no further debugging / refinement or related user support can be provided after that point in time, unless some labs or users contract and fund us for further development and support.

    Therefore I urge you to test this functionality early and give timely feedback, before it is too late for a cheap solution. That still means of course that while constructive feedback is appreciated, no free help will be provided for setup and first steps in general. That’s what our paid support is for.


  • OpenXR VR/AR/MR/XR eyetracking support. See above.

  • PlayMoviesDemo.m: Some performance optimizations for high fps HDR movie playback.

  • CreateResolutionPyramid(): Fix and deuglify MipMapDownsamplingShader.

  • Minor bug fixes, documentation updates and improvements.


  • Psychtoolbox was built and lightly tested against Matlab R2022b and Octave 6.4.

  • OpenXR VR/AR/MR/XR eyetracking support. See above.


  • Psychtoolbox was built and lightly tested against Matlab R2022b and Octave 7.3.

  • Additionally to OpenXR eyetracking, also SRAnipal binocular eyetracking on suitable HTC HMDs, as tested with the HTC Vive Pro Eye.


  • Psychtoolbox was built and lightly tested against Matlab R2022b and Octave 8.3 from HomeBrew. Octave 8.4 was also lightly tested and seems fine.


Psychtoolbox beta updated


Psychtoolbox 3.0.19 Beta update “Virtuality” SP4 was released at 27th October 2023. As usual, the complete development history can be found in our GitHub repository. The release tag is “”, with the full tree and commit logs under the URL:

This Psychtoolbox release was partially sponsored by Mathworks under the year 2023/2024 contract.

Compatibility changes wrt. Psychtoolbox

  • On MS-Windows, GStreamer 1.22 is now required, the latest lightly tested version is GStreamer 1.22.5. With the older GStreamer 1.20, text rendering with the high quality drawtext plugin will no longer work, and the fallback GDI text renderer would be used, which is officially unsupported in case of trouble and has lower performance/quality/features/reliability.

  • On macOS if using Octave, Octave 8.3 is now recommended and tested, but older Octave versions back to v6.3 are expected (but not tested) to continue to work.


None, just a large grab bag of various minor and major fixes and improvements.


  • Some Unix file permission cleanup contributed by Yaroslav from NeuroDebian.

  • CalibrateMonSpd(): Fix some fallout from previous fixes. Set cal.describe.dacsize also if g_usebitspp is already set. Reference:

  • DegreesToRetinalEccentricityMM(): Fix typo in code that prevented replacement of small angles by the linear approximation. Contributed by Stella Prins.

  • MakeSineImage(): Allow passing of center (0 phase) position of the sinusoid. Contributed by David Brainard.

  • ComputePhotopigmentBleaching(): Add constants from Wyszecki and Stiles. Contributed by David Brainard.

  • New touchscreen demo: MultiTouchPinchDemo.m, to show detection and handling of two finger pinch gestures on touchscreens.

  • Output info message with potential troubleshooting tips if drawtext init takes unusually long, hinting at potential fontconfig cache rebuild (problems) on MS-Windows. May or may not help anybody, but probably doesn’t hurt. Suggested by GitHub user @mirh.

  • DrawFormattedText(): Add new keyword ‘left’ to use for the ‘sx’ parameter. It will left-align drawn text to the left border of an optionally provided ‘winRect’, similar to the ‘right’ keyword for right-alignment. Improvement contributed by GitHub user @SVNKoch.

  • PsychPortAudio: Add potential workaround to deal with temperamental / weird audio sound cards. Add a new optional parameter to the tweaking command PsychPortAudio('EngineTunables', ...., workarounds);, which allows to specify a non-default (ie. non-zero) workarounds bitmask to selectively disable or enable workarounds. The currently defined workaround bits are the following, which modify how the Portaudio audio format test function Pa_IsFormatSupported is handled:

    +1 = Do not error abort on test failure, ie. print warnings but don’t abort. +2 = Skip the whole test and always assume success.

    Both could help if the test reports false positives (+1 to continue), or if some hardware queries/operations themselves during the test trigger some trouble (+2 to skip the whole test).

    Also various other minor improvements to PsychPortAudio and some of the audio demos and tests.

  • Snd(): Switch fallback method from use of sound() to use of audioplayer(). Both modern Octave and Matlab implement sound() as a wrapper around their audioplayer() objects, so using audioplayer() directly gives us more control for a better Snd() fallback implementation. Also use the fallback method as new default by default. Iow. unless specified otherwise, Snd() will play via audioplayer(). This provides good interop with other audio clients and with Screen()’s GStreamer based movie playback engine.

  • Beeper(): Formatting/Indentation fixes, refine soundvector calculation.

  • BitsPlusIdentityClutTest: Disable encoder test if Vulkan display is used. Current design lead to the tests running before the Vulkan backend is fully in charge, so we display the PTB welcome screen or pixeltrash during the test, instead of the test stims, which leads to false-positive test failure. Just don’t offer the test option under Vulkan. DatapixxGPUDitherpatternTest is an alternative working way to test with Vulkan at the moment.

  • PsychOpenHMDVR: Use correct ipd/2 instead of ipd for warp-mesh setup in our OpenHMD driver.

  • Minor bug fixes, documentation updates and improvements.


  • Psychtoolbox was built and lightly tested against Matlab R2022b.

  • RPiGPIOMex: Various bug fixes and improvements. Also merged two alternative implementations of the file co-written by Steve Van Hooser and myself. These reimplement functionality by using the pigpio library instead of the old and deprecated wiringPi library. This should be more future-proof and maintainable. For now, the original file based on wiringPi is still used though, until we decide which of the two new variants is the better choice.

  • Fix exception handling on Octave for RaspberryPi on RaspberryPi OS, so errors only abort the users script and don’t terminate the whole Octave application.


  • Psychtoolbox was built and lightly tested against Matlab R2022b.

  • GStreamer 1.22 is now required, GStreamer 1.20 will have limitations.

  • Fix drawtext plugin again, so it no longer breaks under Matlab with GStreamer 1.22 on some systems. This will now require the installation of GStreamer 1.22, the older GStreamer 1.20 will no longer work with the drawtext plugin.

  • Windows: Remove support for building 32-Bit mex files. Matlab is 64-Bit only since a long time on Windows, Octave is about to remove 32-Bit support as well. Windows-10 - the last MS 32-Bit operating system is on the way to final retirement. Ergo, no need for 32-Bit builds in the future anymore.

  • Make Screen(‘Openwindow’) timing startup tests and calibrations more robust. This by disabling processor idling during the tests, ie. ACPI C-State processor power management transitions out of C0 (active). Such transitions can induce latency / variability in code execution timing bad enough to affect timing tests on some setups. If and how much this helps in practice remains to be seen. Based on investigations / measurements by GitHub user @mirh, see GitHub isse #793 for reference. If this new optimization causes trouble or interop problems with cpu performance tweaking tools, e.g., the Windows tools “throttlestop”, it can be disabled by use of the command before the first time you try to open an onscreen window in your experiment script:

    PsychTweak('DontDisableProcessorIdling', 1);


  • Psychtoolbox was built and lightly tested against Matlab R2022b and Octave 8.3 from HomeBrew.

  • Screen(): Add iMac20,1 and iMac20,2 aka year 2020 iMacs to timing fixup lut, so the visual timing fixes also apply to these final Intel iMac models with AMD Navi graphics chips. As the PsychtoolboxKernelDriver does not support AMD Navi graphics, our visual timestamping and our diagnostic for visual timing problems on these machines will be more limited than on older machines, but the untested expectation is that this should fix timing on 2020 iMac internal displays.

  • Screen(): Remove conserveVRAM flag kPsychDontCacheTextures. It was useless and even buggy since years, so let it die.

  • Screen(): Add new conserveVRAM preference flag 2 == kPsychDontSwitchToOptimalVidMode. May or may not help fullscreen display on connected external video splitters like the Matrox DualHead2Go. This is based on a hunch, not on proper root causing. Cfe.


Psychtoolbox beta updated


Psychtoolbox 3.0.19 Beta update “Virtuality” SP3 was released at 13th July 2023. As usual, the complete development history can be found in our GitHub repository. The release tag is “”, with the full tree and commit logs under the URL:

Compatibility changes wrt. Psychtoolbox

  • Octave: Octave 7.3 is required on MS-Windows. Octave 8.2 is required on macOS, but Octave 6.3 - 8.1 may also continue to work on macOS (assumed, but untested).

  • Recommended operating systems: Ubuntu 22.04.2-LTS Linux, MS-Windows 10 22H2, macOS 13.4

  • The macOS 10 (aka Mac OSX) OS family, macOS 11 and macOS 12 operating systems will probably continue to work, but are now untested and officially unsupported and unsupportable. Running Psychtoolbox on Apple Silicon Macs (M1, M2, …) is not officially supported by this release. Visual stimulation timing will be totally broken on Apple Silicon Macs, as well as some other features. It is our understanding that currently no vision science toolkit exists that could provide any reliable or trustworthy operation on macOS for Apple Silicon. On Intel based Macs, Psychtoolbox likely continues to be the only toolkit with somewhat trustworthy visual stimulation timing on most Intel Mac configurations if configured correctly for use with a properly installed PsychtoolboxKernelDriver.

  • Procedural shaders: Remove corrective offsets for hardware texture sampling, as it may be no longer helpful, but harmful, due to changes in gpu hardware drivers on all operating systems. See GitHub issue #800, reported by user @qx1147. Tests on AMD, NVidia and Intel gpu’s under Linux, Windows and macOS suggest this is the right thing to do now. This means that the centers of procedurally generated stimuli like Gabor patches or sine gratings will shift by 0.5 pixels on the screen.


  • Switch lightly tested and supported macOS version from macOS 12 Monterey to macOS 13 Ventura. Older macOS versions are untested and unsupported from now on.


  • The new OpenXR driver has now also been tested with the HTC Vive Pro Eye and the associated “Vive Wand” hand controllers with Valve SteamVR 1.25.7 on Windows and Linux, and with Monado on Linux with “vive” and “survive” backends as OpenXR runtimes on (recommended going forward) Ubuntu Linux 22.04.2-LTS. Past successfull Linux tests were on - no longer tested - Ubuntu 20.04.6-LTS. The driver now also works with Octave 7.3 on MS-Windows.

  • DaqAInScanContinue: Try to fix live data retrieval on USB-1208FS when using more than one analog input channel. It could cause data loss or data to channel mapping misalignment when DaqAInScanContinue(daq, options, 1); was used with more than one input channel. Cfe. This is untested due to lack of hardware. Unpaid work time spent trying to diagnose and fix this: 4 hours.

  • Snd: Update help text, remove Octave specific quirks - no longer needed. Add a new function Snd('OldStyle'); to allow selection of old style audio output path on the fly, as addition to the former static only selection by creating a config file. Allows use of the old output path which simply uses Matlabs or Octaves sound() function, which is now available also on all supported Octave 5+ versions.

  • Make CalDemo work with graphics hardware gamma lut sizes other than 256 slots. Instead use the size of the actual luts stored in the loaded calibration file.

  • Try to fix and improve CalibrateMonSpd and related functions: It now also works on standard display setups other than visual stimulators from CRS and VPixx. Plus tons of bug fixes. Also it now also supports other colorimeters than the PR650. See the following link for the mess this tries to fix:

  • Improve Eyelink('ImageTransfer'): Allow to pass in image matrices from Matlab/Octave, e.g., as read from image files via imread(), or retrieved from PTB drawing commands via Screen('GetImage'), or computed in scripts. Before this, it was only possible to load uncompressed BMP image files. Also fix the - previously broken - demos EyelinkPictureCustomCalibration and EyeLinkPicture. Untested on actual Eyelink, only tested in simulation due to lack of hardware.

  • Procedural shaders: Remove corrective offsets for hardware texture sampling, as it may be no longer helpful, but harmful, due to changes in gpu hardware drivers on all operating systems. See GitHub issue #800, reported by user @qx1147.

  • Minor bug fixes, documentation updates and improvements.


  • Psychtoolbox was built and lightly tested against Matlab R2022b.

  • PsychOpenHMDVR: Fix crash in ‘GetTrackingState’ if VR controllers are not present or are not supported. Also add HTC Vive Pro Eye specific undistortion shaders. Other minor improvements.

  • Eyelink: The mex files for Linux were upgraded to now use and require the SR-Research eyelink_core SDK and runtime version 2.0, instead of the old v1.9 runtimes. To run the new mex files you either need to manually set a symlink for mapping the new runtime name to the old runtime library name. Or install the recent v2 runtime from SR-Research. It is recommended to upgrade, as the new runtime contains nice bug fixes. E.g., the runtime no longer hangs if no Eyelink tracker hardware is connected, iow. Eyelink dummy mode fallback can now work. The most easy way to upgrade Ubuntu or Debian to the latest SDK is from a terminal via the following command-line: sudo apt-key adv --fetch-keys ; sudo add-apt-repository 'deb [arch=amd64] S RResearch main' ; sudo apt install eyelinkcore or you follow the setup instructions at


  • Psychtoolbox was built and lightly tested against Matlab R2022b.

  • The OpenXR driver now also works with Octave 7.3, in addition to Matlab.


  • macOS Ventura (currently version 13.4.1) is the only officially lightly tested and supported macOS operating system, and only for 64-Bit Intel Macs. Support and testing for macOS 12 Monterey has ended, but macOS 12 is assumed to continue to work as before.

  • Upgrade to the brand new 64-Bit GNU/Octave 8.2 from HomeBrew is recommended for running Psychtoolbox on Octave. Other Octave versions from the Octave 6.3/6.4 and 7.x series, Octave 8.1, or future Octave 8.x versions, may work as well, but no guarantees for anything other than Octave 8.2 from HomeBrew.

  • Psychtoolbox was built and lightly tested against Matlab R2022b.


Psychtoolbox beta updated


Psychtoolbox 3.0.19 Beta update “Virtuality” SP2 was released at 21st April 2023. As usual, the complete development history can be found in our GitHub repository. The release tag is “”, with the full tree and commit logs under the URL:


  • PsychPaidSupportAndServices now handles users pressing Space or Enter too often. Reported by Giles Holland, thanks!

  • PsychDataPixx: Don’t blank top-left pixel anymore, so the “Viewpixx EEG trigger pixel” works better.


  • Our new OpenXR driver now has the ability to provide accurate and trustworthy visual stimulus onset timestamps for VR HMD’s - as tested with Oculus Rift CV-1 and HTC Vive Pro Eye and some photo-diode measurements. This however currently only works with Linux and only with Monado as OpenXR runtime, and only with a special set of Mesa Vulkan drivers for AMD and Intel gpu’s. It also comes at a performance cost. However, this combination of Psychtoolbox and modified Monado + Mesa is to my knowledge the only existing modern VR system that can actually provide accurate and trustworthy timing and timestamping for VR applications on modern VR HMD’s. Read “Help PsychOpenXR” for setup instructions. A proper non-hacky, easy to use solution to VR timing problems is still to be done and will require substantial amounts of work.

    The Monado improvements needed for this timestamping hack have now been upstreamed and integrated into official Monado. A minor update to ‘help PsychOpenXR’ describes required tweaked setup instructions.


  • Verified that Psychtoolbox for Octave also works with new Octave 8.2 from HomeBrew on macOS 12.6.5, in addition to previously supported Octave 8.1.


Psychtoolbox beta updated


Psychtoolbox 3.0.19 Beta update “Virtuality” SP1 was released at 12th April 2023. As usual, the complete development history can be found in our GitHub repository. The release tag is “”, with the full tree and commit logs under the URL:

Compatibility changes wrt. Psychtoolbox

  • Octave 7.3 is required on Windows. Octave 8.1 is required on macOS, but Octave 6.3 - 7.3 may also continue to work on macOS (untested as of

  • Recommended operating systems: Ubuntu 22.04.2-LTS Linux, MS-Windows 10 22H2, macOS 12.6.

  • The macOS 10 (aka Mac OSX) and macOS 11 operating systems should continue to work, but are officially unsupported and unsupportable. Use of macOS 13, or running Psychtoolbox on Apple Silicon (M1, M2, …) is not officially supported by this release. Visual stimulation timing will be totally broken on Apple Silicon Macs, as well as some other features. It is our understanding that currently no vision science toolkit exists that could provide any reliable or trustworthy operation on macOS for Apple Silicon. On Intel based Macs, Psychtoolbox likely continues to be the only toolkit with somewhat trustworthy visual stimulation timing on most Intel Mac configurations.



  • The main new feature, after over 800 hours of development, spread over 13.75 months, is our new OpenXR driver for virtual reality, augmented reality and mixed reality applications, known as eXtended Reality. The new PsychOpenXR driver should work on all VR/AR/MR/XR devices from all vendors on all operating systems which have an OpenXR 1 specification compliant runtime installed on your machine. So far the theory.

    In practice, this means GNU/Linux X11 and MS-Windows 10 and later. This new release has been further refined and now also tested for compatibility with the HTC Vive Pro Eye (and presumably similar HMDs from the Vive series), and the associated “Vive Wand” hand controllers. Proper working of our new driver on HMDs from two different VR hardware vendors - Oculus and HTC - should give good confidence that the new OpenXR driver really works cross-vendor. Testing with the HTC Vive Pro Eye was performed with Valve SteamVR 1.25.7 as OpenXR runtime on both Windows 10 22H2 and on Ubuntu Linux 20.04.6-LTS, and additionally also with Monado (with vive and survive backends) under Ubuntu Linux 20.04.6-LTS.

  • Improvements and fixes to all legacy VR drivers, and to VR test scripts and demos.

  • Minor bug fixes and improvements.

  • Various help text and documentation updates. Also spelling fixes to some code comments and docs contributed by Yaroslav Halchenko from the NeuroDebian project. He contributed some automatic spellchecking for our GitHub CI to reduce such mistakes over time.

  • Fixes by Alex Forrence to allow building Python wheels from source more easily.


  • Add support for 64-Bit Octave 8.x, implemented via the shared mex files for Octave 4.4 to Octave 8.x. This enables use with Octave on Ubuntu 20.04 - Ubuntu 23.04, and should also enable use on future Linux distributions. Note though that Octave 8.x compatibility is assumed at the moment, not actually tested, as upcoming Ubuntu 23.04 ships with Octave 7.3.

  • Psychtoolbox was built and lightly tested against Matlab R2022b.

  • Our new OpenXR driver now has the ability to provide accurate and trustworthy visual stimulus onset timestamps for VR HMD’s - as tested with Oculus Rift CV-1 and HTC Vive Pro Eye and some photo-diode measurements. This however currently only works with Linux and only with Monado as OpenXR runtime, and only with a slightly modified Monado runtime and a special set of Mesa Vulkan drivers for AMD and Intel gpu’s. It also comes at a performance cost. However, this combination of Psychtoolbox and modified Monado + Mesa is to my knowledge the only existing modern VR system that can actually provide accurate and trustworthy timing and timestamping for VR applications on modern VR HMD’s. Read “Help PsychOpenXR” for setup instructions. A proper non-hacky, easy to use solution to VR timing problems is still to be done and will require substantial amounts of work.

    As part of this work, the CV1Test.m script has been improved for VR related timing tests, and FlipTimingWithRTBoxPhotoDiodeTest.m now optionally can also test VR HMD’s wrt. stimulus onset timing and timestamping. These test scripts were used to verify timestamping precision and reliability of the proprietary VR drivers (OculusVR, Oculus OpenXR, SteamVR OpenXR) or rather the terrible lack of reliability and precision, and the excellent reliability and precision of the hacked Monado OpenXR runtime on Linux.

  • Basic Vulkan display backend support for RaspberryPi 4 and 400 with VideoCore-6 gpu. This is very basic right now, and requires special setup and use of Mesa Vulkan drivers built from Mesa source code, the build and install automated by use of PiKISS. See instructions under ‘help RaspberryPiSetup’. This currently has little to no advantage over use of the standard OpenGL display backend. In fact, expect way less trustworthy visual timing and reduced graphics performance. The only use case at the moment would be convenient setup on a dual-display RaspberryPi 4/400 setup for experimenter GUI/mirror display + subject stimulus display, a split experimenter + subject configuration currently not supported by the standard display backend.

  • Fixes for Mathworks latest Matlab bugs since R2022b, this time breaking our Vulkan support by shipping a totally outdated and crippled loader library that overrides the system provided full featured loader. PsychLinuxSetup() will now detect this and rename the library to fix Mathworks latest screwup.


  • 64-Bit Intel MSVC GStreamer version 1.20.5 is now required as minimum supported version, and GStreamer 1.22.1 is now recommended as most modern version, and also as the only lightly tested version for 3.0.19. High quality text rendering will fail with any earlier versions!

  • 64-Bit GNU/Octave 7.3 is required for running Psychtoolbox 3.0.19 on Octave, earlier or later versions won’t work! Substantial technical difficulties were encountered when trying to upgrade Psychtoolbox for Windows to the brand-new Octave 8.1, forcing me to give up after over 15 hours of work. The lack of funding for any such troubleshooting and maintenance work means that Psychtoolbox will be frozen/locked to Octave 7.3 until significant funding for such compatibility work becomes available, or until the problem magically resolves itself, in other words possibly never.

  • Psychtoolbox was built and lightly tested against Matlab R2022b.

  • Compatibility fixes for LoadIdentityClut() with AMD graphics card drivers on Windows, contributed by GitHub user @qx1147. The contributor has the following to say about this fix: “Tested with several Windows 10 versions, AMD driver versions, video ports (DP, DVI, DP++/DVI) and AMD cards (HD-7750, R7-250X, R7-260X, RX-550, RX-6400, WX-5100) - although not all combinations of these.” - The old code broke on a subset of these cards, depending on output port, card, driver versions and whatnot. This due to backwards incompatible changes that AMD apparently made to their display drivers gamma table and color conversion handling since summer/autumn 2017, when the same contributer last fixed LoadIdentityClut() for AMD driver changes which broke pixel identity passthrough. Example of a new bug, citing the contributor: “For example, for the Radeon RX550, the codes 9-254 would map to 8-253, but only for DP and DP++/DVI, whereas all is fine with DVI, at least with an older driver. With newer drivers, the mapping is also screwed up with DVI.”


  • Upgrade to the brand new 64-Bit GNU/Octave 8.1 is recommended for running Psychtoolbox on Octave. Other Octave versions from the Octave 6.3/6.4 and 7.x series, or future Octave 8.x versions, may work as well, but no guarantees for anything other than Octave 8.1.

  • Psychtoolbox was built and lightly tested against Matlab R2022b.

  • Compatibility fixes for new GStreamer 1.22 releases.


Psychtoolbox christmas/spring discount is over


Update: The offer is now over, no discount available anymore.

This was another disappointing failure. We sold a total of 45 support memberships in the time between mid-November and mid-March, which is a whopping 10% more than in the previous years, at a 34% reduced profit per license, resulting in a financial loss of 27% compared to the old pricing. What we would have needed for declaring this a success would have been way in excess of 1000 sold memberships instead of 45.

So the final conclusion after almost 2.5 years of trying all kind of incentives is that the paid support membership / community membership program is a failure and nothing we do can incentivize our users to behave decent, or even just rational out of pure self-interest. This even after more than 1000 people confirmed in in-person VSS meetings and online surveys, that this is what we should do and surely they will support us financially! I guess this is how our user “community” expresses sarcasm and I just didn’t get the joke.

There just seems to be no meaningful capacity for rational mid- to long-term thinking in this field, at least not in the majority of over 99% of our users. A big thank you to the ~ 0.5% of decent and supportive people out there though! Unfortunately not enough to save this soft win-win-win approach for everybody to secure funding for PTB’s future maintenance and development.

We will evaluate new options, but it is time to conclude that we are out of “carrots” to incentivize people in a soft and friendly way to behave in their own long-term self-interest.


Psychtoolbox continued early sale and survey!


Dear Psychtoolbox users,

Our christmas discount on the membership has turned into a new-year / winter discount. We’ll keep that up for the remainder of February to give labs a last chance to do the right thing for cheap, now that they should have their funding for 2023 available and decision makers may have recovered from potential christmas food coma. So far a disappointing number of only 36 labs have contributed, in line with disappointing sales from late 2020, 2021 and 2022, suggesting the whole membership program is another failure and this is not the way to financially sustain PTB. But hope dies last…

We are offering you a heavily discounted Psychtoolbox paid support membership licenses, for a substantially reduced price of only 99 Euros (plus tax), instead of the regular 150 Euros for a 12 months membership license!

Buying such a license once a year is a good way to support Psychtoolbox continued existence and health, and also the potential needs of your lab for expert support.

Buy a discounted license under this link:

For an overview of what larger improvements have been made to Psychtoolbox over the last two years, its continued popularity and importance to the field, and also about our urgent need for financial support by our users, please watch Celia Fosters talk from VSS 2022 under this link.

And of course lots of new stuff is to be had, as just announced yesterday in the Psychtoolbox 3.0.19 release announcement below this post!

As you can see from that presentation, in recent years the Psychtoolbox Team has worked hard to improve Psychtoolbox itself and its services on We also kindly ask you to fill out our current user survey if your lab has not done so already, so that we can better understand the needs and wishes of our community. So far participation has been too low.

Click on this link to the survey form if you want to participate.

The survey is conducted by our host for all commercial services and matters, the “Medical Innovations Incubator GmbH, Tuebingen, Germany”.

As a thank you, you will receive a discount code for your next Psychtoolbox Support Membership purchase.

Many Thanks for your support and stay healthy!

Mario, Dee, Celia, Ingo and Anna

Psychtoolbox beta updated


Psychtoolbox 3.0.19 Beta update “Virtuality” was released at 17th February 2023. As usual, the complete development history can be found in our GitHub repository. The release tag is “”, with the full tree and commit logs under the URL:


  • Effective now, Psychtoolbox 3.0.18 is end of life and unsupported.

  • GStreamer 1.20.5 or later required on MS-Windows, GStreamer 1.22.0 recommended on Windows and macOS.

  • Octave 6 support is cancelled, except for Linux. Octave 7.3 is required on macOS and Windows.

  • Psychtoolbox was built and lightly tested against Matlab R2022b.

  • Recommended operating systems: Ubuntu 22.04-LTS Linux, MS-Windows 10, macOS 12.6.

  • Ubuntu 20.04-LTS is considered in maintenance mode now. I will likely terminate its support in the foreseeable future. Lack of funding by our users makes it impossible to provide the levels of long term support as in the past, even for the best suited operating system for neuroscience :(.

  • RaspberryPi OS 10 support is terminated. RaspberryPi OS 11 32-Bit required.

  • Support for all Windows versions older than recent Windows-10 will soon be completely removed. Stick to older Psychtoolbox versions if you want to continue on older Windows for some insane reason. All Windows versions older than Windows 10 are declared dead by Microsoft since early January 2023, even for Microsoft customers which paid for expensive extended security support that has now ended, so use of Windows < 10 is now an even bigger risk for security. It is dead, Jim!

  • The macOS 10 (aka Mac OSX) and macOS 11 operating systems should continue to work but are officially unsupported and unsupportable. macOS 13 or Apple Silicon is not officially supported by this release.


  • OpenXR cross-platform, cross-vendor, cross-device support for VR/AR/MR/XR applications. A new modern foundation for these kind of things, highly extensible, future proof, and supports a much wider range of devices.

  • Improved display mirroring support, including scaling and experimenter overlays for having setups with a stimulus monitor for the subject and a “experimenter console” / “experimenter control monitor” for the experimenter. PTB is still the only software that allows such setups without expensive special hardware and/or screwing up visual stimulation timing and timestamping. There are still corner cases where this is difficult, requiring tinkering and various performance vs. quality tradeoffs, but we are better than ever now, increasing our lead over other toolkits further.

  • Improved low-level USB support, especially useful for the PsyCalibrator toolbox for display calibration under Octave and Matlab.

  • ASIO support for Matlab users on Windows sort-of back, through the backdoor, without us actually having to add it back or dealing with the legal and licensing nightmares.

  • Shitloads of new workarounds for shittons of new bugs brought to you by the iPhone company in their latest iToys operating systems.


  • The main new feature, after over 700 hours of development, spread over 12 months, is our new OpenXR driver for virtual reality, augmented reality and mixed reality applications, known as eXtended Reality. The new PsychOpenXR driver should work on all VR/AR/MR/XR devices from all vendors on all operating systems which have an OpenXR 1 specification compliant runtime installed on your machine. So far the theory. In practice, this means GNU/Linux X11 and MS-Windows 10 and later, and so far it has only be tested with an Oculus Rift CV-1 VR HMD and Oculus touch controllers, remote and XBox 360 controller. Code for using other form-factors than VR HMD’s is not yet implemented, but this driver should provide the foundation for relatively extension into this new realms if wanted. The whole topic deserves its own dedicated and detailed posts, so stay tuned. Some more overview info and setup instructions are to be found via ‘help OpenXR’, the new drivers specific api in ‘help PsychOpenXR’, the general api improvements and help - sufficient for most use cases - in ‘help PsychVRHMD’, as before. Development of this driver was sponsored by a consumer VR company which wants to stay anonymous and not specifically credited here, so thank you for contributing most of the funding. As funding was insufficient to complete this very complex project, Mathworks sponsored another quarter of the remaining costs, thanks! Of course, that means some other highly interesting project had to be delayed indefinitely, as the amount of funding we get from Mathworks is fixed, just the distribution of the fixed amount to deliverables is flexible. In total, funding was totally insufficient for making any urgently needed profit, or even breaking even nonetheless, so we end this one year project with a serious net loss of over 3000 Euros at this point. This without the project being finished to my personal quality and performance standards, barely reaching what I would consider the minimum viable product from my perspective, but almost certainly still much better than anything competing out there for vision science applications. I expect more financial losses related to this area of functionality, unless new contract work or funding come in, related to OpenXR aka VR/AR/MR/XR applications.

    Lots of care was taken to make the new driver reasonably backwareds compatible, essentially a drop-in replacement for the old drivers, so code written following our recommendations should work unchanged, just on a much wider variety of VR hardware than before.

    Effective immediately, this means that all our old drivers are now considered to be in minimal maintenance mode - critical bug fixes only, no further enhancements! They are scheduled for removal, as soon as the OpenXR driver has proven its maturity to some degree over some time.

  • Tons of minor bug fixes and improvements.

  • PsychPortAudio: Improve diagnostics and help texts for channel mapping, and a new demo for multi-channel audio output, named BasicSoundChannelHoppingDemo.m which motivated those improvements, demonstrating dynamic switching between channels of a multi-channel sound card, e.g., hopping between the channels of a 24 channel sound card.

  • SetStereoSideBySideParameters(): Add option to specify offsets in pixels, and add basic RemapMouse() support to deal better with changed stereo display geometry. Various other compatibility fixes to SetStereoSideBySideParameters() and RemapMouse() in combination with stereo display modes in combination with imaging pipeline geometric transformations like FlipHorizontal or FlipVertical. Also for 90 degree step rotation with the PanelFitter.

  • Screen: Fix PsychImaging task ‘MirrorDisplayTo2ndOutputHead’ for most use cases. Turns out that this display mirroring task for macOS and MS-Windows only worked for trivial configurations without use of the panelfitter, MSAA, image processing or other complexities. It also works now when combined with the Vulkan special purpose display backend as primary stimulus display and the regular OpenGL method for the “experimenter feedback” / “control console” mirror display.

  • Add overlay support to the display mirroring tasks ‘MirrorDisplayTo2ndOutputHead’ and ‘MirrorDisplayToSingleSplitWindow’. The new optional useOverlay parameter for these PsychImaging tasks generates a (normally transparent) overlay window, a “head up display” on top of the mirror window that shows a mirror image of the stimulus presented to the subject on the main stimulation display. overlaywin = PsychImaging('GetMirrorOverlayWindow', win); allows to get a window handle overlaywin to this overlay, and then one can use Screen drawing commands to draw info that is only meant to be seen by the experimenter, not the subject, into the overlay. A common use case seems to be gaze position or gaze traces of a subject in eyetracking tasks, or other live feedback about task progression and subject performance. This is generally more flexible than hardware solutions, e.g., as provided by VPixx stimulators, or similar equipment, or some display splitters.

  • PsychImaging: Allow size spec of mirror image for mirroring task ‘MirrorDisplayToSingleSplitWindow’. Dealing with setups where the mirror/console/experimenter monitor has a lower/different resolution than the stimulus monitor needs same special rescaling of the mirror image. Implement rescaling + some minor optimizations. A future extension may allow to automate handling of such less standard display setups, but for now the user has to specify mirror monitor display resolution manually via a new optional parameter.

  • PsychHID: Add support for synchronous USB bulk and interrupt transfers, and manual of automatic claiming of USB interfaces. The new subfunctions ‘USBBulkTransfer’ and ‘USBInterruptTransfer’ implement synchronous bulk and interrupt transfers. This now allows writing M-File drivers for more research equipment. The main motivation was to enable the free and open-source PsyCalibrator toolbox for Octave and Matlab to implement support for many more Photometers and other light measurement devices in a more efficient manner, starting with the cheap SpyderX device. Cfe..

  • PsychHID: Add PsychHID('USBClaimInterface', usbHandle, interfaceId) for manual claiming of device interfaces. This function allows to explicitely claim a USB interface to enable it for I/O from/to an USB interface endpoint. Bulk- or interrupt transfers don’t work if the interface who owns the endpoint has not been claimed. If a call to this function is omitted before doing bulk or interrupt transfers, then PsychHID will automatically claim interface 0. Claimed interfaces are auto-released when closing an USB device. Kernel drivers potentially attached to - and blocking - an interface will be automatically detached, and then reattached at device close. In other words: Use of the most commonly used interface 0 does not need any extra user code. Use of other interfaces will require this call in time.

    On macOS: Note that if a macOS kernel driver (kext) has already claimed exclusive access to the device, then this will only work by detaching the kernel driver, which requires you to run Octave or Matlab as root. Only tested by myself with octave via “sudo octave” so far. For the hoops you have to jump through on macOS to get this working without sudo, read the FAQ under this link

    Executive summary for macOS in such cases: Give up, or be prepared to suffer greatly!

  • Various help text and documentation updates.

  • Terminate support for Python 2.x, it is officially end-of-life since beginning 2020. Only Python 3.6 and later are supported by our Python “Mex files” going forward. This makes the files also forward compatible with more Python versions by opt-in use of the Py limited api. Contributed mostly by Alex Forrence, with some tweaks by Mario Kleiner. Various other minor enhancements to PsychPython.


  • Add support for 64-Bit Octave 7.x, implemented via the shared mex files for Octave 4.4 - Octave 7.3. This enables use with Octave on Ubuntu 22.10.

  • Psychtoolbox was built and lightly tested against Matlab R2022b.

  • Screen: Add gpu detection support for NVidia 170 “Ampere” gpu family and “Ada Lovelace” gpu family. Avoids some confusing warning and may improve Flip performance by a few dozen microseconds in some cases. Use of NVidia graphics cards is still discouraged due to the need of proprietary graphics drivers for all modern models, which limit useful functionality compared to gpus with open-source drivers, and make general use more tedious and troublesome.

  • Drawtext plugin: Add workaround for Mesa bug with small non-anti-aliased text of 8 pixels and less. Rarely needed, but somebody in the VR research community needed it, so there.

  • Compatibility fixes for the RaspberryPi on RaspberryPi OS 11 aka Debian 11 stable. Especially for old RPi 1,2,3 with VideoCore-4 gpu, XOrgConfCreator() now generates a special xorg.conf file to enable fixes for these gpu’s which were not neccessary on older RaspberryPi OS versions. Other misc compatibility improvements.

    Our build system for ARM / RaspberryPi is now 32-Bit RaspberryPi OS 11, with 32-Bit Octave 6.2, 32-Bit ARM RaspberryPi 400. 64-Bit operating systems are not supported, and support for the legacy RaspberryPi OS 10 is now terminated.

  • gamemode.ini: Comment out the amd_performance_level=high gpu perf option. Setting amd_performance_level=high for high performance level was found to cause stability issues at least on AMD Ryzen-5 2400G “RavenRidge” under Ubuntu 20.04.5-LTS with Linux 5.15 under prolonged load, likely a cooling problem. It may be safe to enable it for other AMD gpu’s, especially well-cooled or discrete ones, but better safe than sorry by default, as i don’t like my main devel machine crashing regularly and other users may also have machines with shaky cooling.


  • 64-Bit Intel MSVC GStreamer version 1.20.5 is now required as minimum supported version for both Octave and Matlab. High quality text rendering will fail with any earlier version! From now on we always use the fontconfig-1.dll bundled with GStreamer 1.20.5 and later for font matching, which should simplify debugging of future issues on MS-Windows. This version also enables the ability to use User installed 3rd party fonts without extra configuration work by the user, obsoleting various hacks. GStreamer 1.22.0 was also lightly tested without obvious problems, so upgrading to 1.22.0 is recommended for new features, wider support for audio/video formats, improved performance and various bug fixes in the multi-media area.

  • 64-Bit GNU/Octave 7.3 required for running Psychtoolbox 3.0.19 on Octave.

  • Psychtoolbox was built and lightly tested against Matlab R2022b.

  • PsychPortAudio: Allow use of a wider range of 3rd party portaudio_x64.dll plugins for the underlying PortAudio engine implementation. The most interesting use case of this is ASIO for users of Matlab, as recent versions of Matlab ship with a Mathworks provided Portaudio implementation that has builtin ASIO support, where all the legal licensing and trademark issues are taken care of by Mathworks. If one copies the DLL shipping with Matlab into the PsychtoolboxRoot() folder, renamed to the filename portaudio_x64.dll instead of the filename that Matlab uses (libportaudio.dll), then this will expose basic ASIO support, even when used with GNU/Octave. Please note that Mathworks is legally responsible for this ASIO support, whereas we do not include any support for ASIO into Psychtoolbox, we merely expose whatever backend a 3rd party portaudio DLL supports, which happens to be also ASIO in this case of the Matlab provided dll. Therefore we are legally in the clear, while some of our users may be more happy with their sound setup, even if they refuse to switch to Linux. Obviously, these 3rd party driver plugins are completely unsupported by us in case of trouble, and likely also by Mathworks, as this is not their intended use case, just a side-effect of some functionality that is probably meant for the Matlab audio toolbox.

  • Update bundled libusb-1 for MS-Windows to most recent version 1.0.26 with many bug fixes and improvements over the last 11 years.


  • 64-Bit GNU/Octave 7.3 required for running Psychtoolbox 3.0.19 on Octave. Other Octave versions from the Octave 6.3+ and 7.x series may work as well, but no guarantees.

  • Psychtoolbox was built and lightly tested against Matlab R2022b.

  • Switch the only supported and lightly tested macOS version from 10.15 “Catalina” to 12 “Monterey”. No more development or testing on 10.15.7 Catalina, now that it has been wiped from my drive. We keep macosx-version-min at 10.11 for the time being, so PTB may still work back to macOS 10.11, but no guarantees, and I don’t care if it breaks on older systems than macOS 12.6 Monterey. macOS 13 Ventura is completely untested and not officially supported yet. Apple Silicon Macs continue to be unsupported and untested, with known completely broken visual stimulation timing and possible other issues. All mex files are for the 64-Bit Intel processor architecture variants of Matlab and GNU/Octave only.

  • PsychOculusVR: Remove for macOS. No VR virtual reality support on macOS anymore as of PTB 3.0.19. It only supported the long time out-of-sale since many years Oculus Rift DK1 and Rift DK2, with an Oculus v0.5 runtime for macOS that is not available for download from Oculus or anywhere else anymore since years, and only for macOS versions which supported 32-Bit Intel architecture executables, iow. doesn’t work on macOS 10.15 Catalina and later anymore thanks to Apple breaking backwards compatibility with 32-Bit applications.

  • Fix performance of PsychHID further for the latest Apple security bullshit, introduced sometime after macOS 10.15 Catalina. This was found when testing Octave on macOS 12.5 Monterey, a massive performance degradation for KbCheck and related functions if Matlab or Octave are launched from a terminal (iow. always for Octave!). Apple screwed up their api’s further to increase processing time of some time sensitive operation from 1 msec to over 15 msec! Now we are back to about 2.4 msecs on macOS 12, which is much worse than MS-Windows with less than 1 msecs or Linux with less than 0.1 msecs. So now it is merely Apple bad, as most Apple stuff.

  • Screen: Unbreak our Vulkan display backend via MoltenVK Vulkan-on-Metal again for macOS 12, after Apple broke it somewhere after macOS 11. After close to 80 hours of diagnostic work, distributed over more than 4.5 months on and off, going down every conceivable route of diagnostics and low-level debugging, i could not find anything wrong with my code or MoltenVK. Turns out, it is yet another “dumb beyond imagination” bug in the iPhone companies latest macOS 12, nothing we did wrong. The root cause is unclear, but now we include a dumb hack which makes it work again, against any rhyme or reason. Of course, I don’t know if Apple has broken it or will break it again in macOS 13 Ventura or later abominations. So basic HDR on macOS is back in the game…

  • PsychHID: Switch low-level USB support to use of shared libusb-1 backend instead of Apples macOS proprietary backend, which became a maintenance nightmare. This now allows all operating systems to progress in the same way with shared high-quality code. It does mean however, that if one wants to use low-level USB device access, e.g., USB control-/bulk-/interrupt-transfers, one needs to install libusb-1.dylib with a minimum version of 1.0.22 from a suitable source, or these functions will refuse to work. The most simple way to get this library is via HomeBrew: brew install libusb

    The only affected standard Psychtoolbox function without installing libusb dylib is the ColorCal2() functions for using CRS ColorCal-II devices.


Psychtoolbox end of year sale and survey 2022!


Dear Psychtoolbox users,

starting today, November 24th 2022, and only for a limited amount of time, we are offering you a heavily discounted end of year sale of our Psychtoolbox paid support membership licenses, for a substantially reduced price of only 99 Euros (plus tax), instead of the regular 150 Euros for a 12 months membership license!

Buying such a license once a year is a good way to support Psychtoolbox continued existence and health, and also the potential needs of your lab for expert support.

Buy a discounted license under this link:

For an overview of what larger improvements have been made to Psychtoolbox over the last two years, its continued popularity and importance to the field, and also about our urgent need for financial support by our users, please watch Celia Fosters talk from VSS 2022 under this link.

As you can see from that presentation, in recent years the Psychtoolbox Team has worked hard to improve Psychtoolbox itself and its services on We also kindly ask you to fill out our current user survey if your lab has not done so already, so that we can better understand the needs and wishes of our community. So far participation has been too low.

Click on this link to the survey form if you want to participate.

The survey is conducted by our host for all commercial services and matters, the “Medical Innovations Incubator GmbH, Tuebingen, Germany”.

As a thank you, you will receive a discount code for your next Psychtoolbox Support Membership purchase.

Many Thanks for your support and stay healthy!

Mario, Dee, Celia, Ingo and Anna

Psychtoolbox beta updated


Psychtoolbox 3.0.18 Beta update “Experimental Taylor expansion “ SP8 was released at 11th September 2022. As usual, the complete development history can be found in our GitHub repository. The release tag is “”, with the full tree and commit logs under the URL:

A very minor update. Barely worth proper release announcements.


  • Minor improvements to PsychHID troubleshooting help texts for macOS security GUI bugs.


  • Point out need for GStreamer 1.18 instead of GStreamer 1.20 more clearly.

Psychtoolbox beta updated


Psychtoolbox 3.0.18 Beta update “Experimental Taylor expansion “ SP7 was released at 7th August 2022. As usual, the complete development history can be found in our GitHub repository. The release tag is “”, with the full tree and commit logs under the URL:

This release only contains improvements for the RaspberryPi computer. The 3.0.18 series may be the last version supporting Raspbian OS 10, given that the current stable version is OS 11 / Debian 11 “Bullseye”.


  • Installer: Compatibility fixes for Linux RaspberryPi OS 11 aka Debian 11 / Bullseye on the RaspberryPi microcomputer. Make installation more smooth.

  • Screen: Fix pageflipping on the RPi 4/400 with VideoCore-6 gpu again after it got broken again for Debian 11 by new half-assed format+modifier dmabuf optimization attempts. PsychLinuxConfiguration now installs a special mesa config file with special secret opt-in parameter that enables special downstream patches made to Mesa v3d to fix the half-assery. This way, pageflipping and visual stimulation timing/timestamping works again on RPi4/400 after upgrading to RPi OS 11.

  • PsychPortAudio: Fix selection of default sound output device on the RPi 400. Allows ‘sysdefault’ as a viable choice of device.

Psychtoolbox beta updated


Psychtoolbox 3.0.18 Beta update “Experimental Taylor expansion “ SP6 was released at 4th August 2022. As usual, the complete development history can be found in our GitHub repository. The release tag is “”, with the full tree and commit logs under the URL:

This is mostly a release with smaller quality of life improvements, some bug/compatibility fixes, and more work to take advantage of new Ubuntu 22.04-LTS features and improvements.


  • Various help text and documentation updates. Minor cleanups and improvements, maintenance work etc.

  • PsychVRHMD: Prep work for future OpenXR driver, and some cleanups and minor fixes.

  • PsychPortAudio: Add new AM modulator flag 256 “kPortAudioAMModulatorNeutralIsZero”. By default, a stopped AM modulator device acts as if no AM modulator is attached. With this flag set, while attached to an audio output slave device, it will instead “gate” or “mute” sound output on its associated audio output device, iow. the AM gain value during stopped modulator is zero instead of one. This has proven useful to allow to output tone bursts that are windowed/gated/modulated by an envelope function. Sponsored by a paid support membership - Thanks.

  • Eyelink: Fix potential false “buffer overflow” alert in ‘EyelinkGetQueuedData’, which can cause Octave/Matlab to abort() as a false alarm. Sponsored by SR-Research, paying members of our partnership program - Thanks.


  • XOrgConfCreator: Split up into a legacy version for systems with X-Server 1.20 and earlier, e.g., Ubuntu 20.04-LTS, and a modern version for systems with X-Server 21 and later, e.g., Ubuntu 22.04-LTS. The legacy version is now in maintenance mode, frozen in its behaviour for old systems. The X-Server 21 / Ubuntu 22.04-LTS version was cleaned up, extended and made more plug and play. It hides some rarely needed (for normal users) options behind a “expert mode” flag, simplifies the questions it asks to users, streamlines the whole setup experience, and exposes some new functionality only available on modern X-Server 21, e.g., AsyncFlipSecondaries support for clone/mirror display setups (subject + experimenter displays) which are not synchronized. Improvements to deep color setup, Prime renderoffload “Optimus” setup, VRR setup etc.

  • Deal better with problems in AssertOpenGL, giving better troubleshooting advice – now updated for Ubuntu 22.04-LTS

  • Gamepad/GetGamepadIndices: Refinements for Linux/X11, help text updates. Make selection of the proper GamePad / Joystick device more simple and robust. This work supported by a Psychtoolbox paid support membership - Thanks.


  • PsychVulkan: Add a new workaround for another macOS Metal bug. Make visual presentation timing it a bit better, but still quite awful.

  • Screen(‘AddFrameToMovie’): Change mapping of ‘rect’ to actual capture area. The old math didn’t determine vertical start position of the capture rectangle by rect(kPsychTop), but based on rect(kPsychBottom), which could cause inconsistencies on movie frame capture area on macOS with Retina displays in Retina backwards compatibility mode. The new math fixes this, to deal with Retina displays better.

  • Maybe restore backwards compatibility of Psychtoolbox 3.0.18 with macOS versions older than 10.15 Catalina, possibly back to 10.11 El Capitan with fixes to Screen and PsychPortAudio. This is untested, due to lack of any macOS test systems other than 10.15.7 Catalina final, but may work. Maintaining backwards compatibility is difficult without test systems and the constant breakage introduced by the iToys company in more recent SDK’s and compiler toolchains. Officially we don’t guarantee that current 3.0.18 runs on anything but Catalina.


Psychtoolbox beta updated


Psychtoolbox 3.0.18 Beta update “Experimental Taylor expansion “ SP5 was released at 22nd May 2022. As usual, the complete development history can be found in our GitHub repository. The release tag is “”, with the full tree and commit logs under the URL:

A minor update for macOS Octave compatibility, help/status text updates and to mention our new user survey.


  • Reword text for our new commercial support.
  • Add a mention of our ongoing user survey 2022, ask for participation.


  • Rebuild 64-Bit Octave mex files so that they should work on both Octave-6.3/6.4 and the new Octave-7.1 from HomeBrew.
  • Minor improvements to Screen() status messages.


  • Update some help texts wrt. hybrid graphics support. Some more configurations are verified to work with proper timing, e.g., AMD iGPU + NVidia dGPU Optimus style.
  • Update help PsychLinuxConfiguration.


Video of VSS2022 Psychtoolbox presentation.


Celia Foster was giving a 12 minute quick presentation about what’s new in Psychtoolbox since the last update at VSS 2019, as part of the Mathworks/INCF 1 hour session. Videos of much of that session may become available later, after editing/cutting etc.

For now, a video of Celia’s practice talk, only containing the 12 minute Psychtoolbox bit, without Q & A, is available on YouTube under this link:

Thanks to Mathworks, INCF and the volunteers in the room for hosting this session.


Celia & Mario

Psychtoolbox user survey 2022!


Dear Psychtoolbox users,

In recent years the Psychtoolbox Team has worked hard to improve Psychtoolbox itself and its services. We kindly ask you to fill out this survey, so that we can better understand the needs and wishes of our community. Your answers will greatly help us to shape the future of Psychtoolbox.

Click on this link to the survey form if you want to participate.

The survey is conducted by our host for all commercial services and matters, the “Medical Innovations Incubator GmbH, Tuebingen, Germany”.

As a thank you, you will receive a discount code for your next Psychtoolbox Support Membership purchase.

Many Thanks for your support and stay healthy!

Mario, Dee, Celia, Ingo and Anna

Psychtoolbox beta updated


Psychtoolbox 3.0.18 Beta update “Experimental Taylor expansion “ SP4 was released at 4th May 2022. As usual, the complete development history can be found in our GitHub repository. The release tag is “”, with the full tree and commit logs under the URL:

Minor bug fix for Linux + Wayland handling.


  • Prevent use of Wayland backend by default also under Octave, not just Matlab! setenv(‘PSYCH_ALLOW_WAYLAND’,’1’); to override for the adventurous and masochistic.

Psychtoolbox beta updated


Psychtoolbox 3.0.18 Beta update “Experimental Taylor expansion “ SP3 was released at 2nd May 2022. As usual, the complete development history can be found in our GitHub repository. The release tag is “”, with the full tree and commit logs under the URL:

Minor bug fixes / compatibility improvements.


  • Detect if the Screen() function (for X11/GLX Linux) is executed under a Wayland based desktop GUI, which would run it under XWayland, which would end badly. Warn user, error abort with troubleshooting tips -> Logout and login into a X11/Xorg native X-Server session. This to deal with the new default choice of a Wayland-based desktop environment under Ubuntu 22.04-LTS, which leads to “failure by default”.


  • Improve postinstall routine to skip sync tests while rebuilding the fontconfig cache on Window or macOS, as sync failure could cause a false error and failure to rebuild the fontconfig cache. Spotted on Windows, but may also apply to macOS.

Psychtoolbox beta updated


Psychtoolbox 3.0.18 Beta update “Experimental Taylor expansion “ SP2 was released at 20th April 2022. As usual, the complete development history can be found in our GitHub repository. The release tag is “”, with the full tree and commit logs under the URL:


  • GetClicks(): Add timeout for 1st click, and click time reporting.
  • Setup/Download/UpdatePsychtoolbox(): Add highly experimental optional support for non-interactive operation. May help sysadmins to setup multiple machines faster without too much user interaction. Experimental, unsupported in case of trouble, will not work easily on Linux - would need more work to update PsychLinuxConfiguration.
  • PsychPaidSupportAndServices(): Update language a bit for new support conditions.
  • Fixes by Diederick for DrawFormattedText2() cached text drawing while geometric transformations are applied.
  • DKLDemo.m: Some comment fixes by David Brainard.


  • PsychPortAudio(): Change realtime priority setup for ALSA and Pulseaudio: Instead of assigning static FIFO RT priority 1, use priority of main thread (aka Priority()) + 4, so audio processing stays at higher RT priority than main thread or other PTB threads. May help some special edge cases, e.g., Microsoft Surface Pro 6 audio glitches in some scnearios that I could not reproduce, but a user could. See
  • Add a GitHub actions CI setup to allow to build our mex files for 64-Bit Linux on Intel in the GitHub cloud, both for Octave 5.2 and Matlab under Ubuntu 20.04-LTS.
  • Make Screen() mex files hopefully compatible with Ubuntu 22.04.0-LTS, by changing link dependency to libdc1394-25. Only lightly tested.


  • Require use of GStreamer 1.18.x series, 1.18.5 as latest tested release. GStreamer 1.20 contains multiple potential compatibility bugs wrt. fontconfig / high quality text rendering under Matlab + Windows. Octave 6.4 + Windows should be unaffected, as are other operating systems.

Follow us on Twitter!


Since a week or so, we have a Twitter account, which is not managed by myself - I don’t do Twitter, but people more competent at social media, with bits of content provided among others, by myself and my neuroscientist girlfriend. E.g., PTB news announcements, little technical tips, calls to action.

We hope you will find it interesting and that it opens up another communication channel to Psychtoolbox users and (hopefully) future supporters beyond the audience that frequents the discussion forum.

Twitter handle: @psychtoolbox Account:

Please retweet and share, and have a nice weekend, -Team Psychtoolbox

Psychtoolbox beta updated


Psychtoolbox 3.0.18 Beta update “Experimental Taylor expansion “ SP1 was released at 24th February 2022. As usual, the complete development history can be found in our GitHub repository. The release tag is “”, with the full tree and commit logs under the URL:

This release contains some minor improvements for Linux, and in the future for Windows.


  • Fix AUX buffer fallback in Screen, so MSAA anti-aliasing can be used again without full imaging-pipeline enabled. This was broken due to changes of AUX buffer support in graphics drivers over the last decade. The same fix applies to MS-Windows, but we can’t do a full rebuild of Screen on Windows atm., only for Octave, so this is only “inofficially” fixed for now on Octave + Windows.
  • LinesDemo.m: Request 1xMSAA, so drawing of anti-aliased lines works with nice perpendicular endcaps on AMD + Linux on future Mesa 22.0 and later, e.g., likely on upcoming Ubuntu 22.04-LTS.

Psychtoolbox beta updated


Psychtoolbox 3.0.18 Beta update “Experimental Taylor expansion” was released at 4th February 2022. As usual, the complete development history can be found in our GitHub repository. The release tag is “”, with the full tree and commit logs under the URL:

This release contains some minor improvements, but mostly some experimental and exciting improvements for Linux in composited stimulus presentation mode.


  • PsychHomeDir(), PsychtoolboxConfigDir() compatibility fixes for Matlab compiler on Unix, contributed by Ian Andolina.

  • Screen('DrawText'): Improve help text on drawtext plugin rendering failure. The most common cause for failure is that libfontconfig can’t find a suitable font, usually because something’s wrong with the fontconfig cache. Be a bit more explicit about this and point the user into the right direction. This problem usually only happens occasionally on MS-Windows and Apple macOS, it was not ever observed on Linux.

  • Screen: Add some visual indication of some types of triple-buffering. This will cause some fast “jiggle” or “vibrating” movement of the startup splash image if Psychtoolbox does successfully bypass the desktop compositor, but the low-level display driver still employs triple buffering. Not all types of triple-buffering or n-buffering with n > 2 can be detected, e.g., it is expected to not be diagnostic at all in desktop compositor situations, “Optimus” style render offload etc. The most straightforwad type of triple buffering may be detectable, e.g., what the Intel graphics driver on MS-Windows 10+ uses on most modern Intel graphics chips. There should be no visible change for double-buffered systems, only on triple buffering in some conditions. The test has a high false negative rate. We don’t use it on Linux, as we have much better diagnostic built in since many years due to superior api’s for this stuff on Linux. Also n-buffering is nothing bad on Linux with FOSS drivers, but often beneficial for performance, it is only an easily detected issue with the NVidia proprietary graphics driver on not recommended NVidia hardware.

  • Update help SyncTrouble with a description of this new visual diagnostic cue. Note that DWM -> invisible windows diagnostics at Screen('Preference', 'Visualdebuglevel', 6) is much less reliable (high false negative rate) at detecting compositor involvement since some MS-Windows 10 update late 2021. Note the unfixable triple-buffer brokeness of Intel graphics on Windows. Note the unfixable brokeness of Apple M1 SoC “Apple Silicon” ARM Macs at the moment.


  • Experimental support for the NetWM frame timing protocol for improved client - compositor sync to allow for supposedly robust and precise visual stimulus onset timestamps and improved stimulus onset timing even with half-transparent or partially (per-pixel alpha) transparent fullscreen windows, “windowed” non-fullscreen windows, and certain hybrid graphics configurations, e.g., “NVidia Optimus” laptops with AMD integrated display gpu (iGPU) and NVidia discrete render offload gpu (dGPU).
    • This requires an X11 compositing window manager with NetWM frame timing support: Currently Gnome-3’s “Mutter” is known to support this, so use of Ubuntu 20.04-LTS standard “Ubuntu desktop (X11)” or of “Gnome desktop (X11)” should work. Probably most (all?) other desktop environments, e.g., KDE, won’t support this.
    • You need to opt-in to use of this feature by setting the environment variable PSYCH_EXPERIMENTAL_NETWMTS to 1, e.g., via setenv('PSYCH_EXPERIMENTAL_NETWMTS', '1'). The feature is currently a construction site which only works for the most basic and common use case of a single onscreen window, only use of Screen('Flip') not async flips, no frame-sequential stereo or fine-grained VRR/FreeSync/G-Sync timing, no use of flip events (ie. no functionality demonstrated in PerceptualVBLSyncTestFlipInfo.m) for extra performance boosts or asynchronous operation. Unless the feature supports all reasonable use cases, or at least guards/falls back in a reasonable way on unsupported cases instead of just malfunctioning or hanging without warning, and until is verified more stringently, we keep this an experimental opt-in. The default behavior will stay to have no timing precision/reliability and/or reduced performance in AMD iGPU + NVidia dGPU Optimus configurations, for transparent windows or for windowed windows, just as in the past and on all other operating systems.
    • The timing precision and reliability of visual onset timestamps has not been verified with hardware measurement equipment yet as I am away from the needed equipment for a few weeks. Only software based checks and “eye balling” has been done with Ubuntu desktop and GNOME-3 on Ubuntu 20.04.3-LTS on Intel graphics, and Ubuntu 21.10 on AMD graphics so far, but it looks as if it works correctly. If you use the feature and depend on its precision, wait for my official test results, or measure carefully yourself! In theory this experiment could turn into a failure, although i judge the likelihood of failure low at this point.
    • Credit for proposing and publishing the protocol, and for implementing support for it in GNOME’s Mutter compositor, goes to Red Hat’s Owen Taylor, which also has some nice blog posts about the challenges and tradeoffs of timing vs. performance vs. latency vs. judder in desktop compositors under this link.

Psychtoolbox beta updated


Psychtoolbox 3.0.18 Beta update “Ode to the slacktivists” SP4 was released at 20th January 2022. As usual, the complete development history can be found in our GitHub repository. The release tag is “”, with the full tree and commit logs under the URL:

This release is all about low-level sound driver improvements.


  • PsychPortAudio robustness improvements for some exotic sound hardware that provides/requires/uses variable buffersize audio hostbuffers, instead of the more common fixed size audio hostbuffers. Should help on Windows, macOS and Linux in such cases to avoid audio artifacts during recording or playback under such conditions. Code inspection showed that such artifacts were theoretically possible, although no such artifacts are known to us to have happened in practice, neither reported from users, nor experienced in my own testing, so maybe this issue was non-existent on typically used mainstream hardware in practice. Anyway, the theoretical possibility is now fixed.

  • PsychPortAudio: No longer enforce a 96000 Hz sampling rate in agressive low latency mode if no sampling frequency was specified by user code. Misc other small audio setup improvements.


  • PsychPortAudio robustness improvements in half-duplex audio capture mode for some exotic sound hardware. Fixes a theoretical issue, not one actually reported by users or experienced by myself. But better safe than sorry.

  • Prep-work for use of a new upcoming Pulseaudio sound server backend on Linux, and changed default device selection priorities. If a Portaudio library with Pulseaudio sound server support would be installed on the Linux machine, then that server could be used now by PsychPortAudio by passing in an explicit deviceNumber for a Pulseaudio backed sound device. For auto device selection, InitializePsychSound([reallyneedlowlatency=0]) is now prepared to allow to prefer Pulseaudio devices for reallyneedlowlatency==0 - or for omission of the parameter - over Jack pro-audio server provided devices, and over ALSA devices. In reallyneedlowlatency==1 setting, the preference order is Jack, then Pulseaudio, then ALSA. Actual preference order also depends on the requested latencyclass in each individual PsychPortaudio('Open') call: Audio device sharing with other audio clients by default can only happen for latencyclass 0 and 1, not for class 2 or higher. This to align Linux audio behavior more strongly with macOS behavior and some Windows behavior and make it easier to share audio devices with other applications, system sounds, Snd, Beeper, sound, soundsc or our movie playback functions, at least for cases where reasonably low latency and good timing precision and audio control is enough, as opposed to minimum latency + maximum precision and control. However, this new InitializePsychSound behavior is currently disabled, until a suitable Portaudio library with Pulseaudio support has been officially released and extensively tested by us. Tests against the current prototype are highly promising though and this driver is compatible with the prototype if somebody feels manually installing the prototype to relly live life on the bleeding edge. InitializePsychSound.m has a return` statement that one needs to comment out for this to work. The new Portaudio library is unlikely to debut in the next Ubuntu 22.04-LTS release though, given approaching deadlines, but for the unlikely case it would make it before deadlines, we want to be prepared.

Psychtoolbox beta updated


Psychtoolbox 3.0.18 Beta update “Ode to the slacktivists” SP3 was released at 23rd December 2021. As usual, the complete development history can be found in our GitHub repository. The release tag is “”, with the full tree and commit logs under the URL:


  • Make PsychStartup more compatible with Matlab standalone app deployment via mcc on Windows. If one knows exactly how, this allows to build standalone apps at least with R2019b and on Windows-10/11, as verified. Status on macOS or Linux is untested, but should supposedly work more easy on macOS and even more easy on Linux.

  • Workaround for PsychVulkanCore for build systems with outdated Vulkan SDK. Mostly useful to keep Psychtoolbox 3.0.18 for GNU/Octave building for the NeuroDebian version and by upstream Linux distributions like Debian and Ubuntu, until they update their Vulkan SDK to at least version 1.2.189. Also, we can spare ourselves an update on macOS for the moment, given it lacks the functionality anyway. Some latency optimizations are compile-time disabled for such builds though, so for maximum performance one would want to get our own upstream build via DownloadPsychtoolbox, which does not lack this optimization. However, as of end 2021, only the NVidia proprietary Vulkan drivers for Linux and Windows implement the feature, and only in such a half-assed and broken way that it is utterly useless on those drivers.

Psychtoolbox beta updated


Psychtoolbox 3.0.18 Beta update “Ode to the slacktivists” SP2 was released at 2nd December 2021. As usual, the complete development history can be found in our GitHub repository. The release tag is “”, with the full tree and commit logs under the URL:


  • Cleanups and refactoring, mostly irrelevant to end users.

  • Various help text and documentation updates.

  • Various improvements to demos and tests, done as part of the validation and compatibility work for Matlab R2021b on Ubuntu 20.04.3-LTS, MS-Windows 10 21H1 and macOS 10.15.7 Catalina final. Sponsored by Mathworks, thanks! (

  • New demo BasicSoundPhaseShiftDemo.m - Realtime phase-shifting of sine wave tones.


  • Note that modern AMD Polaris graphics cards under Linux 5.14 with the latest AMDVLK v2021.Q4.1 AMD Vulkan driver now support 16 bpc framebuffers for native 12 bpc output. In principle this would also work with earlier AMD Sea Islands and Volcanic Islands gpu’s, but needs a custom built amdvlk driver, which we have available, but won’t provide for free.

  • Some diagnostic improvements for pixel identity passthrough.

  • Substantial improvements to NVidia Optimus laptop support when using the proprietary NVidia OpenGL driver. “help HybridGraphics” for details. Laptops with Intel integrated graphics chips and NVidia discrete gpu’s should work with proper timing and timestamping now on modern Linux distributions like Ubuntu 20.04.3-LTS. AMD Ryzen integrated graphics + NVidia discrete gpu’s should also work better wrt. quality and timing, although limitations wrt. performance exist with AMD’s display driver and there might be unknown edge cases with broken visual stimulus onset timestamping. I do have some (Linux kernel patch) solution for that, which provides excellent quality. That solution is a hack though, and implementing a proper solution for the official Linux kernel will take time to implement and get upstreamed, especially with the lack of proper funding. We haven’t decided if and under what conditions we will provide the inofficial - hacky, but well working - solution. The only sure thing is we won’t provide it for free.

    Please note that our general advice is to avoid hybrid graphics dual-gpu laptops. Single gpu machines require less setup and have less potential for bugs and complications. Also, on Windows, these dual-gpu laptops are pure trouble. These improvements for Linux are just to lessen the impact of a bad purchase decision as far as this is possible.


  • Switch supported and required Octave version to Octave 6.4. Octave 6.3 will likely continue to work.

  • Try to detect if we are running on Apple silicon “M1 SoC” ARM - Macs with Apples proprietary gpu. This will enable workarounds that allow Screen() to at least limp along, still with totally broken visual stimulation timing and timestamping, but at least getting a picture onto the screen, instead of complete failure. Also detect and report macOS variant and version, ie. Intel (supported) or ARM M1 SoC (unsupported), macOS 10.15 (supported), macOS 11/12 (unsupported).

  • Fix KbQueueCreate() crash if running in a single-threaded host runtime, iow. octave-cli. More importantly, this should avoid some keyboard queue crashes under macOS with some Python runtimes. Ditto for Screen().

  • Note that MoltenVK 1.1.5 should be used for Vulkan on macOS.


  • Switch supported and required Octave version to Octave 6.4. Octave 6.3 will likely continue to work.

  • Try to detect Windows version more reliable. Report Windows 11 as officially unsupported/untested.

  • Fix for Vulkan display backend for AMD graphics on Windows. Try to handle problems switching to “fullscreen exclusive mode” better. Both the latest NVidia and AMD drivers have various bugs and issues. We better try to work around them as good as we can, instead of just showing a black screen. This is highly fragile under current Windows-10 due to poor graphics driver quality, and may result in compromised presentation timing and timestamping. Luckily the only meaningful use cases for Vulkan on Windows are HDR-10 display modes atm., so the damage is limited. Our guess at the moment is that AMD driver versions older than 20.11.2 may work ok, ie. ones from before November 2020. For people who want HDR display with proper timing, upgrading to AMD on Linux is recommended.

Psychtoolbox beta updated


Psychtoolbox 3.0.18 Beta update “Ode to the slacktivists” SP1 was released at 26th October 2021. As usual, the complete development history can be found in our GitHub repository. The release tag is “”, with the full tree and commit logs under the URL:


  • Minor cleanups, mostly irrelevant to end users.


  • Rebuild all mex files for Matlab to allow them to work on macOS 10.11 El Capitan and later. Fixes “only works on Catalina and later” bug when using Matlab. This was a compatibility issue silently introduced multiple Matlab releases ago, due to a mex configuration file format change by Mathworks. It already affected v3.0.17, making the Matlab version of PTB 3.0.17 only work on 10.14 Mojave or later, not on 10.11 and later, as intended. Apparently nobody ever noticed that throughout the 1 year life time of v3.0.17, maybe because nobody updates PTB often enough, or maybe because everybody is on macOS Mojave or later? The former one would be scary, given various fixed macOS issues since 3.0.16.


  • Minor fix for HDR workarounds for AMD graphics on Windows. Setting PsychVulkan override flags 2 as workaround should no longer fail in HDR mode. Instead it should properly switch to the fp16 + scRGB mode as workaround.

Psychtoolbox beta updated


Psychtoolbox 3.0.18 Beta update “Ode to the slacktivists” was released at 13th October 2021. As usual, the complete development history can be found in our GitHub repository. The release tag is “”, with the full tree and commit logs under the URL:


  • Changes in Octave support: Octave 6.3 required on Windows and macOS, Octave 5 or later required for Linux.

  • Only Matlab R2021b supported and tested, going forward.

  • Improved VR support for Linux and Windows, tested on the Oculus Rift CV-1 with touch controllers.

  • 16 bit native (effective 12 bit) framebuffer support for Linux with AMD Polaris and later.

  • Terminated support for Ubuntu 18.04-LTS or any other pre-Ubuntu 20.04 LTS Linux distribution.

  • Multitouch touchscreen support for Windows.

  • Fixes for PsychPortAudio and iMac’s, thanks to new workarounds for Apples broken macOS 11 operating system.

  • Various smaller fixes and improvements.


  • This version was built and lightly tested against Matlab R2021b, and going forward R2021b is the only supported version. Older Matlab releases may or may not continue to work correctly.

  • CreateProceduralSmoothedApertureSineGrating: Improvements and fixes by Ian Andolina: “By default the ‘useAlpha’ option is turned OFF and smoothing uses the background color directly (alpha channel untouched). In this case no change will be seen by this fix. However when ‘useAlpha’ is turned on, the shader should use the edge modifier (Mod)on the alpha channel directly. Previously the fragment shader combined the global and local alpha ((rawAlpha * Mod) + Offset.a) causing an undesired effect (as I originally contributed this it was my bug), and the edge is not smoothed. To fix this we use the Modifier value directly (Offset.a * Mod), which allows the edge to blend properly with the underlying color while leaving the rest unaffected. When the background colour and offset are the same (as is normally the case, e.g. [0.5 0.5 0.5 1]), then useAlpha ON/OFF now looks the same. If the background colour is different to the offset, now with useAlpha=ON the edge properly smooths. I added an optional value = 2 to ‘Method’ which copies what is done in the SmoothedDiscShader.frag (option to invert the smoothing mask). Previously it accepted 0 or 1, and so there will be no change unless you explicitly set this to 2.”

  • Screen: Suppress broken pageflip warning if external display method is in use. Also if the window is not a fullscreen window, as failure is expected then. This checking code only ever executes on Linux + AMD if the user foolishly disables OpenML timing and timestamping, ie. never under normal circumstances, or on macOS with PTB kernel driver loaded on a AMD or Intel gpu. In practice only the macOS + kernel driver case matters, and only for standard OpenGL display backend via CGL.

  • Snd: Update help text a bit, add “permanent” PPA sharing: This is mostly useful if one wants to use Beeper() in parallel to PsychPortAudio(), e.g., for auditory feedback tones during Eyelink calibration.

  • AudioFeedbackLatencyTest: Improve flexibility.
    • Allow specifying input/output audio devices, or separate devices.
    • Auto-detect and handle different number of channels for in/out.
    • Auto-detect and handle different sample frequencies for in/out.
    • Reduce reqlatencyclass to 2, so the driver can auto-select a supported default sampling frequency, and let it choose that, if not explicitely given. This makes it more robust against Windows WASAPI’s endless flaws.
  • FlipTimingWithRTBoxPhotoDiodeTest: Reduce audio volume to 2% to make it less annoying, especially on the MacbookPro 2017 under Linux.

  • Update “help SyncTrouble” for the year 2021. Less outdated now, still not really up to date.

  • Update help OculusVR for the year 2021.

  • VRInputStuffTest: Refine and improve tested functionality, e.g., among others:

    • Haptic pulse feedback support for left/right controllers with low/high frequency rumble.

    • Allow to advance through demo phases with touch-contoller button clicks instead of only keyboard press.

    • Allow teapot movement via thumbsticks on the controllers, ie. left and right, forward and backwards, relative to viewer. Pressing the thumbsticks gives faster movement.

    • Add haptic feedback to teapot animation.

    • Visualize touch controller positions and orientations, and state of the grip and trigger analog buttons.

    • Visualize guardian playbounds / outer bounds under Windows-10 with dual-sensor Rift CV-1.

  • Update help for GStreamer setup: Recommend GStreamer 1.18.5 from now on: 1.18.2 has sometimes stability issues on macOS, at least with 10.15.7 and Matlab R2021b or Octave 6.3, although Matlab seems to be more fragile, as usual. Note: While 1.18.5 on Windows-10 21H1 with R2021b or Octave 6.3 shows no problems in movie playback/writing, and video capture/recording, with or without sound, on macOS we see that movie playback, movie writing with/without sound and videocapture works fine, but videorecording is broken for unknown reasons – no known workaround. At least this is true on macOS 10.15.7 on a MBP 2017, using its internal FaceTime HD webcam. Go figure…

  • MeasureLuminancePrecision: Refine / cleanup further: Remove pointless wigglePixelNotCLUT and useDithering, as both are either not needed anymore (dithering is handled by Screen() automatically), or ineffective - gamma tables are often now PWL, so this way of defining luminance won’t work on modern gpu’s.

  • PsychImaging: Improve help texts wrt. 10 bit support. Still not quite up to date, but less wrong/outdated. I should revisit all that’s changed, now that we can assume Ubuntu 20.04, Linux 5.4, Mesa 20.x, X-Server 1.20, but i don’t have the time because time is money and money is scarce, so time is scarce.

  • PsychImaging: Update help text for ‘EnableNative16BitFloatingPointFramebuffer’, so it aligns with reality as of October 2021.

  • Some badly documented minor improvments by the Brainard lab, regarding some color conversion or simulation code, who knows?


  • Terminate support for all Linux distributions older than Ubuntu 20.04-LTS or equivalent. Distributions need at least X-Server 1.20, Linux 5.4, and generally the software versions of components of at least as recent as Ubuntu 20.04-LTS. Also the C runtime library must be at least of version glibc v2.31.

  • Terminate support for Octave 4 and earlier. 64-Bit Octave 5 is now the minimal required Octave version. Older versions likely won’t work anymore with Psychtoolbox

  • PsychImaging: Rewrite ‘EnableNative16BitFramebuffer’ support. My patches for 16 bpc framebuffer support for all AMD gpu’s since Sea Islands (DCE-8) are part of the Linux 5.14 mainline kernel, and my patches for 16 bpc support have also been integrated into the AMDVLK development branch for AMD’s open-source Vulkan driver. This driver, likely in its next release, will support 16 bpc framebuffers on AMD Polaris (DCE-11.2) and later, if running under Linux 5.14 or later.

    Sadly Linux 5.14 won’t ship with Ubuntu 21.10, a near miss. They are only going for Linux 5.13. But installing Linux 5.14 is easy enough.

    This commit switches PsychImaging() to only expose 16 bpc framebuffers on such Linux + X11 + AMD Polaris+ + amdvlk + Linux 5.14 systems, but then at much better reliability and performance than our old dead code.

    It allows to get up to 12 bpc per color-channel color output, ie. 4096 intensity levels for red, green, blue, grayscale/luminance and a total of 64 billion shades of color, either on suitable 12 bpc capable high-end displays, or via spatial dithering by the gpu on the more common 10 bpc capable displays or even - at a lower quality - standard 8 bpc capable displays.

    This makes Linux the first operating system to my knowledge to support this color precision on out of the box on commodity graphics hardware and displays, natively at full performance without any compromise in timing precision or reliability.

    Basic testing has been performed with a CRS ColorCal-2 on a HDR-10 10 bpc capable monitor and on a MacBookPro 2017 Retina display under Linux, with AMD RavenRidge and Polaris.

  • PsychOpenHMDVR driver for driving VR headsets other than the Oculus Rift DK1/DK2. Many improvements:
    • Add proper state.status signalling for status of positional HMD / touch controller tracking.
    • Add version check and reporting.
    • Fixup ipd handling, make consistent with OpenHMD behaviour.
    • Add input device support: The new subfunction ‘GetInputState’ now reports digital and analog button state of controllers. ‘GetTrackingState’ now reports 6-DoF tracking state for supported VR controllers. This has been successfully tested with a Oculus Rift CV1 + up to two tracking sensors, and two Oculus touch controllers. Behaviour is almost identical to the Windows driver, except that capacitive “touch buttons” and derived hand gestures are not reported. The code should handle other than Oculus VR devices reasonably well, e.g., NOLO, GearVR, Android Daydream, WMR, Vive, Deepon, etc. As of OpenHMD 0.3, only Oculus Rift CV1 and S, as well as NOLO touch controllers, do support 6 DoF tracking with up to two touch controllers or equivalents. Other devices only support some input buttons, thumb-sticks, or orientation tracking. The code has not been tested with other than Oculus Rift CV1 + touch controllers, due to lack of hardware.
    • Some of the VR improvements will need manual installation of an experimental libopenhmd version from our own Misc repository at GitHub, as needed improvements are not yet part of the officiall libopenhmd 0.3 releases contained in Ubuntu 20.04-LTS and later. This is especially true for HMD positional tracking and touch controller tracking for the Oculus Rift CV-1 and Oculus Rift-S. Download location is:
  • VRRTest: Refine diagnostics a bit.

  • PsychPortAudio: Work around broken timing if pulseaudio is used for output: By default we do not allow use of Pulseaudio in parallel to PPA operation at all, because this way (Pulseaudio server force-suspend) we get exclusive access to the sound hardware for best possible timing. But if the ‘EngineTunables’ override is used to allow to keep Pulseaudio running in parallel to our operation, things are different. If Pulseaudio is idle for our target sound device, everything is the same. But if it is active, we may get redirected in our choice of default sound card to the ALSA ‘default’ or ‘pulse’ device, which both map to the ALSA Pulseaudio plugin. That plugin allows parallel sound i/o with PulseAudio, arbitrated and mixed by PulseAudio. The problem is that the plugin does not return any audio timestamps - all timestamps are constant zero! So far we simply returned bogus timestamps and screwed up totally if timed audio onset/offset/scheduling was requested. We can do a bit better: If we detect all-zero timestamps from Pulseaudio, we replace them by current system time aka GetSecs time. This gives somewhat wrong/inaccurate but at least consistent timestamps and allows our client code to run with an accuracy that is at least good enough for basic auditory feedback, instead of going bong-shit. This is all consistent with the QoS promised in PPA ‘Open’ for ‘reqlatencyclass’ == 0, e.g., as used by simple demos like BasicSoundOutputDemo.m or the Snd() and Beeper() functions. If user code requested reqlatencyclass > 0, ie. low latency, high timing precision, then we print a warning each time PsychPortAudio(‘Stop’) is called if timing and timestamping was broken during a auditory stimulation run, so there aren’t any surprises or sad faces in the end.

  • PsychPortAudio: Extend half-duplex capture workaround to Portaudio v19.7.0: Portaudio v19.7.0 has the same bug as 19.6, because i never got around to write and submit an upstream fix. This becomes relevant now, because Matlab R2021b ships its own override Portaudio library v19.7 for Linux, with the bug present, but our hack to workaround the bug was limited to 19.6.0 and earlier. Extend the workaround to 19.7.0 and earlier. This fixes R2021b in half-duplex capture mode, ie. timestamping of captured audio is fine again.

  • PsychVulkan: Make Vulkan display backend work more robust with NVidia’s proprietary display drivers. This should now work reasonably ok on single-display per X-Screen setups, as tested by Celia Foster.

  • GetMouseWheel: Adapt to X11 libinput driver.

  • PsychHID: Allow optional use of masterPointer for touch input.

  • XOrgConfCreator: Update for PTB 3.0.18 and future X-Server 21.1 and later: The modesetting-ddx of X-Servers after 1.20 does support setup of Variable refresh rate VRR, and the use of modern GAMMA_LUT’s if the Linux kernel supports them. This allows use of modesetting-ddx in a VRR scenario, but also on Intel gpu’s with a color depth of more than 8 bpc, where Intel-kms needs use of the GAMMA_LUT instead of the legacy lut, which could only do 256 slots of 8 bpc width.

    Also update specs wrt. color depth and VRR and Intel / AMD gpu’s.

    Also try to retain modesetting-ddx as driver choide if user does not request otherwise and no forcing circumstances force a different choice and the modesetting-ddx is already in use.

  • VideoMSPro6CamCaptureDemo.m: Delete it, no longer needed. Since the Linux 5.13-surface kernel and the latest libcamera-git from September 2021, our standard video capture demos work just fine on the Microsoft Surface Pro 6, no special treatment needed anymore.

  • CMUBox: Make OpenSerialPort lenient. Some USB-Serial converters may fail to respond to low-latency setup requests. Make this non-fatal.

  • GameMode: Fine tune gamemode.ini and help “LinuxGameMode”, for better Intel iGPU tuning, and removed support or pre-Ubuntu 20.04-LTS.

  • Update deepcolor.conf file: GNOME-Shell can deal with 10 bpc just fine now. GNOME shell for Ubuntu 20.04-LTS and later can deal with depth 30 / 10 bpc framebuffers without problems, so no longer suppress 10 bpc visuals for the shell.

  • help VRRSupport: Update for Ubuntu 20.04-LTS.

  • LoadIdentityClut: Fixes for Linux with NVidia hardware.


  • Terminate support for Octave 6.2 and earlier. 64-Bit Octave 6.3 is now the minimal required Octave version. Older versions won’t work anymore with Psychtoolbox

  • Add basic multitouch touchscreen support. Development of this feature was paid in the end by Mathworks (

    This implementation is more limited than the touchscreen support that we have on Linux since 4 years, but it should do for at least simple use cases with one touchscreen, e.g., on Windows tablets, without affecting visual stimulation timing. Of course, many Windows tablets use Intel integrated graphics chips, and those often have drivers with broken timing, so this may not help as much, e.g., the Microsoft Surface Pro 6. But at least testing on a desktop machine with AMD onboard graphics and NVidia discrete gpu showed that this touchscreen implementation does not make visual stimulation timing reliability worse than it sometimes is on Windows-10. MultiTouchMinimalDemo.m and MultiTouchDemo.m demonstrate this, just as they do on Linux. Tested on Windows-10 May 2019 edition, October 2020 edition, 20H2 edition, and the 21H1 edition which is the most recent Windows-10 version as of 3rd October 2021. Tested hardware: Microsoft Surface Pro 6 with internal touchscreen, and also with RaspberryPi touchscreen attached as secondary screen. This is probably as good as it will ever get on MS-Windows.

  • PsychOculusVR1: Bug fixes and improvements for Oculus Rift CV1+ support, e.g.:
    • Fix haptic feedback for duration < 2.5 seconds.
    • Make haptic feedback work better in general, more reliable.
    • Avoid annoying white flashing at the end of sessions with recent Oculus runtimes.
  • Upgrade portaudio_x64.dll for 64-Bit Windows to Portaudio v 19.7-devel from latest upstream git: This new Portaudio version supposedly brings some improvements to Windows audio support, so far the theory. In practice I don’t have the time now to test this carefully, because time is money and money is scarce, neither do I have the equipment available atm. So “practice in the field” will show if theory translates to practice. At least no obvious regressions were spotted.

  • PsychStartup: Fix wrong drive letters for GStreamer path setup if the fallback path for broken Windows setup is triggered and GStreamer is installed on a different drive than the default C drive. Bug was introduced in the initial 3.0.17 release. Reported by Andreas Sprenger, thanks!


  • Terminate support for Octave 6.2 and earlier. 64-Bit Octave 6.3 is now the minimal required Octave version. Older versions won’t work anymore with Psychtoolbox Tested with Octave from HomeBrew, as usual.

  • Screen: Enable PsychtoolboxKernelDriver on Intel graphics by default. Instead of being disabled by default (opt-in), we now enable by default (opt-out), unless a user-provided setenv(‘PSYCH_DISALLOW_DANGEROUS’, ‘1’); setting will disable it. We never received any reports of trouble with this, neither did i ever encounter it. So lets optimistically assume the problem is not one in practice. Maybe it helps users to have less broken Intel graphics timing, or to get an assessment of how broken - or not - it is on macOS. I don’t expect Apple to ever release new machines with Intel integrated graphics, so maybe we get lucky with the existing set of Intel gpu’s.

  • Screen: Try to fix our display timing fixes on macOS 11 + iMac. The iToys company introduced new brokeness for iMac computers under macOS 11, which apparently prevents iMac Retina panels from running under native resolution, despite our code requesting that since over a decade. Ian Andolina reported this problem under macOS 11 with a 2015 iMac Retina, so lets deal with this issues via special case handling, using a lookup table which encodes proper settings for all known iMac models. Currently our lut only contains the panel sizes and resolutions of the display panels used in Intel-based iMac computers, but all of this stuff won’t matter on M1 ARM Macs anyway - it is all unfixably dead for models with Appple Silicon.

  • Update Vulkan related help texts for macOS wrt. minimum MoltenVK requirements and download links to the required 3rd party runtime. macOS 11 is just as broken as macOS 10.15 wrt. to timing under macOS Metal, according to Ian Andolina’s testing on an Retina iMac 2015 with Intel graphics on macOS 11.5 Big Sur. The status on macOS 12 and on Apple M1 SoC’s remains unknown.

  • MacDisplaySettings: Make it also compatible with 10.15 Catalina and macOS 11.6. By Denis Pelli, contributed “as is”, untested and unsupported by us.

  • Upgrade PsychPortAudio for 64-Bit macOS to use of Portaudio library v19.7-devel: This new Portaudio version supposedly brings many improvements to macOS audio support, trying to fix various things that Apple broke over the years. Especially for the macOS 11 trainwreck. So far the theory. In practice i don’t have the time now to test this carefully, neither do i have the equipment available atm. So practice will show if theory translates to practice. One thing that seems to work better is the OS actually respecting the volume settings, although that could be also just an auditory placebo.


Psychtoolbox beta updated


Psychtoolbox 3.0.17 Beta update “Hope to the hopeless” was released at 10th May 2021. As usual, the complete development history can be found in our GitHub repository. The release tag is “”, with the full tree and commit logs under the URL:

This release is another tribute to Apples low quality operating systems, this time dealing with the nightmare that is macOS Catalina and later security UX workflow. We can’t fix that abomination, but we can give users a bit of more hand-holding if they made the unfortunate decision to install Catalina, or - even worse, so much worse! - Big Sur.


  • DrawFormattedText2(): Fix handling of UTF-8 unicode for Octave 6, contributed by Github user @qx1147.
  • Help text improvements - spelling fixes for some PsychMunsell color conversion routines - by Danny Garside.
  • Some internal minor improvements.


  • Fix FlushEvents() and ListenChar() and GetCharTest for use with Octave cli on OSX, similar to the fixes of CharAvail() and GetChar() from PTB
  • Improve diagnostics and add troubleshooting help of PsychHID for the latest Apple macOS 10.15 and 11 screwups. PsychHID now detects at startup if Apples broken security workflow blocks use of HID “Input Monitoring” - which makes PsychHID unusable. If so, it reports it to the user, provides troubleshooting guidance, and shuts down. A better error handling behavior than just random mysterious failure to enumerate input devices, failure to create KbQueues or to detect keyboard input in KbCheck et al. Unfortunately we can’t auto-fix macOS brokeness, just hopefully give users a hand in navigating this byzantine labyrinth of broken UX, brought to you by Apple.


  • Mex files for 64-Bit Octave rebuilt: Now we support/recommend Octave-6.2, although Octave 6.1 should continue to work.


Psychtoolbox beta updated


Psychtoolbox 3.0.17 Beta update “No Metal to the pedal!” was released at 20th April 2021. As usual, the complete development history can be found in our GitHub repository. The release tag is “”, with the full tree and commit logs under the URL:

Highlights: Experimental Vulkan/Metal display backend support for macOS (mostly a failed experiment though), Octave 6 fixes for macOS, AMD Vega DCE-12 support for Linux, and various smaller improvments and bug fixes.


  • MeasureLuminancePrecision now works with all photometers supported by PTB, not only with ColorCal2. ColorCal2 is the default choice if no photometer type is specified.
  • Octave 6.2 on Windows and macOS is now no longer warned against, as light testing suggests it works.
  • Various minor fixes and improvements.
  • Help text and documentation improvements.


  • AMD Vega / DCE-12 low-level support for Linux, so now it is actually finally verified to be working, as tested with a Datapixx3 wrt. identity pixel passthrough and timestamping.
  • Fixes to LoadIdentityClut AMD fallback path.
  • Fixes to SetMouse in windowed mode (ie. non-fullscreen windows).
  • Fixes to GraphicsDisplaySyncAcrossDualHeadsLinux() - added a bug in the last release.
  • PsychLinuxConfiguration now also calls AssertOpenGL to allow builtin libdc1394 compatibility fixups for Ubuntu 20.10+ for Screen when installing matlab-psychtoolbox-3 from NeuroDebian.
  • Some improvements ot the RaspberryPi build process.


  • Basic, highly experimental, highly deficient / unreliable / low performance, and therefore not supported in case of problems Vulkan (== Metal) display backend support for macOS. This requires at least macOS 10.15.4 and installation of the 3rd party Khronos MoltenVK open-source Vulkan icd driver and Vulkan runtime. MoltenVK implements the Vulkan portability subset on top of the proprietary Apple macOS Metal graphics api. It allows to now also use our Vulkan display backend on macOS for the really desperate and masochistic. Effectively this is a Metal display backend, which was intended to be a replacement for cases where the standard OpenGL backend doesn’t work well. As a by-product, it provides basic HDR support on macOS, on machines where this is supported - utilizing Metal EDR functionality to implement Apples peculiar opinion about HDR. The HDR support is way more limited in performance, reliability, accuracy and flexibility compared to Windows-10 and even more limited compared to Linux, but may be of some use for people desperately clinging to the iToys. Unfortunately, at least as testing on macOS 10.15.7 with both AMD and Intel graphics on a MacBookPro 2017 went, Apple Metal is even more broken and unreliable wrt. visual stimulus onset timing and timestamping than OpenGL! After spending over 160 hours of work, trying to beat this thing into submission, i conclude this to be mostly a failure, due to bugs in Apples proprietary Metal api, only fixable by Apple, with all workarounds on our side exhausted. But who knows, maybe it will work better on macOS 11? I can’t test macOS 11 at the moment due to unrelated showstopper bugs in macOS 11 which would make installing macOS 11 on my test machine too high a risk of bricking the machine. This experimental Vulkan/Metal display backend work was sponsored by Mathworks.

  • Fixes for Octave 6 on macOS 10.15, so the octave GUI no longer hangs infinitely at exit if Screen() was used in a session. The workaround we had to invent for severe Apple macOS 10.11 logger bugs, started to work against us at some point, causing problems instead of fixing them. Apparently either macOS was fixed at some point, or Octave got a workaround for Apple macOS bugs. Anyway, now it seems that Octave 6.2 when launched in octave --gui mode now works ok, at least as tested under macOS 10.15.7 Catalina final. We keep the workaround active for macOS 10.13 and earlier, as we don’t know when it turned from helping into hurting.

  • Fixes for GetChar / CharAvail on macOS, when used with Octave or Matlab in command line (non-gui) mode. ListenChar works with Octave in gui mode, and Matlab in gui and commandline mode, but is still a big troublemaker for Octave in commandline mode under macOS, so now running octave --gui is recommended as the only way for ListenChar to work.
  • Octave mex files on macOS rebuilt against Octave 6.2 from HomeBrew.


  • Robustness improvements by Diederick to GetGITPath and GetGITInfo for Windows.


Psychtoolbox beta updated


Psychtoolbox 3.0.17 Beta update “Let them eat cake!” SP2 was released at 19th February 2021. As usual, the complete development history can be found in our GitHub repository. The release tag is “”, with the full tree and commit logs under the URL:

A minor PTB beta update, mostly featuring small bug fixes, doc updates and refinements.


  • Add Denis Pelli’s MeasureLuminancePrecision.m as baseline to PsychAlpha/ . The script is already useful as it is, and received quite a bit of cleanup by myself wrt. Denis original. However, currently it is needlessly restricted to use of the ColorCal-II, and needs more refinement. We add it to the PsychAlpha alpha-quality folder for the time being, so it can have some use while it gets refined over time.

  • PsychtoolboxPostInstallRoutine(): Improve diagnostics slightly for textrenderer setup failures on MS-Windows or macOS.

  • Many minor fixes to demos and tests for Matlab R2020b compatibility. Various cleanups. Also many old and obsolete tests and demos deleted, which don’t have much use anymore in the year 2021. This cleanup and R2020b compatibiity work was sponsored by Mathworks.


  • Fix MacModelName() for macOS Catalina. By Denis Pelli and Darshan Thapa.
  • DriftTexturePrecisionTest: Make compatible with macOS Retina displays.


  • Minor help text updates in SetResolution() and Screen(‘Resolution’) wrt. multi-display setups.

Psychtoolbox beta updated


Psychtoolbox 3.0.17 Beta update “Let them eat cake!” SP1 was released at 8th February 2021. As usual, the complete development history can be found in our GitHub repository. The release tag is “”, with the full tree and commit logs under the URL:

A minor PTB beta update, mostly featuring small bug fixes, doc updates and refinements. And a new start screen.


  • PsychRTBox: Robustness fix during box open. Sometimes the first query for the box id data delivers partial trash for unknown reasons. If that’s the case, requery.
  • BasicSoundInputDemo: Add missing setup for unified KbName. Otherwise the ESCAPE key is not recognized for mapping on Windows and we get error abort.
  • Update our Welcome splash to Celia’s latest and more eye-catching artwork.


  • KbCheck: Add workaround for missing ESCape key on touchbar MacBook Pro’s without functioning touchbar. Map ~ key left to 1 key also to ESCAPE. Mostly for testing with Linux development kernels which do not yet have the Apple touchbar dkms drivers updated for use with them.
  • XOrgConfCreator: Use of intel-ddx implies DRI3/Present from now on. This is needed, because the intel-ddx does not choose the modern iris OpenGL driver on modern Intel chips, but still old-school i965 classic DRI driver, which is a mismatch to the desktop GUI and other clients choosing iris in such a scenario. Switching DRI3 on will make this a non-issue. Or in other words: No login failure when enabling color depth 30 bit / 10 bpc color precision mode on modern Intel graphics chips of Gen 8 and later on modern Linux distributions.
  • MultiTouchMinimalDemo / MultiTouchDemo: Add a small potential performance optimization.
  • “help RaspberryPiSetup”: Update to account for Raspbian bug fix.


  • Screen/Windows: Add new visual diagnostic for DWM compositor interference. If Screen(‘Preference’, ‘VisualDebugLevel’, 6) is set and we run on Windows-8 or later, and a fullscreen window is opened - which shouldn’t be subject to DWM composition - then create the onscreen window with DWM redirection surface disabled. This will cause any DWM composited windows client area to not display at all, but instead just show transparent. This is a clear visual indicator that a window is subject to unwanted DWM composition, iow. if the DWM is the root cause for visual timing and timestamping problems.

Psychtoolbox beta updated


Psychtoolbox 3.0.17 Beta update “Let them eat cake!” was released at 23rd January 2021. As usual, the complete development history can be found in our GitHub repository. The release tag is “”, with the full tree and commit logs under the URL:

The most noteworthy improvement about the minor “Let them eat cake!” beta update is initial support for the RaspberryPi 4 and RaspberryPi 400, two quite nifty microcomputers.

A minor PTB beta update, mostly featuring christmas work:

All systems:

  • OffsetRect(): Allow single rect as both row and column vector, instead of only as row vector.
  • Some stuff by David Brainard in ComputePhotoPigmentBleaching(), described as “Implement bleaching kinects calculation”.


  • Add support for the RaspberryPi 4 and 400 on 32-Bit Raspbian/RaspberryPi OS: Also some setup instructions and feature descriptions in the new help file “help RaspberryPiSetup”. The new Pi is in quite good shape, only sound output with PsychPortAudio over HDMI video output does not currently work, but that can be worked around, via the builtin soundchip and headphone jack, or - in the case of the RaspberryPi 400 without headphone jack - by plugging an external USB soundcard. The RPi 4 sports faster processor and graphics, more RAM, dual-display output, well working Wifi, and substantially improved graphics support, e.g., for high precision floating point textures and framebuffers, advanced shaders, and hardware accelerated video playback for some formats like H264.

Psychtoolbox beta updated


Psychtoolbox 3.0.17 Beta update “Dynamically High!” SP6 was released at 19th December 2020. As usual, the complete development history can be found in our GitHub repository. The release tag is “”, with the full tree and commit logs under the URL:

:christmas_tree: Ho Ho Ho! :christmas_tree:

The most noteworthy improvements about “Dynamically High!” are that it contains initial support for “High Dynamic Range” displays for visual stimulation (HDR) on Linux and Windows-10, sponsored by VESA (Read the press release by clicking this link), and a new installer and updater for use with Matlab, sponsored by Mathworks, which should hopefully especially help the less fortunate - people who are forced to use Apple macOS. This is also the first release supported under our new business model, and the first release built and at least somewhat tested under macOS Catalina 10.15.7 final.

SP6 is a release with bug fixes, workarounds for Apples broken macOS Catalina operating system, and smaller incremental improvements. See the previous release announcements for the 3.0.17 series for the major features.

The most interesting improvement in SP6 is basic support for stereo HDR stimulation on dual HDR display monitor setups under Linux.

All systems

  • Fixes and improvements to the Python support, contributed by Alex Forrence (GitHub users @aforren1) - Thanks!
    • DLL runtime libraries misplaced on Windows after package restructuring.
    • NumPy now gets installed automatically in a suitable version, as it was added as dependency.
  • More code cleanup and deletion of obsolete/long dead and unused code and functionality.

  • All Octave mex files will now be stripped of the most verbose debug symbols. This drastically reduces the size of many Octave mex files, so this Psychtoolbox should shrink considerably in download size / disk space despite new functionality. Some other big binaries related to the no longer supported Ubuntu 14.04/16.04 LTS were deleted for further space savings.

  • Quite many Docs and help text updates.

  • Various minor improvements to HDR support on Linux and Windows:
    • SimpleHDRDemo: Hide distracting mouse cursor.
    • ImagingStereoMoviePlayer: Fix text drawing and add basic HDR stereo movie playback support.
    • PerceptualVBLSynctest: Add another way to visually check for dual-display video refresh sync, e.g., for stereo setups.
    • HDRViewer: Fix initial mouse cursor positioning on multi-display HDR setups.
  • Performance enhancements to drawing of our startup Welcome Screen. The logo can now also be automatically scaled down when running on low-resolution displays.


  • Make PsychHID on Linux robust against touchscreens that claim to be keyboards on the MS Surface Pro 6 tablet (ipts touchscreen!). GetKeyboardIndices() will no longer enumerate such touch screens as dysfunctional keyboards. PsychHID will reject similar weird devices in the future, even if they don’t get filtered out by GetKeyboardIndices() iow. future proofing.

  • Have special format handling for Video4Linux2 devices which provide video in MJPEG format.

  • Fix rejection of AMD DCN-2 / Navi gpu family gpu’s for low-level mmio access.

  • Rebuilt the drawtext plugin for 32-Bit ARMv7l architecture, ie. the RaspberryPi, to add so far missing support for underlined text drawing.

  • XOrgConfSelector: Recommand CTRL+ALT+F3 instead of CTRL+ALT+F1 in case of display server startup failure, as Ubuntu 20.04-LTS uses the VT1 (F1) for the login manager / lock screen, so VT3 (F3) is a better choice for a text console if troubleshooting is needed.

  • XOrgConfCreator: Provide improved setup instructions for 10 bpc / depth 30 deep color support: Update to cover the fact that AMD Navi+, Raven Ridge+ and other 2018+ gpu’s with DCN display engine are no longer supported by our low-level MMIO hacks for 10 bpc+ framebuffer precision, but instead the standard xorg.conf depth 30 setup should be used to the same effect with higher performance, just as on Intel and NVidia graphics cards. The low-level hacks could be implemented on more modern gpu’s but there isn’t any practical need or benefit for that anymore, at least not as of PTB 3.0.17.

  • PsychVulkan now supports improved visual stimulus onset timing and timestamping via Vulkan driver native support on suitable drivers. This makes use of the VK_GOOGLE_DISPLAY_TIMING extension when available.

  • PsychVulkan can now also optimally work with Intel graphics chips on Linux, as has been tested with a prototype Mesa branch for OpenGL+Vulkan interop. This is not yet available as part of standard Linux distributions, but when they are ready, we are ready! Vulkan is not yet supported in a usable way for us on MS-Windows.

  • Add new experimental PsychImaging task for HDR: PsychImaging('AddTask', 'General', 'UseStaticHDRHack'); enables use of a new hack that only works on Linux with classic X11 X-Display X-Server, not on Linux+Wayland and not on other operating systems. This allows dual-display stereo presentation of HDR-10 stimuli, ie. with stereomode 4 or 5 “Dual display stereo”, also single-display or multi-display use of this mode, e.g., for frame-sequential stereo presentation of HDR stimuli, or “display wall” multi-HDR-monitor setups. Normally our HDR display support is currently restricted to one HDR monitor per onscreen window, no multi-monitor HDR stereo setups. This hacks makes this work in a limited fashion, as described in the PsychImaging help.

    • A new SimpleHDRLinuxStereoDemo.m shows stereoscopic HDR stimulus display on a dual-HDR-monitor setup.
    • ImagingStereoMoviePlayer shows stereoscopic HDR movie playback as a new optional playback mode.
    • For performance benchmarking of HDR playback, the option to select this hack was also added to PlayMoviesDemo.


  • Special case handling for Microsoft Surface tablet’s builtin video cameras.

  • Support new mfvideosrc “Multimedia Foundation” capture plugin.

  • Minor video capture improvement: Use device monitors / device providers.


  • SetupPsychtoolbox: Handle latest Apple macOS Catalina+ brain-damage. Apples Catalina trainwreck needs special treatment. If Psychtoolbox has been downloaded via a webbrowser as a zip file or tgz file and then extracted, then all binary executable files like .dylib’s and .mexmaci64 mex files will have the attribute set to prevent them from working in any meaningfully user fixable way - Thanks Apple! Use the xattr command to remove the quarantine flag.

  • Delete memcpuCudaOpenGL for macOS. It’s dead since Apple decided to drop support for NVidia gpu’s - and thereby CUDA - from their “Most advanced operating system in the world”.

  • PsychtoolboxPostInstallRounte: Deal with another Apple macOS Catalina SDK screwup: Since we are now building Screen() for macOS against 10.15 Catalina with the Catalina SDK we hit a new bug in Apples low-quality software. Apparently when built against the Catalina SDK, but running on older macOS versions than Catalina, then OpenGL rendering into a hidden window (via Preference ‘WindowShieldingLevel’ -1) is broken and triggers GL_INVALID_FRAMEBUFFER_OPERATION_EXT errors. The same works perfectly fine - as expected and tested before release - on Catalina itself. This caused error abort in the fontconfig cache rebuilt code which opens a hidden onscreen window when run under < Catalina. The bug is known to happen at least on 10.14 Mojave, 10.13 High Sierra, and 10.12 Sierra, so probably going back through all older macOS versions. Work around it by suppressing OpenGL error checking during this OpenWindow sequence, as we do not actually need rendering to work here. Work time spent to diagnose and workaround this bug which is again like almost all macOS issues fully Apples fault: 5 hours. Thanks Apple!

  • Note in help GStreamer that movie playback and high quality text rendering on macOS now also needs GStreamer 1.18 at a minimum, 1.18.2 is recommended.

  • Refine reporting of OS support status in Screen() startup and Screen(‘Computer’): Report everything before Catalina as untested and unsupported. Report everything beyond Catalina, ie. macOS 11+, as not yet tested or supported. As of now, i very rarely and infrequently spot-check stuff on my old 10.13.6 High Sierra system under some Matlab version. Given 10.13’s end of life and age of that machine, this won’t happen often anymore. Also testing Octave 6.1 on 10.13 is just too painful going forward, now that HomeBrew no longer provides Octave bottles for 10.13 and source build just takes way too long – like a dozen hours!

Psychtoolbox beta updated


Psychtoolbox 3.0.17 Beta update “Dynamically High!” SP5 was released at 6th December 2020. As usual, the complete development history can be found in our GitHub repository. The release tag is “”, with the full tree and commit logs under the URL:

The most noteworthy improvements about the original “Dynamically High!” relesae are that it contains initial support for “High Dynamic Range” displays for visual stimulation (HDR) on Linux and Windows-10, sponsored by VESA (Read the press release by clicking this link), and a new installer and updater for use with Matlab, sponsored by Mathworks, which should hopefully especially help the less fortunate - people who are forced to use Apple macOS. This is also the first release supported under our new business model, and the first release built and at least somewhat tested under macOS Catalina 10.15.7 final.

What’s new in the Santa Claus update?

SP5 is mostly a release with bug fixes and smaller incremental improvements on top of that. See previous release announcements for the 3.0.17 series for the major features.

The major change is cancellation of support for Octave versions other than Octave 6.1 on Microsoft Windows and Apple macOS. If you use Octave on these systems, you must upgrade your Octave to the new version 6.1. macOS users of HomeBrew can do a brew update and brew upgrade to achieve this, followed by launching octave and running cd(PsychtoolboxRoot); SetupPsychtoolbox; Ditto for Windows users, after downloading and running the new installer from Octave’s website.

All systems

  • Lots of code cleanup and deletion of obsolete/long dead and unused code and functionality.

  • Octave mex files will now be stripped of the most verbose debug symbols. This drastically reduces the size of many Octave mex files, so this Psychtoolbox should shrink considerably in download size / disk space despite new functionality.

  • Convert EyelinkToolbox demo images from BMP to space saving JPEG for lower disc space consumption.

  • Docs and help text updates.

  • Make Postinstall routine more robust against fontconfig cache rebuild failures.

  • SimpleHDRDemo: No longer use .hdr demo image file from Matlab image processing toolbox. We don’t want to require an extra toolbox just for a sample image, when we ship our own set of free images!

  • PsychDataPixx(‘Verbosity’, 7) now allows logging of all actual calls to the Datapixx mex file for enhanced debugging of issues with VPixx hardware.

  • Add PsychContributed/Eduloggers: Simple Edulogger support. Contributed by Todd Parsons (@TEParsons) under MIT license, thanks! This is unmaintained and untested code, as it was partially rewritten to reach the minimal quality standard of PTB by Mario Kleiner, but could not be tested after the rewrite due to lack of Edulogger hardware. Hence the location in the PsychContributed folder for the time being, instead of proper placement in the PsychHardware folder.

  • Support the brand new GNU/Octave 6.1 on Windows, macOS, and future Linux distribution releases via NeuroDebian and upstream distribution Octave and Psychtoolbox packages. Cancel support for Octave 5 on Windows and macOS. Octave 6 has various improvements relevant to us, e.g.,:
    • Improved GUI, editor etc.
    • HiDPI per monitor scaling on Windows-10, which makes the UI nicer on HiDPI/Retina displays and should allow visual stimulation timing being less affected on mixed DPI setups under Windows (untested, that is the theory).
    • Supports the webread()/webwrite() family of functions for RESTful api’s. This allows, e.g., to now support Eduloggers under Octave.
    • Supports handles to nested functions. This allows, e.g., the following improvements to various fitting functions in Psychtoolbox.
  • Octave 6.1 and later now supports function handles to nested functions, and its ‘optim’ optimization toolbox supports fmincon() and some other non-linear optimization functions. This enables us to support some parts under Octave 6 which were so far not functional: Various new monitor calibration / gamma fitting routines used / supported by FitGamma(), Some psychometric fitting procedures like, e.g., FitCumNormYN() and FitWeibXXX Weibull function based fitting functions, as well as FitNakaRushton(). Additionally LjgToXYZFun() for color space conversions and FitConeFundamentalsWithNomogram(). Basically all functions that would utilize the Matlab optimization toolbox’s fmincon() and fminunc() solvers.


  • Make PsychHID on Linux robust against touchscreens that claim to be keyboards on the MS Surface Pro 6 tablet (ipts touchscreen!). GetKeyboardIndices() will no longer enumerate such touch screens as dysfunctional keyboards.

  • Fix PsychtoolboxVersion() for NeuroDebian installations.

  • MultiTouchDemo and MultiTouchMinimalDemo allow selection of target touchscreen to display on. Suggested by @iandol.

For Octave 5 on Ubuntu 20.04-LTS and similar modern Linux distros only so far:

These features will be provided in a later update for Ubuntu 18.04-LTS and Octave 3.8/4.0/4.2 and for Matlab.

  • Have special format handling for Video4Linux2 devices which provide video in MJPEG format.

  • Fix rejection of AMD DCN-2 / Navi gpu family gpu’s for low-level mmio access.


  • Switch required and supported Octave version from Octave 5.x to the brand-new Octave 6.1.

  • Special case handling for Microsoft Surface tablet’s builtin video cameras. Only on Octave 6.1, Matlab to follow later.

  • Support new mfvideosrc “Multimedia Foundation” capture plugin. Only on Octave 6.1, Matlab to follow later.

  • Minor video capture improvement: Use device monitors / device providers. Only on Octave 6.1, Matlab to follow later.


  • Switch required and supported Octave version from Octave 5.x to the brand-new Octave 6.1.

  • Minor video capture improvement: Use device monitors / device providers.

Psychtoolbox now offers priority support, community membership and more!


Have you got some leftover funds in your lab’s budget and wonder how to spend them before Christmas? Wonder no longer, we can help!

As many of you know, for over 15 years Psychtoolbox for Matlab and the free GNU/Octave has been primarily developed by Mario Kleiner, with almost no support for his efforts. Over this time, not only Psychtoolbox’s popularity and functionality, but also the required workload, has greatly increased, requiring his full time commitment.

Given the urgency of this issue, some years ago an event was held at VSS to discuss how to improve the sustainability of Psychtoolbox, focusing especially on the financial situation. Additionally a user survey was conducted during the years 2016 to 2018, asking labs about their willingness to financially support Psychtoolbox development. Out of 1270 responses of individual labs, 417 labs (~33% of all responses) stated they would certainly contribute financially if invoices could be provided [1]. That was very encouraging and we have now made this possible!

Since 2018, Psychtoolbox and Mario Kleiner have found a new home in Medical Innovations Incubator GmbH, which supports early-stage companies in the area of life sciences with know-how and methods. Since then, Mario and the incubator have together developed a concept for commercial support and services which will allow Mario to continue Psychtoolbox development.

Here we would like to introduce the outcome of this work with our companion website, , detailing the options available for labs, companies and individuals to support the Psychtoolbox project.

In particular, we want to point labs to the ability to purchase a yearly membership for paid priority support. At a modest price of 150 Euros per year (+ VAT), this provides labs with fast expert advice and help for questions and problems related to Psychtoolbox and its surrounding ecosystem, in addition to supporting the future maintenance and development of Psychtoolbox and the software it depends upon. E.g., Mario also improves the open-source Linux operating system to make it even more suitable for experiments requiring high precision, performance, flexibility and robustness. He also develops workarounds for bugs in proprietary operating systems like Apple macOS and MS-Windows. All of this work additionally benefits other neuroscience toolkits, especially ones which use parts of Psychtoolbox as their underpinning, e.g., PsychoPy.

Additional options include contracting us for development and improvement of specific Psychtoolbox or Linux features which are vital for your experimental needs [2]. We also offer product integration partnerships for companies which manufacture and sell neuroscience products.

Lastly, for a small fee, individuals can become community members - essentially a small donation. You can also buy Psychtoolbox swag (from t-shirts, hoodies and mugs all the way to teddy bears) in the swag shop, where a fraction of the proceeds will go to support Psychtoolbox.

We hope that through labs, companies and users can find the right support or partner program fitting to their individual needs, and can find a way to contribute to Psychtoolbox development and maintenance. As is the case with many open source projects, we depend on your support to keep the project viable and moving forward. We hope that we are now able to offer you viable and mutually beneficial ways of financially contributing to the project.

Please also contact us at if you would like to discuss other options, or if you run into any problems with the purchase process.

As a recent example of the exciting new features added to Psychtoolbox, including High Dynamic Range support, that keep Psychtoolbox as the foremost option for demanding neuroscience and beyond, click this link to see what is new in the recent Psychtoolbox 3.0.17 release:

Your continued support will allow continuous progress, as well as maintenance, to ensure your code keeps working on old and new hardware and operating systems, and for exciting new paradigms to become possible over the years to come.

Rest assured: Psychtoolbox itself will remain open source software and will continue to be available for free.

Thank you for your time and support, The Psychtoolbox team

[1] Another 635 labs (~50%) responded that their support would depend on the specific payment or business model behind Psychtoolbox. If you are one of these labs and none of our current options are suitable for you, please get in touch with us at

[2] A few examples of our happy contract work customers so far are PsychoPy for substantially improved audio, timing and response collection functionality; Denis Pelli for fixing severe issues with Apple macOS for visual stimulus timing and response collection; and the VESA industry consortium for High Dynamic Range display support (see for their press release).

Psychtoolbox beta updated


Psychtoolbox 3.0.17 Beta update “Dynamically High!” was released at 2nd November 2020. As usual, the complete development history can be found in our GitHub repository. The release tag is “”, with the full tree and commit logs under the URL:

If you choose to use Psychtoolbox with Matlab then, at time of release, the most well tested Matlab versions on Linux are now R2014b and R2019a. The most well tested Matlab version on MS-Windows is R2019a, and on macOS R2020b. Other recent versions are expected to work as well, but not tested yet.

The most noteworthy improvements about “Dynamically High!” is that it contains initial support for “High Dynamic Range” displays for visual stimulation (HDR) on Linux and Windows-10, sponsored by VESA, and a new installer and updater for use with Matlab, sponsored by Mathworks, which should hopefully especially help the less fortunate - people who are forced to use Apple macOS. This is also the first release supported under our new business model, and the first release built and at least somewhat tested under macOS Catalina 10.15.7 final.


A total of 374 commits have changed 451 files for this release, made with over 6 months of work, changing or adding over 93113 lines of code. This is a big one!

New features and improvements:

All operating systems:

  • New meta-feature: Advertisement for the new “community membership with priority support” and other paid services. See PsychPaidSupportAndServices() and our new accompanying website Paid priority support by default applies to the most recent released PTB Beta, ie. this Psychtoolbox-3.0.17 release at time of writing, and the officially recommended and supported operating system and hardware configurations.

  • DownloadPsychtoolbox(), UpdatePsychtoolbox() and PsychtoolboxVersion() on Matlab R2014b or later now use Matlab’s builtin Java-based SVNKit as “no-need-to-install” Subversion client. This should avoid the need to install a separate Subversion client. Especially macOS users should benefit from this, given that Apple both removed Subversion support from the latest macOS and XCode versions and additionally worked hard to sabotage the easy use of 3rd party clients. Thanks Apple! In case of trouble with the new method, DownloadPsychtoolbox() has a new optional ‘downloadmethod’ parameter, which can be set to -1 to request use of the old method based on a 3rd party Subversion client. An optional ‘downloadmethod’ of 1 requests the downloader to just download the raw unversioned Psychtoolbox folder, with all versioning control information stripped. This will prevent the use of UpdatePsychtoolbox() or PsychtoolboxVersion() after such an “export only” download, and you will lose the advantages brought by version control. The advantage is a smaller download and installation size of currently about 300 MB instead of over 600 MB. Choose your poison… This work was sponsored by Mathworks.

  • ColorCal-II colorimeter integration into the standard CMCheckInit() / MeasXYZ() based color measurement routines. While the ColorCal-II was supported since years via the ColorCal() function, now it also works with the older and more exhaustive calibration routines, e.g., the ones which so far required PhotoResearch PR devices like PR-650/655/670/705. This is so far only tested on one monitor of dubious color reproduction quality, so viewer discretion is advised! Iow. Trust, but verify!

  • New colorspace conversion helper routines: RGBToXYZMatrix(), XYZToRGBMatrix(), and ConvertRGBSourceToRGBTargetColorSpace() for converting RGB image matrices from one color gamut (set of primaries and white-point) to another. These are currently used for the HDR demos. They convert source RGB colorspace -> XYZ space -> target RGB colorspace, with the color spaces defined by their CIE 1931 XYZ chromaticity coordinates of red, green, blue primaries and white-point. Iow. Build a 3x3 CSC matrix and do the matrix by color vector multiply for all pixels.

  • Basic OpenEXR image reading support for single-part RGB (.exr) images, by use of the open-source tinyexr library Also returns some standard and extended OpenEXR image attributes, e.g., image color gamut and conversion factor from values to nits.

  • Improved reading for RLE-RGBE “Radiance” image file (.hdr), with some parsing of some image attributes.

  • HDR image reading routines are integrated for convenient use into the improved HDRRead() function.

  • OpenGL 4.6 support in our “MOGL” Matlab/Octave OpenGL scripting interface. Ofc. only a subset of functions is supported, which is easily usable from a scripting language and allows for auto-generated interface code. Functions which require C memory pointer double indirections are not supported by default. Some might be supportable by manual writing of suitable wrapper code.

  • New and improved PsychTests:
    • VBLSyncTest(), PerceptualVBLSyncTest(), FlipTimingWithRTBoxPhotoDiodeTest() and DatapixxGPUDitherPatternTest() now also support testing with the new Vulkan based display backend.
    • FlipTimingWithRTBoxPhotoDiodeTest() can now also test timing with framebuffer color precisions beyond standard 8 bpc, e.g., 10 bpc and 16 bit floating point.
    • The new VulkanInteropDebug() can help debugging Vulkan display driver bugs.
    • AudioFeedbackLatencyTest() received some makeover to try to fix some file corruption that was present for unknown reasons.
    • The new HDRTest() allows to test the basic luminance response curve and color gamut of HDR display monitors by use of supported colorimeters (tested with ColorCal-II) or manual data entry or external devices.
  • Bug fixes, documentation updates, misc. improvements.

  • Deprecation / Half removal of BrightSideDisplay support. More code is to be removed, but this is essentially already dysfunctional since the end of life of WindowsXP 32-Bit. Then BrightSide the company doesn’t exist since over 12 years and their products probably all died of old age, so we can let it rest in peace.

  • GNU/Octave 6.1 seems to be very close to its first public release, but didn’t quite make it. As soon as Octave 6.1 is released, we will switch the Octave requirements for MS-Windows and macOS from Octave 5.2 to Octave-6.1. This will require all Octave users of Psychtoolbox 3.0.17 to upgrade their Octave installations after the corresponding PTB beta update. If you want to stick to Octave-5.1/5.2 be advised to stick to the old Psychtoolbox-3.0.16, which will be officially unsupported from now on going forward.

Linux and Windows-10 only:

  • “High Dynamic Range” (HDR) display support on modern Linux distributions with modern AMD graphics cards, and on Windows-10 with modern AMD and NVidia graphics, when connected to suitable HDR monitors:
    • Most of my (= Mario Kleiner) development work for this big new feature was sponsored by the Video Electronics Standards Association (VESA) under contract with my employer the Medical Innovations Incubator GmbH (MII) in Tuebingen, germany. Big thanks to VESA for this support! If you need similar feature development for Psychtoolbox, please see our services at
    • More thanks go to the AMD Linux open-source Vulkan driver team, and AMD Linux display driver team, the MESA Linux Vulkan developers for help with integration of HDR related improvements into the Linux kernel and user-space libraries and helpful technical discussions, and also to some of the folks at the XDC 2020 Linux graphics developer conference for fruitful discussions about future improvements to our HDR and Vulkan support. Without Linux and open-source development, this project would have been almost impossible to finish.
    • See “help PsychHDR” for detailed infos.
    • The HDR-10 standard (BT-2100) with BT-2020 / ITU Rec. 2020 color space, 10 bit per color channel precision and SMPTE ST-2084 PQ “Perceptual Quantizer” EOTF is supported.
    • So far, Linux was successfully tested over both DisplayPort and HDMI video outputs with AMD graphics cards of the Polaris series (Radeon Pro 560 in a MacBookPro 2017, and a discrete Radeon RX-460 graphics, both with DCE-11.2 display engine) and Raven Ridge integrated processor graphics (AMD Ryzen 5 2400G, Raven Ridge IGP, Vega 11 graphics, DCN 1.0 display engine). All modern AMD cards of Polaris and later are expected to work, likely also cards of the earlier Volcanic Islands and Sea Islands gpu families.
    • So far, Windows-10 was successfully tested over both DisplayPort and HDMI video outputs with AMD Raven Ridge processor graphics. Also 3rd party testing of AMD RX-460, and AMD RX 5500 GPU card connected via DisplayPort. Windows-10 was also tested over both DisplayPort and HDMI video outputs with a NVidia GeForce GTX 1650 by myself, and 3rd party testing with GeForce GTX 1080 and GTX 2080.
    • The new HDRTest.m script allows basic testing of correct operation (luminance response curve / linearity, color gamut) with supported colorimeters.
    • The new demos SimpleHDRDemo.m and HDRViewer.m demonstrate basic use of HDR for HDR image display, and basic HDR 2D drawing. Also use of the new HDRRead() and color space conversion functions.
    • MinimalisticOpenGLDemo.m with the new ‘hdr’ parameter and the new HDRMinimalisticOpenGLDemo.m demonstrate HDR display of OpenGL rendered 3D content.
    • PlayMoviesDemo.m has been extended with an optional ‘hdr’ == 1 parameter to demonstrate playback of HDR-10 movies. GStreamer 1.18 is required for automated handling of HDR movies. GStreamer 1.16 will be able to playback HDR content with some manual help of the usercode, at least for PQ and HLG encoded content, as demonstrated in PlayMoviesDemo with the ‘hdr’ parameter set to 2. This allows 4k UHD HDR playback at reasonable framerates, also utilizing HDR static metadata type 1 information for mastering display properties and content light level properties.
  • As a by-product of HDR support, movie playback can now playback non-HDR UHD 4k content or Wide color gamut content with improved performance as well if the optional ‘pixelformat’ parameter is set to 11. Pixelformat 11 is automatically seleced when HDR display mode is in use. This does not work on Apple macOS due to Apples deficient OpenGL implementation, or on old graphics cards. GLSL shading language version 1.3 is required as a minimum for optimized movie playback.

  • As a by-product of HDR we have basic support of the Khronos Vulkan rendering api as a limited display backend on graphics cards and driver which support OpenGL-Vulkan interop. This is not used by default, but as an opt-in, as it does not yet provide real advantages in most standard dynamic range (SDR) stimulation scenarios. See “help PsychImaging” for the new task ‘UseVulkanDisplay’, as demonstrated in PerceptualVBLSyncTest, VBLSyncTest, FlipTimingWithRTBoxPhotoDiodeTest and AdditiveBlendingForLinearSuperpositionTutorial.
    • Single display visual stimulation is supported on AMD graphics cards and NVidia graphics cards under Linux and Windows-10 with up to date drivers.
    • Fullscreen mode with proper timing is currently somewhat unreliable and hit and miss on Linux with proprietary NVidia graphics, but highly reliable with AMD graphics cards. AMD graphics is strongly recommended!
    • Multi-Display setups can be used, but only one display can be selected and used at a time for a single onscreen window, ie. dual-display stereo onscreen windows do not work.
    • Opening multiple single-display onscreen windows may work, but is not always trouble-free or reliable.
    • Basic visual timing and timestamping works reliably on AMD graphics cards, but not on NVidia graphics cards. AMD graphics is strongly recommended!
    • Only stimulus onset via Screen(‘Flip’) is supported at this time. Async flips via Screen(‘AsyncFlipBegin’)…, frame-sequential stereo modes, and fine-grained timing via HDMI VRR, Displayport adaptive sync or AMD FreeSync are not yet supported. Only Linux with AMD graphics supports FreeSync/DP adaptive sync, and some more fragile and limited support is available for NVidia G-Sync under Linux.
  • Use of the Vulkan display backend under Linux with AMD graphics cards of the Polaris gpu family or later models (Vega, AMD Ryzen processor graphics, Navi recommended, but Vega and Navi untested so far) and the AMD developed amdvlk open-source driver with Linux 5.8 or later does allow for a new high precision output mode: Floating point 16 bit output for about ~11.5 bits of precision per color channel on suitable graphics cards and displays. See AdditiveBlendingForLinearSuperpositionTutorial() for one script demonstrating this. This should be able to attain better than 10 bpc output precision on native 12 bpc displays (DisplayPort strongly recommended, HDMI discouraged!) and on 10 bpc displays or 8 bpc displays via use of gpu hardware spatial dithering. This is so far only lightly tested on one native 10 bpc capable HDR monitor, so viewer discretion is advised.

Linux only:

  • GStreamer version 1.8 is now required at a minimum.

  • Ubuntu 16.04 LTS - or for that matter really anything older than Ubuntu 18.04.5 LTS, is no longer officially supported. Light touch and go testing shows most stuff still works fine, except DrawFormattedText2() in some special cases like text rotation or certain text alignment on Octave 4.0. But no further testing will be performed, and we may make incompatible changes to the 3.0.17 series and later in the future. This should not be a big problem, as Ubuntu 16.04 LTS will reach its official end-of-life in less than six months.

  • There is some minimal compatibility fix for the brand-new Ubuntu 20.10 (Groovy Gorilla) for dealing with the upgraded Firewire and USB-Vision video capture library for IIDC machine vision cameras.

  • NOTE: Ubuntu 20.10 is not yet exhaustively tested for compatibility with Psychtoolbox 3.0.17, but may have some problems with sound output via PsychPortAudio(). Stay tuned…

Windows only:

  • GStreamer version 1.18.0 64-Bit MSVC or later versions are now required on Windows. Screen() will no longer work with older versions of GStreamer! The current download link is this one: GStreamer 1.18 MSVC

  • Windows 7, Windows 8, Windows 8.1, and Windows-10 versions older than the Window-10 November 2019 update (Release 1909) are not tested at all for this release. Upgrading to a 2020 release of Windows-10 is recommended, as future testing of PTB will happen on the latest recommended stable Windows-10 releases, e.g., May 2020 update (Release 2004) or later. While the expectation is that this release still works with Windows-7, this may change at any time for any reason without further warning in a future PTB beta release. Windows-7 has reached end-of-life already at the beginning of 2020, and Windows-8 even long before, so this should not pose any real problems.

macOS only:

  • The macOS build system and only somewhat tested and officially supported platform is now macOS 10.15.7 Catalina final. Please note that this is not and endorsement of Catalina, the most awful macOS version ever imposed onto the world. I fully expect the upcoming macOS 11 “Big Sur” to be even worse for neuroscience testing and take the crown from Sierra, stay tuned! You should probably stick to your current system if it works reasonably well for you, because things are guaranteed to get worse when “upgrading” to Catalina. I unfortunatey did not have the choice of sticking to the better working macOS Mojave, because of lack of support for some API’s and features and forced deprecation of functionality by Apple, so here we are. At this point we only have one test machine for frequent testing with Catalina, using AMD graphics (MacBookPro 2017 15 inch), and one machine for very infrequent testing on Intel graphics (macMini 2012), and no other Apple test machines apart from an over 10 years old MacBookPro 2020 with slowly failing hardware and limited usability for testing under macOS 10.13.6 High Sierra.

  • GStreamer version 1.8 is now required at a minimum. While GStreamer on macOS is still optional if you don’t need multi-media or video capture/recording functionality, our advanced plugin based text renderer likely will not work, at least not with Matlab (see “help DrawTextPlugin”), only the inferior and officially unsupported Apple CoreText renderer. GStreamer is now the recommended choice for getting our text renderer going, and additional workarounds have been added to deal with macOS being macOS when it comes to text rendering. Previously X11 was recommended, but given that Apple deprecated that technology this doesn’t seem to be the most convenient choice. Octave 5.2 should support our high quality renderer even in the absence of GStreamer though.

  • Octave 5.2 from HomeBrew is the only supported GNU/Octave version at this point in time. Our DownloadPsychtoolbox() function will now try to preferentially use the Subversion command line client “svn” provided by HomeBrew for downloads and updates. In case of a missing or dysfunctional (e.g., intentionally sabotaged by Apple) svn client, it will offer to automatically install Subversion from HomeBrew. The same fallback mechanism is available by specifying an optional ‘downloadmethod’ of -1 in DownloadPsychtoolbox() if one tried to install/update on Matlab and the new SVNKit method would fail for some reason.

  • We are deprecating libdc1394 Firewire video capture support, Microsoft Kinect support (PsychKinect()), and Oculus VR support (PsychOculusVR) on macOS. The functionality is still available but practically untested and unsupported in case of trouble. If we get aware of actual trouble with this functions, we will remove them for macOS, as the effort is not worth the gain anymore:

    • All Apple Macs since after 2012 do no longer have Firewire ports.
    • The Microsoft Kinect is no longer sold.
    • Oculus does not support any of their consumer VR HMD’s on macOS as they consider Apple hardware and operating systems unsuitable for serious VR application. So does Valve btw.
    • We will keep all this functionality supported indefinitely on Linux and as long as practical on MS-Windows.


Psychtoolbox beta updated


Psychtoolbox 3.0.16 Beta update “Crowning achievement” was released at 10th May 2020. As usual, the complete development history can be found in our GitHub repository. The release tag is “PTB_Beta-2020-05-10_V3.0.16”, with the full tree and commit logs under the URL:

If you choose to use Psychtoolbox with Matlab then the most well tested Matlab versions on Linux are now R2014b and R2019a. The most well tested Matlab version on MS-Windows and macOS is now R2019a. For best results and support, use R2019a. R2019b and R2020a are expected to work as well, but not extensively tested yet.

The most noteworthy thing about “Crowning achievement” is that it contains the highest number of 3rd party contributions (7 if i counted right) ever! Various people contributed new functions and improvements to existing functions. This would be a good trend if it continues. Thanks!

New features and improvements:

All operating systems:

  • Add disclaimer to “help PsychContributed” that all code in there is not considered up to the regular quality standards, often only supported by the 3rd party contributors not by us, subject to removal or backwards incompatible changes or breakage for any reason. If you use it, you are mostly on your own!

  • Improve some help texts, e.g.,
    • Screen Rect? Screen GlobalRect? : Mention it also works on textures.
    • Help section on display mirroring in PsychImaging() improved to match what works/doesn’t on modern operating systems.
  • sca(): No longer recenter the mouse cursor at the display center at invocation of sca(). This is a measure that was needed on old Linux distributions with some desktop environments, but not needed on modern Linux, Windows or macOS. It can trigger some weird crash bugs on some exotic Windows-10 multi-display setups. Problem reported by Diederick.

  • Screen: Always print error messages wrt. sync test failure at OpenWindow time, even if level of verbosity is set to zero, to aid debugging the most common reason for OpenWindow failure on Apples trainwrecks and other low-quality systems.

  • Add underlining support to Screen(‘DrawText’) (ie. honor the Screen(‘TextStyle’) setting flag 4 = underline) when using the modern standard drawtext plugin. So far underlining was only supported with some of the legacy OS specific text renderers. Now it works in the typical use case. Code for drawtext plugin contributed by Diederick (@dcnieho).

  • MinExpEntStair(): Make it compatible with modern Octave versions 4.4 and later, contributed by Diederick.

  • Fix ClockRandSeed() for compatibility with recent Matlab versions. Problem reported and solution suggested by Xiangrui Li (@xiangruili)

  • MeasureDpi(): Now optionally allows DPI measurement using standard credit cards, as very common calibration objects of well defined size. Measuring with other objects is still possible, by specifying their size, as in the past. Some other minor improvements. Contributed by Miguel García García (@mikelgg93).

  • New function HoritaTitler() to control the Horita SCT-50 video titler and compatible devices via serial port ( Contributed by Natasa Ganea from the Goldsmiths Infantlab, University of London.

  • New procedural texture shader for sine-wave and square-wave gratings which don’t change brightness, but color between a neutral background color and two different colors at the peaks and valleys of the grating, e.g., red-green or blue-yellow gratings for research wrt. color opponent perception. Also with adjustable smoothness of the transition between the two colors for square-wave gratings, and with a radial aperture of controllable radius. CreateProceduralColorGrating() to create them, ProceduralColorGratingDemo.m to show how it is used. Contributed by Ian Andolina (@iandol).


  • Add support for Octave 4.4+ 64-Bit, to support the new 64-Bit Octave 5.2 in Ubuntu 20.04-LTS. Mostly by adding an Eyelink mex file built against Octave 5.2 and checking that our set of mex files built against Octave 4.4 for Ubuntu 19.10 still works with Octave 5.2 on Ubuntu 20.04-LTS.

  • Improvements to XOrgConfCreator() for Ubuntu 20.04 LTS and modern AMD gpu’s:
    • Fix ddx video driver detection on recent AMD gpu’s with DCN display engine (Ryzen integrated graphics, AMD Navi gpu family of discrete gpu’s).
    • Allow to opt-out of use of modesetting-ddx, instead of only opt-in: The defaults have changed on Ubuntu 20.04 LTS. Modesetting is used by default on Intel and NVidia nouveau, instead of being an optional alternative compared to vendor specific intel-ddx and nouveau-ddx drivers.
    • Make it robust against use under 30 bit color depth for the X-Screen if something is botched in the color depth 30 bit setup. XOrgConfCreator() is part of the troubleshooting procedure, so there shouldn’t be a need to troubleshoot itself first in case of trouble.
  • Reduce verbosity of gpu detection and low-level access setup machinery at default verbosity level.


  • ShowCursor(): Add support for more cursor shapes that are available on Windows by default. Contributed by Diederick.

  • “help DrawTextPlugin”: Mention alternate locations for the fontconfig cache, and how to solve trouble there. Problem and solution reported by @sr-brian.

  • PsychOculusVR1 driver: Allow printing of debug messages from secondary threads (VR runtime threads) again when running under Octave. As printing of debug messages from secondary threads crashes Matlab since around R2018, this was unconditionally disabled. Now we allow it again when running on Octave, so users could get more help in debugging mysterious problems iff they use Octave for debugging these problems.


  • Add MacDisplaySettings(), contributed by Denis Pelli (@denispelli) . This is a replacement for AutoBrightness(), which is now a wrapper around MacDisplaySettings() for backwards compatibility. MacDisplaySettings() provides more control over more display settings which get in the way of properly calibrated monitors, e.g., automatic backlight brightness, nightshift, etc. It is also supposed to be more robust and faster than the old code. NOTE: This function is part of the PsychContributed category of functions. As such it is unsupported and not tested at all (not even for security issues or unintended side effects) by the official maintainer. It could fail or break or be changed in a backwards incompatible way in the future for any reason. All support requests will have to go directly to Denis Pelli.


Psychtoolbox beta updated


Psychtoolbox 3.0.16 Beta update “Toiletpaperhamsteridiots” was released at 26th March 2020. As usual, the complete development history can be found in our GitHub repository. The release tag is “PTB_Beta-2020-03-26_V3.0.16”, with the full tree and commit logs under the URL:

If you choose to use Psychtoolbox with Matlab then the most well tested Matlab versions on Linux are now R2014b and R2019a. The most well tested Matlab version on MS-Windows and macOS is now R2019a. For best results and support, use R2019a.

This release brings minor bug fixes and improvements.

New features and improvements:

All operating systems:

  • PlayMoviesDemo: Add alpha-blending support for transparent movies.

  • Improve help text for Screen Screens?

  • PsychPortAudio: Fix start of capture ‘capturetime’ timestamps in certain exotic conditions.


  • Fix default audio input/capture device selection for certain exotic audio input devices which expose separate logical audio devices for playback vs. capture.

  • Cut down on chatter if running on latest generations of AMD gpu’s with DCN display engine, e.g., AMD Ryzen integrated processor graphics (Raven Ridge / Picasso / Renoir / …) and AMD Navi family discrete graphics cards. These latest generation DCN display engines are not supported by our bag of low-level tricks, as there is neither need nor benefit. Spare the user from pointing this out with extra debug clutter.

  • Fix detection code for VRR capable displays (HDMI VRR and DisplayPort Adaptive Sync / FreeSync). The detection code only probed the first connected display output, regardless into which output the display is plugged in, therefore falsely disabling VRR capable displays from using VRR.


  • Fix crash on Screen() reload if GStreamer isn’t installed, but libglib is installed by 3rd party, e.g., from HomeBrew.

  • SetMouse: Deal better with Retina displays on macOS: At least if a window handle is provided, this should deal with position scaling on Retina displays if not using native Retina resolution on the trainwreck. Not great, but better than nothing.


Psychtoolbox beta updated


Psychtoolbox 3.0.16 Beta update “English breakfast” was released at 30th January 2020. As usual, the complete development history can be found in our GitHub repository. The release tag is “PTB_Beta-2020-01-30_V3.0.16”, with the full tree and commit logs under the URL:

If you choose to use Psychtoolbox with Matlab then the most well tested Matlab versions on Linux are now R2014b and R2019a. The most well tested Matlab version on MS-Windows and macOS is now R2019a. For best results and support, use R2019a.

This release brings minor bug fixes and improvements to high precision color support on Linux. Especially the 12 bpc 12 bit per color channel output mode (PsychImaging(…‘EnableNative16BitFramebuffer’…) has been improved and now verified to truly provide 12 bpc precision.

New features and improvements:

All operating systems:

  • Fix movie playback with pixelformat = 10, ie. deep color playback of more than 8 bpc content.


  • Various high precision color improvements for Linux: Enable 10 bpc framebuffer support on Mesa by default. Make sure video outputs operate at maximum output precision in > 8 bpc modes. Improvements to 16 bpc native framebuffer support on AMD DCE-8+ gpu’s. I have now verified with a ColorCal2 to be able to produce 12 bpc output precision on at least one display with at least one AMD Polaris gpu. This should work with all AMD gpu’s except for ones with the new DCN display engines, ie. it should work starting with “Sea Island” gpu’s, going on to “Volcanic Island”, “Polaris” and ending with “Vega”. AMD Ryzen integrated processor graphics “Raven Ridge” and later, and the latest AMD “Navi” gpu’s are not supported for 11 bpc and 12 bpc mode for the time being.

  • Improve default KbQueue selection to ignore more mice which pretend to be also keyboards.


  • More hand-holding for people who are challenged with reading and install the wrong GStreamer variant. Our PsychStartup script tries to detect wrong GStreamer and gives warning and troubleshooting tips.


Psychtoolbox forum back again on Discourse!


Happy new year!

Our user forum has been resurrected at its new home at Discourse:

Link to new forum at Discourse

This is a way more polished and featureful discussion group system, so it should also provide improved usability. We have to figure out all the new bells and whistles ourselves over time, but all the basics should be ready.

People signed up to the old forum may have to (re-)sign up for the new Discourse forum. Much of the old content from the old YahooGroups forum has been imported into the new forum.

Yahoo has by now deleted all forum content from the old forum, so that one is as dead as it can be - you can delete your bookmarks to it, and R.I.P.

As some stats: The old Yahoo Groups forum had 2,810 subscribers at the time of its shutdown by Yahoo at the end of October 2019, and received 24136 messages during its lifetime from 17th January 2000 to 28th October 2019. We hope the new forum will show as much user engagement, now that it is reestablished!

For bug reports and feature requests, go to our Issue tracker by clicking this link

Hip hip hurray, and post away!

Psychtoolbox beta updated


Psychtoolbox 3.0.16 Beta update “Timely Twinkler” was released at 18th December 2019. As usual, the complete development history can be found in our GitHub repository. The release tag is “PTB_Beta-2019-12-18_V3.0.16”, with the full tree and commit logs under the URL:

If you choose to use Psychtoolbox with Matlab then the most well tested Matlab versions on Linux are now R2014b and R2019a. The most well tested Matlab version on MS-Windows and macOS is now R2019a. For best results and support, use R2019a.

This release follows the pattern of substantial visual stimulation timing improvements: It brings another bunch of substantial improvements to VRR/FreeSync/G-Sync support on Linux.

New features and improvements:

All operating systems:

  • Adds PsychPhotodiode() driver for combining photo-diodes with sound cards for visual stimulus onset timestamping. Demonstrated in VRRTest.m as hwmeasurement=5 method.

  • UpdatePsychtoolbox() will now resolve potential file conflicts automatically by forcing the updated files from the upstream server, simply overwriting/discarding user modifications.

  • Documentation updates. Among other minor things, point to the new user forum at Discourse:

  • Improve ability to do reproducible builds for Python, contributed by Bernhard Wiedemann on behalf of openSUSE.


  • Ship basic set of MEX files for Octave 4.4 on Linux, e.g., for easy use with Octave on Ubuntu 19.10. Currently missing, to be part of a later update: Eyelink.mex, PsychCV.mex.

  • Improved VRR support for fine-grained visual stimulus onset timing on Linux. The API has been reworked to allow for more future flexibility and future extensions without breaking backwards compatibility of user scripts. Most importantly, a more sophisticated multi-threaded VRR scheduler is now used, which should take hardware (gpu and display) and operating system/driver constraints into account to provide more precise and stable visual stimulus onset timing. Testing shows pretty good results on AMD FreeSync hardware, and some improvements on NVidia G-Sync hardware. AMD gpu’s and compatible “FreeSync” displays are strongly recommended over NVidia G-Sync for optimal current results and to take advantage of substantial improvements on Linux in the future.


Psychtoolbox beta updated


Psychtoolbox 3.0.16 Beta update “Funky Syncopation!” was released at 4th December 2019. As usual, the complete development history can be found in our GitHub repository. The release tag is “PTB_Beta-2019-12-04_V3.0.16”, with the full tree and commit logs under the URL:

If you choose to use Psychtoolbox with Matlab then the most well tested Matlab versions on Linux are now R2014b and R2019a. The most well tested Matlab version on MS-Windows and macOS is now R2019a. For best results and support, use R2019a.

This release follows the pattern of substantial visual stimulation timing improvements:

New features and improvements:

All operating systems:

  • drawChromaticity() renamed to DrawChromaticity(), so Matlab/Octave don’t complain and our documentation generator can actually generate documentation. Other small cleanups/refinements.

  • InitializePsychSound() made less chatty.

  • Minor improvements to PsychPortAudioTimingTest and other timing tests which involve audio: Go back to 44100 Hz sample rate, as that seems to be supported on a wider range of sound hardware. Weird, because the HDA spec only mandates 48000 Hz, so one would expect lazy hw vendors to implement that foremost.

  • BasicSoundInputDemo: Only switch from recording to playback on ESCape key press.


  • XOrgConfCreator can now configure hybrid graphics laptops also when running under Matlab, not just Octave, by working around a Matlab limitation. So far it didn’t recognize a multi-gpu laptop as such when executed under Matlab, only on Octave.

  • Support for use of Variable Refresh Rate (VRR) displays, also known as VRR, HDMI-2.1 VRR, DisplayPort Adaptive Sync, AMD FreeSync or NVidia G-Sync, with suitable AMD FreeSync or NVidia G-Sync gpu’s on suitable Linux versions and drivers. “help VRRSupport” explains hardware and software requirements, gives setup instructions and usage / test instructions, and also provides background infos. VRRTest exercises suitable system setups. PsychImaging(‘AddTask’, ‘General’, ‘UseFineGrainedTiming’); requests use of VRR on supported setups. This is an initial implementations of the basics. It is expected to work best on AMD gpu’s of the Vega gpu family or later, e.g., Ryzen / Raven Ridge integrated graphics controllers and Vega or Navi family discrete gpu’s. It will also work with some more limitations on older AMD gpu’s like Polaris, Volcanic Islands and Sea Islands family. It may work ok’ish on NVidia G-Sync gpu’s, but use of AMD graphics + AMD FreeSync2 monitors is strongly recommended over NVidia graphics + NVidia G-Sync displays. Stay tuned for future improvements to VRR based fine grained visual stimulus timing. Not supported on MS-Windows yet.


Psychtoolbox beta updated


Psychtoolbox 3.0.16 Beta update “Syncopation” was released at 27th November 2019. As usual, the complete development history can be found in our GitHub repository. The release tag is “PTB_Beta-2019-11-27_V3.0.16”, with the full tree and commit logs under the URL:

If you choose to use Psychtoolbox with Matlab then the most well tested Matlab versions on Linux are now R2014b and R2019a. The most well tested Matlab version on MS-Windows and macOS is now R2019a. For best results and support, use R2019a.

This release was aptly named by Denis Pelli: The main meat of it is substantial improvements to visual stimulation timing on Apple macOS, as well as other fixes for Apples trainwrecks, e.g., for keyboard queries and for running Octave and Matlab R2019b without crashing. The timing fixes were done as contract work, paid by Denis Pelli. For more details about the general state (=awfulness) of current macOS and about these fixes see:

Iow. all Apple macOS users should upgrade to this release ASAP!

New features and improvements:

All operating systems:

  • Help text and doc updates.

  • DownloadPsychtoolbox/UpdatePsychtoolbox: Improve some online help texts. Contributed by Ian Andolina.

  • UpdatePsychtoolbox can now work even if the Psychtoolbox folder is not on the path. Contributed by Denis Pelli.

  • Improvements to diagnostics, e.g., DatapixxGPUDitherpatternTest is even more careful now about detecting trouble.

  • FlipTimingWithRtPhotoDiodeTest. Now also supports VideoSwitcher + RtBox for timing tests.

  • Improved data sets: Update T_xyz1931 and T_xyz1964 with more decimal places and wavelength samples. Updated versions provided by Danny Garside. It’s possible this could break code that made assumptions about wavelength sampling, but code should not do that. Reviewed and merged by David Brainard.

  • New function contributed by Danny Garside: drawChromaticity() can plot various types of chromaticity diagrams with spectrum locus. Reviewed and merged by David Brainard.


macOS Fixes and workarounds for the various horrifying Apple macOS operating system bugs:

  • KbCheck: Handle Apple MacBookPro TouchBar Gimmick.

  • KbCheck: Workaround for macOS Catalina’s shoddy IOKit HID support which led to slowdowns of 50x

  • KbQueueCreate: Workaround for macOS Catalina’s latest multi-threading bugs to avoid crashing.

  • Screen: Improve Retina display handling related to GetMouse and use of panel fitter.

  • Screen: Workaround the endless number of graphics/display driver bugs affecting visual stimulus onset timing and timestamping. This should bring improved or well working visual timing on a variety of hardware on macOS 10.11 to 10.15.1, but is targeted at specifically macOS 10.14.6 Mojave with the MacBookPro 2017 and the iMac 27 inch 5k Retina late 2014. Work done under contract with Denis Pelli. A summary of all the horrors in Apples trainwrecks, and how we work around them now can be found in this pull request:

  • Fix crashes of Octave 5.1 during operation and shutdown caused by macOS multi-threading bugs and other Apple screwups that just baffle my little brain to no end.

  • Fix crash of Matlab R2019b due to more horrendous Apple screwups.


  • Make disable of display dithering for modern AMD gpu’s on modern drivers actually work, for identity pixel passthrough needed by visual stimulators of VPixx and Cambridge Research Systems.


  • Improve gpu detection for some new AMD gpu’s.


Apples latest Catalina trainwreck not supported


A friendly note to all members of the church of Apple.

macOS 10.15.0 “Catalina” is not supported by current Psychtoolbox, due to a number of new entertaining bugs introduced by the iToys company into their latest trainwreck.

Upgrading to Linux is generally recommended for generally more reliable and trustworthy data collection.

Psychtoolbox Yahoogroups forum shut down


At 28th October 2019, YahooGroups started the shutdown of its forum groups, including the Psychtoolbox user forum.

From now on, no new questions or replies can be posted to the public forum website. All existing content will be deleted starting 14th December.

The shutdown of Yahoo’s services happened on such short notice that we didn’t have time to prepare in advance.

For bug reports and feature requests, go to our Issue tracker by clicking this link

We are working to find a new home for the forum and will let you know here when it is ready.

Psychtoolbox beta updated


Psychtoolbox 3.0.16 Beta update “Burnout” SP2 was released at 26th September 2019. As usual, the complete development history can be found in our GitHub repository. The release tag is “PTB_Beta-2019-09-26_V3.0.16”, with the full tree and commit logs under the URL:

Please note that as of now, Psychtoolbox 3.0.15 is end-of-life, no longer supported in case of trouble or questions. All documentation on our website will be updated to only help with use of Psychtoolbox 3.0.16.

If you choose to use Psychtoolbox with Matlab then the most well tested Matlab versions on Linux are now R2014b and R2019a. The most well tested Matlab version on MS-Windows and macOS is now R2019a. For best results and support, use R2019a.

This is a minor maintenance release.

New features and improvements:

All operating systems:

  • GetSecs(‘AllClocks’): Optionally return monotonicTime as 4th return argument. Identical to GetSecsTime on Windows and macOS, returns Posix CLOCK_MONOTONIC time on Linux. Allows timestamp remapping / sync with, e.g., Tobii gazetracker SDK.

  • Python port: Allow editable installs. Contributed by Eric Larson.

  • CenterRectOnPoint[d]: Fix ambiguity for 4x4 rect matrices.

  • BackupCluts(): Ignore virtual screen 0 on a MS-Windows multi-display setup. By Ian Andolina.

  • Update some help texts and slightly improve some demos.

  • Misc other stuff.


  • Screen on Linux now supports high precision timestamping with the proprietary NVidia driver for NVidia Volta and Turing gpu’s.


  • Allow use with Matlab releases < R2014b under macOS again. Not recommended on Apples current trainwrecks, but reenabled for consistency with Linux and Windows.


Psychtoolbox beta updated


Psychtoolbox 3.0.16 Beta update “Burnout” was released at 7th August 2019. As usual, the complete development history can be found in our GitHub repository. The release tag is “PTB_Beta-2019-08-7_V3.0.16”, with the full tree and commit logs under the URL:

Please note that as of now, Psychtoolbox 3.0.15 is end-of-life, no longer supported in case of trouble or questions. All documentation on our website will be updated to only help with use of Psychtoolbox 3.0.16.

If you choose to use Psychtoolbox with Matlab then the most well tested Matlab versions on Linux are now R2014b and R2019a. The most well tested Matlab version on MS-Windows and macOS is now R2019a. For best results and support, use R2019a.

The initial release of Psychtoolbox 3.0.16, while light on new features and general improvements, marks the first big transition of runtime environments and build systems in almost 8 years, from:

  • Octave 4.4.1 required to Octave 5.1.0 required on Windows and macOS.

  • Matlab R2012a as a build and test system replaced by R2019a on Windows and macOS.

  • Matlab R2014b as a build and test system and R2019a as a test system instead of old R2012a on GNU/Linux.

  • Switch of the Windows build and test environment from Windows-7 SP1 to Windows-10.

  • Windows 10 SDK and MSVC 2015-2019 runtimes instead of Windows 7 SDK and older MSVC 2010.

  • Linux: At least GStreamer 1.4 required instead of GStreamer 1.0.

  • Windows: At least GStreamer 1.16.0 in the MSVC variant required instead of >= GStreamer 1.4.0 MinGW variant.

    This means that Octave users on Windows and macOS must upgrade to Octave 5.1.0 before they run UpdatePsychtoolbox or DownloadPsychtoolbox. All Windows users must upgrade GStreamer to version 1.16.0 MSVC before updating Psychtoolbox. Download link for new GStreamer on Windows:

    With this release, Windows users lose the ability to run Psychtoolbox without installing GStreamer - it is no longer optional, even if you don’t need any GStreamer provided multi-media functionality or video capture / video recording.

    On the plus side: This release may fix the crashes and stability problems that Windows users frequently experienced when using multi-media functionality with Matlab’s GUI enabled. At least two Windows 10 test machines with R2014a and R2019a did not experience Matlab related stability issues anymore. Fingers crossed!

    Windows users may require Microsoft Visual Studio Runtime 2015-2019 redistributable to be installed unless your system is sufficiently up to date to have this already. One suitable copy of this is bundled with Psychtoolbox and also available under this link:

You may want to make a backup copy of your current Psychtoolbox installation before upgrading to this one!

New features and improvements:

All operating systems:

  • Fix small bug in PsychPortAudio(‘Stop’): Did not block until true sound offset, but possibly return a few msecs too early.

  • Add new MouseMotionRecordingDemo.m: Shows how to record mouse/trackpad movements et al. on Linux and Windows via use of enhanced keyboard queues.

  • Various documentation updates, e.g., for Linux gamemode support, RetinaDisplays, GStreamer.

  • Minor improvements and various cleanups.

  • Datapixx updated to latest state from VPixx upstream to support their latest functionality.


  • Enable GstDeviceMonitors for nicer or theoretically more robust video capture device enumeration.

  • Now requires at least GStreamer 1.4.0. Matlab mex files will fail on distributions with older GStreamer versions. Octave mex files provided by Ubuntu/Debian and NeuroDebian would continue to work on older GStreamer versions without GstDeviceMonitors support.

  • Ubuntu 14.04-LTS or other distros older than Ubuntu 16.04-LTS are no longer supported. This because they lack GStreamer 1.4+, but also no further testing is performed against them.

  • Our download works with Octave 3.8 - 4.2. Octave 4.4 and 5.1 will be supported by NeuroDebian packages octave-psychtoolbox-3 or the Linux distributions octave-psychtoolbox-3 packages themselves.

  • Developed and tested against Matlab R2019a and R2014b, no longer regularly tested with R2012a, but continues to work with R2012a.

  • The RaspberryPi edition now is build and tested against the current Raspbian 10 “Buster” based OS, with Octave 4.4.1 instead of older Octave versions. You need to upgrade to the latest Raspbian to use this release. Or use the distribution provided and probably somewhat outdated octave-psychtoolbox-3 package.


  • Now absolutely requires the MSVC built GStreamer 1.16.0 for both Octave and Matlab. Screen() will no longer work without GStreamer 1.16.0 MSVC installed! Download link:

  • May require Microsoft Visual Studio Runtime 2015-2019 redistributable to be installed. One suitable copy of this is bundled with Psychtoolbox and also available under this link:

  • Keyboard queues can now record mouse/touchpad etc. motion as well, also raw motion, similar to but not quite as powerful and flexible as the Linux implementation (which can also deal with Joysticks and other game contoller movements). Cfe. MouseMotionRecordingDemo.m

  • Update PsychPortAudio’s internal Portaudio library to latest upstream release with improvements and bug fixes to Windows WASAPI sound backend support.

  • Now runs on and requires 64-Bit Octave 5.1, no longer on Octave 4.4.1.

  • Now is tested and developed against Matlab R2019a, no longer R2012a, but should continue to work on older Matlab versions than R2019a.

  • Crashes of Matlab in Java / GUI mode when using GStreamer functions like movie playback/writing/recording and video capture may be finally resolved! At least testing on Windows 10 with R2019a and R2014a did not experience any crashes anymore. Fingers crossed.

  • Improved compatibility and easier setup of GStreamer 1.16.0 + Octave 5.1.0.


  • Improve robustness of Screen(‘ConfigureDisplay’,’Brightness’) on Apples recent trainwrecks with NightShift support and such. Also add theoretical ability to control ‘AutoBrightness’ mode - in practice it doesn’t seem to work at all on any tested macOS 10.13 or 10.14 system.

  • Now runs on and requires 64-Bit Octave 5.1, no longer on Octave 4.4.1.

  • Now is tested and developed against Matlab R2019a, no longer R2012a, but should continue to work on older Matlab versions than R2019a, possibly back to R2014b.


Psychtoolbox beta updated


Psychtoolbox 3.0.15 Beta update “No rocket science” was released at 19th July 2019. As usual, the complete development history can be found in our GitHub repository. The release tag is “PTB_Beta-2019-07-19_V3.0.15”, with the full tree and commit logs under the URL:

The Psychtoolbox-3.0.15 beta update “No rocket science” mostly contains bug fixes, workarounds for OS bugs, and new features and improvements here and there. It is expected to be the last release in the 3.0.15 series, before we start the 3.0.16 series. The 3.0.16 series will drop support for Ubuntu versions older than 16.04-LTS and equivalent other distributions that don’t provide GStreamer 1.4.0 or later, and will also involve a major update of the Microsoft Windows build system, the Matlab versions used for building and testing, and the supported Octave versions.

New features and improvements:

All operating systems:

  • Improvements to Python implementations for PsychHID, PsychPortaudio: Pythonic wrapper classes hid and audio and hidtest_pythonic, ppatest_pythonic. Ability to build wheels and sdist’s for upload to PyPi. Jon Peirce currently takes care of building and uploading this stuff to PyPi et al. Bug fixes by Jon and myself for .py and C code, e.g., for detection of HID devices with exotic names on MS-Windows. Also add some missing license file to PyPi distro by Richard Höchenberger.

  • Various updates to help texts and documentation.

  • MakeBeep: Fix off-by-one error by Diederick.

  • Addition of “Krinov reflectance data” data set by David Brainard.

  • Fix failure of PsychHID(‘ReceiveReports’) with optional options struct - regression introduced around beginning of 2019 (forum msg 23724).

  • Screen: Fix GStreamer movie audio writing for recent GStreamer versions. Audio track writing (cfe. ImagingStereoDemo([],[],2)) failed on Ubuntu 19.04, because the audio layout of source data was not specified. Current plugins seem to require explicit specification of our interleaved input format audio caps as “format=interleaved”.

  • PsychRTBox: Adapt for use with Bits# emulated virtual RTBox. Tested on Linux, untested on macOS.

  • BitsPlusDIO2Matrix(): Allow use of Bits# trigger output port.

  • Ask/GetString/GetEchoString/GetCharTest: Deal with Unicode key input. This now allows to take input in character sets / from keyboard layouts other than US layout with ASCII/Latin-1. E.g., german umlauts etc. should be processed properly. Only tested on Linux, but hopefully works on Windows/macOS as well. One limitation that became apparent is that GNU/Octave doesn’t really support processing of Unicode, while Matlab does. So while you can record/receive use input from non-US layout keyboards, and process it in your own scripts, many of Octave’s string processing functions and printing of such strings to the command window via fprintf() or disp() may fail for non-ASCII characters. This is a Octave design limitation as of Octave 5.1. You will have to work around it on a case by case basis in your scripts.

  • PsychImaging: For Native10/11/16Bit framebuffer mode, don’t load identity lut. If use of a gpu native 10 Bit, 11 Bit or 16 Bit framebuffer is requested, and this happens via native graphics driver facilities and not via our own Linux+AMD MMIO low-level hackery, then do not request use of a identity gamma lut via LoadIdentityClut() anymore. Modern Intel/AMD/NVidia gpu’s when operated natively in > 8 bpc framebuffer depths can switch to hardware lut’s with more than 10 bpc output width, so we’d lose precision for gamma correction by using our shader based method instead. Also LoadIdentityClut() built in lut’s are only optimized for / targeted at 8 bpc framebuffer passthrough, e.g., for use with VPixx and CRS devices, VideoSwitcher and other video attenuators. If used in 10 bpc framebuffer mode or higher they might truncate output precision to 8 bpc, e.g., on Intel graphics chips under Linux!

  • PsychImaging: Add support for native 16 bit floating point framebuffers. A new task ‘EnableNative16BitFloatingPointFramebuffer’ requests 64 bpp, 16 bpc RGBA16F floating point windowing system framebuffers. Also requests >= 16 bpc float precision from the imaging pipeline if the pipeline is enabled. Switches to unclamped normalized high-res color range 0.0 - 1.0 as usual. This is so far only known to work in a meaningful way on NVidia GeForce 1000+ “Pascal” gpu’s under Windows-10. Photometer measurement on a 8 bit panel with dithering enabled showed at least roughly 11 bits luminance precision under quick testing. Didn’t work on AMD + Windows-10, untested on Intel, macOS. Not yet supported on Linux. AdditiveBlendingForLinearSuperpositionTutorial and BitsPlusCSFDemo show off the new mode on suitable gpu + os combos.

  • Snd(): Allow better interop with PsychPortAudio via pahandle sharing. “help Snd” for explanation. Should also help with shared use of PsychPortAudio and Beeper() or PsychPortAudio and Eyelink tracker calibration/recalibration iff Eyelink audio feedback tones are used.

  • OpenAL MOAL support improvements:
    • Clean up moaldemo and AudioTunnel3DDemo a bit. moaldemo did not work under Octave on any machine other my own, duh!
    • Fix use of OpenAL on Matlab R2015b and later: Broken, but never reported as broken by anyone.
    • Implement all missing OpenAL 1.1 functions, e.g., various missing alGetXXX() functions that are rarely needed.
  • DrawFormattedText2 with cache as input in cacheOnly mode, to transform text in cache without having it drawn to screen. Also some other bug fixes. By Diederick.

  • ConfirmInfo and TwoStateQuery now work in GUI mode on R2014b and later. By Diederick.

  • TwoStateQuery: Fix Octave GUI support for current Octave versions.


  • Priority(): Add support for Feral Interactive’s gamemode optimizations. See “help LinuxGameMode” for setup instructions and detailed explanations. The short story is that if you install the FeralInteractive gamemode package on your Linux distribution, which is easy on Ubuntu 18.04 LTS, then calling Priority(n) with a real-time priority level n > 0 will trigger additional automatic optimizations of your Linux system for optimal real-time behaviour, low-latency, precise timing etc. Hardware I/O for Octave/Matlab is prioritized over other applications. Processors (cpu’s) are switched into high-performance mode for more deterministic timing and compute performance. Supported graphics cards, currently modern models from AMD and NVidia, will be switched to high-performance mode as well. Priority(0) restores standard system operation for less real-time but more energy savings.

  • XOrgConfCreator: Usability improvements.

  • Try to workaround or at least warn about runtime environments which may cause trouble in multi-threaded operation, because the host application doesn’t call XInitThreads() early enough during application startup. This problem was discovered with the PsychHID implementation on Python. It is fixed in current PsychoPy releases, and worked around for various other Python IDE’s or the Python commandline interpreter. Turns out that Octave versions up to and including Octave 4.0.x (e.g,, shipped in Ubuntu 16.04 LTS by default!) and Matlab pre R2013b also have/had this problem. While Screen() has workarounds for this in place and PsychHID never caused trouble, this may mean we just got lucky. Ideally upgrading to Linux distros with at least Octave 4.2 (using QT-5 for its GUI) or Matlab versions of R2013b or later is recommended.

  • AMD Vega-M gpu’s should now get detected properly by low-level code to use our bag of tricks if needed. Vega-M is part of some high-end Intel processors.

  • LoadIdentityClut(): Now should also work to load identity pixel-passthrough, e.g., for use with VPixx devices, with latest AMD gpu’s of the DCE-12 Vega series and - starting with the upcoming Linux 5.3 kernel - also with latest AMD gpu’s/apu’s that have the new DCN-1/2 display engines, e.g., integrated AMD Raven / Vega11 in AMD Ryzen processors, or the brand-new AMD Navi gpu generation. These latter parts with DCN display engines are no longer supported by Psychtoolbox low-level setup code, as the default amdgpu display driver provides all the functionality we need - and more! This means though that we leave pixel-identity passthrough setup to the AMD display driver, so PTB must help the driver to do the right thing and validation is needed to make sure things stay in a good shape. Note this also means that DCN parts like Ryzen/Raven won’t be suitable for use with special visual stimulators like VPixx devices until Linux 5.3 is released with neccessary enhancements, e.g., as part of Ubuntu 19.10 in October 2019.

  • PsychHID: Allow keyboard queue cookedKeys to handle non-US keyboards. We now deal with other keyboard layouts than US properly. See “help KbEventGet” for remaining pitfalls or troubleshooting if extra configuration is required to make this work.

  • GetChar et al.: Use KbQueue fallback under Linux + Matlab + KDE. Not sure when this happened, but at least KDE Plasma 5 under Ubuntu 18.04 LTS and later steals keyboard input focus from the Matlab window as soon as a fullscreen PTB onscreen window opens. Various attempts at preventing this failed, e.g., use of different config options in the KControlcenter, definition of suitable window rules for Matlab or PTB, code hacks… The net result is that Matlab will lose input focus on Linux+KDE, therefore Java based GetChar() will be starved of keyboard input. Pragmatic solution: Detect if KDE is used as desktop GUI and use the kbQueue fallback, just like in matlab -nojvm mode, on Octave, and on Microsoft Windows. Other options would be to use old-style override redirect setup for onscreen windows even on KDE single-display via Screen(‘Preference’,’ConserveVRAM’, 2^25) – but then one must manually (Shift+ALT+F12) toggle off the desktop compositor, which is clunky and easy to forget.

  • VideoCapture: Fix use of dc1394src with GStreamer engine. Never worked. But is also kind of moot, as with pro class DC1394 cameras you should use our dedicated DC1394 firewire high-performance video capture engine. Anyway, cosmetic fixes are also fixes…


  • GetMouse can now also return “physical” mouse cursor position. For the Windows version, return two valuator axis, which encode mouse cursor (x,y) position in what MS calls physical cursor coordinates. This is the returned (x,y) position from calling the windows api function GetPhysicalCursorPos(). This only works with Matlab, not with Octave due to limitations of Octave’s MinGW runtime environment on Windows. As a side-effect, this also means Screen() won’t work with WindowsXP 64-Bit anymore, Windows Vista is now an absolute must. Officially we don’t support anything older than Windows-7 anymore, so this doesn’t really matter.

    Usage on Windows for additional physical coordinates:

    [x,y,b,f,v] = GetMouse();

    physicalX = v(1);

    physicalY = v(2);

    This may or may not help for use case from forum message 23845, fingers crossed!


  • PsychtoolboxKernelDriver: Add up to date, but unsigned, kext. This one is rebuilt from current source as of June 2019, so should support all AMD Polaris DCE-11.2 gpu’s used in Apples latest luxury toys, but not Vega gpu’s with DCE-12 display engine, so the most expensive Apple gear will as of now also be the most dysfunctional. “help PsychtoolboxKernelDriver” for details. The updated driver for latest Polaris gpu’s is not cryptographically signed or attested by Apple, so it will not load without SIP disabled. It may not even load automatically during system boot, requiring manual loading via kextload or kexttool after each reboot. The old driver is still shipping and this one is at least cryptographically signed - but not attested by Apple. However, latest - and way too late for this release cycle - user feedback from testing with a Polaris class “Radeon Pro 560X” gpu under macOS 10.14 Mojave shows that these machines are just as broken in terms of visual stimulation timing and timestamping as most other Apple machines. Therefore the driver can only detect but not fix or workaround the breakage. Upgrading to Linux is strongly recommended on the subset of modern Apple machines that still allow to do that without major pain and problems.

  • DownloadPsychtoolbox: Provide more hand-holding in case of outdated svn clients, as frequently shipping with the “most advanced operating system in the world”.


Psychtoolbox beta updated


Psychtoolbox 3.0.15 Beta update “P-Funk” was released at 7th February 2019. As usual, the complete development history can be found in our GitHub repository. The release tag is “PTB_Beta-2019-02-07_V3.0.15”, with the full tree and commit logs under the URL:

The Psychtoolbox-3.0.15 beta update “P-Funk” mostly contains bug fixes, workarounds for OS bugs, minor improvements here and there.

New features and improvements:

All operating systems:

  • Help text updates. Online docs improvements and updates.

  • Bug fixes and minor improvements.

  • Screen(‘DrawDots’) optimize round dot rendering for dot_type 3.

  • Screen(‘Transformtexture’) fix some corner-case bug.

  • DrawFormattedText/DrawFormattedText2: Suppress unicode warnings on Octave.

  • DrawFormattedText2 enhanced by Diederick: Can now handle unicode text. Can now cache drawn text into internal texture for much faster redrawing of text that needs to be presented in multiple stimulus frames, misc other improvements and fixes.

  • DrawFormattedText2Demo shows Diederick’s new features, like fast text scrolling by redrawing from texture cache, and unicode rendering.

  • The Brainard lab did random improvements to random stuff in PsychColorimetric, but without useful commit messages as usual, so i won’t try to figure out what they did. Things changed, ‘nuff said.


  • Fix AMD screen+output -> displayhead mapping for AMD gpu’s driven by amdgpu-kms + DisplayCore on kernels later than Linux 4.15. Makes auto-detection of mapping for low-level access plug & play again.

  • Add support for low-level access for AMD gpu’s with DCE-12 display engine, ie. Vega family.

  • Add low-level support for a few more upcoming AMD gpu’s.

  • Fix failure of Screen(‘DrawDots’) to draw round dots if different point sizes across dots are requested and running on Mesa versions 18.1.0 - 18.3.1. Bug is properly fixed in Mesa 18.3.2 and later.

  • Add highly experimental P-Sync support for some AMD gpu’s.


  • Fix a potential crash-bug on recent Matlab versions, e.g., reported against R2018a, with the new PsychOculusVR1 driver for Oculus Rift CV1 VR HMD.


  • PsychPortAudio: Increase default sound output latency to at least 10 msecs for reqlatencyclass setting 0 and 1 (which is the default class setting). This to work around the latest macOS operating system bugs wrt. audio. Apples trainwreck reports being able to support latencies it can’t actually handle, so on some Macs this leads to audio dropout and crackling sounds. Select a latency more compatible with the trainwreck, unless agressive low latency is requested with settings 2 and greater, or manually overriden with the suggestedLatencySecs parameter.

  • Block use of PsychtoolboxKernelDriver for AMD gpu’s with DCE-12 display engine for now, ie., Vega family, e.g., the most expensive 2018 MacBook”Pro” toy, and the absurdly overpriced iMac”Pro”. DCE-12 is not yet supported in our low-level code for macOS and can’t be validated without access to suitable hardware. This means that those machines are mostly unusable for exact visual timing and other tasks with need for precise control, and that many bugs can’t be detected/worked around by Psychtoolbox.


Psychtoolbox beta updated


Psychtoolbox 3.0.15 Beta update “Late Bloomer” was released at 25th November 2018. As usual, the complete development history can be found in our GitHub repository. The release tag is “PTB_Beta-2018-11-25_V3.0.15”, with the full tree and commit logs under the URL:

The Psychtoolbox-3.0.15 beta update “Late Bloomer”, apart from minor improvements, adds one piece of long awaited functionality, basic support for the Oculus VR Rift CV1 Virtual Reality headset for 64-Bit Microsoft Windows 7 and later. Two years later than i hoped, but better late than never…

New features and improvements:

All operating systems:

  • Some help text updates.

  • TextBounds(): Make usable with Unicode text.

  • Remove Psychtoolbox3-Slides.pdf - it was utterly outdated.

  • License and trademark doc updates.


  • Finally adds support for the Oculus Rift CV1 and other Oculus VR products using the “new” v1 SDK and runtime. The new PsychOculusVR1() driver allows use of the Oculus Rift CV1 under 64-Bit Microsoft-Windows 7 or later versions with Octave 4.4.1 or Matlab. Use of Windows-10 is strongly recommended. Existing VR usercode should not need modifications if it uses the PsychVRHMD() high-level driver, as the new driver is as compatible to the old driver as possible, so the switch to a Rift CV1 should be basically plug & play. Example demos that should work are VRHMDDemo, VRHMDDemo1, SuperShapeDemo, MorphDemo, and as part of the separate Horde3DForPsychtoolbox package the HordeVRDemo. Classic “closed loop” VR with a tight stimulus presentation loop that uses Screen(‘Flip’, win); should work well, as tested on Windows-10. Timed flips however, a la Screen(‘Flip’, win, tWhen); with a target time more than a video frame in the future, may show unreliable timing. Timestamps returned by ‘Flip’ will be generally not very accurate or trusworthy, despite being self-consistent. Pausing animations for more than about a second will bring up the sandclock icon in the VR view. These are limitations imposed on us, because the Oculus v1 SDK allows for much less low-level control than our other VR drivers, ie. the old Oculus drivers for Rift DK1 and Rift DK2, or the PsychOpenHMDVR driver for Linux. It is unclear if this can be improved upon, but so far all my attempts failed due to SDK limitations or what might be bugs in the proprietary Oculus runtime / VR compositor for Windows, or in NVidia’s proprietary graphics drivers for Windows. The new driver exposes support for VR input controllers like the Oculus Remote control, the XBox controller or the Oculus Touch controllers - the new demo VRInputStuffTest.m shows the new input capabilities.


  • AppleVersion(): Make it less broken, but still pretty pointless.

  • PsychJavaSwingCleanup: Try to cope with latest macOS Mojave bugs: On Mojave, onscreen windows get stuck after “window close”, because Apple. Probably new bugs in macOS 10.14 Window/GUI event handling. The hack is as awful as the operating system it tries to deal with. Use of macOS 10.14 is strongly discouraged and officially unsupported at this time.


Psychtoolbox beta updated


Psychtoolbox 3.0.15 “The Shape of Things to Come” was released at 8th November 2018. As usual, the complete development history can be found in our GitHub repository. The release tag is “PTB_Beta-2018-11-08_V3.0.15”, with the full tree and commit logs under the URL:

This is a substantial upgrade, collecting over 5 months of work, with potential backwards compatibility breaking changes especially for Windows audio support. Apart from various small improvements and bug fixes these are the major new features and improvements:

New features and improvements:

All operating systems:

  • Substantial internal code refactoring.

  • Initial port of a subset of Psychtoolbox mex files to Python:
    • WaitSecs, GetSecs, IOPort, PsychHID and PsychPortAudio are ported.
    • Python 2.7 and Python 3.5+ should work, but Python 3.6+ is recommended.
    • Python extension binaries are not bundled with Psychtoolbox, to not further bloat the distribution, also because these extensions have to be built specifically for each minor Python 3.x release, due to limitations in Python’s ABI compatibility. Local builds and installs can be done via standard distutils method, e.g., python install –user
    • Basic Python support code and basic test code in the PsychPython subfolder of the root folder.
    • Porting of these Psychtoolbox mex files to Python was financially supported by a contract with the University of Nottingham on behalf of Jon Peirce and the PsychoPy toolkit ( Thank you!
  • PsychPortAudio: Upgrade used libportaudio from our over 10 years old heavily modified branch to what is essentially the (almost) unmodified current upstream Portaudio v19.6.0-devel. This has different OS specific consequences - new features and improvements, but also loss of features - listed below. Various audio demos and tests have been refined accordingly. Small other improvements, e.g., one can now specify a fractional sampling frequency in ‘Open’ and debug/diagnostic messages have been refined.

  • BitsPlusPlus improvements:
    • Support two connected CRS devices for dual-display operation: New subfunction ‘SetDualDevices’ controls and describes the new functionality.
    • Improvements to ‘OpenBits#’ - handles, port specs.
  • Screen: Remove restriction of valid refresh between 25-250 Hz. Also allow to skip “out-of-vblank” 2 msecs minimum waits before Flip via a new ConserveVRAMSettings flag. This allows to operate displays with more than 250 Hz refresh rate, or even more than 500 Hz, e.g., custom DLP devices, although the latter might be highly unstable on operating systems other than Linux.

  • CreateProceduralSmoothedApertureSineGrating(): Clarify interactions with alpha blending. Documentation and demos got updated. With contributions from Matthew Krause. See GitHub issue #505 for more details and discussion (

  • PsychOptics: OtfToPsf(): Increase default tolerance for negative PSF values. (David Brainard)


  • This release is tested and known to work well on Ubuntu 18.04 LTS “The Bionic Beaver”, which going forward is now the recommended Linux distribution. Ubuntu 16.04 LTS continues to be supported and tested, specifically Ubuntu 16.04.5 LTS. Ubuntu 14.04 LTS is less than 6 months away from its end-of-life and no longer receives any compatibility testing, but expected but not verified to work reasonably well. Please note that our upstream release may not work with Ubuntu 18.10 “Cosmic Coala” at least as tested with Ubuntu 18.10’s Octave 4.4.1 due to potential ABI compatibility issues. You need to use official distribution packages built and provided by Ubuntu 18.10, or NeuroDebian provided packages of octave-psychtoolbox-3 once they become available.

  • Screen: Improve detection of AMD gpu’s under Mesa 18 and later on Ubuntu 18.04 LTS. Also now support AMD Vega 10, Vega 20 and Vega M for low-level control.

  • Screen: Handle amdgpu-kms’s DisplayCore code for engine detection. Make display detection and identity pixel passthrough work on latest generation AMD gpu’s controlled by the new AMD DisplayCore driver. AMD RavenRidge APU’s have a new DCN display engine, and PTB’s low-level gpu control code is not tested/verified for compatibility with those new display engines. May or may not work.

  • Fix multitouch touch screen input support on multi-X-Screen setups. This didn’t work properly due to what i think is likely a X-Server bug. Now we work around the problem. Reported by multiple users to work now on single x-screen and multi x-screen setups with one or more touch displays.

  • PsychPortAudio on Linux now dynamically links against the system provided, e.g., version 19.6.0 on Ubuntu 18.04 LTS. This

    • Allows for additional low latency optimizations for even lower latencies at requested latency class 3 or higher, e.g., less than 10 msecs on Intel HDA onboard sound chips.
    • Supports use of the JACK audio server as an additional backend to the standard ALSA backend.
    • It is so far untested if PsychPortAudio still works out of the box on Ubuntu 14.04 LTS, whose bundled portaudio library may or may not be too old, whereas support on Ubuntu 16.04 LTS is verified.


  • GNU Octave 4.2.0 is no longer supported. Psychtoolbox 3.0.15 now requires and supports the new 64-Bit Octave 4.4.1 ( Psychtoolbox on Octave 4.4.1 has been tested with GStreamer 1.14.4. Due to incompatibilities between Octave and GStreamer you will need to delete the following DLL files in the C:\Octave\4.4.1\bin\ folder, or Screen() won’t work properly:
    • libglib-2.0.0.dll
    • libgmodule-2.0.0.dll
    • opengl32.dll
  • wintabslowloop.m: Fix missing assignment/misasignment of pkt(9) when using WinTabMex() for accessing digitizer tablets. This allows to properly handle pen pressure information. However, user reporting suggests that the WinTab api is sometimes unreliable on some tablets and use cases.

  • PsychPortaudio now uses a dynamically linked Portaudio 19.6.0-devel DLL from upstream:
    • As this DLL is build with MSVC 2017, it requires the “Microsoft Visual C++ 2015 redistributable Update 3”, which may or may not be part of Windows-7 and later. I couldn’t verify this due to lack of testing hardware.
    • The proprietary ASIO sound API and backend is no longer supported. Note: “ASIO is a trademark and software of Steinberg Media Technologies GmbH.”
    • DirectSound backend support is also removed in this build.
    • ‘DirectInputMonitoring’ is no longer supported.
    • PsychPortAudio now supports the Windows WASAPI sound system on Windows Vista and later and uses it in low-latency/high timing precision mode. Microsoft documentation claims substantially improved performance for WASAPI compared to older legacy Windows backends(See Testing on one machine with a Intel HDA onboard sound chip showed that millisecond accurate sound timing and sound onset timestamping is possible, with comparable precision to the former ASIO backend on pro sound hardware. On Windows-10, absolute latencies for sound onset of less than 10 msecs and bit-exact audio reproduction are possible for high settings of reqlatencyclass, whereas older versions of Windows are more limited, often to at least 20 msecs latency.
    • Mapping of PsychPortAudio sound channels to hardware channels is now via the ‘selectchannels’ parameter of PsychPortAudio(‘Open’, …); on the WASAPI backend with Windows 7 - Windows 10. However, how well channel mapping works is so far untested. Mapping is not likely to be identical with the one formerly supported via ASIO, so scripts using the ‘selectchannels’ parameter may need to be adapted.


  • macOS 10.12 Sierra is no longer tested by myself. My development and main test system is now macOS 10.13 High Sierra, but testing is very limited due to ageing and partially defective hardware. Psychtoolbox is now built against the 10.14 Mojave SDK, but should continue to work on macOS 10.11 El Capitan, which however judging by the lack of critical security updates seems to have been declared end-of-life and abandoned by Apple. macOS 10.14 Mojave received some very light testing. Mojave seems to be the so far worst Apple operating system for visual stimulation. Testing on a Apple macMini 2012 showed visual stimulation to be completely broken.

  • GNU Octave 4.2 is no longer supported. Psychtoolbox 3.0.15 now requires and supports the new 64-Bit Octave 4.4.1, as tested with the HomeBrew version (

  • Screen: Workaround broken OSX Show/HideCursor support. Multiple invocations of HideCursor or ShowCursor no longer stack and behave like on real operating systems.

  • PsychPortaudio now uses unmodified and statically linked Portaudio 19.6.0-devel:

    • ‘DirectInputMonitoring’ is no longer supported.
    • Mapping of PsychPortAudio sound channels to hardware channels is now possible via the ‘selectchannels’ parameter of PsychPortAudio(‘Open’, …);
    • PsychPortAudio may now allow for a tad lower latency and better timing precision on modern Apple Macs due to some optimizations and fixes.


Psychtoolbox beta updated


Psychtoolbox 3.0.14 “Red Alert!” SP4 was released at 26th May 2018. As usual, the complete development history can be found in our GitHub repository. The release tag is “PTB_Beta-2018-05-26_V3.0.14”, with the full tree and commit logs under the URL:

New features and improvements:

All operating systems:

  • Fix a crash on Linux or MacOSX with Matlab R2018a if CTRL+C is pressed while KbQueues are active.
  • PsychtoolboxPostInstallRoutine: No longer perform any online registration.
  • No longer prompt for any participation in the 1st Psychtoolbox user online survey.
  • Various help text updates. Various minor updates in debugging output.
  • Ask(): Fix formatting / text alignment. Fix by user jonasvannijnatten.
  • psychrethrow(): Handle MException objects.
  • EyelinkGazeContingentDemo: Fix issues due to recent Matlab case sensitivity.
  • New types of procedural shaders by Ian Andolina: Add smoothed edge disc and sine gratings, add square wave grating.
  • LoadOBJFile: Fix error if texture coordinates or normal vectors are missing. Reported and partially fixed by user wangsen131. Additional fixups by kleinerm
  • PsychPortAudio: Handle lifecyle issues and some other bugs. Fixes contributed by user bmtran. Some minor other improvements by kleinerm.
  • Screen: Fix Screen(‘Close’, window) logic.
  • Screen: No longer report ‘dacbits’ in Screen(‘ReadNormalizedGammaTable’) - it’s bs. There’s no way we can faithfully detect and report it, so just report 0 from now on as “I don’t know”. Better no info than wrong info.
  • Fix creation of procedural shaders on multi-window, multi-screen setups under certain corner cases.
  • PsychColorimetric: New function ComputeDE2000_Lab by David Brainard’s lab. Other minor improvements, e.g., to SplineSpd().
  • Quest: Improvements by Denis Pelli: “Enhanced to allow for monotonically DECREASING psychometric function. Formerly we assumed it was monotonically INCREASING. Now it can be either. This new feature has not been extensively tested.”. Some optional animated graph for QuestDemo.
  • New ProceduralSmoothedDiscMaskDemo by Ian Andolina.
  • Small “help GStreamer” fix.
  • Welcome splash is no longer asking for donations.


  • XOrgConfCreator improvements:
    • Handle multi x-screen setups better if modesetting-ddx video driver is used, as on latest Ubuntu 16.04.3+ LTS systems for Intel graphics chips.
    • Force the NVidia proprietary graphics driver to report/allow VR HMDs instead of hiding them. By default such HMDs get hidden, unless a proper xorg.conf is created to force them to show up.
    • Allow selection of color depth 30 on a per-x-screen basis. Not needed for AMD gpu’s, but useful for NVidia proprietary and for future depth 30 support on NVidia open-source and Intel open-source drivers.
  • Screen: Allow logging and delay of NVision3D trigger timing. setenv(‘PTB_NVISION3D_DELAY’, ‘SECONDS’); allows to delay trigger emission by SECONDS after vblank, in case we need to phase-shift the trigger emission. This will also swap emission of left-eye and right-eye triggers. This temporary debug setting should allow to better find out how to get this actually working ok’ish.

  • Build fixes for latest Debian upstream.

  • Minor improvements to low-level gpu control code.

  • Add AMD DCE12 as supported display engine for low level functions - Untested due to lack of hardware, assumed to work like older generations DCE10/11.

  • Screen: Disable GstDeviceMonitor/DeviceProvider support on Linux. It only provided minor to no benefit so far, we can easily do without it. This removal allows to build PTB on Ubuntu > 14.04 in the future while hopefully retaining backward compatibility for basic features to Ubuntu 14.04 for its remaining 1 year life-span.


  • Timeglue: Improve single-core locking on Windows. This to avoid a potential failure in very rare circumstances. In fact, only one failure incident was reported in over 10 years, not reproducible, so this may be a pointless improvement, but who knows?


  • GetMouseWheel(): Fix potential compatibility issue with some mice when using this low-level trickery. May or may not help. May or may not hurt.
  • GetKeyboardIndices/GetKeypadIndices: Filter out locationID zero on OSX. Just like default logic for KbCheck does, to deal with the broken MacBookPro 2016+ touch-bar.

Psychtoolbox beta updated


Psychtoolbox 3.0.14 “Yellow Alert!” was released at 8th October 2017. As usual, the complete development history can be found in our GitHub repository. The release tag is “PTB_Beta-2017-10-08_V3.0.14”, with the full tree and commit logs under the URL:

New features and improvements:

All operating systems:

  • PsychPowerMate: Add ‘List’ function for enumerating multiple PowerMates, and the ability of ‘Open’ to select among them. Add timeout ability to ‘WaitButton’ and ‘WaitRotate’. Add a ‘wait for button release’ ability to ‘WaitButton’. Help text updates.
  • PsychtoolboxConfigDir: Cleanups and error handling improved.
  • Screen(‘ConfigureDisplay’,’Brightness’) - Fail gracefully on pure brightness queries: Return a -1 “unsupported” status code on unsupported setups instead of error out.
  • Screen: Make blue-line stereo sync lines 3 scanlines high. Increases robustness against slightly buggy display drivers and picky stereo goggle sync equipment.
  • NetStation: Add response check to GetNTP synchronization. For improved error handling. Contributed by Andreas Widmann.


  • Research-grade Multi-Touch touchscreen and touchpad support. “help TouchInput” for a starter. MultiTouchMinimalDemo.m for a simple demo. MultiTouchDemo.m for an advanced demo.
  • PsychHID: Motion and valuator change recording in KbQueue event buffers, e.g., for time-stamped background recording of mice/joysticks/gamepad/controller movements etc.
  • PsychHID: Add new KbQueueCreate flag 4 for raw motion event delivery. Mostly useful for capturing raw motion dynamics of pointing devices or joysticks.
  • PsychPowerMate: New functions for background recording of knob turns and knob presses. Also acts as a demo for how to use the new motion/valuator change recording of PsychHID.
  • help Hybridgraphics simplified, now that Ubuntu 16.04.3-LTS makes many things simpler.
  • Improve some timing related info/warning messages.


  • help DrawTextPlugin: Give more detailed troubleshooting instructions for Matlab + Windows.


  • help PsychtoolboxKernelDriver: Update for Apples latest train wreck.
  • PsychHID/DaqDeviceIndex: Improve USB-HID interface detection. This may make DaqDeviceIndex work more reliable on the train wreck.
  • Add new warning message when running on OSX with broken AMD graphics, so people don’t waste time trying to get reliable timing on an unfixable setup. Clarify various other mostly OSX related warning messages.

Psychtoolbox beta updated


Psychtoolbox 3.0.14 “Kafkaesque!” was released at 19th August 2017. As usual, the complete development history can be found in our GitHub repository. The release tag is “PTB_Beta-2017-08-19_V3.0.14”, with the full tree and commit logs under the URL:

New features and improvements:

All operating systems:

  • ConfirmInfo/TwoStateQuery: Remove brain-dead, broken GUI mode on current Matlab R2014b+, use sane text mode instead.
  • Helptext updates for KbName and DrawTextPlugin.
  • Make glShaderSource() command more robust against awkward/funky formatted GLSL shader code.
  • Fix ClockRandSeed() for compatibility with Octave, and with current Matlab.
  • Some improvements to ComputeCIEConeFundamentals.m by David Brainard.
  • Add new optional ‘GetNTPSynchronize’ command to NetStation(), which allows to NTP synchronize event timestamps on suitable EGI Netstation systems for much higher timestamp accuracy. Successfully tested on a 400 series amp with Linux as client and MacOs Netstation amp machine. Also a new helper function GetNTP() which is an OS independent simple NTP client. Code contributed and tested by Andreas Widmann and Urte Roeber, with helpful input by Justin Ales.
  • Add matching/selection of devices by productName, serialNumber or locationID to all of GetKeyboard/Mouse/Gamepad/KeypadIndices, ie. wherever this was missing.
  • VideoMultiCameraCaptureDemo: Make it write movies in a format that even Apples dumb Quicktime player can comprehend, similar to ImagingStereoDemo.


  • PsychOpenHMDVR driver for virtual reality headsets (HMDs) supported by OpenHMD. See “help PsychOpenHMDVR” for help and setup instructions. OpenHMD currently supports the Oculus Rift DK1/DK2/CV1, the HTC Vive, the Sony PSVR, and some more exotic devices. No controller input is supported so far. Only head orientation/rotation tracking supported, no absolute position tracking, as that is wip in OpenHMD. Also less sophisticated latency/blur compensation. The driver is so far tested with the Rift DK2 and Rift CV1 on standard PC and the DK2 on RaspberryPi-2. Use of the CV1 requires running openhmdkeepalivedaemon.
  • Clear screen in multi-x-screen config properly to black in stereomode 4/5 at window close.
  • Support transparent windows on 10 bpc / 30 bit color depth setups.
  • Handle use of software renderer wrt. to stimulus timing a bit more intelligently - avoid false warning.
  • VRHMDDemo: Allow selection of HMD via optional deviceIndex parameter.
  • KbQueues: Fix failure to detect key events on multi-x-screen setups if mouse pointer is on other screen than X-Screen 0.


  • Handle backwards compatibility bugs in AMD’s proprietary display drivers for Windows, which cause failure to load identity lut’s in LoadIdentityClut() or failure to disable digital display dithering when requested to do so. Investigated and fixes contributed by Mark Repnow.

  • Some build system improvements and code formatting cleanups by Diederick. Also removal of dead tests for ancient Matlab 4/5 bugs on ancient MacOS 8/9.

Psychtoolbox beta updated


Psychtoolbox 3.0.14 “Kalsarikännit” was released at 11th June 2017. As usual, the complete development history can be found in our GitHub repository. The release tag is “PTB_Beta-2017-06-11_V3.0.14”, with the full tree and commit logs under the URL:

This release mostly contains bug-fixes, small improvements and minor new features.

Btw. I’ve observed on some MS-Windows systems that UpdatePsychtoolbox - or more accurately the underlying svn Subversion command line tool - didn’t do anything. It claimed a successfull update, but didn’t update anything. This was also reported once in our Issue tracker. I don’t know if this is a Windows specific svn bug, or something more widespread. Anyway, if UpdatePsychtoolbox doesn’t upgrade/change about 60 files then something went wrong, and you’ll need to use DownloadPsychtoolbox for a completely fresh download. Let us know if this happens on other systems than Windows.

New features and improvements:

All operating systems:

  • Fix PsychImaging ‘EnableCLUTRemapping’ task. Did only work in scripts, not functions, due to a bug introduced in last beta. Also had off-by-one indexing errors for > 256 slot LUTs. CLUTMappingBugTest.m allows to test for proper functioning of this now, ie. verifies the bug-fix.

  • Fix use of Screen(‘PutImage’) when Psychimaging NormalizedHighRescolorRange task is used. PutImageTest.m verifies the bug fix.

  • Improve Screen(‘LoadNormalizedGammatable’) compatibility with functions that expect return values for loadOnNextFlip setting 2 – where those return arguments are meaningless, but return them anyway with faked values to simplify user scripts.

  • NetStation() go back to January 2017 version, as the version from the latest beta contains show-stopper bugs curtesy of myself and Justin Ales. This needs more work before a proper update to NTP synced synching is possible.

  • Remove all traces (and users) of the long dead SerialComm() serial port driver for 32-Bit Matlab on OSX. This wasn’t used by default by anything, and everything has higher quality IOPort based implementations.

  • Final fixes and prep work for the ready-for-release, but unreleased, new OculusVR1 driver for Oculus HMD’s which need the 1.x runtime.

  • Add compat code to the general VR handling routines like PsychVRHMD, and add some compat routines for functions freshly exposed on the Oculus-1 driver.

  • Pimp some VR related demos a bit.


  • Provide anti-aliased round dots on RaspberryPi via Screen(‘DrawDots’). Raspian can do this now with its current Mesa vc4 driver version.

  • Update “help SyncTrouble” and “help HybridGraphics”, as well as some flip warning messages, to reflect our current knowledge about this stuff on Linux.

  • Fix NVidia Optimus detection on Linux with the proprietary NVidia driver. Turns out our detection code only worked by chance on the NVidia 840M laptop by chance. Increasing hardware samples to n=2 with the Razer Blade 2016 showed it was broken. Now works (hopefully) on all such laptops.

  • XOrgConfCreator: Add automatic setup code for 30 bit native framebuffers (Intel, NVidia, amdgpu-pro), and setup for special 16 bpc framebuffer experimental code on Linux + AMD Sea Islands gpus.


  • Make ColorCal2() driver work on Windows by use of virtual COM port, by a dedicated code path.

Psychtoolbox beta updated


Psychtoolbox 3.0.14 “Spooling up the spinner!” was released at 12th May 2017. As usual, the complete development history can be found in our GitHub repository. The release tag is “PTB_Beta-2017-05-12_V3.0.14”, with the full tree and commit logs under the URL:

This release contains the accumulated work of 4 months, 200 separate improvements in 176 files, changing about 27000 lines of code. Major work was done under the hood for Linux improvements and prep work for VR HMD support improvements.

Btw. I’ve observed on some MS-Windows systems that UpdatePsychtoolbox - or more accurately the underlying svn Subversion command line tool - didn’t do anything. It claimed a successfull update, but didn’t update anything. This was also reported once in our Issue tracker. I don’t know if this is a Windows specific svn bug, or something more widespread. Anyway, if UpdatePsychtoolbox doesn’t upgrade about 176 files then something went wrong, and you’ll need to use DownloadPsychtoolbox for a completely fresh download. Let us know if this happens on other systems than Windows.

New features and improvements:

All operating systems:

  • New function Screen(‘ConstrainCursor’); for Linux/X11 and MS-Windows: Allows to constrain cursor movements to subareas of an onscreen window. Not supportable on OSX due to lack of OS facilities.

  • DrawFormattedText: Optionally return per-word bounding boxes to define AOI’s, e.g., for text perception + eye tracking studies.

  • Brand-new DrawFormattedText2() function and DrawFormattedText2Demo by Diederick Niehorster. More flexible in its formatting and text transformation options than DrawFormattedText. This is considered beta quality for now, bugs may linger in this large new piece of code. I added the ability to return per-word bounding boxes, like in DrawFormattedText, but that code has the limitation that it doesn’t yet work with complex compound transforms.

  • VideoIPWebcamCaptureDemo: Add sample mode for screencasting. Setup code and example gst-launch lines for live screen-casting from Linux X11 (tested) or Windows (untested) to PTB’s videocapture, so random windows from the desktop can be live-displayed into a PTB fullscreen onscreen window.

  • Screen(‘GetImage’) can now automatically handle multi-sample anti-aliased drawbuffers without need for manual intermediate steps for readback of such buffers as MSAA resolved images.

  • PsychImaging ‘PseudoGray’ task can now also boost 10 bpc and 12 bpc framebuffers by up to 2.8 bits in grayscale precision in principle, although this is only very lightly and incompletely tested due to lack of suitable native 10/12 bpc display devices.

  • New PsychImaging ‘UseSubpixelDrive task to allow to drive special medical imaging high precision grayscale displays with high precision, e.g., the “Eizo RadiForce GS-521”.

  • New GetSecs subfunction [getSecsClock, wallClock, syncErrorSecs] = GetSecs(‘AllClocks’); returns not only regular GetSecs() timestamp as ‘getSecsClock’, but also a wall clock timestamp ‘wallClock’ in UTC world time. This ‘wallClock’ time can be OS synchronized to external time references, e.g., via NTP, to synchronize it with the clocks of other computers. Measures seconds since some reference point, 1.1.1970 00:00:00 UTC on Linux and OSX with microsecond resolution, seconds since 1.1.1601 00:00:00 UTC on MS-Windows with millisecond resolution. This may come in handy for interoperation with EGI Netstation EEG systems.

  • Some improvements to PsychColorCal routines by the Brainard lab.

  • Various fixes and small improvements.

  • Large amount of under the hood infrastructure prep work for supporting new VR HMD devices, but no support for new devices yet. Check for potential regressions if you use Psychtoolbox Oculus Rift DK1/DK2 support!


  • help PsychtoolboxKernelDriver: Update setup instructions / help text for OSX 10.11+.

  • Document 10/11 bpc framebuffer mode behaviour on OSX 10.11/10.12, improve setup code. Thanks to Denis Pelli and Hoermet Yiltiz for testing on their machines.

  • Some fixes for MacBookPro 2016’s brokeness.


  • Screen(): Disable the magic “@” master abort key.

  • Better support for compose/compound/dead keys handling for GetChar / KbEventGet by Diederick.

  • PsychRTBox: Fix box serial port probing for Octave on Windows. Although Xiangrui Li found an even better solution, which is not part of this update yet.

  • Fix Optical() brokeness due to compatibility bugs introduced by MS into Windows-7. Credit: Andreas Widmann.


  • Improved hybrid graphics laptop support: Detail work and improved setup documentation for hybrid graphics with the open-source drivers (Intel + AMD, Intel + NVidia), and verified that NVidia Optimus (Intel + NVidia) also works ok with NVidia proprietary drivers, as tested on Ubuntu 17.04 “Zesty Zappus”. Add extra setup instructions specifically for NVidia + Ubuntu 17.04. Tested on two separate Optimus laptops, a Lenovo Ideapad Z50-70, and a Razer Blade 2016 with GeForce Pascal.

  • Improved compatibility with amdgpu-pro hybrid graphics driver, for the very few cases where that driver is beneficial over the standard AMD open-source drivers, e.g., certain 144/165/240 Hz refresh rate displays.

  • Improved 11 bpc / 16 bpc native framebuffer support for AMD gpu’s, and better setup instructions.

  • NVidia NVision 3d stereo emitter support for NVidia stereo goggles on regular consumer class GeForce gpu’s, AMD gpu’s and Intel gpu’s should now work with more emitter models, especially - as tested - with some NVision-2 emitters, whereas before only original NVision-1 emitters worked.

  • GetMouseWheel() now also works on Linux.

  • Improve GetMouse() coordinate handling on multi-x-screen.

  • Make PR-670 photometer work out of the box on Linux by adding workarounds for that devices broken firmware. Note: PR-670 remains broken on OSX 10.11, but seems to work on OSX 10.12.

  • Improve default keyboard selection if exotic or broken keyboard like devices are connected.

  • Various improvements, bug fixes, too many to mention.

Psychtoolbox beta updated


Psychtoolbox 3.0.14 “Standby FTL!” SP1 was released at 3rd January 2017. As usual, the complete development history can be found in our GitHub repository. The release tag is “PTB_Beta-2017-01-03_V3.0.14”, with the full tree and commit logs under the URL:

This is the initial v3.0.14 release. It drops all support for MacOSX 10.10 Yosemite. Psychtoolbox will not work at all anymore on OSX 10.10. Going forward only 10.11 El Capitan and 10.12 Sierra are expected to work, but only 10.12 Sierra is officially supported.

This release also cancels support for 64-Bit Octave 4.0 on OSX and Windows and introduces support for 64-Bit Octave 4.2.0 on OSX and Windows.

New features and improvements:

All operating systems:

  • Various help text updates, some refinements to some demos.


  • Terminate support for OSX 10.10 “Yosemite”. Psychtoolbox will no longer work at all with 10.10.
  • Without OSX 10.10 our own kernel driver based 10 bit framebuffers on AMD graphics cards won’t work anymore, as Apple sabotaged this functionality on 10.11 and later. Therefore remove our own 10 bpc support code.
  • Introduce support for OSX 10.11.4+ native 10 bit framebuffers on supported Apple hardware. This is untested due to lack of suitable hardware, but Apple docs claim it should work “under some conditions” on the 2013 MacPro with “suitable displays” and on the late 2014 and late 2015 iMac 27 inch Retina 5k models.
  • OSX 10.12 “Sierra” is now the only officially supported and lightly tested Apple OS, although PTB should continue to work on 10.11.
  • Implement a workaround for the MacBook”Pro” 2016 touchbar brain-damage. This will probably make KbCheck and KbQueues work again, but while the problem has been diagnosed, the fix is so far untested.
  • Some new workarounds for OSX sync failures on some iMac Retina 5k models, likely only minimally effective.
  • Terminate support for 64-Bit Octave 4.0.
  • Introduce support for 64-Bit Octave 4.2. Octave 4.2 is currently available via the HomeBrew and MacPorts package managers. Psychtoolbox has been only tested with Octave-4.0.0 from HomeBrew. You need to install/compile Octave from source if you want functional audioread/audiowrite functions for reading and writing wav audio files, e.g., via

    brew install -s octave –with-docs –with-java –with-sndfile



  • Some compatibility fixes to XOrgConfCreator on Linux + Matlab + NVidia by Ian Andolina.

Psychtoolbox beta updated


Psychtoolbox 3.0.13 “Jump Prep!” was released at 6th December 2016. As usual, the complete development history can be found in our GitHub repository. The release tag is “PTB_Beta-2016-12-06_V3.0.13”, with the full tree and commit logs under the URL:


New features and improvements:

All operating systems:

  • Download/Setup/UpdatePsychtoolbox: Be more lenient on unsupported platforms, to allow downloading of old PTB versions.
  • Fix compatibility of MOGL low-level OpenGL for Matlab support with Matlab R2015b and later versions.
  • MOGL: Fix glClearNamedFramebufferfi().
  • Improvements to DaqAInScan(), some by user jsdpag. New option options.nodiscard. Robustness improvements if multiple DAQ’s are connected. Fixes for Matlab’s brokeness since R2013b.
  • Improvements to ple and PsychEyelinkDispatchCallback by iandol.
  • Fix getting Psychtoolbox root folder in scripts with nested functions, by zacklb.
  • NetStation: Fixed bug for less than 4 arguments for an event and improved argument handling for events. By Justin Ales.
  • VBLSyncTest: Only abort via ESC key, truncate plots/analysis on short (aborted by ESC) runs.
  • Fixes to text rendering plugin for textHeight return argument of Screen(‘TextBounds’) by Diederick.
  • Misc other fixes and lots of low level compatibility/maintenance work, e.g. upgrade of Screen() and moglcore() to GLEW-2.0, which is now the minimum required GLEW version.


  • Screen: New workarounds for the deficient Apple OS, to avoid some crashes of Matlab/Octave after a ‘clear all’ and then running a PTB script using Screen() again.
  • PsychtoolboxKernelDriver: Add support for AMD Polaris and Nvidia Pascal gpu families. Support for OSX 10.12 “Sierra”.
  • LoadIdentityClut: Intel HD gfx needs type 2 lut on OSX. At least on current Intel HD chips.


  • Fix potential ‘deviceIndex’ breakage for KbCheck on Windows.
  • IOPort on Windows: Allow specification of COM port numbers > 9, e.g., COM10.


  • Linux: Disable loading of ‘lp’ parallel port line-printer module harder, to simplify use of parallel ports for digital i/o.
  • Various improvements related to use of hybrid graphics/switchable graphics/Enduro/Optimus Laptops under Linux.
  • Linux: Add docu, config files and modified modesetting ddx for some use of NVidia Optimus Laptops under Linux with the proprietary NVidia driver under X-Server 1.19. See “help HybridGraphics”.

Psychtoolbox beta updated


Psychtoolbox 3.0.13 “Boldly go where no one has gone before!” was released at 10th September 2016. As usual, the complete development history can be found in our GitHub repository. The release tag is “PTB_Beta-2016-09-10_V3.0.13”, with the full tree and commit logs under the URL:


New features and improvements:

  • Initial hybrid graphics laptop support for Linux (prime renderoffload) “help HybridGraphics”. Describes setup to get the majority of hybrid graphics laptops to work between “useable” and “really well” under Linux.

  • PsychLinuxConfiguration: Automate setup of AMD deep color support, e.g., for DisplayPort deep color and HDMI deep color.

  • Some improvements to XOrgConfCreator.

  • Provide basic compatibility with the Windows-10 “Windows subsystem for Linux”. With a X-Server like XMing installed, allows to run some basic “PTB for Linux” functionality in Windows-10’s new Linux emulation layer. However, no sound, no PsychHID functionality/KeyboardQueus/DAQ, very bad timing, visual tearing artifacts. This more for geek cred than for any even remotely research grade use.

  • New demo VideoIPWebcamCaptureDemo.m - Capture streaming video from Android IPWebcam app.

  • GetGamePadIndices: Make as capable as GetKeyboardIndices.

  • CreateProceduralGabor: Add optional ‘validModulationRange’ parameter. Suggested by Taylor Hanayik.

  • DownloadLegacyPsychtoolbox: It’s dead, Jim! Download of legacy toolbox versions < 3.0.10 is currently broken.

  • SeparateAlphaTextureShader.vert.txt: Add additional (dx2,dy2) offsets. This allows for off-center rotation of sampled texture images. A usage example would be the one described in PTB forum message 20926. Shaders are created via MakeTextureDrawShader(‘SeparateAlphaChannel’), cfe. DriftDemo6.m

  • KbWait: reorganized and simplified input checking a bit. KbQueueFlush minor improvements. From Diederick.

  • KbQueueWait now gained forWhat and untilTime, like KbWait. From Diederick.

  • DrawFormattedText’s ‘flipVertical’ fixed for new text renderer. From Diederick.

  • PsychPortaudio: Give better error feedback if trying to open same device multiple times.

  • Daq: Update help texts wrt. USB 1024-LS. Now verified to work well.

  • Minor other stuff here and there.

Psychtoolbox-3.0.13 released


Psychtoolbox 3.0.13 “Set condition 1!” has been released. This is the first release of the 3.0.13 series.

3.0.13 no longer supports:

  • 32-Bit Octave-4 for MS-Windows.
  • 64-Bit Octave-3.8 for OSX.
  • Mac OSX 10.8 “Mountain Lion” and OSX 10.9 “Mavericks”.

It only works on:

  • 64-Bit Octave-4 for Linux, Windows and OSX. 64-Bit Octave 3.8 on Linux.

  • 64-Bit Matlab on all operating systems, R2012a or later is recommended, earlier versions may or may not continue to work, but are no longer tested or supported in case of trouble.

  • OSX 10.10 Yosemite and OSX 10.11 El Crapitan. Only El Crapitan is tested and somewhat supported in case of trouble.

  • On Linux we no longer provide mex files for 32-Bit Octave for Intel machines for direct download from us. However, NeuroDebian / Debian upstream / Ubuntu upstream will continue to provide these mex files in a convenient fashion in their “app-stores”, so this is not really a drawback, just something to be aware of.

  • I will probably allow inclusion of M-Files into future betas which may use object oriented programming (aka classdef) if those files have been shown to work flawlessly on Octave-4 and don’t touch widely used core functionality. Octave-4 has limited support for classdef programming, so not all object oriented code will work. We continue to support Octave-3.8 during the life-time of Ubuntu Linux 14.04-LTS, and Octave-3 does not support classdef programming, so such M-Files should be limited to functionality that isn’t essential to the use of PTB by the majority of users.

Users who wish to stick to Psychtoolbox 3.0.12 because they want to continue use of a future unsupported platform can redownload Psychtoolbox via:

DownloadPsychtoolbox([targetdirectory], ‘Psychtoolbox-3.0.12’);

Obviously keep backup copies before deleting/redownloading. Alternatively simply refrain from ever executing UpdatePsychtoolbox again.

New features and improvements:

  • New function UniqueCell and improvements to SortCell by Diederick Niehorster.

  • Some bug fixes to XOrgConfCreator by zacklb.

  • Some improvements to color functions by David Brainard.

  • Improved RaspberryPi support. Psychtoolbox is pretty ready for the Pi! New mex file RPiGPIOMex to control the Pi’s GPIO pins and a demo RaspberryPiGPIODemo to demonstrate basic GPIO control of the 2 status LED’s on the RPi 2B.

  • Improvements and bug fixes to validation code for high precision display devices like VPixx Datapixx/Viewpixx/Propixx and the Cambridge Research Systems Bits+ and Bits#.

  • Various bug fixes and minor improvements in 313 files.


Psychtoolbox user survey 2016


As of 6th July we got 356 responses in 22 days - Good, but we need more! Keep them coming!!

We are currently conducting a user survey for Psychtoolbox. Please participate, the sooner the better! We need one person per lab to respond, ideally one with sufficient insight into the operation of the lab, the labs needs, and the labs ability to contribute funding to PTB. In other words, the PI of the lab, or maybe a lab manager might be best suitable to fill out the survey.

The outcome of this survey may help to secure some short-term, time-limited bridge funding for Psychtoolbox development, maintenance and support. It will also influence decisions on how to fund future development, as well as priorities in development wrt. supporting new functionality or hardware.

The survey has a mandatory part of six questions, important for funding decisions and PTB’s future, and an optional longer part of optional questions, mostly to determine how you use PTB, what your needs and wishes are, what hardware/software you use.

Click on this link to the survey form if you want to participate



Psychtoolbox-3.0.12 final released


Psychtoolbox 3.0.12 final has been branched. This is the final release of 3.0.12. I may or may not backport trivial fixes in M-Files for serious bugs to it for a while, but you can mostly consider it done and unsupported from now on.

3.0.12 was the last version to support:

  • 32-Bit Octave-4 for MS-Windows.
  • 64-Bit Octave-3.8 for OSX.

  • Mac OSX 10.8 “Mountain Lion” and OSX 10.9 “Mavericks”.

Future beta releases will only support/work on:

  • 64-Bit Octave-4 for Windows and OSX.

  • 64-Bit Matlab on all operating systems, R2012a or later is recommended, earlier versions may or may not continue to work, but are no longer tested or supported in case of trouble.

  • OSX 10.10 Yosemite and 10.11 El Crapitan. Only El Crapitan is tested and somewhat supported in case of trouble.

  • On Linux i will no longer provide mex files for 32-Bit Octave for Intel machines for direct download from us. However, NeuroDebian / Debian upstream / Ubuntu upstream will continue to provide these mex files in a convenient fashion in their “app-stores”, so this is not really a drawback, just something to be aware of.

  • I will probably allow inclusion of M-Files into future betas which may use object oriented programming (aka classdef) if those files have been shown to work flawlessly on Octave-4 and don’t touch widely used core functionality. Octave-4 has limited support for classdef programming, so not all object oriented code will work. We continue to support Octave-3.8 during the life-time of Ubuntu Linux 14.04-LTS, and Octave-3 does not support classdef programming, so such M-Files should be limited to functionality that isn’t essential to the use of PTB by the majority of users.

Users who wish to stick to Psychtoolbox 3.0.12 because they want to continue use of a future unsupported platform can redownload Psychtoolbox via:

DownloadPsychtoolbox([targetdirectory], ‘Psychtoolbox-3.0.12’);

Obviously keep backup copies before deleting/redownloading. Alternatively simply refrain from ever executing UpdatePsychtoolbox again.


PTB BETA "Bring in the cat! (+SP5)" released


The new BETA “Bring in the cat!” and its Service Pack 2-5 update was released at 14th May 2016.

As usual, the complete development history can be found in our GitHub repository. The release tag is “PTB_Beta-2016-05-14_V3.0.12”, with the full tree and commit logs under the URL:


New features:

  • TurnTableDemo: Fix for compatibility with Matlab R2015b and later.
  • BitsPlusPlus: Add new subfunction ‘UseFE1StereoGoggles’ to automatically drive those CRS goggles.
  • BitsStereoDemo: Make use of modern PTB features like UseFE1StereoGoggles.
  • Some file permission cleanups by Yaroslav.
  • Fixed some typo in ComputeCIEConeFundamentals() help text by git user spitschan.
  • Screen(‘DrawTextures’) speed improvements, only for 64-Bit Screen for Matlab and Octave on Linux for now.
  • Screen, PsychHID for RaspberryPi updated.
  • XOrgConfCreator now can also setup xf86-video-modesetting, the generic video driver for Linux.
  • PsychGPUControl now can deal with Compiz single-x-screen multi-display setups for Ubuntu’s standard “Unity” GUI.
  • rpath fixes for mex files on Octave-3/4 for 64-Bit OSX to make PTB for Octave on OSX work with different Octave versions.
  • VC4 DRI3/Present Mesa 11.2 workaround for Screen() on RaspberryPi.
  • Allow normal users PTB low-level access to modern AMD gpu’s, e.g., the R9 380 Tahiti Pro.
  • Additional performance improvements to Screen(‘AsyncFlipBegin/End/…’) - So far only for 64-Bit Linux.
  • Performance improvements to PsychProPixx.
  • KDE-5 multi-x-screen “pointer gets stuck” workaround for KDE-5 Plasma on KUbuntu 16.04.0-LTS.
  • Minor fixes and improvements to various M-Files.

PTB BETA "Bring in the cat! (+SP1)" released


The new BETA “Bring in the cat!” and its Service Pack 1 update was released at 14th April 2016.

As usual, the complete development history can be found in our GitHub repository. The release tag is “PTB_Beta-2016-04-14_V3.0.12”, with the full tree and commit logs under the URL:


New features:

  • Add (almost) complete support for 64-Bit Octave-4.0.1 on MS-Windows. (Datapixx does not work yet.)
  • Add good support for Griffin PowerMate USB on Linux, limited/deficient support for Windows and OSX.
  • DrawFormatttedText: Add new horizontal alignment option ‘centerblock’. Always use ‘yPositionIsBaseline’ for vertical text positioning for consistency.
  • New demo TurnTableDemo to show off PsychPowerMate() function and some PsychPortAudio live stream updates on Linux. Works not so great with PowerMate on OSX.
  • PR670 photometer code robustness improvements by David Brainard.
  • Maintenance work and small fixes and improvements here and there.

PTB BETA "Nothing but the rain SP1" released


The new BETA “Nothing but the rain” and its Service Pack 1 update was released at 15th March 2016.

As usual, the complete development history can be found in our GitHub repository. The release tag is “PTB_Beta-2016-03-15_V3.0.12”, with the full tree and commit logs under the URL:



New experimental features:

  • Basic alpha-quality support for Psychtoolbox on the Raspberry Pi model 2B. This requires the brand-new experimental/alpha-quality open-source OpenGL graphics/display drivers written by Eric Anholt for the Pi’s VideoCore-4 gpu on Broadcom’s SoC. These drivers are now backported to the February 2016 update of Raspbian, the Debian GNU/Linux variant for Raspberry Pi. This is more of a sneak preview to work in progress than production quality for neuro-science applications atm. See for current driver status.

Text drawing improvements:

  • Screen(‘TextTransform’) allows application of a 2D affine transform only to drawn text strings. Currently supported on the standard FTGL drawtext text renderer with high performance and good quality, and on the unsupported/deprecated legacy Apple OSX Coretext text renderer at the cost of a drastic performance loss and almost completely useless Screen(‘TextBounds’) bounding box results. Screen TextTransform? explains some of the gotchas and traps you will run into if you really think you want to use this function.

  • Screen(‘DrawText’) now returns more accurate/useful new text cursor position and a new optional ‘textHeight’ for “newline” vertical spacing. These enhancements only with the standard FTGL drawtext plugin renderer, not on the legacy renderers.

  • Support for sub-pixel anti-aliasing (“LCD filtering”) on the legacy Apple CoreText renderer 0, if that renderer is manually selected, and ‘TextAntialiasing’ preference setting 2 is selected and preference ‘TextAlphaBlending’ is enabled via setting 1 and a solid opaque ‘TextBackgroundColor’ is selected. Sub-pixel anti-aliasing only works on OSX under those special conditions. In all other cases, only regular per-pixel anti-aliasing is used, as in the past.

  • Fix memory leak in legacy OSX CoreText renderer and other OSX text renderer bugs.

  • Other small text quality improvements.

  • “help DrawTextPlugin” Update for latest OSX + Matlab trouble.

Small improvements:

  • Replace ‘clear all’ in many demos with a more harmless clear; Probably also not great, but better than that other disaster. Also replace some calls to GetChar/CharAvail, as we don’t want to give too many bad examples.

  • Add option ListenChar(-1): This only disables spilling of typed characters into the Matlab/Octave command window (like ListenChar(2)) but without enabling keyboard listening (GetChar et al.). This allows to use character suppression in parallel to use of Keyboard queues.

  • Add replacements psychwavread/psychwavwrite for wavread/wavwrite which were removed in Matlab R2015b. Used in our audio demos to provide a less brain-dead approach to basic backward compatibility than Mathworks.

  • Robustness improvements and/or bug fixes and/or help text updates to AutoBrightness, GazeContingentDemo/BubbleDemo, HighColorPrecisionDrawingTest, MeasureDpi, Kbqueues, BitsPlusIdentityClutTest, KbCheck, Screen(‘CopyWindow’), OSX legacy CoreText renderer, FrameSequentialStereoTest, GetEchoString, GetKbChar, DrawFormattedText, PsychHIDTest…

  • Windows: Allow Screen(‘LoadNormalizedgammatable’) to load > 256 slots gamma tables to devices like CRS Bits# or VPixx Datapixx. GPU hw gamma tables are still limited to 256 slots due to OS restrictions.

  • GetEchoString and AutoBrightness: Cosmetic and help text fixes.

  • XOrgConfCreator: Slightly more robust error handling against broken graphics setups.

  • Screen(‘DrawDots’): Make shader-based path more friendly to gpu drivers.

  • Add udev rule for potentially simplified use of Griffin Powermate on Linux.

  • Some improvements by the Brainard lab to PsychColorimetric utility routines.

  • Other small improvements here and there.

PTB BETA "Into Darkness" released


The new BETA “Into Darkness” was released at 25th January 2016.

As usual, the complete development history can be found in our GitHub repository. The release tag is “PTB_Beta-2016-01-25_V3.0.12”, with the full tree and commit logs under the URL:

New features and improvements:

  • FTGL Drawtext plugin support for MS-Windows. Used as default textrenderer 1 on Windows, with fallback to the GDI legacy renderer if it is unsupported. Requires use of Octave-4 on Windows, or in case of Matlab on Windows that GStreamer is installed. We now have a consistent high quality text renderer on all platforms. This should also fix HiDPI display issues with text rendering on Windows, give much better anti-aliased text quality, and better text positioning. On GitHub issues: Fixes #282 Fixes #254

  • The default text renderer 1 is now always the (originally Linux only) FTGL renderer. Screen(‘Preference’,’TextRenderer’, 0) allows to select the OS specific legacy renderer (GDI on Windows, Apple CoreText on OSX). The legacy renderer is also used as fallback if the FTGL plugin fails for some reason. Note that use of the legacy renderer is from now on completely unsupported by us if you should run into any problems with it. It is on “life support” and may be removed completely in a future version of Psychtoolbox.

  • Use same font (“Arial” or something close to it), text size (24 pixels), style (normal) by default on all operating systems instead of OS specific settings, now that we use the same text renderer by default on all OSes, so one size should fit all.

  • Screen(‘DrawDots/DrawLines’): Add size limit queries and lenient flag. These functions now optionally return the min/max size of normal or anti-aliased dots and lines for the given graphics card/driver, as those differ across gpu’s, drivers and operating systems.

  • Minor other improvements.

Bug fixes:

  • Fix fast offscreen window support on use of PsychImaging ‘UseRetinaDisplay’. Was accidentally falling back to the old more limited legacy implementation if Retina support was requested.
  • Screen(‘GetImage’) - Make sure ‘rect’ is inside the source window.
  • Textbounds() - Accept optional ‘yPositionIsBaseline’ flag and make more robust. Contributed by Denis Pelli.
  • OffsetRect: Resolve ambiguity for 4x4 ‘oldrect’ matrix. Contributed by GitHub user mscain.
  • Snd(): Make more robust against failing InitializePsychSound().

PTB BETA "Puking Rainbow Unicorn SP1" released


The new BETA “Puking Rainbow Unicorn SP1” was released at 7th December 2015.

As usual, the complete develoment history can be found in our GitHub repository. The release tag is “PTB_Beta-2015-12-07_V3.0.12”, with the full tree and commit logs under the URL:

New features and improvements:

  • Fix AMD GPU DCE-8+ display engine handling on Linux and OSX. Latest generation AMD gaphics cards are now fully supported.
  • Fix OSX PsychtoolboxKernelDriver multi-display handling bugs introduced by the “Puking Rainbow Unicorn” beta.
  • Improve 10 bpc pixelformat selection for OSX for native 10 bit framebuffer support. Untested due to lack of iMac 5k hardware.
  • Minor bug fixes and documentation updates in various places.
  • OSX: Maybe improve detection and handling of USB-DAQ devices. PsychHID for OSX may now support USB device selection by HID interfaceID, which might improve robustness of USB-DAQ detection and DaqAInScan functionality. Completely untested due to lack of hardware.
  • Windows: Improve visual stimulus timing on Windows-10, and maybe on Windows 8/8.1 (untested). On a Windows-10 test system with a 5 year old AMD Radeon HD-5770 this makes visual stimulation timing and timestamping work ok, despite the DWM being permanently enabled. More tests are needed, but this might allow at least basic use of Windows-10.

PTB BETA "Puking Rainbow Unicorn" released


The new BETA “Puking Rainbow Unicorn” was released at 5th November 2015.

As usual, the complete develoment history can be found in our GitHub repository. The release tag is “PTB_Beta-2015-11-05_V3.0.12”, with the full tree and commit logs under the URL:

New features and improvements:

  • Introducing 32-Bit Octave-4 support for MS-Windows. Psychtoolbox should now work with 32-Bit Octave-4.0.0 as provided by the following official MXE Setup.exe installer provided by the Octave developers:

    Light testing shows that Psychtoolbox should work well with Octave-4 for Windows, except for video capture and video recording. Trying to use video capture will cause an immediate termination of Octave for currently unknown reasons. 32-Bit Octave-4 is only supported because the Octave upstream developers currently do not provide a 64-Bit build and installer for Octave. As soon as upstream would provide a 64-Bit Octave-4 installer, we would immediately switch to 64-Bit Octave support and cancel support for 32-Bit Octave, so do not rely on reintroduced 32-Bit support being around for too long on Windows.

  • 64-Bit Octave-4 suppport for Linux, as Ubuntu 15.10 and Debian testing now ship Octave-4. 32-Bit Octave-4 is not supported by us, but the NeuroDebian project will provide 32-Bit Octave-4 support soon for those few still using a 32-Bit system.

  • Experimental NVidia USB NVision emitter/stereo goggles support for 64-Bit Linux. This is untested due to lack of suitable hardware so far. It should allow to use any graphics card under Linux in frame sequential stereo mode with such NVidia stereo goggles, driven via the USB connection.

  • AMD Volcanic Islands gpu family low-level support for Linux and OSX. This covers the latest graphics cards from AMD.

  • Auto-detection of display head assignments for Linux and OSX on AMD gpus. Instead of using a heuristic, as for NVidia gpus, this should automatically find the correct setup for AMD gpus. A side effect of the auto- detection is a short flicker of all displays when the Screen mex file gets loaded on OSX or when the first onscreen window opens on Linux.

  • XOrgConfCreator + XOrgConfSelector assistants for Linux: XOrgConfCreator is a little setup assistant that automatically creates a xorg.conf display server configuration file by looking at the systems display setup and asking a few questions to the user. This should simplify setup of high performance multi-display setups on Linux. XOrgConfSelector allows to easily apply such config files on the given setup, switching between multiple different configs depending on experimental needs or regular desktop use.

  • PsychLinuxConfiguration improvements for Linux. New tweaks for performance tuning.

  • Screen(‘DrawDots’) shader based smooth point rendering support. On graphics drivers which don’t support drawing of smooth dots this will implement smooth dots via use of a GLSL shader. Use of shader based drawing of smooth dots can also be triggered via the new ‘dot_type’ flags 3 and 4. Using shader based dot drawing can be useful to enhance drawing performance on all gpu’s if one wants to draw lots of dots of variable size, as the GLSL shader based drawing code can draw dots of varying size faster than the standard code by use of some special shader features.

  • Improvements to Shuffle(), contributed by GitHub user NxNiki.

  • Add new kPsychGfxCapVCGood flag for ConserveVRAM settings to work around gpu texture sampling precision issues on some gpus with some graphics drivers, e.g., AMD gpus on OSX 10.11. You can use HighColorPrecisionDrawingTest with test blocks 3, 4 and 5 to test for these problems. The test will tell you to use this flag as one measure to improve precision if needed.

  • Add HiDPI detection code for MS-Windows, with hopefully useful troubleshooting messages. On Windows-7 and earlier Windows versions, Psychtoolbox can prevent timing issues caused by HiDPI/Retina high pixel density displays by disabling the DWM desktop compositor for fullscreen onscreen windows. On Windows-8 and later, PTB can’t prevent such issues, so it has to rely on the given Matlab or Octave host application being DPI aware, so MS-Windows does not need to enable DWM based DPI virtualization and rescaling. PTB can now detect problematic behaviour of Matlab and provide some hints on how to avoid DPI related trouble, but it can’t fix it, as that is not technically possible on MS-Windows.

  • PR655Init() tweaks for improved robustness on OSX.

  • Various bug fixes and minor improvements in various places.

PTB BETA "Immersator" SP2 released


The new BETA “Immersator” SP2 was released at 12th October 2015.

As usual, the complete develoment history can be found in our GitHub repository. The release tag is “PTB_Beta-2015-10-12_V3.0.12”, with the full tree and commit logs under the URL:

From now on, OSX versions before 10.11 El Capitan are no longer tested or officially supported. OSX 10.8 - 10.10 should continue to work, but no problems relating to these versions will be handled and no bugs will be fixed. Only OSX 10.11 El Capitan will receive basic testing, bug fixes and support.

New features and improvements:

  • Allow H264 profile selection for movie writing. Demo this in ImagingStereoDemo by choosing Profile=2, the “Main Profile”, something that even works with deficient movie players like Apples Quicktime.

  • Fixes for El Capitan, Apples latest goddamn awful “masterpiece”.

    • No longer completely hang and deadlock Octave-3/4 in GUI mode due to El Capitan bugs.
    • Avoid initial sync failure, caused by new El Capitan bugs, via some dirty hack.
    • Reduce frequency of white flashes when there shouldn’t be any, caused by El Capitan bugs. Dirty hack.
    • Make frozen/black screen hangs at end of a session slightly less frequent via a new hack.
    • Auto fallback from stereomode 1 to stereomode 11 on OSX if mode 1 is unsupported, as is the case on El Capitan, where Apple decided that their users do no longer need professional stereo display support.
    • Rebuilt all OSX mex files against XCode 7 and OSX 10.11 SDK’s.
    • Change support status on OSX: 10.11 El Capitan now supported, support for OSX 10.10 Yosemite cancelled.

PTB BETA "Immersator" (+SP1) released


The new BETA “Immersator” and its SP1 were released at 5th October 2015.

As usual, the complete develoment history can be found in our GitHub repository. The release tag is “PTB_Beta-2015-10-05_V3.0.12”, with the full tree and commit logs under the URL:

New features and improvements:


  • General Virtual Reality HMD support infrastructure, with a driver specifically for the Oculus Rift DK1 and DK2.

    Look at “help OculusVR” and “help PsychVRHMD” for general setup and usage instructions.

    Look at the demos MovingLineDemo, VRHMDDemo, VRHMDDemo1, SuperShapeDemo, ImagingStereoDemo(103), MorphDemo on how to use this.

    The Horde3DForPsychtoolbox repository has been updated as well to provide support for such VR headsets when used with the Horde3D graphics engine in combination with Psychtoolbox. Support is available for 64-Bit Linux, OSX and Windows. Horde3D support for 32-Bit systems has been dropped. Find the repo, together with a demo named “HordeVRHMDDemo1” under the following link:

General improvements:

  • Support for use with 64-Bit Octave-4 on OSX via HomeBrew.
  • HighColorPrecisionDrawingTest: Robustness improvements to deal with the latest brokenness of OSX 10.11
  • Eyelink: Optionally prevent opening of existing EDF files to protect against accidental overwriting of data files.
  • LoadGLSLProgramFromFiles/LoadShader: Improve debugging output. Contributed by Diederick.
  • ImagingStereoDemo and others: Compatibility fixes for Matlab R2014a
  • KbQueueReserve: Check for invalid deviceIndex with more than one element.
  • GetMouseIndices: Add option ‘slavePointers’ for simpler use of KbQueues with mice on Linux.
  • Fixes and improvements to Quest by Denis Pelli.
  • Some small fixups for HomeBrew, and VRHMDDemo1.m

PTB BETA "Tediousness overdrive SP1/SP2" released


The new BETA “Tediousness overdrive” SP1 and SP2 were relased at 21st August 2015.

New features and improvements:

  • Datapixx on Octave OSX fixes.
  • PsychHID robustness improvements in HID device enumeration for OSX. Removes failure of PsychHID if special devices like, e.g., Oculus VR Rift, are connected.
  • AutoBrightness fix from Denis. Now probably works on both OSX 10.10 and 10.9.
  • QuestUpdate improvement from Denis: Make sure “intensity” is real, not complex.
  • DrawFormattedText: Fix bug for Unicode text introduced when improving single-line text centering.
  • Some fixes for text drawing provided or suggested by Diederick: – Screen: Fix returned alpha value in Text(Background)Color. – Screen(‘DrawText’): Remove the escaping of ampersand from DrawFormattedText()
  • Fix Var2Str: failed when infinity imaginary component in variable. Provided by Diederick.
  • Unit Tests: make use of capturing exception info in the catch instead of lasterr. By Diederick.
  • Fixes and improvements to color handling routines by David.
  • OSX mex file fixes for Octave: Drop Octave 3.8.1 support for OSX HomeBrew, add 3.8.2_2 support instead.
  • Some new tests and other minor improvements, e.g., to demos.
  • New test: DatapixxGPUDitherpatternTest - Test GPU dithering via Datapixx.

PTB BETA "Tediousness overdrive" released


The new BETA “Tediousness overdrive” was relased at 25th July 2015.

As usual, the complete develoment history can be found in our GitHub repository. The release tag is “PTB_Beta-2015-07-25_V3.0.12”, with the full tree and commit logs under the URL:

New features and improvements:

  • KbWait: Fix treatment of empty forWhat argument.
  • Screen: Fix PTB-2 emulation mode a bit.
  • Screen/Linux: Dis/Enable DPMS while onscreen windows are open.
  • Screen/Linux: Detect use of DRI3/Present.
  • Screen/OSX: Fix color handling of OS X native text renderer.
  • Improve help text of GetGamepad/Keyboard/KeypadIndices
  • Add Screen(‘DrawText’) color precision test case to HighColorPrecisionDrawingTest.
  • DrawFormattedText: Improve bounding box precision for single-line case.
  • DaqAInScan: Make it potentially a bit faster for USB 1608-FS.
  • Screen/OSX: Remove hybrid graphics workaround for MBP 2010
  • DaqALoadQueue: More fixes for Octave compatibility and basic sanity.
  • Screen/Linux: Use old-style override_redirect on multi-x-screen KDE.
  • Screen/Linux/X11: Prevent crash at Screen reload on multi-x-screen with buggy Mesa.
  • Screen/Linux/X11: Restrict workaround for Mesa mapi bug to Mesa < 10.5.2
  • White-list Mesa versions >= 10.5.9 and >= 10.6.2 for XCloseDisplay()
  • NetStation: Improve and consolidate various improvements. - Gergely Csibra
  • Screen: Add new optional ‘ignoreErrors’ flag to ‘LoadNormalizedGammaTable’
  • Screen: Make FTGL plugin the default text renderer on OSX.
  • BasicSoundScheduleDemo: Remove redundant ‘RunMode’ 1 assignment.
  • Screen/OSX: Try to make modesetting Retina compatible.
  • VideoCaptureDemo, VideoDelayLoopMiniDemo: Use default ROI by default.
  • Snd(): Some fixes for corner use case.
  • PsychVideoDelayLoop: Cleanup textures at end of each session.
  • Update “help DrawTextPlugin” for new default FTGL renderer on OSX.
  • Screen: Improve Screen(‘Close’, window);
  • Screen/OSX: Fix cursor movement lag after SetMouse()
  • Screen/OSX: Return OS reported mouse delta movement in GetMouse() valuators.
  • Screen: Add ‘detachFromMouse’ support to SetMouse().
  • Screen: Fix CopyWindow to use windows clientRect instead of rect for Retina/HiDPI compatibility
  • Screen/OSX: Fix hostname display in Screen(‘Computer’)
  • DrawFormattedText: Remove 250 chars linebreak on OSX. - Diederick Niehorster
  • Screen: CopyWindow update help text.
  • Screen/Linux: Make ext_buffer_age warning less chatty.
  • Speak: Fix use with apostrophes in text string. - elladawu
  • ImageUndistortionDemo: Minor improvements.
  • ImagingVideoCaptureDemo: Add a (disabled) test line for CSV geometrycorrection.
  • CreateDisplayWarp: Bug fix and enhancement for CSV method.
  • New prototype quality display correction method: DisplayUndistortionLabRiggerMouseStim.m
  • PsychImaging: Update help text for task ‘UseRetinaResolution’
  • Update and extend conversions between degrees and mm of retina - David Brainard.

PTB BETA "Gifts for the gifted" SP1 released


The new BETA “Gifts for the gifted” SP1 was relased at 19th April 2015.

As usual, the complete develoment history can be found in our GitHub repository. The release tag is “PTB_Beta-2015-04-19_V3.0.12”, with the full tree and commit logs under the URL:

New features and improvements:

  • SetMouse multi-screen improvements for Windows. Allow positioning relative to screen origin, as the screenNumber is now also honored on Windows.
  • CMUBox doc updates for Windows. Describe how FIFO size must be set on Windows COM ports for good timing.
  • KbQueue fixes for OSX. Avoid hang of scripts in KbQueueRelease on some OSX setups.
  • PsychPortAudio improvement for Linux. Try to avoid selecting HDMI/DP audio on video outputs of graphics cards as default sound card. Prefer regular sound cards over graphics cards with sound output if possible.
  • Handle Intel ddx DRI2 triple-buffering on Linux, so visual timing works on Intel graphics chips without need for special xorg.conf settings or ddx drivers. It is now possible to even take advantage of triple-buffering with properly adapted scripts.
  • General improvements to timing checks on advanced operating systems which support OS native timestamping mode 4.
  • Documentation updates.
  • Fixes and refinements to demos.
  • New function CenterRectArrayOnPoint() contributed by Natalia Zaretskaya.
  • QuestQuantile() improvements by Denis Pelli.
  • Some improvements to color calibration routines by David Brainard.
  • Improvements for efficiency of clut updates and of error handling on VPixx devices.
  • Some compatibility updates to joystick configuration files for current Linux distributions.

PTB BETA "Gifts for the gifted" released


The new BETA “Gifts for the gifted” was relased at 16th March 2015.

As usual, the complete develoment history can be found in our GitHub repository. The release tag is “PTB_Beta-2015-03-16_V3.0.12”, with the full tree and commit logs under the URL:

Major new features and improvements:

  • Experimental Wayland backend for Linux - disabled at compile time. Used for development and testing of Wayland 1.7/Weston 1.7, useable on those setups for simple tasks, but not ready for prime-time.

  • Many videocapture improvements for increased robustness on certain cameras, and for handling USB-3 USBVision IIDC compliant cameras, especially tested with PointGrey Flea, and for handling custom GStreamer sources like network streaming IP cameras.

  • Initial enablement work for using tracker plugins also under GStreamer.

  • ProPixx fast 4x / 12x mode, initial experimental support.

  • Many cleanups, small improvements and bug fixes.

  • Linux/X11 specific ddx video driver for nouveau dropped, as it is now part of the Ubuntu 14.04.2-LTS hardware enablement stack, so we don’t need our own binary anymore.

  • Linux/X11 specific ddx video driver for intel on XOrg 1.15 dropped, as Ubuntu 14.04.2-LTS HWE ships with XOrg 1.16 like Ubuntu 14.10, so we only need one driver for XOrg 1.16 on both 14.04.2-LTS and 14.10

  • Imaging pipeline compatibility fixes for Intel gpus. Avoid creating FBO’s with RGB > 8 bpc color attachments, as Intel HD series can’t handle those.

  • JavaSwingCleanup() cleanup code improved to make Matlab R2014b happy.

  • Retina support improved to also handle windowed windows, not only fullscreen on OSX.

  • VBLSyncTest improved to avoid/reduce effects of clock skew with Datapixx, new PerceptualVBLSyncTestFlipInfo2.

  • PsychHID on Linux can blacklist more non-keyboards automatically.

  • PsychHID on OSX may be more robust wrt. keyboard queues.

  • Additional pageflipping checks for AMD graphics cards under Linux and on OSX with PsychtoolboxKernelDriver.

Psychtoolbox 3.0.12 released


The first BETA “Random acts of kindness” was relased at 5th October 2014 and started the new Psychtoolbox 3.0.12 series. Now, one month later, after some stabilization and tweaking and some minor updates, and without any user complaints so far, it is about time to announce it.

As usual, the complete develoment history can be found in our GitHub repository. The release tag is “PTB_Beta-2014-11-06_V3.0.12”, with the full tree and commit logs under the URL:

Changes with respect to version 3.0.11:

System and software requirements

  • MS-Windows: Only 64-Bit Windows-7 is officially supported. PTB only gets (infrequently and lightly) tested with Windows-7. It should also work with 64-Bit Windows-8 and later and with 64-Bit Windows Vista and 64-Bit Windows-XP, but if you run into problems with those earlier or later systems you are on your own. Especially support for Windows-XP is expected to degrade due to lack of future testing and bug fixing. No care will be taken to prevent future development from breaking support for Windows XP or Vista.

    32-Bit versions of Windows will no longer work with Psychtoolbox 3.0.12.

  • Apple OSX: 64-Bit OSX version 10.8 “Mountain Lion” and later is needed for PTB to work at all, but only OSX 10.10 “Yosemite” is officially supported. No future testing, bug fixing or troubleshooting will be performed for any version but 10.10 “Yosemite”.

  • GNU/Linux: All reasonably modern versions of 32-Bit and 64-Bit Linux should work. Primary development and testing is done on Ubuntu 14.04-LTS and 14.10, and compatible flavors, e.g, KUbuntu 14.04-LTS and KUbuntu 14.10. These are the officially supported Linux distributions. GNU/Debian version 7 and upcoming version 8 are tested by the NeuroDebian team.

  • Matlab: 64-Bit Matlab on Linux, OSX and Windows. Current development and testing happens with R2012a but will probably be soon completely shifted to R2014b.

    32-Bit versions of Matlab are no longer working with Psychtoolbox 3.0.12.

  • GNU/Octave: On Linux, our “DownloadPsychtoolbox” installable version supports 32-Bit and 64-Bit Octave version 3.8.x for Debian and Ubuntu. On OSX, our “DownloadPsychtoolbox” installable version supports Octave 3.8.0 - 3.8.2.

    If you get your Psychtoolbox for GNU/Debian or Ubuntu from NeuroDebian’s repository then it will support whatever 32-Bit or 64-Bit version of Octave is officially shipping with your distribution - usually some Octave version between 3.4.0 and 3.8.x, depending on the age of your distribution.

    We do recommend upgrading your Linux distro to a release from the year 2014, as those will usually ship Octave 3.8 out of the box. Octve 3.8 features a Matlab like GUI for a higher level of convenience.

  • GStreamer: GStreamer-0.10.x is no longer supported. You must install GStreamer version 1.4.0 or later on Windows or OSX, GStreamer version 1.0.0 or later on Linux if you want to use any multi-media functionality like Video capture, Video recording, movie writing or movie playback.

  • PsychKinect support: Support for the Kinect now requires libfreenect version 0.5 or later on Linux and OSX. Suitable versions of libfreenect will be automatically provided by NeuroDebian if you install Psychtoolbox for Linux from their repository. On OSX you can get a sufficiently recent version of libfreenect from HomeBrew.

Major new features and improvements:

All operating systems:

  • GStreamer 1.0 as new multi-media backend. Apart from fixing some bugs of GStreamer-0.10, this should make Psychtoolbox multi-media handling more future-proof, as GStreamer-1.x is in active development and supported, whereas GStreamer-0.10.x no longer receives and maintenance, support or bug fixes from its developers. GStreamer-1 supports more video codecs, support for deep color video formats and more efficient multi-threaded video decoding for popular formats like H264. The latter should provide performance gains on multi-core Mac OSX and Windows machines, so performance on those legacy operating systems should come a bit closer to what Linux users are enjoying since many years.

    Caveats: Video capture and recording is currently unsupported on MS-Windows due to missing video capture plugins in the current GStreamer-1.4 distribution for Windows. This will start working again when the GStreamer developers provide suitable plugins. Video capture on OSX is limited to what Apples AVFoundation and QuicktimeKit support. Specifically capture from DV camcorder cameras didn’t work at all when testing under OSX 10.9. Audio-Video sync for video recording with USB webcams under OSX 10.9 wasn’t great at all. The best video capture and recording experience is expected under Linux, just as in the past. Movie playback with some video codecs on Microsoft Windows with some Matlab versions can cause random crashes of Matlab. This has been infrequently observed during playback of H264 video, e.g., with Psychtoolbox SimpleMovieDemo. These don’t happen always and are likely due to some incompatibility between some Matlab versions and GStreamer. There are no known problems wit any movie playback on OSX or Linux.

  • The PsychKinect driver now supports the XBOX Kinects and the original Kinect 1 for Windows - on Linux and OSX. Kinect for Windows is not supported on MS-Windows. Kinect 2 is not supported at all at the moment. The driver can handle multiple simultaneous Kinects.

  • Stereo crosstalk reduction support, especially for frame sequential stereo modes by Diederick. Useful, e.g., to reduce crosstalk on NVidia’s NVision shutter glasses. See help of PsychImaging.

  • Our MOGL OpenGL for Matlab and Octave low-level support now supports a large subset of OpenGL 4.5 functionality. Functionality of OpenGL versions more recent than version 2.1 is supported via OpenGL extensions as in the past, but our support is now more complete wrt. the latest OpenGL 4.5 spec. E.g., Geometry Shaders do work now.

  • The Datapixx mex files for VPixx devices like Datapixx, Viewpixx and Propixx is now available with identical full feature set on all operating systems and supported Matlab and Octave versions. PsychImaging will now take care of especially large VBLANK intervals as used by those devices in frame sequential stereo modes.

  • Improvements and bug fixes to the NetStation() driver for EGI Netstation EEG systems.

  • Bug fixes and enhancements to DrawFormattedText.

  • The RemapMouse function can now also handle display rotation by Psychtoolbox panel fitter, ie., rotation generated by the PsychImaging functions UseDisplayRotation and UsePanelFitter can now be properly handled wrt. mouse input, as demonstrated in PanelFitterDemo.

  • Many bug fixes and improvements to demos, help texts or other documentation.

GNU Linux

  • Support for Ubuntu 14.10 and compatible/derived flavors - tested with 64-Bit KUbuntu 14.10. help SyncTrouble points to a new set of example xorg.conf configuration files and explains how to install those in your system to optimize it for best visual stimulus onset timing and timestamping precision. This release has been tested on Ubuntu 14.04 and KUbuntu 14.04 and KUbuntu 14.10 with X-Servers XOrg-1.15 and 1.16, Linux kernels 3.13, 3.16 and later kernels on open-source radeon, nouveau and intel graphics drivers with multiple Radeon graphics cards, NVidia graphics cards and Intel graphics cards and shows excellent visual timing behaviour on all tested systems. Especially on Apple systems, the tested Linux distros outperformed OSX wrt. timing precision and reliability by large margins, sometimes up to 300x more precise.

  • Improved deep color 10 bpc framebuffer support on Linux. New 11 bpc and (up to) 16 bpc framebuffer support for AMD graphics cards when using the open-source graphics driver on a deep color capable HDMI or DisplayPort display device. Details of setup, limitations and capabilities for different systems are explained in the help text of PsychImaging.

Apple OSX

  • Support for Mac OSX 10.10 “Yosemite”. However, initial testing on two machines and user feedback suggests that 10.10 seems to be even more buggy and unsuitable for neuro-science applications than 10.9 and 10.8 were. None of the bugs present in OSX and known to me have been fixed by Apple, as far as initial testing goes. Visual timing and timestamping precision has degraded even further. Expect many new “Sync failures”, as all attempts to workaround OSX flaws have failed. The PsychtoolboxKernelDriver is now even more important for precise visual timing, but no longer works by default on Intel GPUs. Forcing its use on Intel gpu’s is possible but can cause serious system malfunctions on some Macintosh computers, with a small but non-zero probability of making your machine unbootable without the help of an Apple repair technician. In order to load the driver at all on OSX 10.10 for the supported NVidia and AMD gpus, you will need to disable kernel module verification in Apples OS. See “help PsychtoolboxKernelDriver” for instructions to do so at the downside of reducing system resilience against hackers and computer viruses.

  • Improved PsychHID for OSX: Now supports multiple parallel simultaneous keyboard queues, catching up a bit to the superior PsychHID for Linux. Now can cope with Apples broken HID keyboard handling on MacbookAir 2013 and later, making keyboard queues working again on the MacbookAir.

  • Support for Apple Retina displays. Visual stimulus onset timing and timestamping should work better now with such non-standard HiDPI display devices. Psychtoolbox will use its panel fitter by default to create backwards compatible behaviour to version 3.0.11, but with hopefully fixed visual onset timing, working around Apples Retina display hacks. A new PsychImaging task UseRetinaResolution allows to make use of the full resolution of Retina displays (typically twice the horizontal and vertical video resolution for 4 times more pixels), at the performance impact caused by the much higher GPU rendering load.

  • Many new awful workarounds for broken Apple operating systems.

PTB BETA "goto fail"


“goto fail” is an hommage to Apple’s fine software engineering skills and well known insane attention to detail and perfection.

“goto fail” is the final release of the 3.0.11 series. The next release will start the 3.0.12 series. It contains the following more notable improvements:

  • Our experimental 10 bit framebuffer support for Linux and OSX for AMD Radeon graphics cards is now also available (but untested so far) for Radeon HD-5000 and later graphics cards. In the past this was restricted to X1000 - HD-3000, now it should covers all currently shipping cards since X1000. Along this line goes more fine-grained control of dithering on digital display outputs via new parameters to PsychImaging’s EnableNative10BitFramebuffer functions and a new Screen('ConfigureDisplay', 'Dithering') subfunction; It is important to stress here that while 10 bpc output is known to work reasonably well for analog VGA connected CRT monitors, 10 bpc output to digital display devices will not work on OSX at all, and is unlikely to work over DVI or HDMI on Linux. We are currently looking into ways to enable > 8 bpc support on Linux. What you will get if you enable a 10 bpc framebuffer on such a display setup is a 10 bpc framebuffer which gets reduced to 8 bpc via dithering on the digital video output. Iow., you get simulated 10 bit precision via dithering, which may work reasonably well for some stimuli, or go horribly wrong for other stimuli.

  • Screen('Textfont') now allows atomic setting of font family and and font style with a single Screen('TextFont', window, fontName, fontStyle); call. This to resolve some problems encountered when on tries to use exotic fonts.

  • Eyelink bug fixes and improvements contributed by Li Jie of SR-Research and me. Eyelink('ImageTransfer') should work now, Drawing of targets in PsychEyelinkCallback should work on less capable graphics hardware, Various octave compatibility fixes to SR-Research demos. Eyelink('Command') robustness improvements against some input.

  • Fix Octave + PsychDataPixx long standing compatibility bug for timestamping, remove workaround from and cleanup VBLSyncTest.

  • Workarounds for nouveau-kms bugs in Linux 3.13/3.14 for the upcoming Ubuntu 14.04 LTS release. These bugs shouldn’t have made it into a release but did, because i wasted way too much time fixing Apple’s latest screw-ups, using up most of the testing time i planned to allocate for Linux + Ubuntu 14.04 testing. Anyway, this means that the open-source nouveau graphics driver for NVidia gpu’s will probably be of limited use for vision science until we get the required bug fixes into a post-release update. The proprietary NVidia driver should work just fine though. I will try to not let this happen again. Fixing any problems caused by Apple will have the lowest priority from now on.

  • Workarounds for OSX 10.8 dual-display stereo graphics driver bugs and various 10.8/10.9 graphics bugs. As it turned out during trying to resolve other OSX bugs, at least OSX 10.8 has a hilarious bug when used with two or more open fullscreen onscreen windows, e.g., for dual-display stereoscopic stimulation in stereomode 10. As soon as a 2nd onscreen window opens on a screen, the first previously opened onscreen window will be switched from page flipping for stimulus updated (good for timing and performance) to desktop composition. This is really bad for performance, visual stimulus onset timing and various other things, e.g., 10 bpc framebuffer support. It is also almost completely undetectable by software tests, so will have a good chance of silently corrupted presentation timing in such scenarios. The current PTB will enable a workaround for OSX 10.8 and later which fixed the problem at least on the one tested setup with AMD graphics. It is unclear if this would introduce any new subtle bugs. According to Apple docs it shouldn’t, but of course this is Apple talking about its own products and we know how well that goes in practice. I also realized when testing on my MacBookPro with 10.9.2 and NVidia graphics that 10.9’s swap scheduling on NVidia gpu’s seems to be utterly broken as well. PTB has a new visual test script OSXCompositorIdiocyTest() which you should run on your setups and dual display setups. If that test doesn’t show expected results then you can consider your setup being mostly unuseable for frame accurate visual presentation timing. There are no known workarounds for these issues. I don’t consider “modern” OSX systems trustworthy for frame-accurate visual presentation anymore.

    Bugs not fixed on OSX 10.9: Sometimes you will be left with a blank screen at the end of a session after PTB closed its windows. A mouse click, keyboard press gives you your GUI back. This bug brought to you by Apple. The only known workaround is to use Screen('Preference','ConserveVRAM', 16384); which will likely reduce performance and visual timing accuracy - or possibly make visual timing untrustworthy. I can’t test this because my only remaining Mac test machine has a NVidia graphics card with broken graphics drivers, so timing on my only test machine is always untrustworthy.

    Keyboard queues apparently don’t work at all on recent MacBookAir’s on at least 10.9, because Apple completely broke backwards compatibility in the relevant bits of the OSX HID subsystem.

  • Ability to disable crashy CVDisplayLink timestamping on OSX: PsychTweak('DisableCVDisplayLink'); now allows to disable CoreVideo timestamping as a workaround for timing. If you care about timing you should always install the PsychtoolboxKernelDriver on OSX. CoreVideo timestamping was used as a workaround for setups where this couldn’t be used, e.g., on all Intel graphics cards. The method has proven unreliable due to Apple CoreVideo bugs not fixed since years, but additionally its use causes random crashes at the end of experiment sessions on some setups for some users.

  • PsychImaging - add convenience setup function for dual-display stereo mode 10. See ImagingStereoDemo for the simplified setup for stereomode 10.

  • PsychImaging - Improve 10 bpc framebuffer setup: Do not disable dithering on digital output by default, but leave decision to OS, with option to override.

  • Screen('ConfigureDisplay', 'Dithering') allow low-level control of AMD dither control registers.

  • Various help text updates.

  • Various updates to color calibration/color handling routines by David Brainard.

  • Misc other fixes.

  • PsychtoolboxKernelDriver updates. Different drivers for legacy 10.7 and earlier vs. 10.8+. Apple removed the necessary sdk’s from its latest XCode to build the PsychtoolboxKernelDriver for OSX versions earlier than 10.8. Therefore we now have a for OSX 10.8 and 10.9, which contains bug fixes and improvements. Then a legacy set of 64-Bit and 32-Bit kernel drivers for OSX 10.7 and earlier. These legacy drivers are no longer maintained and contain known bugs and limitation.

  • The OSX Psychtoolbox now requires Octave 3.8.0 or later. It will not work with Octave 3.6 and earlier anymore. It could be made working by manually setting a symbolic link in the file system if somebody wants to stick to 3.6. But upgrading to 3.8 is a good thing, as it now provides a useable GUI and other improvements relevant for PTB.

End of support for Windows XP...


A gentle reminder that the end of life for Microsoft Windows XP is approaching quickly:

What a lucky coincidence that April 2014 is not only the month of the scheduled demise of Windows XP, but also the month of arrival of the next Ubuntu Linux long term support release Ubuntu 14.04-LTS.

Starting with the next PTB beta release and start of the ptb 3.0.12 series, people can consider Windows XP and Vista unsupported at least by me. While i expect ptb to continue to work ok on WinXP, and i won’t sabotage it intentionally, i will not perform any testing, bug fixing or support for that system in any way for probems only related to WinXP or Vista. The very little bit of tuning and development that happens for the MS os’es at all will focus on Windows-7 and later.

“If you discover you are riding a dead horse, the best strategy is to dismount.”

PTB BETA RELEASE "Sex, Lies and Video"


  • OSX 10.9 Mavericks compatibility fixes. E.g., for AppNap protection, visual timing fixes, other brokeness fixes.
  • Rewrite of OSX FontInfo and DrawText renderer for higher startup speed and compatibility and future proofing.
  • Add new supported GPU’s from AMD.
  • Minor bug fixes for OSX, Windows, Linux, e.g., IOPort, Eyelink, PsychHID KbQueues.
  • General improvements to video capture and video recording, e.g., for DV cameras.
  • DC1394 based Firewire video recording support, high bit depths capture support, various other bells and whistles.
  • DC1394 based Firewire multi-camera synchronized video capture/recording.
  • Staircase procedure improvements by Diederick Niehorster.
  • PsychColorimetric routines improved by David Brainard.

PTB BETA "Hammertime!" - SP4 "Deadlock"


This beta release fixes some ugly regression introduced into the PTB for Linux in the last beta. The regression could cause a crash of Octave or Matlab when quitting the application or clearing the Screen function on some setups with some scripts.

It makes DaqDeviceIndex mildly more robust on 64-Bit OSX by applying a new set of horrifiying hacks.

Fixes some small bugs in IsomerizationIn[Eye/Dish]Demo and makes them work on Octave again, after some regression was introduced this summer.

PTB BETA FlowerPower released


This one is just a bug fix for the FlowerPower beta 3 days ago.

It fixes some locking bugs introduced into the Linux PTB by the last release, which only affect use of FOSS graphics drivers with frame-sequential stereo or async flips. Those fixes could have caused a deadlock in those use cases.

This release was successfully tested against the upcoming Ubuntu 13.10 “Saucy Salamander” release.

PTB BETA RELEASE "Hammertime!" SP2 - "Flowerpower"


  • Cool new SuperShapeDemo by Joana Leitao.
  • Display rotation support in PanelFitter, as shown by PanelFitterDemo.
  • Make DrawText on Linux multi-x-screen capable and even faster than before.
  • Make BitsPlusImagingPipelineTest a little bit more lenient.
  • Improve display locking on Linux, and various micro-optimizations.
  • Remove beamposition timestamping support for Intel gpu’s on OSX and Linux.
  • Small improvements to Daq toolbox and other stuff.
  • Disable mex files for OSX versions before 10.6 Snow Leopard.

Stop! PTB BETA RELEASE "Hammertime!"


Stop! It’s time for Hammertime :)

Hammertime contains mostly bug fixes, but also a few neat improvements: Break it down!

Change of software requirements:

  • Go with the flow! Psychtoolbox for 32-Bit Matlab on MS-Windows now uses and requires the GStreamer SDK, instead of the rather old GStreamer runtime from the OSSBuilds project. If you want to use multi-media functions, you will need to uninstall your old OSSBuilds GStreamer and install the 32-Bit GStreamer SDK. help GStreamer contains updated instructions.

If you want to stick to the old SDK, you can DownloadPsychtoolbox() with flavor Psychtoolbox-3.0.11-PreWinGStreamerSDK. This will download and lock your Psychtoolbox permanently to the “Stadtmusikanten” release from last week, the last PTB to support OSSBuilds GStreamer.

Bug fixes: Just for a minute let’s all do the bump, bump, bump

  • Bugfix for GStreamer OpenGL bugs on Windows for movie playback with special pixelformat >= 6. Thanks to Matthew Edmundson for help in debugging this.

  • Bugfix for Linux + PsychHID: A bug in HIDAPI, the FOSS library we use as backend for low-level USB-HID device access, caused the failures described by Ian Mackenzie in forum message #16555. After use of a PsychHID low-level function, Octave and Matlab stopped parsing decimal numbers iff the system number formatting (“Country and language settings”) was setup to use “,” instead of “.” as a decimal point. E.g., german number formatting would do this. An update of PsychHID to a bug fixed HIDAPI solved this.

  • Bugfix for OSX crash at window close due to Apple OSX CVDisplayLink bugs on Matlab R2013b, as reported by Keith Schneider in forum msg #16553. Hopefully…

Improvements and new functions: Fresh new kicks advance!

  • OpenGL context sharing support between “windowed” non-fullscreen windows and fullscreen windows on OSX is now sometimes possible, at least on OSX 10.7 and later with NVidia cards, maybe also with other cards or an earlier OSX version. This means that the scenario desired in forum message #16114 may now work at least on some OSX setups. This enhancement was possible because we dropped support for OSX 10.5 and i could cleanup and rewrite our window and OpenGL context setup code to take advantage of some post-10.5 features.

  • Improved GUI window support. GUI windows now click better with some users.

  • Low-level support for latest and upcoming AMD GPU’s on Linux and with OSX PsychtoolboxKernelDriver. Beamposition timestamping and other special goodies should work with those new gpus.

  • You can’t touch this! WinTabMex for touch screens and digitizer tablets with WinTab api is now also available for 64-Bit Matlab on Windows, thanks to some enhancements contributed by Jason Friedman.

  • At the end of the day, stop a bit for some hammertime in PlayMoviesDemo’s cool video section, and bust a few moves.

PTB BETA "Stadtmusikanten"


  • ECVP2013 demos and tutorial slides PDF file added.
  • New function PsychDefaultSetup for normalized color range by default.
  • Some new demos, e.g., SimpleSoundScheduleDemo.
  • PsychColorimetric improvements by David Brainard.
  • Minor fixes and improvements here and there.

PTB BETA RELEASE "Blue skies and empty brains" - SP2


Mostly bug fixes and minor improvements, most interesting is probably the Eyelink() stuff.

  • Fix download failure for legacy v3.0.10 in DownloadPsychtoolbox() on 32-Bit Matlab for OSX.

  • Fix mex file load errors on 64-Bit Octave for OSX with Octave installed via Fink package manager and for other versions of Octave than 3.6.1 with HomeBrew.

  • New function Eyelink('SetAddress') for setting tracker computer target IP address, to allow selection of non-default IP address.

  • Enable raw sample data access for Eyelink on Linux. This requires the latest Eyelink packages for Linux, Windows, OSX. For entertainment value, SR-Research provides up to date 32-Bit packages for Debian/Ubuntu Linux via automatic software update, but delivers outdated and incompatible 64-Bit packages via software update, despite matching version numbers and release dates! However, downloading and manually installing the .tar archive for 64-Bit from their Linux support area works fine. Great release engineering guys, i had so much fun with this!

  • Updated help for PsychVideoSwitcher by Xiangrui Li to clarify how the toggle between Luminance and RGB mode works.

  • Update some other help texts, e.g., DisplayOutputMappings, to describe multi GPU support/issues/workarounds.

  • Add new text rendering mode 0 on OSX for new-style ATSU rendering of problematic exotic fonts. Screen('Preference', 'TextRenderer', mode) still defaults to 1 on OSX, but a setting of 0 uses a different layout strategy which handles some fonts better, e.g., Denis Pelli’s “Kuenstler LT”, while breaking layout for other fonts, e.g., Japanese Kanji. Great work Apple, you rule! The best solution is actually to use mode 2, which uses the (ported) Linux text renderer instead of the Apple text renderer on OSX. That renderer handles all known fonts at same or better quality and flexibility with much higher performance. However, we stick to classic mode 1 on OSX for reason of consistency, so modes 0 and 2 are opt-in.

  • Add GstX264Enc video encoding profile for fast camerabin2 video recording with GStreamer SDK. This makes VideoRecording work reasonably well with the GStreamer-SDK on 64-Bit Windows.

  • Some new demos and improvements from David Brainard in area of color calibration or simulation, e.g., IsomerizationInDishDemo.

  • New function GetGITPath from Ben Heasley.

PTB BETA "Rainbows, Droids & Compute Hippies!" SP12 released


The last update to the latest beta. Some feature improvements for use of the GStreamer SDK, especially on Windows. Upgrading to the 2013.6 SDK is recommended. Some minor other improvements and some bug fixes.

Bug fixes have been applied to the Psychtoolbox-3.0.10 flavor as well, but functional improvements are no longer applied to 3.0.10 aka 32-Bit OSX.

Users which want to stick to ancient OSX 10.4 or 10.5, or want to continue to use PTB with 32-Bit Matlab on OSX are advised to switch to the Psychtoolbox-3.0.10 flavor immediately by use of the DownloadPsychtoolbox() function with the flavor parameter set to Psychtoolbox-3.0.10. The next PTB beta update, whenever that will happen, will remove all support for those ancient configurations without further warning.

  • Make drawtext plugin on Linux and OSX more robust against weird fonts (non 8bpp fonts). This fixes the bug on Gentoo Linux reported in msg #15827.

  • Improve window focus handling for GUI windows on Linux. Don’t steal window focus.

  • Enable video capture and recording with GStreamer SDK. Video capture works on OSX with the SDK. Video recording works, but so far has very low performance with the SDK. Functionality should work on 64-Bit Matlab on Windows, but is so far mostly untested.

  • Enable movie writing with GStreamer SDK 2013.6. Works ok on OSX. On MS-Windows, it currently manages to write a valid movie file, but often hangs Matlab at the end of the writing session, so this is of limited use on Windows…

  • Enable delay loading of GStreamer SDK dll’s for 64-Bit Matlab on Windows to make installation of the SDK optional. Screen() will work without the SDK being installed, as long as no video capture/recording, movie writing or movie playback is used. This is now consistent with the behaviour on 32-Bit Matlab for Windows and should simplify installation of the Windows PTB a bit.

  • Fix regression in BubbleDemo, which was introduced in a previous beta release.

  • Allow sending arbitrary data types in NetStation() to the EEG system, not only 32-Bit integers. Contributed by Matt Mollison, University of Colorado Boulder, Department of Psychology and Neuroscience.

  • Performance improvements for DaqAInScan et al., contributed by Daniel Braun, University of Birmingham.

  • Fix GLU toolkit NURBS functions regression, so they can be actually used.

  • Movie demo cleanups for pure GStreamer operation and no more Quicktime.

  • Improvements to radiometric functions by David Brainard.

PTB BETA RELEASE "Rainbows, Droids & Compute Hippies!" SP8 - Final


Final 3.0.10 series release update:

  • Reduce verbosity of PsychHID’s libusb debug output to “silence” on Linux by default.
  • Add proper psychtoolbox udev rules for MCC DAQ operations on Linux without root.
  • Verify Daq toolbox works mostly with MCC USB-DAQ 1408FS, disable obsolete warnings.
  • Try to make DaqAInScan work with 1408FS on 64-Bit OSX – unsuccesfull.
  • Small fixes & improvements to Daq toolbox.
  • Screen for 32-Bit Matlab on OSX final recompile to sync up with beta.

This is the branch point for the 3.0.10 branch.

PTB BETA RELEASE "Rainbows, Droids & Compute Hippies!" SP4, SP5, SP6, SP7



PTB BETA RELEASE “Rainbows, Droids & Compute Hippies!” SP7

  • moglcore build fix for NeuroDebian et al.


PTB BETA RELEASE “Rainbows, Droids & Compute Hippies!” SP6

  • A fix provided by zacklb for a regression introduced in new Java setup code.


PTB BETA RELEASE “Rainbows, Droids & Compute Hippies!” SP5

  • Fix octave short-circuit operator warnings by fixing all M-Files.
  • Factor out Java classpath Matlab setup into one function.
  • Update a few Datapixx mex files.
  • Fix a PR-705 toolbox bug (zacklb).
  • Tiny other stuff.


PTB BETA “Rainbows, Droids & Compute Hippies” SP-4

Fixes to DAQ toolbox, PR-xxx toolboxes, Screen(), online documentation and help, display calibration and other small bits.

End of life for 32-Bit PTB for OS X, and OS X 10.4, 10.5


A little reminder that I will suspend development & support for:

  • All 32-Bit versions of PTB for Mac OS X, aka 32-Bit Matlab.
  • All versions of PTB for OS X 10.4 “Tiger” and 10.5 “Leopard”.
  • All classic Apple Quicktime support.
  • The PsychtoolboxKernelDriver for 32-Bit OS X Kernels.

… before end of May 2013. The latest beta release from yesterday may be the last one for those platforms. Maybe I’ll do some “service pack” releases to fix post-release bugs common to all platforms or such within the next few days or weeks, but no significant new features or improvements or bug fixes will be added anymore until the quickly approaching end of life. At end of life time, a new unsupported branch will be created for those who want to stick to the old version.

PTB beta “Rainbows, Droids & Compute Hippies!” release 2013-04-20


Git tag: PTB_Beta-2013-04-20_V3.0.10

This release contains a couple of new features and improvements, some rather experimental by now, but also the usual amount of small improvements and bug fixes.

All systems:

  • Basic GPGPU compute support:

    A first sketchy implementation of (G)eneral (P)urpose computation on (G)raphics (P)rocessing (U)nits support. We already supported (ab)use of GPUs for other tasks than rendering since the beginning of 2007, with our built-in imaging pipeline and various plugins to accelerate common image processing and stimulus post-processing operations. However, so far all functionality was implemented by reformulating computation tasks as graphics rendering tasks and executing them as a mixture of fixed-function OpenGL rendering and programmable vertex- and fragment-shading via the GLSL OpenGL shading language. This works very well for many visual processing problems, but can become awkward or inefficient for non-graphics compute problems. Technology progressed and nowadays most modern GPUs support GPGPU in a more straightforward and efficient way by use of NVidia’s CUDA API (for NVidia GPUs only) and OpenCL for pretty much all GPUs on the market, including NVidia’s, so it’s time to look into what can be done better with those APIs for stimulus creation. This beta release contains basic support for utilizing NVidia CUDA capable GPU’s under 64-Bit Matlab by use of a high-level open-source toolbox called “GPUmat”, which can be downloaded for Linux and Windows from here: GPUmat toolbox download link

    GPUmat allows to implement computational methods in familiar Matlab language, as it extends Matlab with new GPU data types GPUsingle and GPUdouble. If vectors and arrays are created with this datatype, then the data is stored on the GPU and processed in parallel by the GPU. Psychtoolbox initial implementation provides builtin functionality to detect if GPUmat is installed and to initialize it, if so. It also provides an interface for efficient data transfer and synchronization between GPUmat and Screen/OpenGL. Screen’s floating point framebuffers, offscreen windows and textures can be efficiently passed to GPUmat as GPUsingle matrices to do computations on them and resulting matrices can be converted back into PTB’s representation for post-processing, rendering and display. In this initial release, I focused on getting the high-level setup code right to hopefully allow future painless extensions, and to optimize data transfer between PTB/OpenGL and GPUmat/CUDA.

    Benchmarking showed that the current data transfer works with > 90% of the theoretical peak performance of the tested GPU under Linux, with about 30-40% efficiency on Windows, and IIRC in the 1-2% range on OS X. Profiling showed that the OS X implementation essentially performs data exchange with the speed of a slow software fall-back path and unsurprisingly the deficiency seems to be in the OS X graphics subsystem - another area where the most advanced operating system in the world falls way short of its competitors. This means that if you like to use this functionality, you can gain an almost 100x performance boost for some tasks by running you Mac under Linux instead of OS X.

    There are currently three demos in the PsychDemos/GPGPUDemos subfolder, all showing fast application of a 2D-FFT and inverse FFT to GPU accelerated image filtering by replacing convolution with a point-wise multiply in frequency space.

    Current restrictions: Only 64-Bit Matlab supported, as GPUmat needs object oriented programming support v2 (“classdef” OOP) which is not yet available in stable releases of GNU/Octave. However, octave’s classdef support has made quite a bit of progress, so I’m optimistic this will work for stable octave in the not too far future. Only 64-Bit because I’m too lazy to maintain this for 32-Bit as well. There are not technical reasons, just that people should move to 64-Bit if they want to do this style of computing efficiently. Only NVidia CUDA capable GPU’s for now, as GPUmat is based on CUDA. The long-term goal would be to primarily support OpenCL, as it is cross-platform, cross-vendor and also supports non-GPU compute accelerators. Only Linux and Windows as of today, because GPUmat is not yet available for OS X. I ported it to 64-Bit OS X, but haven’t submitted it upstream for inclusion into the official distro yet, that’s a todo.

    Setup instructions under help PsychGPGPU, demos under help GPGPUDemos.

  • RenderDemo shows a new way to use our imaging pipeline and new plugins to perform GPU accelerated color space conversion and calibration. New functions of the imaging pipeline allow to convert from the XYZ tristimulus color space to calibrated RGB output, taking the calibration data from our color calibration routines into account.

    Wikipedia’s definition of XYZ color space

    The advantage is that all the color calibration can now get easily integrated into our stimulus post processing pipeline, and of course speed. The demo also shows a new plugin to convert from xyY color space to XYZ color space. It should be noted that this is only lightly tested. While light testing of a few sample values showed proper behaviour, David Brainard wants to write more exhaustive unit tests at some point in the future. Of course patches for tests are welcome.

  • CRS Bits# support: The display subsystem of the Cambridge Research Systems Bits# device is now fully integrated for convenient and efficient use. The I/O system is todo. Demos and tests have been updated to take advantage of new Bits# functionality like improved diagnostic and troubleshooting.

  • PR-705 photometer support contributed by Zachary Lindbloom-Brown.

  • The ColorCal2 driver now also works with GNU/Octave, thanks to the donation of a ColorCal-II by CRS. The driver seems to work very well on Linux, is a hit and miss on OS X, apparently due to funny new OS X bugs or incompatibilities, and was a no-go for me so far on Windows. The current driver uses USB-HID protocol to communicate with the device, which seems to be flaky on non-Linux. It might make sense to switch it over to good old Serial-over-USB protocol which is probably more trouble-free on the other OS’es.

  • OptiCal support, contributed by Andreas Widmann, although it could be this

  • Various smaller fixes and improvements, e.g., updates to demos, DrawFormattedText now accepts arbitrary ’rect’angles for layout of text, not only the bounding rectangle of the target window or texture, OS specific fixes, …


  • Linux Google Nexus-7 / ARM support:

    Included in this release is experimental support for the Google Nexus-7 tablet when run under Ubuntu Linux 13.04 “Raring Ringtail”, 32-Bit ARM edition. This won’t work under the normal Android OS on the tablet, but you will need a tablet edition of Ubuntu desktop Linux, either as only operating system, or as dual-boot setup in parallel to your Android OS. Psychtoolbox seems to work reasonably well on the tablet, with a certain amount of tweaking.

    What works? GetSecs/WaitSecs with usual precision, real time scheduling, sound (PsychPortAudio and 3D OpenAL), keyboard and mouse I/O — touch input as mouse input, IOPort and PsychHID stuff is so far untested, but expected to work normally if you have an OTG adapter cable, Screen() and MOGL 3D OpenGL mostly works, i.e., all the basics work. What doesn’t work is functionality that requires programmable shading support, as we currently only support OpenGL-ES1.1 fixed function rendering, not OpenGL-ES2.0 programmable shading.

    Simple installation instructions for Ubuntu Linux on the Nexus-7 under this link.

    This would wipe your Android OS and data from your device, so no more “Cut the rope” or “Angry Birds” for you, but all the fun of drifting gabor patches and movie playback.

    I chose a dual-boot setup, which preserves Android and its goodness, but requires serious tinkering, and averaging installation instructions over multiple partially incomplete or mutually contradictory howtos, e.g., this howto.

    Anyway, this is mostly a test setup for now to see how much interest there is in Psychtoolbox for mobile devices and what the challenges are. I chose the Nexus-7 because it is the reference device for porting and testing Ubuntu Linux and it is also rather good price/performance at 200$/Euros.

  • Linux highly experimental multiple display and rendering backend support: Not really interesting for now, but this is to test next generation display system support for the Linux PTB, ie., non-X11 display setups, EGL, Wayland, raw framebuffer, Android and OpenGL-ES / OpenGL-3/4/…


  • More fixes for OS X Retina and LCD timestamping brokeness and other OS X bugs. I now recommend to always install the PsychtoolboxKernelDriver if you use OS X 10.7 or later and want precise stimulus onset timing or timestamping. The level of OS X brokenness has reached the point where our own implementation is almost always better than what Apples OS has to offer. E.g., OS X beamposition queries are only supported anymore on NVidia GPU’s and scheduled by Apple for complete removal in a future OS X release. Even on NVidia the mechanism is slightly broken and inaccurate on all modern GPUs and totally broken as of OS X 10.8 for any kind of digital flat panel / LCD / DVI-D etc. - it only sort of works for classic analog VGA connected CRT monitors.

PTB beta “The fun in dysfunction” SP2 release 2013-1-14


Git tag: PTB_Beta-2013-01-14_V3.0.10

This update is dedicated to Aaron Swartz (R.I.P.) and others who fight for freedom of information and the internet. It contains some improvements to M-Files.

All systems:

  • Full panelfitter high-level setup support via PsychImaging('AddTask', 'General', 'UsePanelFitter'): Selection of common scaling/fitting modes. Fully compatible with all stereo display modes, high-precision display modes and other PsychImaging tasks. Also now fully compatible with RemapMouse().

  • Cleanups to BeampositionTest by Ian A.

  • Robustness improvements to GStreamer-SDK detection on 64-Bit Windows.

  • Fix PsychImaging display mirroring when only fixed-function pipeline is active.

  • Tiny fixes in moglmorpher() and LoadOBJFile().

  • Minor tweaks to some demos.

PTB beta “The fun in dysfunction” SP1 release 2013-1-8


Git tag: PTB_Beta-2013-01-08_V3.0.10

More fun with dysfunction:

  • Minor bug fixes to PsychDataPixx on some setups.

  • Improved interaction of panelfitter with new side-by-side stereo mode.

  • Documentation updates regarding installation of Psychtoolbox kernel driver on OSX.

  • Improved support for Retina Mac Book Pro.

  • Support for Geforce 600 Kepler GPU’s on OSX.

  • Experimental support for 4 display heads on Kepler GPU’s for OSX and Linux.

PTB beta “The fun in dysfunction” release 2013-01-04


Psychtoolbox-3/Psychtoolbox-3@89ac3a06 at GitHub tag: PTB_Beta-2013-01-04\_V3.0.10

All systems:

  • Support for GStreamer camerabin2 video capture & recording: Once a future release of the GStreamer-SDK catches up in functionality, this will enable video capture and recording on 64-Bit OSX and for 64-Bit Matlab on MS-Windows. Currently it only works on Linux, or for 32-Bit Matlab on Windows or for OSX either with 32-Bit Matlab or with a self-compiled GStreamer installation from Homebrew.

  • Support for a new builtin imaging pipeline panel fitter: This allows to open onscreen windows whose drawing area size is bigger or smaller than the area of the screen occupied by the window. A new optional parameter clientRect for Screen('Openwindow',...); allows to specify the “virtual size” of the window, whereas the old rect parameter still specifies the true size of the window on the screen. Psychtoolbox will pretend your window is only the size of clientRect, but at Screen('Flip') time it will upscale or downscale your stimulus image to the true size of the window, applying linear or better filtering for this zoom.

    Why would you want to do that?

    Typical flat panels and projectors only work optimally at their native resolution. All other resolutions usually cause at least funny timing problems or sometimes visual artifacts with dynamic stimuli. This option allows you to transfer a script written for visual stimulation on, e.g., a CRT monitor or a panel on a certain resolution, to a different experimental setup which has a different native display resolution with minimal modifications to the script in case your script made assumptions about the display resolution in use. It would be especially useful if you worked in a place where some equipment is badly maintained and tends to break down in the middle of data collection, so it needs to be swapped with incompatible equipment of different native resolution. This release still misses the high-level setup code in PsychImaging() to access and configure this feature in convenient ways, so the panel fitter may not work well or need some tinkering when used together with some advanced features, e.g., some stereo display modes or high precision display modes which use a unusual display geometry themselves. This will be fixed in a future release. For standard bread & butter rescaling it works well. Of course it is still better to choose your resolutions wisely or write your code resolution independent if possible, as the scaling comes at some cost of another millisecond or two spent on rescaling in the gpu.

  • Small fixes to PsychKinectCore and to PsychHID.

  • Various other fixes for small documentation and PTB bugs.

  • Potential multi-threaded decoding improvements for GStreamer movie playback. The multi-threaded high performance playback mode introduced in the previous beta is so far only effective on Linux and on the GStreamer packages provided by the Homebrew package manager on OSX, but not with the GStreamer-SDK on OSX or Windows. This beta prepares higher performance playback with a future version of the GStreamer-SDK.

  • Support for a popular HDMI stereo frame packing format, side-by-side horizontally compressed stereo. PsychImaging() has a function to enable this, ImagingStereoDemo(102) demonstrates it.

  • Datapixx and Eyelink improvements.

  • Use of multisample anti-aliasing MSAA with imaging pipeline enabled should now work better on deficient OSX graphics drivers, especially in 3d rendering mode due to addition of new/improved error handling and fallback path.


  • Improved Linux support for timestamping, graphics problem detection and desktop compositor handling. This further increases the advantage Linux users already had over OSX and Windows users wrt. timing precision. This beta has been tested with different common desktop GUI’s for Linux wrt. to correct stimulus display, proper timing and timestamping and display synchronization across dual-display setups, e.g., for stereoscopic presentation, with a NVidia GeForce 8800 card under Ubuntu Linux 12.04.1-LTS, the latest NVidia binary drivers and a Datapixx for external measurement of stimulus onset timing and timestamping. It works perfectly well on single-display and on dual-display setups under KDE-4 with KWin desktop manager, GNOME-3/Gnome-Shell with Mutter dektop manager, LXDE with OpenBox, GNOME-2 classic without desktop compositor, and XFCE-4 with/without compositor. It works perfectly well on single display setups, but not on multi-display setups with desktop GUI’s based on Compiz: Unity and GNOME-2 work well single display but not dual-display. This must be a bug in Compiz introduced by the latest software updates to Ubuntu 12.04 LTS sometime December 2012. Canonical applied some optimizations to improve video game performance, which worked out well on single display setups, but apparently went wrong for dual-display setups. It doesn’t work well at all with the Unity-2D desktop, something is broken there. If you run data collection i would recommend running a desktop GUI without compositor, e.g., by creating a separate “experiment” user account on your machine where data collection is run and a pure 2d desktop is installed, e.g., XFCE-4 with desktop composition turned off, or LXDE+OpenBox. This gives you that extra piece of mind that even if there would be compositor related bugs in Psychtoolbox or your system, no compositor could interfere, because something that doesn’t exist can’t interfere. It may also give you a few percent extra performance. However, the desktop GUIs mentioned above are well behaved even if a compositor is active, as PTB can temporarily turn off the compositor, or the compositors switch themselves to standby during an experiment session. It’s a tradeoff you have to make between paranoia vs. convenience and bling.

  • Improved workarounds for handling of slightly broken Intel-DDX graphics drivers on Linux (pre 2.20.16 series). Intel video drivers before version 2.20.16 but after June 2011 have a bug in their swap scheduling. Psychtoolbox will detect this bug and enable a workaround for such drivers since the previous beta. The detection code has been improved. Of course it is best to update to a fixed driver (v2.20.16 or later) asap.


  • Improved support for handling of MS-Windows-8 dektop compositor: Psychtoolbox is better at detecting if a desktop compositor on Windows Vista/7/8 interferes with timing and can warn you in most cases. However, Windows-8 does no longer allow to disable the compositor, neither manually by you, nor automatically by us. This means you have to completely rely on the compositor disabling itself for fullscreen window displays, something that didn’t work well at all in the past. Testing with an up to date Windows-7 system showed that the compositor now auto-disables for fullscreen windows on single-display setups, but fails miserably on multi-display setups. I didn’t test with Windows-8 as we don’t have or use that os. Maybe Windows-8 behaves better than Windows-7. If it doesn’t then it is completely unuseable for timed stimulus presentation an anything but a single display setup, with no second monitor even connected.


  • Bugfixes / Workarounds for some MS-Windows bugs and many new MacOSX 10.7+ operating system bugs. If i had to describe Apples latest operating systems in one word it would be “Dysfunctional”. Especially many fixes are related to use of high-precision display devices like Datapixx/Viewpixx/Propixx/Bits+/Bits# etc.

PTB beta “Dancersizing, Grey & Hopeless” release 2012-11-11


Psychtoolbox-3/Psychtoolbox-3@9b5c6901 at GitHub tag: PTB_Beta-

This is mostly a bug-fix release, but it also improves GetChar support on some platforms.

All systems:

  • GetChar, CharAvail, FlushEvents and ListenChar now (ab)use keyboard queue functionality on setups where use of Java based GetChar et al. is ineffective or impossible: This should enable useable support for Windows Vista, Windows-7, Windows-8 (untested), Matlab in -nojvm mode, and for GNU/Octave in its standard terminal command line interface mode, and the GUI which will be part of the next major Octave release. Now this mode will use keyboard queue functionality, which means it doesn’t work if your code already makes use of keyboard queues. More specifically: On Linux it will block access to the keyboard queue of the default keyboard, all other queues will work. On Windows it will block access to all keyboard queues, but allow use of the “keyboard queues” to query mice, joysticks and other non-keyboard devices. On OSX it will block all use of keyboard queues, because there is only 1 queue, as opposed to Linux/Windows which can have many parallel queues. Otoh, code that explicitely uses keyboard queues will have a more flexible and powerful interface to keyboards anyway. GetChar et al. are just for simple and convenient keyboard access, and mostly to keep old code working, so this shouldn’t be much of a limitation.

  • CRS OptiCal support by Andreas Widmann, Uni Leipzig. The OptiCal() function allows reading measurements from a CRS OptiCAL luminance meter connecte to a serial port.

  • Various other small improvements.

  • PsychPortAudio: Now reports ElapsedOutSamples more precise, even in some corner-cases where that count could be off by up to a millisecond in the past.

  • Some audio demos have been improved, ie., cleaned up, to show best practices for the current driver instead of the stuff that was considered optimal 2 years ago. The old code of course still works perfectly with the current driver, but sometimes did unneccessary complex stuff that is no longer needed for the current driver. PsychPortAudioTimingTest now also adapts a bit better to the kind of large latencies required to make shoddy MS-Windows setups work.

  • IOPort: If async background data reception is used, e.g., to automatically receive and timestamp trigger bytes from a serial port, and a read timeout occurs, e.g., the trigger source hasn’t been started within the max 25 secs timeout, then the driver will return an empty [] packet, instead of one that is filled with zeros. The old behaviour was confusing, this one now behaves in async mode as it would behave in sync mode.


  • PsychGPUControl: Can now also automatically disable 3D desktop composition on Ubuntu Linux 12.10, at least when the Unity interface is active. So far it was incompatible with 12.10 and did nothing. However, the general recommendation is still to manually disable any kind of 3D desktop compositor on experiment machines, regardless what OS you use. It avoids possible confusion if the automatic fails - which can happen on both Linux and Windows under some circumstances without PTB noticing this, and helps performance in any case, because even a compositor on standby will use more valuable graphics resources and cpu/memory than a disabled compositor.


  • Screen: Videocapture should now also work with 64-Bit Octave on OSX, not only with Matlab.

PTB beta “Death by a thousand paper cuts” release 2012-10-09


Psychtoolbox-3/Psychtoolbox-3@759f023b at GitHub tag: PTB_Beta-

This is mostly a bug-fix release to deal with various operating system and graphics driver bugs discovered after the last release.

Release Highlights:

All systems:

  • The Speak() command is now supported on all operating systems, and made more flexible. Very flexible Linux support via speech dispatcher service added. Basic MS-Windows support added by Vishal Shah from the Pelli lab at NYU. Mac OS support made slightly more flexible.

  • Improvements to general graphics driver sync tests to catch some interesting potential future bugs. Some warning clutter removed where it was redundant.

  • Enhancements to the PsychPortAudio backed Snd() legacy sound command: Snd() uses PsychPortAudio internally for higher robustness. However, this means that use of Snd() is incompatible with simultaneous use of PsychPortAudio() within the same script. Snd() now notifies you of this, and also falls back to the old Matlab / Octave sound() function, if PsychPortAudio is already in use.

  • Some improvements to DKL color functions by David Brainard.

  • Make Screen startup more artifact free on setups with OpenGL triple-buffering enabled. So far you have to disable triple-buffering on any graphics driver on any operating system to get PTB to work correctly timing-wise. Or more specifically, you have to refrain from enabling triple-buffering, as triple-buffering is off on almost all graphics drivers and operating systems by default. However, i’ve just submitted patches with improvements to the Intel and Nouveau drivers for Linux. Once the improved drivers will be released, you will be able to use the drivers with triple-buffering enabled on Intel and NVidia graphics cards , and then it will be nice to have a good looking, artifact free start screen.

  • Fix for NVidia graphics driver bug on all platforms, which caused output of many errors when using GL_TEXTURE_2D textures in some demos, e.g., BlurredMipMapDemo.


  • Fix pnet() data reception on 64-Bit Matlab. Certain parameters for data reception could cause it to crash due to a 64-Bit compatibility bug.

  • Fix ShowCursor() and HideCursor() on some MS-Windows setups. HideCursor() wasn’t hiding the cursor anymore on some setups for no conceivable reasons, whereas it worked flawlessly on others, without any change of code on our side.


  • Improved correctness tests and wokarounds for a graphics driver bug on Intel graphics cards under Linux. A bug was introduced into the Intel drivers released after July 2011, which slipped through (my) code review. This could cause too early stimulus onset, earlier than requested via the when parameter of Screen('Flip') - basically the parameter was ignored and flip always happened at start of the next video refresh cycle. Psychtoolbox automatic correctness tests didn’t test for this, so it slipped through ptb’s tests as well :-(. However, the problem was easily detectable by checking the timestamps returned by Screen('Flip'), or in the case of long interstimulus intervals or animations by visual inspection. Psychtoolbox now checks for this type of bugs as well, warns the user and switches to a fallback path to workaround the problem until a graphics driver update fixes the bug for good. A bugfix for the graphics driver has been submitted for inclusion into future Intel graphics driver releases.

  • Make Linux Screen() compatible to apitrace utility. apitrace is a tracer for OpenGL applications. Very useful for debugging bugs in OpenGL code. Calling setenv('PSYCH_ALLOW_APITRACE', '1') makes it possible to trace Psychtoolbox execution of OpenGL commands for debugging of hairy bugs in OpenGL code.

  • Bugfixes and enhancements to Screen('Resolution') on Linux. It could return stale information after a display resolution switch in some cases.


  • Bugfix for Screen(‘Resolutions’) on 64-Bit OSX. It crashed 64-Bit Matlab/Octave on OSX when called.

  • Catch errors during HID device enumeration and handle them more gracefully by output of a useful error message instead of crashing hard later. This to work around bugs in Apple’s 64-Bit HID Utilities framework (shoddy error handling), and potentially in some OSX HID drivers, e.g., for certain Wacom tablets. A specific tablet model could crash PsychHID by messing with device enumeration, as reported in Issue#62 on Psychtoolbox-3 at GitHub.

PTB beta “Broken Windows” release 2012-09-15


Psychtoolbox-3/Psychtoolbox-3@fde2c3f5 at GitHub

Most importantly this release adds 64-Bit Matlab support for MS-Windows and removes Octave support and Quicktime support for MS-Windows.

Release Highlights:


  • The runtime library requirements have changed: Now our mex files require the MSVC-2010 runtime libraries. Installers for these are contained in the Psychtoolbox/PsychContributed folders (vcredist.exe, vcredist_x64.exe).

  • The prehistoric PsychSerial() command has been removed. Use IOPort for serial i/o.

  • GNU/Octave support for MS-Windows completely removed. After over 3 years of availability on Windows, only about 117 of over 22000 MS-Windows users gave Octave a try - that’s only 0.5%, so i consider this a failure and declare defeat. If you want to continue using Octave 3.2.4 with Psychtoolbox on Windows, you must refrain from updating PTB 3.0.10 any further, or stick to PTB 3.0.9, otherwise the update will delete your Octave mex files. DownloadLegacyPsychtoolbox() always allows to downgrade to the unsupported v3.0.9 and then stick to that.

  • Apple Quicktime support for Windows finally completely removed. Now GStreamer is mandatory for multi-media functionality on Windows (Movie playback, movie creation, video capture, video recording). help GStreamer will tell you how to install it.

  • 64-Bit Matlab support for MS-Windows added. Limitations: At the moment, on 64-Bit Matlab, GStreamer must be installed for Screen() to work at all, even if you don’t use any multi-media functions. Eyelink() is unsupported with 64-Bit Matlab, as SR-Research doesn’t support 64-Bit Windows yet afaict. Datapixx support is missing, but will probably get added soon.

  • A new PsychTweak() command allows to control some parameters on how clocks are handled on MS-Windows. This allows to change the way broken clock hardware on MS-Windows is detected and handled. The defaults have been changed to be a bit more lenient to tolerate some brokeness in the latest processors on Windows.


  • 32-Bit Octave support on OSX removed, 64-Bit Octave 3.6 support added. Should work with Octave installed via the “HomeBrew” package manager.

  • Optional GStreamer support for 32-Bit Matlab on OSX added. Now you can use it on 10.6 Snow Leopard and later. Apple Quicktime is still the default on 32-Bit Matlab for OSX, the Screen('Preference') switches allow you to use GStreamer instead.

  • The PsychtoolboxKernelDriver on OSX now supports Intel integrated graphics cards as well.

I consider the 32-Bit PTB for OSX now on “live support”. I have one machine left for maintaining it. As long as that machine keeps working and is not getting upgraded to 64-Bit, i’ll keep the 32-Bit PTB for OSX alive.


  • Windowed window support and GUI window support now shows same level of functionality and behaviour as on OSX, e.g., PsychDebugWindowConfiguration is now fully useable.

All systems:

  • Movie playback performance and functionality improvements for GStreamer based movie playback engine. Some perf. improvements for videocapture engine, and basic GeniCam/GigE video capture support. The default behaviour and performance is the same, but some optional switches now allow to enable multi-threaded video decoding for some codecs, e.g., H264 and use of optimized texture upload methods for some movie formats. This can speed up playback of high framerate and high resolution videos considerably on high end machines with many cores and modern gpus. PlayMoviesDemo() has some new optional parameters pixelFormat and maxThreads which allow to enable these optimizations, e.g., on H264 video. E.g., a pixelFormat = 6 and maxThreads = 0 will use as many processor cores as available for video decoding. On Linux and OSX this can provide over six-fold speedup, on Windows the multi-threading seems to be mostly ineffective at the moment, probably due to some codec bugs on Windows.

  • Support for GL_TEXTURE_2D textures as render targets (e.g., Offscreen windows and use with TransformTexture) – For improved OpenGL interop with 3rd party OpenGL code like Horde3D. Non-power-of-two texture support. Mipmap filtering support and demos for efficient blurring via gpu accelerated resolution pyramids. The new BlurredMipmapDemo employs/demonstrates OpenGL mip-map filtering to use image resolution pyramids for fast blurring of images, e.g., for certain types of gaze contingent displays.

  • MOGL OpenGL support updated to support most new OpenGL-2.1 extensions up to the ones added in August 2012.

  • Various other improvements, cleanups and bug fixes i can’t remember.

PTB beta “Rotten Apples” release 2012-06-01 (Start of Psychtoolbox 3.0.10)


Psychtoolbox-3/Psychtoolbox-3@92809a33 at GitHub

“Rotten Apples” starts the new Psychtoolbox Version 3.0.10 series.

The almost only new feature in this release is support for 64-Bit Matlab under Apple MacOSX.

Minimum system requirements for OSX/Apple:

  • An Intel based Apple Macintosh computer.
  • For 32-Bit OSX PTB: OSX 10.4.11 “Tiger” and later are still supported.
  • For 64-Bit OSX PTB: Absolute minimum is OSX 10.5.8 “Leopard”, with functionality and performance restrictions.
  • For 64-Bit OSX PTB: OSX 10.6 “Snow Leopard” and later should support all functionality without restrictions.

Basic 64 Bit compatibility testing happened on 10.5.8 with Matlab R2010b-SP1, 10.6.8 with R2012a and 10.7.4 with R2012a. Future testing will happen on 10.7.x Lion with R2012a, with very infrequent basic testing on 10.5.8 Leopard with R2010b.

Support for using PTB on OSX on Apple PowerPC computers has been removed. If you want to keep your old PowerPC useable with PTB you’ll need to stick to the deprecated and unsupported V 3.0.9 PTB.

On Microsoft Windows, support for Matlab versions older than V7.4 - R2007a has been completely removed. Windows-2000 and earlier is no longer tested for compatibility with PTB.

On other systems, support for Matlab older than 7.4 - R2007a is no longer guaranteed. The mex files would still work, but we will no longer keep M-Files compatible with older Matlab versions.

If you want to use old Matlab versions, stick to the old V3.0.9 PTB, but realize that this version is no longer supported by us in any way.

You won’t be able to upgrade to 3.0.10 via UpdatePsychtoolbox. Instead you will need to download a complete fresh copy of PTB via DownloadPsychtoolbox. The updater will provide you with further instructions after a call to UpdatePsychtoolbox. Alternatively you can download a fresh DownloadPsychtoolbox script from our Wiki. A new installer script DownloadLegacyPsychtoolbox allows to downgrade to - or stick with - older PTB’s of Version 3.0.9 or earlier if you want to run on ancient hardware or Matlab versions.

PTB revision numbers, as reported by the PsychtoolboxVersion() command for an old PTB installation have no meaning once you’ve upgraded to V 3.0.10, ie., the mapping of numbers to actual code has changed. This means that the SVN revision number no longer uniquely defines the software you have installed. Instead the combination of version number, e.g., 3.0.10 and revision number does. The reason for this is that we moved our code hosting for the new 3.0.10 series from GoogleCode to GitHub, and our underlying version control system from Subversion to Git.

Psychtoolbox on 64-Bit OSX now requires the free and open-source GStreamer framework for movie playback, movie writing, video capture and video recording - “help GStreamer” for installation instructions. The 32-Bit PTB on OSX will continue to use Apple Quicktime as a default for a limited amount of time - until we have GStreamer support for it as well, after which Quicktime will become optional, with GStreamer as default. I consider Quicktime in maintenance mode from now on. Only critical bugs regarding it will be fixed, but no future enhancements or new features for it are planned

Psychtoolbox on Windows will switch to GStreamer as default with one of the next beta releases, Quicktime will be made optional or possibly completely removed on Windows if maintaining it turns out to be too much work.

Other changes in this beta release:

  • Some improvements to color and gamma calibration code by David Brainard.

  • The 64-Bit Psychtoolbox on OSX now also enables floating point textures and frame buffers for high color precision stimulus display and GPU computing on the latest generations of Intel graphics hardware, ie., the Intel HD 3000 integrated GPU’s found in recent MacBooks, MacBookPro and MacBook Air. Hardware functionality of these GPUs seems to have improved enough in the latest hardware generations to make them viable for more demanding tasks. Some of our software tests show good precision, comparable to discrete state of the art AMD or NVidia GPU’s, whereas some other tests still show some deficits, and no hardware testing with photometers etc. has been performed to see how well these gpu’s work for high precision stimuli beyond the frame buffer - ie. if the new goodness actually reaches the display correctly.

Intel HD graphics series support will be added for other operating systems and 32-Bit configurations in a future ptb release.

Much deserved credits for the OSX 64-Bit port go to:

Thanks to Prof. Heinrich Buelthoff at the Max Planck Institute for Biological Cybernetics in Tuebingen, Germany, for supporting the work on the 64-Bit port - and most other significant improvements to PTB throughout the last six years, by letting me spend some of my work time on this time intense “hobby”.

Thanks to Prof. Keith Schneider at the University of York, Canada, for donating an almost new Apple MacBookPro, thereby allowing to work on a 64-Bit OSX port in a much more pain free manner.

Thanks to Ian Andolina from UCL London for help in initial testing of the 64-Bit port.

Thanks to Linus Torvalds for inventing the wonderful Git version control system and to GitHub for our free Git hosting. Git is a wonderful tool for preventing nervous breakdowns and reducing crying fits and rage against the machine during software development.

Absolutely no thanks to various unknown people working at Apple and Mathworks for reasons too many and too horrifying to mention.

PTB beta release 2012-5-21 (SVN Revision 2580/2591)


For more details, please review the detailed change log.

This beta, nick-named “Conradine”, marks the last official Psychtoolbox release in the Version 3.0.9 series. We may or may not fix critical bugs after this release, but most likely we won’t.

This is the last release to support MacOSX on Apple PowerPC hardware, the last one to support MS-Windows 2000, and the last to support Matlab versions older than V7.4 aka R2007a

All systems:

  • PsychPortAudio: Fix sound output with dithering enabled on current 64-Bit Linux and all other future 64-Bit platforms. There was a bug in the underlying PortAudio library which caused strong white noise with dithering enabled on a 64-Bit runtime. In low latency / high timing precision output mode, dithering is disabled by default, so most demos and scripts weren’t affected. BasicSoundOutputDemo however worked in “normal mode” with dithering on by default, so the actual sound output was drowned in strong static white noise.

  • Eyelink: Fix EyelinkFixationWindow function for use with Matlab R2012a, which is case sensitive and treats wrong case in function names as errors, instead of warnings.

  • PsychHID: Add keyboard event ring buffer support. Once a keyboard queue for a specific keyboard(-like) device (mouse buttons on a mouse, joystick/gamepad buttons, etc. are treated as “mini keyboards”) has been created and started via KbQueueCreate and KbQueueStart all events (button press and release) are not only recorded between invocations of KbQueueCheck, but they are now additionally recorded in a ring buffer that can hold up to 10000 press- and release events. The buffer sequentially records all events, including a timestamp and potential additional data. The buffer can be emptied (“flushed”), checked and read out with the new functions KbEventFlush(), KbEventAvail() and KbEventGet() independent of the old KbQueueXXX functions. This should allow more convenient access to recorded subject responses, scanner triggers etc. without the need to constantly poll for key state via KbCheck, GetMouse, GamePad etc. Each queue and thereby each individual keyboard has its own buffer (although you can only address one keyboard or mouse on windows due to operating system limitations, and only have one keyboard queue on OSX due to limitations of our current PsychHID driver, so multiple queues for multiple devices is only really useful on Linux). KbQueueDemo demonstrates how to use keyboard event buffers.

  • moglmorpher: Add more strict parameter checking to subfunction moglmorpher('AddMesh') to catch some coding errors in user scripts instead of aborting with puzzling error messages.

  • Screen: Allow to disable sound decoding of Quicktime movies during playback on Windows and OSX, to match behavior on Linux and Windows when used with the GStreamer playback engine. Precisely: Sound decoding is not really disabled, as Quicktime does not allow that. Instead sound output is just muted. This way scripts behave in a compatible and consistent way, irrespective of playback engine, but users of Quicktime won’t get the benefits of reduced processor load and sound resource utilization.

  • Various performance improvements in the mex files and small bug fixes.

  • Various improvements to color correction and gamma correction routines by David Brainard.


  • Screen: Update low-level GPU detection support to work with the latest year 2012 AMD GPU’s, ie., the “Southern Islands” and “Trinity” GPU families, better known by their marketing names “Radeon HD 7000” and “AMD Fusion”. This allows our special bag of neat low-level tricks on Linux to also work with these new models of graphics hardware and expose some special features not found on other systems.

  • PsychHID: Fix default keyboard selection on Linux on some Laptops, which report the VideoBus as a keyboard. If no specific keyboard device index is given to any of the keyboard functions, PsychHID uses a heuristic to try to select the “default keyboard” as a reasonable choice. As there isn’t any real “default keyboard” on any operating system, the heuristic is a “best effort” approach which can go wrong on exotic hardware setups. On Linux, some Laptops expose some control buttons related to graphics hardware as a “one button keyboard” and the heuristic sometimes chose those buttons as default keyboard - clearly not what one would expect. Now the heuristic skips those button devices labeled as VideoBus. PsychHID on Linux selects the default device by name pattern matching, selecting the first device whose name string sounds like a real keyboard instead of something exotic. PsychHID on MacOSX selects the first HID device labelled as “HID Usage value keyboard class”, so the order in which keyboards get plugged into the computer - or detected at boot up, or the location where they get connected - determines which is the default keyboard. On Windows, PsychHID can’t discriminate keyboards due to operating system limitations, therefore it can’t choose the “wrong one” ;-)

PTB beta release 2012-4-1 (SVN Revision 2540)


For more details, please review the detailed change log.

All systems:

  • PsychPortAudio: Potential startup latency reduction on all systems as now runlevel 1 is used by default. This potentially reduces start latency for sound playback at the expense of slightly higher cpu load while playback is stopped.

  • Performance improvement to Screen('MakeTexture') via new optional specialflag 4 – Much faster for all uint8 input textures and for Luminance + Alpha and RGB8 textures as created from double() input matrices. However, mode 4 requires a GPU with shader support and may not work well with scrolling/drifting textures or on a few other special cases. It is best used for fast creation of still images.

  • Code cleanup here and there.

  • Some tiny fixes for Octave 3.6 compatibility of M-Files.

  • DaqAInScanContinue now can return “live data”. (Untested).

  • KbCheck, KbQueueCheck, KbTriggerWait et al. now support handling of mouse, joystick, gamepad and similar devices as mini keyboards: Their buttons can be treated as keys on a keyboard and queried by the KbXXX functions. This allows simplified (ab)use as response button devices.

  • Support for procedural visual noise on modern GPUs - Perlin noise for fast visual noise generation on supported gpus. Use with caution: Perlin noise is not Gaussian noise!

  • Small improvements to QuestSimulate: Can now visualize its operation.

  • Datapixx mex files updated by VPixx to support the ViewPixx device, e.g., backlight control.

  • CMUBox now handles Cedrus Lumina response boxes (Untested).

  • Various other small improvements and some new demos.

Windows & Linux:

  • GStreamer movie playback engine enhanced with many bug fixes, improved features, some new functionality, performance improvements.

OSX & Linux:

  • Improved realtime scheduling setup for increased robustness of timing when many threads are active or system is loaded. OS/X now uses Mach realtime scheduling everywhere, not only on master thread. Linux has refined priority level setup and uses mutexes with priority inheritance.


  • Screen(‘DrawText’) now obeys geometric transformations, e.g., in DrawMirroredTextDemo.

  • PsychHID HID device enumeration improved due to upgrade to latest HIDAPI.

PTB beta release 2012-2-8 (SVN Revision 2450)


For details, please review the detailed change log.


Screen() now supports frame-sequential stereo presentation on graphics card / graphics driver / operating system combos which don’t provide native OpenGL quad-buffered frame-sequential stereo support. In stereomode 1 it detects if native support is available and uses it if possible. Otherwise its own built-in implementation is used. Stereomode 11 always uses the built-in implementation.

Tested and shown to work reasonably well on WinXP, OS/X, Linux with sufficiently fast gpu & cpu under light load. Robustness of this built-in method is highly dependent on speed and timing behaviour of the underlying os and computer / gpu hardware. A native implementation (e.g., NVidia QuadroFX or AMD Fire gpu’s) is preferrable if available, but this should be good enough for not too demanding casual stereo presentation.

Bugfixes / Tweaks:

  • Fix to PsychtoolboxPostInstallRoutine by Diederick.

  • DrawFormattedText now allows wrapping of Unicode text as well.

  • Screen/Linux: Allow floating slave input devices for use with GetMouse().

  • Screen/Linux: Robustness improvement to OML timestamping for nouveau.

  • Screen: Some documentation fixes.

  • Screen/Linux: Don’t link directly against libraw1394, only indirectly through libdc1394 if libdc1394 needs libraw1394. May or may not help with broken Matlab installations on Linux.

  • PsychHID for Windows and Linux: Bugfixes to ‘GetReport’ et al. Does no longer enqueue empty hid reports – no buffer overflow anymore. Small fixes to error handling.

  • Fix documentation of Quest: Formula in help text was inconsistent with formula in actual implementation.

  • Various other small documentation fixes.

PTB beta release 2012-1-12 (SVN Revision 2434)


For details, please review the detailed change log.

Improvements to Microsoft Kinect driver for all platforms:

  • Can now handle multiple Kinects simultaneously (untested).

  • PsychKinectCore(‘GetDepthImage’) now allows return of unprocessed raw sensor data in uint16 format, for fast disc writeout. Demonstrated in very sketchy KinectRawRecordingDemo.m.

PTB beta release 2012-1-7 (SVN Revision 2423)


For details, please review the detailed change log.

All systems:

  • Bugfixes.

  • Screen(‘AsyncFlipXXX’) functions greatly improved. Now much more convenient and child-proof to use. Now allow use of almost all Screen() drawing functions in parallel to a pending async-flip – for enhanced parallelism. New implemenation can be disabled via a ‘ConserveVRAM’ preference setting. Associated tests AsyncFlipTest, MultiWindowLockStepTest demonstrate usage and performance.

  • Screen GPU rendertime measurements improved. Now more flexible (Screen(‘GetWindowInfo’, …) infotypes 5 and 6) Can start/stop/start… measurement multiple times per frame for fine-grained benchmarking.

  • Handling of window geometry in stereo modes and special display modes, e.g., Bits+/DataPixx Color++/C48 mode improved.

  • Screen now enables fast offscreen window support by default on GPUs which support it –> More efficient, flexible, robust Offscreen window support. So far this was an opt-in, now it is an opt-out via a new ‘ConserveVRAM’ setting.

  • Some improvements to video capture engine.

  • moglmorpher() can now dynamically delete meshes as well, not only add new ones.

  • PsychRTBox driver now should work with latest RTBox models & firmware, although untested.

  • Some demos refined.


A new workaround for OS/X 10.7 Lions broken vblank irq timestamping is in place. We fall back to CoreVideo display link timestamping. This doesn’t work well at all on 10.4 Tiger, which is why it gets only enabled on 10.7+ systems. All older systems use our proven and robust vblank irq timestamping. Or the even more robust and precise beamposition timestamping if it is supported by the OS or by use of the PsychtoolboxKernelDriver.


  • IOPort / PsychRTBox / CMUBox response button box drivers can now auto-enable low-latency mode on FTDI usb-serial ports, no need for user setup anymore.

  • Random improvements, also in documentation.

  • Most important: As part of an improved installer, the new function PsychLinuxSetup now configures the system (pending the users permission) for root-less operation: Psychtoolbox can use realtime-scheduling, beamposition timestamping, special GPU features, various optimizations, and access to special research hardware, e.g., the products from CRS and VPixx without the need to run Matlab or Octave as root user via “sudo”. This should remove quite a bit of headaches and increase system security considerably.

PTB beta release 2011-12-7 (SVN Revision 2386)


For details, please review the detailed change log.

The only changes in this release are performance improvements for GStreamer movie playback functionality under Linux. We now detect if the video decoder is multi-threading capable and enable multi-threaded decoding, if so. This provides some speedup, e.g., with the multi-threaded H264 decoder of the latest GStreamer versions, e.g., shipping with Ubuntu Linux 11.10. Some bits of additional performance benchmarking code for video playback was added as well.

This is mostly useful for playback of high resolution HD video (1920 x 1080p HD) at unusually high framerates (e.g., 60 fps) on powerful multi-core machines, e.g., 4 - 8 core high-end systems. Users of dual-core systems will probably not notice any difference, as the old Psychtoolbox was already able to saturate two processor cores. Also, for more usual resolutions or framerates, there probably won’t be a big benefit.

With this release, the Linux Psychtoolbox will probably significantly outperform both the OS/X and Windows Psychtoolbox for demanding video playback applications.

PTB beta release 2011-11-29 (SVN Revision 2381)


For details, please review the detailed change log.

No new features in this release, just a host of bug fixes, compatibility fixes and workarounds for broken operating systems, device drivers and other hardware.

Misc fixes:

  • PsychHID: Compatibility and performance fixes of Linux/Windows version with OS/X version. Now should hopefully behave identically and support HID Set/GetReport properly.

  • PsychRTBox: Compatibility fixes with latest boxes and firmware.

  • PsychDataPixx: Handle GPUs which have gamma tables with more than 256 slots, e.g., NVidia QuadroFX-3800 on Linux.

  • DowloadAdditionsForNeuroDebian: On Octave + Linux, also download DataPixx driver.

  • LoadIdentityClut: Handle NVidia GPUs with more than 256 gamma table slots, e.g., pro GPUs on Linux.

Screen on Linux:

  • Fix multi-display detection and setup for ZaphodHead multi-display on multi-x-screen configurations. Make a reasonable assignment of RandR crtcs and physical GPU crtcs

  • Fix tiny bugs in new RandR multi-display setup code.

  • RandR compatibility fixes for NVidia GPUs with binary blob driver: The proprietary NVidia driver lies to us: It claims full RandR V1.2 support, but only supports a subset of functions. E.g., it fails miserably with video modeline queries and get/set gamma tables. Add detection code to detect this and use a good’ol XF86VideoModeExtensions fallback.

  • Handle GPUs with gamma tables with more than 256 slots correctly. NVidia pro class GPUs, e.g., QuadroFX-3800 have 2048 slots, god knows why. Anyway…

Screen on MacOS/X

Try to work around broken VBL-IRQ mechanism on OS/X 10.7 Lion. Test by users pending. Either this fixes it, or it is “game over” for VBL-IRQ timestamping on Apple hardware.

PTB beta release 2011-11-6 (SVN Revision 2357)


For details, please review the detailed change log.

With this beta update, we changed our hosting service for Psychtoolbox from Berlios which is operated by the FOKUS institute of the german Fraunhofer society to GoogleCode, operated by Google. This migration was done because Berlios was about to shut down its operations by the end of the year 2011 due to lack of funding. Now it seems that at least Berlios basic services will be able to continue, maintained and funded by a volunteer driven non-profit organization created for the purpose of rescuing this great institution. Unfortunately these news came too late for us.

Migration of existing Psychtoolbox installations from Berlios to Google should happen automatically and mostly transparent for users during regular Psychtoolbox updates and downloads.

Good bye Berlios, and thank you for five years of great service!

Misc improvements, bug fixes, and new functions:

  • Some function and unit test updates by Diederick.
  • Improve SensorToSettings by David.

PTB beta release 2011-08-24 (SVN Revision 2193)


A summary of major improvements, features, bug fixes. For details, please review the detailed change log.

PsychHID support for Linux and Windows

  • KbQueueXXX support for both systems. Linux allows multiple keyboard queues, one for each individually adressable keyboard. Windows only allows one queue for the system keyboard. In theory it allows also multiple queues, but for that it would need to enumerate separate keyboards separately. However, Microsoft has removed this function in their DirectInput implementation for Windows-XP and later. Thanks Microsoft!

  • KbCheck support for individual keyboards on Linux.

  • GetMouse/SetMouse/ShowCursor/HideCursor support for multiple independent mice/pointers on Linux.

  • Touchpad, touch tablet, digitizer tablet, gamepad, joystick support on Linux. Tested with some usb joystick and a Wacom CintiQ tablet.

  • USB low-level control support (control transfers) for Linux and Windows. Tested with ColorCal2 driver for Linux, but not tested at all on Windows.

  • USB-HID device enumeration and control (HID transfers a la Set/GetReport) for HID devices. This should make the DAQ toolbox work cross-platform but DAQ toolbox is untested due to lack of hardware.


Some fixes for text renderer and text renderer plugin, and small improvements.


OpenAL 3D sound support now also implemented for Linux.


  • Improvements to fitting routines etc. in PsychColorimetric folder by David Brainard.

  • Fixes and improvements and some staircase functions by Diederick Niehorster.

  • Other smallish bits and bytes.

PTB beta released 4.9.2010 (SVN Revision 1783)


This summarizes all new beta features from 6.6.2010 up to 4.9.2010. The list of improvements is likely incomplete as always. For detailed logs, click this link.

This update contains a couple of bug fixes and minor improvements. Most interesting should be the improvements to the Eyelink toolbox by Frans Cornelissen.

  • Improvements and cleanup to many demos by Frans Cornelissen. Frans also enabled the video feed from the Eyelink eye camera during tracker calibration by default, so the subjects eye can be monitored during calibration procedures. The PsychHardware/EyelinkToolbox/ folder contains a file “compatibility” (help compatibility) with information on what has changed in this release of the Eyelink toolbox and how to restore the old behaviour if you don’t like the eye camera video feed to be displayed.

PsychPortAudio sound driver

  • Bugfix when used with Microsoft Windows Vista or Windows-7 on fast multi-core machines (e.g., has only been observed on a 8 core, 2.7 Ghz PC running Windows-7): Under certain circumstances the driver may falsely report your computers clock to be broken (“Time going backwards” warning) and switch to a low resolution backup clock. This is now fixed. The same fix applies to Screen and IOPort, although it was very unlikely to encounter the bug when using those mex files.

Improvements and bug fixes to Screen and other drawing functions – The Visuals

  • Updates to help texts for some functions.
  • The PsychtoolboxKernelDriver for OS/X on IntelMacs with ATI GPU’s has been refined (help PsychtoolboxKernelDriver). Now provides even more precise visual onset timestamping and removes a constant 0.4 - 0.7 msecs (depending on videomode) bias in the timestamps. Datapixx measurement confirms our timestamps are now spot-on on the two tested ATI GPU’s, a Mobility Radeon X1600 and a FireGL-V3700
  • Improvements to procedural gabor- and sinegrating rendering. Allow to specify a global contrast scaling factor as proposed by Xiangrui Li.
  • CreateProceduralSineGrating(): Add optional support for drawing procedural sine gratings with a circular aperture of selectable radius.
  • PsychImaging: Add new stereo mode 'InterleavedColumnStereo' for column interleaved stereo displays, e.g., for driving auto stereoscopic displays based on lenticular sheet lenses or parallax barriers. ImagingStereoDemo(101) demonstrates this.

Misc stuff

  • Some improvements to display calibration, gamma correction and color handling routines by David Brainard’s lab. Also improvements to the PR-650 photometer support.
  • Some improvements to general toolbox routines by Diederick Niehorster.
  • BalanceFactors: Speed optimization by David Fencsik. BalanceTrials() - New function for balancing a set of factors, contributed by David Fencsik.


PTB beta released 6.6.2010 (SVN Revision 1737)


This summarizes all new beta features from 11.1.2010 up to 6.6.2010. The list of improvements is likely incomplete as always. For detailed logs, click this link.

Some users of Microsoft Windows may encounter an error during update or download of the toolbox. On failure, the installer will give you instructions on how to download and install updated copies of the Microsoft Visual C runtime libraries to make Psychtoolbox work again. This is a required upgrade, forced by some changes in Microsofts OS.

These updates introduce various bug fixes and enhancements. Especially the Screen and PsychPortAudio and Datapixx drivers as well as the image processing pipeline and many demos and drawing functions have been improved again.

PsychPortAudio sound driver

  • Bugfix for audio artifacts due to “wraparound errors” in the Portaudio sample converters. Could cause audio artifacts if sound samples reached the (legal) signal level 1.0 and the soundcard expected audio data converted to 24 bit integer or 32 bit integer format. This mostly affected some ASIO soundcards on Windows.
  • Perform clamping of audio output signals to valid -1.0 to +1.0 range in all modes by default, instead of only in non-low-latency mode as in previous versions of the driver. Allow to change defaults for dithering and clamping in the ‘Open’ function.
  • On Windows with some ASIO soundcards and on Mac OS with some external soundcards, direct input monitoring is supported. This requires hardware support by the soundcard and allows to feed back sound from the soundcards inputs (microphone etc.) to its outputs with minimal latency. Most soundcards don’t support this feature, so you’ll need to use PsychPortAudio's software implementation which has a slightly higher latency.
  • Improved support for sound schedules: Now allows to specify and schedule onset/offset/pauses of sounds wrt. to the system clock, i.e., in the same timebase as GetSecs and all other timestamps in Psychtoolbox.
  • Support for virtual audio devices and mixing: Allows to open a physical soundcard as a master device, then create multiple “slave devices” which attach to different channels of the master device. Output of multiple slave devices is combined/merged/mixed and send to the master device. This allows to play back multiple independent soundtracks simultaneously and with independent control of content, timing and volume. Also allows to address each channel or set of channels on a card separately. New function PsychPortAudio('OpenSlave') controls this functionality.
  • Support for capturing and recording the mixed output stream as it gets sent to the real soundcard, e.g., for feedback, testing, debugging and documentation purpose.
  • Support for per device and per channel gain and volume control via the new ‘Volume’ function.
  • Support for precisely timed amplitude modulation (AM) of each virtual audio output slave device by definition of time series of gain values which can be applied with sample-accurate timing. Cfe. BasicAMAndMixScheduleDemo for demo of AM modulation, volume control, mixing and scheduling support.
  • Option to resume playback in a ‘Start’ call where it was last ’Stop’ped, instead of restarting at the beginning.

Serial port hardware support

  • Some performance improvements to IOPort and some parameters to allow to workaround operating system / serial port driver bugs on some setups.
  • CMUBox driver for serialport or USB response boxes now supports also the fORP device when connected via a serial port and to use the UBW32/Bitwhacker as a response button box.

Improvements and bug fixes to Screen and other drawing functions – The Visuals

  • Further improvements to high precision visual stimulus onset timing and timestamping. Also added new tests and workarounds for various broken graphics drivers on Windows and Mac OS.
  • Experimental support for OpenML based visual stimulus onset scheduling and timestamping for GNU/Linux. This is an opt-in, work in progress. Not yet ready for mainstream use, but will allow to take advantage of Linux special facilities, once they are completed and stable.
  • Support for NV_swap_group and SGIXX_swap_group extensions on Linux and Windows. Some professional grade graphics cards, e.g., some AMD FireGL/FirePro cards and some cards do support these extensions in hardware. These allow to perfectly synchronize bufferswaps and visual stimulus timing across multiple windows, displays, graphics cards or even different nodes on visualization clusters. Screen will automatically use these extensions if they are present and a dual-display stereo mode or other dual display / multi window mode is used.
  • Support for creation and writing of Quicktime movie files on Mac OS and Windows. Allows to create and write movie files. Currently only supports one video track per movie and doesn’t support soundtrack. Works with any codec supported by Quicktime. ImagingStereoDemo contains test- and example code to demonstrate usage. Can create a movie which records the animated stereo display.
  • Various bugfixes and help text updates.
  • The imaging pipeline PsychImaging in conjunction with PsychColorCorrection now also allows to apply automatic display vignetting correction aka shading correction to automatically compensate for spatially varying differences in luminance or per color gains of display devices, e.g., due to lense vignetting on projectors. VignetCalibration implements an interactive calibration procedure, VignettingCorrectionDemo and AdditiveBlendingForLinearSuperpositionTutorial demonstrate how a calibration is applied for realtime vignetting correction.
  • ScreenDrawDots is a reimplementation for the Screen('DrawDots') function to allow smooth dot drawing on broken Mac OS 10.6.3 systems.
  • PsychDrawSprites2D allow for drawing of large numbers of similar textures, so called Sprites. It behaves exactly like Screen('DrawDots'), except that it doesn’t draw dots, but little copies of a given texture, with selectable size, position, rotation and color. This is demonstrated in DotDemo by passing an optional flag.
  • A new Sadowski-Illusion demo.
  • Full support for the VPixx technologies DataPixx device on all platforms, except Apple PowerPC and Windows with Matlab versions before V7.4 (R2007a). All special graphics display functions (stereo, multi-display, mirroring, high precision color and luminance display) are supported via PsychImaging, e.g., demonstrated in BitsPlusCSFDemo, AdditiveBlendingForLinearSuperpositionTutorial and ImagingStereoDemo. Timestamping functionality and other convenience functions, as well as audio capture and voice keys are available via PsychDataPixx and DatapixxAudioKey, PsychPortAudioDatapixxTimingTest. See help DatapixxToolbox. All low-level features are supported via theDatapixx mex file driver.
  • OpenGL for Matlab and Octave: Add support for GLU tesselator functions.
  • New DotRotDemo for rotating dot fields by Keith Schneider.

Misc stuff

  • Many new and improved display calibration, gamma correction and color handling routines by David Brainard’s lab.
  • Some improvements to general toolbox routines by Diederick Niehorster.
  • Support for later models of the RTBox response button box in the PsychRTBox driver.
  • Bugfixes and workarounds for the latest collection of bugs in Mac OS/X Snow Leopard 10.6.3 and MS-Windows.
  • Compatibility fixes to mex files to provide good support for Ubuntu Linux 10.04 LTS “Lucid Lynx”.


PTB beta “Arrested Development” released 11.01.2010, Mario takes a break from development


Mario takes a break

The first PTB beta update for 2010, codename “Arrested Development” has been released 1 week ago. “Arrested Development” is not only the name of a medical condition, a hip-hop band and a tv series, but also the only item on my todo-list for Psychtoolbox throughout the next few months. I have to get the writeup of my thesis finished and time spent on PTB development & support is a major obstacle to this goal, although a pleasurable one.

I will continue to monitor the forum for serious problem reports but only respond to really urgent and important requests, if you make it really simple for me to help you by preparing your specific questions carefully according to the guidelines we have at the start page of the forum and on our Wiki. In short: “Careless emails do not invite careful responses.” – Other users are of course welcome to help their troubled colleagues.

A good way to help yourself is to look at the various demo scripts in the PsychDemos folder if you need help on how to implement certain things or get examples for coding, to use google to search the forum for previous answers for similar questions, to search the Wiki for information, to actually read and follow the instructions for beginners that our installers print after each single installation and update. It also helps to actually read error messages and warnings and follow the pointers to troubleshooting instructions that they quite often contain, instead of simply copy & pasting them to the forum – Although copying the output is still better than simply writing “It doesn’t work” in the most fuzzy way possible.

I’m not interested in discussing feature requests for the next months, we have a page on our Wiki where you can write those down, together with a contact address, and i’ll likely come back to you, once i have time to pick up development again. You are still welcome to submit improved code or new functionality to me or the other developers for inclusion into the toolbox, as long as you’re doing most of the work and not me.

I’m also not interested in bug reports for trivial bugs or pure annoyances. If it is trivial enough for you to fix it yourself, fix it and send me the updated files. If it is non-trivial for you to fix, write a bug report and add it to our bug reporting system, or to the proper section of our Wiki.

Reports for really serious bugs will still catch my attention if they are well written and i will do beta updates to fix such bugs should this become neccessary.

Thanks for your sympathy.

New features in “Arrested Development”:

These are the new features and improvements of the latest beta. I’ll post more details when i have time.

  • Good support for international character set handling, Unicode and Multibyte/UTF-8 text encoding and other non-ASCII scripts on all operating system platforms. Read help DrawTextEncodingLocaleSettings for further details, as well as the updated help of Screen TextBounds? and Screen DrawText?

  • High-Quality text rendering support with anti-aliasing and Unicode drawing on GNU/Linux via use of dynamically loaded FTGL text rendering plugin. Should work out of the box. For interesting options and troubleshooting if it doesn’t, read help DrawTextPlugin.

  • Support for control of power-management and dithering of modern ATI GPU’s via PsychGPUControl() + proper helper binary executables for Windows and Linux. This will require further explanations, stay tuned…

  • Workarounds in IOPort for broken USB serial drivers as reported by Xiangrui Li, see message 10537.

  • Improvements to PsychRTBox driver to expose new functionality in the latest generation of the RTBox response time box.

  • DaqDIn may be able to read from USB 1024-LS now, as requested by Thomas G. Fikes, see message 10484.

  • Improvements in visual stimulus onset scheduling, realtime scheduling and high-precision visual stimulus onset timestamping on all platforms as result of the extensive benchmarking and tuning efforts on all supported platforms. This will need further explanation in the future. If you want to take advantage of it and get best possible stimulus onset timing, make proper use of the ‘when’ parameter of Screen('Flip') and the returned timestamps, as explained in the Intro-PDF and demonstrated in a few of our demos.

  • Kbcheck, KbWait, KbQueueXXX et al. functions on MacOS/X can now also handle keypads, not only keyboards. Read their help texts for explanation. This code contributed by Roger Woods. Thanks!

  • Initial support for the VPixx Technologies "DataPixx data acquisition and graphics system for the vision sciences”. This is the first iteration, so far only on OS/X on Intel Macs under GNU/Octave is supported. This is work in progress. The basic infrastructure for good integration into PTB is implemented, tested and shown to work very well. As most of the remaining development work will be done by VPixx, e.g., support for all other operating system platforms and Matlab, i’ll probably do some beta release with an update, once all other platforms are ready. See help PsychImaging and search for Datapixx for supported high precision display video modes of the device. Most of our demos for high precision stimulus display have been updated to support the device as well. help PsychDataPixx for more interesting features. Again, this is work in progress, a somewhat functional sneak preview, not the final product.

  • Some improvements by David Brainard et al. to the PsychCal subroutines for monitor calibration and similar tasks.

  • Lots of bugfixes, small improvements.

Have fun and good luck, -mario

Stable is dead! Long live beta!


For the record: The Psychtoolbox flavor formerly known as "stable" is hereby declared officially dead! We have renamed it to unsupported to allow users with an interest in archeology or masochism to download it under that new name. Hopefully the new name leaves no room for interpretation about the level of support or sympathy you could expect from us if you’d continue to use this flavor instead of letting it r.i.p.

We have removed all references to it from the Wiki and current downloader and have no intentions of ever touching it again for any purpose. Actually we didn’t touch it for almost 2 years, so this is nothing new. The beta flavor was always more current, reliable and bug free than stable ever was.

Psychtoolbox beta updates up to and including the update from 2009-02-18 (SVN Revision 1245)


These updates introduce support for the USTC RTBox button response box, the PR-655 colorimeter, and various bug fixes and enhancements. Especially the IOPort and PsychPortAudio drivers have been improved again.

Online documenation updated

Our tireless “master of online documentation” Tobias Wolf has updated the online documentation of all PTB functions on the Wiki, so it corresponds to the state of PTB - Beta as of 21st february 2009.

New PsychRTBox driver for RTBox USB Response button box by Xiangrui Li et al.

This new driver (see PsychRTBoxDemo for demonstration of most basic functions) allows to interface with the “USTC RTBox Reaction Time Box”, a response button box for button response collection from subjects with exact button press- or release timestamping. In addition to four response buttons, the box also provides a photo-diode input (including a photo-diode) and a single BNC trigger input for reception and timestamping of external trigger signals and visual stimulus onset. The driver allows to control all features of the box and to retrieve exact timestamps in the regular Psychtoolbox GetSecs time format, so the timestamps are directly comparable to timestamps returned by Screen('Flip'), PsychPortAudio, KbCheck, KbWait, GetSecs, WaitSecs, IOPort etc., which greatly simplifies calculation of reaction times and other time related events. Most aspects of the driver and especially its timing precision have been extensively tested under a variety of Macintosh computers and PC’s under Microsoft Windows XP, Linux and MacOS/X 10.4.x and 10.5.x., so far with good results.

PsychPortAudio sound driver

  • Important bugfix for playback of short sounds (less than about 50 milliseconds) on MS-Windows and GNU/Linux. Due to a flaw in the underlying PortAudio library, trying to call PsychPortAudio('Stop') after playback of such short sounds could cause Matlab to hang until it got forcefully terminated. This is fixed. However, this bug was only present in betas released in January 2009. Older versions of the driver didn’t expose this flaw.

  • PsychPortAudio methods 'Start', 'Stop', and 'RescheduleStart' now also allow you to define a sound offset time (called ‘stop’ time) in addition to the previous ‘when’ sound onset time: This allows to schedule a sound playback which lasts until an exactly specified point in time, nearly sample accurate, ie., with sub-millisecond precision. The ‘Stop’ subfunction allows you to (re-)specify a stop time while playback is already active, for on-the-fly rescheduling of your sound timing. This is done by setting the new optional 'stopTime' parameter.

  • These routines also allow you to specifiy and respecify (while playback is already active) the repetition count ‘repetitions’ for a defined number of sound repetitions, and the repetition count can be fractional now, e.g., 1.5 for one and a half repetitions of a sound.

  • The PsychPortAudio('Stop') function can now request stop of sound playback (as mentioned above via 'stopTime' or ‘repetitions’ or immediately) without waiting for the stop to actually happen. This can avoid blocking execution of your Matlab code in the ‘Stop’ routine for a few milliseconds, should your experiments require such a non-blocking behaviour. This is achieved by setting the new optional 'blockUntilStopped' parameter to a zero value. Otherwise, the ‘Stop’ method will block until sound is really stopped as in previous driver versions.

  • PsychPortAudio('RefillBuffer', pahandle [, bufferhandle=0], bufferdata [, startIndex=0]); allows to refill portions of the sound playback buffer while playback is active, for dynamic updating of sound content in situations where the streaming refill via the PsychPortAudio('FillBuffer') command is not applicable. This is interesting when used in conjunction with the new PsychPortAudio('SetLoop') command to restrict sound playback to a subsection of the playback buffer.

  • The new subfunctions PsychPortAudio('UseSchedule') and PsychPortAudio('AddToSchedule') allow to predefine a whole sequence of precisely timed of sounds to be played according to a given playback schedule. This is similar to the playlists you can set in your favorite media player. The schedule can be extended on the fly during sound playback to allow very flexible sound playback which can concatenate different sounds with well defined gaps inbetween or completely gap-free. Unfortunately we don’t have any interesting demos for this new function yet.

  • For people with very low latency requirements, the driver can be switched into a new mode of operation, called “runmode 1” via the PsychPortAudio('RunMode') function. By default, runmode 0 is used. In runmode 1, the audio hardware, once started, keeps running all the time. This consumes more system memory and processing ressources on your computer during the runtime of your script, as processing is active even if no sound is played at all, but it allows for a faster stop and restart of playback operations, ie., it can avoid multiple milliseconds of delay, especially on Linux, but also to some lesser extent on the other operating systems. You can compare this to a strategy where you keep the engine of your car running during stops at red traffic lights or in traffic jams, as opposed to our default strategy of stopping the engine at each halt and restarting after the break.

Colorimeter Support

  • We now support the Photo Research PR-655 colorimeter via the new PR655Toolbox in the folder Psychtoolbox/Psychhardware/PR655Toolbox. This code has been contributed by Thad Czuba. You can either use the routines in that subfolder directly, or use the higher level functions like CMCheckInit, CMClose, MeasXYZ and MeasSpd by selecting the ‘metertype’ argument to be 4.

  • Both, the new PR-655 toolbox and the old PR-650 toolbox now use the new IOPort driver instead of the old operating system dependent SerialComm driver. Due to this change, both toolboxes should now work on all operating systems, not only on OS/X.

IOPort Serial port hardware support

The new IOPort driver has been refined in a few areas. The driver is still much work in progress, with a few useful features missing. However, it should be already a far superior replacement for all old serial port drivers like PsychSerial, SerialComm and Matlabs serial objects for most purposes.

  • FindSerialPort function: Now can also automatically find serial port devices for the IOPort serialport driver on all operating systems.

  • New optional parameter 'HardwareBufferSizes=in,out' for IOPort('OpenSerialPort',..); and IOPort('ConfigureSerialPort', ...); configstring parameter. This is not set by default, and only supported on MS-Windows, ignored on other platforms. It triggers the Windows SetupComm() function to set the hardware input and output buffer sizes to the requested in,out values. Hardware drivers are free to ignore the request, and it will only work if invoked after opening the device but before doing any I/O. Rationale: The operating system is supposed to choose reasonable settings for these buffersizes if not provided (according to Microsoft documentation), but the old Windows PsychSerial driver set these sizes explicitely, so we give usercode the option to do so as well, in case some buggy windows drivers misbehave if this isn’t set.

  • IOPort('OpenSerialPort'): Bugfix in configuration option parser code for all operating systems. Providing settings/options in the optional 'ConfigString' parameter which conflicted with the builtin defaults may cause wrong setup, ie. either the defaults take precedence or the users settings, but in a unpredictable way. This is fixed now. Didn’t show up in any real applications so far, because 100% of all tested devices (and probably 95% of all devices out there) are happy with our builtin defaults.

  • Help texts have been improved as well.

Improvements and bug fixes to Screen and other drawing functions – The Visuals

  • New Screen('Preference','ConserveVRAM', ...) setting 16384 on OS/X allows to force use of AGL and Carbon in non-fullscreen windowed mode, even if a fullscreen window is requested. This as another attempt to work around the broken NVidia drivers for dual-display operations on Leopard 10.5.6 with Geforce 8000 hardware, as that bug persists on OS/X 10.5.6, and Apple engineering remains silent about this major defect. This workaround provides dual-display fullscreen display on such machines, but at a horrible performance, zero timing accuracy and defunct timestamping. It may be good enough for mostly static stimulus displays though.

  • Screen('Computer') on Mac OS should not crash anymore if machine has an empty machine name or empty username.

  • Screen('GlobalRect', win) now correctly returns the global bounding box (wrt. to origin of desktop coordinate system) of a given onscreen window handle ‘win’ even if the window is a real window, not a fullscreen window.

  • Screen('FrameRect'): When providing an empty (=default) rectangle, it didn’t draw anything due to some bug in the batchdrawing processing routine. This is now fixed.

  • Screen('Resolution') now only checks for open onscreen windows when deciding to be cooperative or not, not for any window. Previously a resolution switch was also prevented when textures or offscreen windows where open, which is not neccessary.

  • Bugfix for Screen on Mac OS: When onscreen window wasn’t a fullscreen window, but a windowed AGL+Carbon window, and the imaging pipeline was off, userspace rendering via MOGL didn’t work due to a bug in the way we set up our userspace OpenGL context in the AGL setup path. This is now fixed.

  • Screen('FillOval'): Added missing documentation of 'perfectUpToMacDiameter' parameter.

  • Screen subfunctions FillOval, FrameOval and FillArc, FrameArc, et al. will now work with subpixel accurate precision instead of rounding given locations to full pixels at various occassions. The precision of positioning and sizing such drawing primitives is now only limited the the graphics hardware at use, no longer by Screen itself.

  • Screen('DrawText') on Linux: Didn’t assign proper textcolors or render text correctly if a floating point precision HDR framebuffer was enabled, and a HDR draw shader was active to work-around GPU’s without glClampColorARB() support, e.g., on Linux with current ATI driver for Radeon X1600. This is now fixed. Also made more robust against very long fontnames of more than 256 characters.

  • Bugfixes to some PsychRects functions: They didn’t handle the case of passing 2, 3 or 4 rects properly. Only the single rect and > 4 rects cases were handled correctly. This is now fixed, although the current beta still contains a glitch for the exactly 4 rects case. Bugfixes by Thad Czuba and MK.

  • BitsPlusPlus error handling improved: Restores display gamma tables on error abort.

  • DrawFormattedText: New optional ‘vspace’ parameter allows to set line spacing between consecutive lines of text. Contributed by Alex Leykin. The function also now optionally allows to draw text that is mirrored/flipped left-right and/or upside down.

  • New function AddNormalsToOBJ: Takes an obj 3D object definition, as provided by, e.g., LoadOBJFile(), and adds per-vertex surface normal vectors to it. Useful if an OBJ file doesn’t have surface normals defined. Uses cross-product computation on defining triangles to calculate normals.

  • Minor other fixes and updates to help texts.

There are still a few unresolvable serious bugs in OS/X 10.5.6, especially prominent with NVidia 8000 series hardware for which no workaround exists. E.g., multi-display operation (stereo setups) seems to be highly unreliable and dysfunctional. Frame sequential stereo on NVidia 8000 series hardware seems to be seriously broken in 10.5.5 (and maybe 10.5.6, untested). Only Apple engineering will be able to fix this.

New or enhanced demos

  • FDFDemo and moglFDF received some further improvements: The maxFGDots and maxBGDots parameters are auto-adapted to meet requirements, instead of aborting with error. The new subfunction ReinitContext allows to change context stimulus parameters without need to destroy and recreate the fdf context, this is about 4 times faster when switching between conditions with high or low dot densities, short or long dot lifetimes and other parameters. The new optional instantOn flag to the Update function allows to buildup the whole dot distribution in one single ‘Update’ call at start of a trial. Minor other fixes and improvements. Now one can regulate the signal to noise ratio within the silhouette of the animated object between 0.0 and 1.0, allowing to introduce some background noise in the silhouette area. The FDFDemo now allows to control a couple of stimulus parameters during runtime by use of the cursor keys.

  • VideoCaptureDemo Now allows video image to cover full window, by proper, aspect preserving, rescaling.

  • MinimalisticOpenGLDemo now has an optional ‘checkerboard’ mode: Setting that optional flag will texture the spinning sphere with a Matlab generated checkerboard pattern instead of an earth surface image, just to show how this is done, as well as how to apply trilinear mipmap filtering to avoid any aliasing artifacts with such high-frequency patterns.

  • SimpleMovieDemo is the new most simple demo on how to playback Quicktime movies. Not fancy, but down to the absolute basics.

  • PsychRTBoxDemo demonstrates basic use of the new PsychRTBox driver for control of the USTC RTBox button response box.

Test scripts in PsychTests

  • Minor improvements to dualhead display sync tests in GraphicsDisplaySyncAcrossDualHeadsTest and PerceptualVBLSyncTest.

  • KeyboardLatencyTest now allows some assessment of the timing accuracy of response boxes, the response box from Cedrus, and the reaction time box from Xiangrui Li et al.

Misc other stuff

  • Merged large parts of the “Bitstuff Toolbox”: This is a collection of generally useful new M-File routines in the categories PsychSignal, PsychOneliners and PsychProbability. The toolbox was written and contributed under GPL license by Diederick C. Niehorster.

  • RestrictKeysForKbCheck is a new function that allows to restrict the keys to check in KbCheck, KbWait, et al. to a subset of keys on the keyboard. This is convenient on all systems to restrict subject responses to valid response keys. On Mac OS it can also provide a significant speedup in the operation of KbCheck, reducing its execution time from 1 millisecond to a few dozen microseconds.

  • KbName now queries all connected keyboards if called via KbName from the commandline, not only the primary keyboard.

  • Improvements to geometric display calibration routines: Optionally one can load an image file as a “backdrop image” to the calibration grids in DisplayUndistortionBezier/BVL, and one can set window size to the size of those images. This allows to (mis-)use those display calibration routines for creation of generic transformations, e.g., for generic image undistortion of images or videos. The still unfinished ImageUndistortionDemo allows to apply such calibrations to loaded images from disk for the purpose of image unwarping.

  • New routines for color conversions in Munsell color space in subfolder PsychColorimetric/PsychMunsell, contributed by David Brainard.

  • Add function GetEchostring: Ported from PTB-2, contributed by yaosiang.

  • Also add functions GetNumber and GetEchoNumber from PTB-2.

  • Ask function:Strips ENTER keycode and BACKSPACE keycodes from returned replies.

  • WaitSecs('YieldSecs', seconds) is a new subfunction of WaitSecs which allows to sleep for a specified time interval seconds, but imprecisely. That is, the sleep is allowed to take a few milliseconds longer than specified. This allows to use a different waiting strategy which is not precise, but reduces the load on the computers processor. It is meant for code that wants to be nice by not taxing the cpu too much, e.g., in a polling loop where not every millisecond counts.

  • Snd: Always returns some ‘err’ status, even if it is only a zero, as this return argument is mostly meaningless in current implementation. This for backwards compatibility to old Mac OS-9 code.

  • Enhancements to GetClicks and GetMouse, as suggested by Diederick Niehorster.

  • Modified PsychtoolboxRegistration routine for online registration to use the pnet() file on Matlab runtimes to implement communication for online registration. No need to use netcat anymore, except for Octave runtimes. As netcat aka nc.exe aka is no longer needed on the MS-Windows platform it has been remove from the distribution. No problems for poor Windoze users due to idiotic virus scanners anymore.

  • The new PsychHomeDir function retrieves path to users home directory on each system, and optionally to subdirectories as well.

New download location for Portaudio driver with ASIO support

The special patched portaudio_x86.dll audio low-level driver with compiled-in support for Steinberg’s ASIO sound interface for use on Microsoft Windows systems with our PsychPortAudio driver has a new home on our Wiki. You no longer need to request the driver from Mario Kleiner via e-mail. Instead, simply download the zip file with the driver from the PsychPortAudio section of the Wiki. The zip file contains the DLL, a readme file with installation, setup and usage instructions, and the special license for use of this driver, which deviates from our normal GPL license.

Psychtoolbox beta update from 2008-11-4 (SVN Revision 1151)


This update introduces support for “formless dot field” type stimuli, and various bug fixes and enhancements. Especially the IOPort driver has been improved again.

IOPort Serial port hardware support

The new IOPort driver has been refined in a few areas. The driver is still much work in progress, with a few useful features missing. However, it should be already a superior replacement for all old serial port drivers like PsychSerial, SerialComm and Matlabs serial objects for most purposes.

  • IOPort('Write') now supports a blocking flag of 2 on all operating systems. The old Linux specific polling for “transmitter empty” has been moved to blocking = 3. A mode of 2 now polls for the number of pending bytes for writeout in the system write buffer and repeats the polling loop until pending bytes = 0. This is supported on all operating systems.

  • IOPort('Write') now returns a couple of additional optional timestamps, useful for special timing calibration routines like the upcoming PsychRTBox.m driver, and for low-level debugging: A prewrite timestamp, a postwrite timestamp and a timestamp of last poll loop iteration (if used)…

  • IOPort('Read') accepts (for blocking reads) a new optional setting PollLatency in IOPort('ConfigureSerialPort',...); The setting allows to select the idle time between unsuccessful poll iterations, to trade off the system load against time quantization in such time critical polling loops.

  • IOPort('ConfigureSerialPort') allows via new options to enable asynchronous background reading of data from the serial port via a parallel background thread on MacOSX and GNU/Linux, this feature is not yet supported on Windows. If async read is enabled, IOPort('Read') will not directly fetch data from the serial port, but it will fetch data that has been read already in the background by the reader thread. This allows to automatically collect streaming data from serial port in the background, for later retrieval via ‘Read’ calls. This feature is experimental for now, its programming interface may change!

  • Help texts have been improved as well.

Improvements and bug fixes to Screen and other drawing functions – The Visuals

  • GetMouse on OS/X fixed: If used on multi-core Macintosh computers with many cores, e.g., MacPro 8 core machines and recent multi-threaded Matlab versions, the function crashed Matlab reliably on each single invocation, unless Matlabs GUI was disabled, ie. Matlab was run in -nojvm mode! This was a classic race-condition, probably present since the very first Psychtoolbox release around 1995! This bug only gets triggered with increasing probability on machines with large numbers of processor cores and on operating systems with efficient multi-threading support, so it basically never happened on single processor machines or under Mac OS 10.3 and earlier, and only very seldom on dual-core machines with recent Mac OS versions.

  • Regression in anaglyph stereo mode fixed: Anaglyph stereo as demonstrated in StereoDemo with settings 6,7,8 and 9 didn’t work. This is fixed.

  • Robustness improvements to Screen('DrawText') on OS/X: If a corrupt text string is supplied, the function doesn’t crash anymore, but abort with a (hopefully) diagnostic error message.

  • Bugfix to Screen('DrawText') on Windows: If text is drawn into different windows (onscreen or offscreen) with different text sizes or other different font settings, text should be drawn properly, instead of sometimes applying wrong settings. This was a bug in the way textsettings are cached internally to improve speed.

  • Screen('FillPoly') received a few performance optimizations. However most of them only had a minor impact on performance. Drawing of complex, concave, potentially self-intersecting filled polygons still needs substantial processing on the CPU and is therefore much slower than drawing of simple concave polygons or simple convex polygons (which are the fastest).

  • Potential robustness improvement for Screen('FrameRect') against broken graphics drivers when setting ‘penSize’. This is a potential improvement, which may or may not help on broken drivers.

  • DrawFormattedText: No longer aborts with error on empty text string as input, but simply does nothing in that case.

  • moglmorpher: The fast 3D morpher contained special workaround code for some serious bugs in the ATI display drivers on OS/X Tiger 10.4.x. As i’ve learned, the drivers got fixed at least in Leopard 10.5.5, so when used on 10.5, the workaround caused malfunctions on the fixed drivers! Now we detect the OS/X version, and only enable the workaround on versions lower than 10.5.5. This works now on all 10.4 systems and 10.5.5. I don’t know how it behaves on 10.5.0 to 10.5.4, due to lack of a testing system.

  • Small fix to VideoDelayLoopMiniDemo for use with built-in iSight cameras of some Macintosh computers. A bug in the OS/X operating system caused wrong image display on such cams.

  • Fix a bug in PsychVideoSwitcher driver which caused the TTL trigger mechanism to fail. Also extended trigger function: One can select if trigger should happen at each ‘Flip’ until disabled, or for a predetermined number of ’Flip’s then auto-disable.

  • PsychImaging: Add support code for setup of native 10 bpc framebuffers on supported ATI FireGL/Pro and NVidia GTX cards.

  • Fix in ConvolutionKernelTest for error handling when invalid convolution kernels are passed.

  • Minor other fixes and updates to help texts.

There are still a few unresolvable serious bugs in OS/X 10.5.3, 10.5.4 and 10.5.5, especially prominent with NVidia 8000 series hardware for which no workaround exists. E.g., multi-display operation (stereo setups) seems to be highly unreliable and dysfunctional. Frame sequential stereo on NVidia 8000 series hardware seems to be seriously broken in 10.5.5. Only Apple engineering will be able to fix this.

New or enhanced demos

  • FDFDemo is a new demo: It demonstrates basic usage of the new moglFDF function, rendering an animated rotating “random dot” motion sphere. The moglFDF function allows to efficiently draw a special class of random dot “structure from motion” stimuli, so called “(F)ormless (D)ot (F)ields”. The algorithm is heavily inspired by the algorithm introduced by Jedediah M. Singer and David L. Sheinberg in their Journal of Vision paper “A method for the real-time rendering of formless dot field structure-from-motion stimuli” (Journal of Vision, 8, 1-8). It should behave mostly as the method described in that paper, but operate at a significantly higher speed if stimuli are demanding (e.g., high display resolution, large number of dots, complex underlying 3D geometry), as the moglFDF routine pushes nearly all compute intense operations onto the GPU, only random number generation and flow control are done on the CPU. However, as the paper doesn’t state actual benchmark numbers and i never had a look at their implementation, this is an unverified assumption so far. This code has been tested for multiple months in-house for complex 3D facial motion stimuli and worked well, but given its complexity there may remain more or less subtle bugs or limitations of the method for other classes of stimuli. Let me know if you find this routine useful and if you encounter limitations. One limitation is the need for half-way recent graphics hardware: Minimum requirements are a NVidia GeForce 6000 series card or later, or a ATI Radeon X1000 series card or later, more specifically hardware with support for or later and floating point framebuffers.

  • ImagingStereoMoviePlayer Minor improvements.

  • MovingLineDemo: Changed behaviour to be more useful for exposing the troubles with flat panels.

  • AdditiveBlendingForLinearSuperpositionTutorial now also demonstrates how to use the TTL trigger mechanism of the VideoSwitcher device.

  • BitsPlusCSFDemo contrary to its name now also supports optional output to VideoSwitcher device , ATI 10 bpc framebuffer and PseudoGray output (aka bit stealing). It also allows to display an intensity gradient test chart instead of a CSF chart.

Test scripts in PsychTests

  • Minor improvements to dualhead display sync tests in GraphicsDisplaySyncAcrossDualHeadsTest and PerceptualVBLSyncTest.

  • KeyboardLatencyTest now allows some assessment of the timing accuracy of response boxes, the response box from Cedrus, and the reaction time box from Xiangrui Li et al.

Misc other stuff

  • SearchGammaTable and various display calibration routines improved by David Brainard, also improvements to CalDemo

  • Fix annoying warning about unrecognized escape sequence for KbName on Linux.

  • Modifications to SerialComm to translate a hardware path, e.g. /dev/cu.usbserial, to a port name and improvements to FindSerialPort by Christopher Broussard.

Psychtoolbox beta update from 2008-08-15 (SVN Revision 1110)


This update introduces support for synchronizing the displays of ATI based dual-display setups on OS/X, experimental support for 10 bit native framebuffers on some graphics hardware, smallish fixes for demos and subroutines, and a few new demos and tests in PsychDemos and PsychTests, as well as improvements to existing demos. The new IOPort has been improved as well.

IOPort Serial port hardware support

The new IOPort driver has been refined in a few areas. The driver is still much work in progress, with a few useful features missing. However, it should be already a superior replacement for all old serial port drivers like PsychSerial, SerialComm and Matlabs serial objects for most purposes.

  • The optional nonBlocking flag of the IOPort('Write') and IOPort('Read') subfunctions is replaced by a blocking flag instead! If you didn’t specify that flag in code using that driver, you won’t need to change anything in your code, because the default behaviour is the same - and the default is pretty reasonable. If you specified that flag in your code, you’ll have to change that flag to be the opposite of what it was! If you used a setting of 0, change it to 1 and vice versa. The old flag nonBlocking used a double-negation - A setting of zero meant no non blocking operation, ie., blocking operation! Beta testing proved that this twisted definition is too hard on the brain, including the brain of the person that developed the driver ;-) – The meaning of the new blocking flag is easy to understand, so the potential of wrong use of that flag should be greatly reduced.

  • On GNU/Linux, the blocking flag in the IOPort('Write') subfunction can also be set to a setting of 2, on other operating systems a setting of 2 is treated like a setting of 1 for now. A settting of 2 requests use of an especially low-latency mode of waiting for write completion. This is useful for code that needs especially high timing precision in sending data out of the serial port, but it incurs much higher processor load, so it should be used judiciously. With some serial port hardware, it can cause a complete hang of the application due to low level driver bugs (e.g., the current FTDI serial-over-usb driver).

  • At IOPort('Verbosity',0) verbosity level zero, the driver won’t abort an [handle, errmsg] = IOPort('OpenSerialPort',...); call anymore if opening the serial port fails. Instead it returns handle to be a negative number and returns an operating system dependent error message in the optional return argument errmsg. The text string errmsg contains some specific (searchable) text tokens to signal some frequent error conditions. Specifically, the text string ENOENT is contained in errmsg if one tries to open a non-existent serial port device. Accessing a device which is already opened by some other process, or with insufficient access permissions, or opening a serial port that exists but doesn’t have an operational device connected, will return EBUSY and/or EPERM as part of the errmsg string. This behaviour and tokens allows custom written Matlab code to auto-detect and probe available and operational serial ports by trying to open known ports and checking the return codes. Useful for automatic device detection.

  • Help texts have been improved as well.

Hardware support

  • The CedrusResponseBox driver has been improved to take advantage of the improved IOPort driver for higher robustness in error handling. The overall robustness of Cedrus response box support hasn’t increased though, but we are quite certain that this is mostly due to design flaws in the response boxes. Still no response from Cedrus developer support, 4 month after an inquiry… See also Docs:CedrusResponseBox

Improvements to Screen – The Visuals

Most improvements are related to the image processing pipeline. While the detailed documentation is contained in the files referenced below, most functions are accessed and controlled by the PsychImaging function and the basic help for how to use them can be found there. Demos mentioned below demonstrate this stuff in “real world” scripts.

  • Support for native 10 bits per color component (10 bpc) framebuffers on some graphics hardware + operating system combinations:
  • On GNU/Linux and OS/X with ATI Radeon GPU’s of the consumer level Radeon X1000 series and the Radeon HD2000 / 3000 / 4000 series and later, we provide experimental support for 10 bit framebuffers with our own homegrown solution. On Linux you need to start Octave or Matlab as system administrator or via the sudo command so it has the neccessary permissions to do so. On OS/X you need to load our special PsychtoolboxKernelDriver, see help PsychtoolboxKernelDriver for how to do that. Support is experimental in the sense that we can’t guarantee that this feature will work reliable (or at all) on a given system configuration, because we use tricks that are not officially supported or recommended by ATI or Apple, so this feature may or may not work due to factors out of our control. If it works, it may break with future operating system upgrades, so if you need it, better make a backup of your operating system in case you’d need to downgrade!
  • That said, it works pretty well on the tested machines with Tiger 10.4.11, and it actually worked like that since multiple Psychtoolbox beta releases. The news is that we finally verified it really gives 10 bits resolution on consumer Radeon cards via some perceptual visual test - A nice greyscale gradient test image which shows clearly perceptible intensity steps at the expected locations in 8 bit framebuffer mode, but a smooth gradient in experimental 10 bit framebuffer mode.

  • On Microsoft Windows and GNU/Linux, the first graphics cards with native, officially vendor supported 10 bit framebuffers start to hit the market. If you happen to have such a card, Psychtoolbox will support it as well, without the need for special experimental tricks. These cards should support 10 bit reliably - assuming the vendors implementation is correct. As of now, vendors have announced some level of 10 bit support for the following cards:

  • ATI/AMD FirePro / FireGL GPU of the latest 2008 generation is advertised as supporting 10 bit on special 10 bit digital displays (e.g., high precision flat panels with DisplayPort), it may soon support 10 bit over the analog output as well (ie., VGA driven CRT monitors etc.).

  • The latest generation NVidia Quadro GPU’s on Linux (and probably Windows?) will support 10 bit output, according to this excerpt from the release notes of the latest NVidia display drivers for Linux.

  • The latest generation of NVidia Geforce GPU’s is rumored to support 10 bit natively under some circumstances as well: See this link and this link.

  • Support for 10 bpc framebuffers can be enabled via the PsychImaging('AddTask', 'General', 'EnableNative10BitFramebuffer'); subcommand, as demonstrated in the AdditiveBlendingForLinearSuperpositionTutorial demo.

  • The PsychtoolboxKernelDriver for OS/X has been refined. We’ve verified that it is able to synchronize (or resynchronize, after some change of display settings or display configuration) the video refresh cycles of two identical displays connected to the two output connectors of a dual-head graphics card. This works only on ATI Radeon graphics cards of the X1000 series (and likely later models of the HD series) and only for one single dual-head card. It has only been tested on the Radeon Mobility X1600 so far. You need to choose identical monitors and identical display settings for resolution, color depths and refresh rate if you want the monitors to stay in sync after a synchronization, otherwise they’ll quickly drift out of sync due to different timing. You need to load the kernel driver as described in help PsychtoolboxKernelDriver. Then you can issue the residual = Screen('Preference', 'SynchronizeDisplays', 1); command to trigger a resync. The optional return argument residual will contain a remaining offset in scanlines between the two displays. The driver will try up to four times to resync. We always managed to get perfect sync this way. The scripts PerceptualVBLSyncTest([0,1]) and GraphicsDisplaySyncAcrossDualHeadsTest allow you to test the sync. The first script allows for a perceptual test, the latter script for some numeric assessment.

  • The PsychtoolboxKernelDriver for OS/X also provides support for beamposition timestamping on ATI graphics cards – a feature lacking on current OS/X. This support is nothing new, just worth mentioning again.

  • We no longer unconditionally disable beamposition queries on MS-Windows with Intel GPU’s. Some modern Intel GPU’s will probably work correctly and our tests have improved so much that we should be able to detect problematic chips automatically. So some Intel GPU’s will provide more accurate stimulus timestamping.

  • Capabilities of the ATI FireGL / FirePro GPU should be now detected correctly on Windows and Linux.

  • A new image processing function AddImageUndistortionToGLOperator() plus demo ImageUndistortionDemo.m how to use it: It allows application of geometric “unwarp” transformation as created by DisplayUndistortionBVL/Bezier to textures and offscreen windows by use of Screen('TransformTexture') instead of as part of preflip operations. This allows for geometric undistortion of input images, instead of whole display devices. The demo is kind of sketchy, that’s why it is added to the PsychAlpha/ subfolder to label it as workable but immature. This method is useful if you don’t want to correct for geometric distortions of your display device (for that, see help DisplayUndistortionBVL), but if you have some optically distorted input video footage or images (e.g., from some camera) that you want to undistort, or if you want to actually apply a geometric distortion to your visual stimulus image.

  • Minor other fixes and updates to help texts.

New built-in workarounds in Screen for broken graphics drivers and operating systems

These workarounds get automatically enabled if the corresponding problem is detected on your system. Some will print out some warning messages to inform you about the problem and possible caveats related to the workaround. Remember: It’s always better to fix the system than to rely on some workaround which can only fix 90% of the problem and isn’t totally for free. Therefore stay informed about graphics driver and operating system updates if your system has problems.

  • MS-Windows with many ATI cards and recent NVidia cards/drivers: Beamposition queries fail and therefore get disabled. Certain types of failure can be auto-detected and a workaround is enabled. This workaround should reenable high-precison timestamping on such systems, at the expense of slightly increased processor load in certain cases. The warning message of Screen will tell you about more details and refer you to some help text that explains further caveats of this approach.
  • In this release we’ve increased the sensitivity of the test which is supposed to detect such broken beamposition mechanism on startup, so it is less likely to miss some broken configs. In case it still misses some bugs, you can add the new setting 4096 to a call Screen('Preference', 'ConserveVRAM', ...);, see help ConserveVRAMSettings for more info. This will unconditionally enable the special workarounds, even if our test doesn’t detect any problems.

There are still a few unresolvable serious bugs in OS/X 10.5.3 and 10.5.4, especially prominent with NVidia 8000 series hardware for which no workaround exists. E.g., multi-display operation (stereo setups) seems to be highly unreliable and dysfunctional. Certain Screen('CopyWindow') commands can caus a hard graphics system lockup for no conceivable reason. Many posts on public internet forums and the Apple mailing lists suggest many more similar serious problems. Only Apple engineering will be able to fix this. Currently we recommend to not upgrade to 10.5.3 or 10.5.4 on machines that are crucial for your productive work!

New or enhanced demos

  • AdditiveBlendingForLinearSuperpositionTutorial shows two things:
    • How to take advantage of high precision floating point textures, framebuffers and additive alpha-blending to efficiently draw mathematically correct superimposed stimuli, e.g., overlapping gratings with controllable contrast. This demonstrates a very efficient way of doing such things.
    • How to enable support for a variety of supported high precision display devices and methods. The demo shows correct setup of nearly all currently supported devices. Type help AdditiveBlendingForLinearSuperpositionTutorial for an overview. The previous demo, which was specific to the CRS Bits++ box, has been merged into this demo.
  • SimpleVoiceTriggerDemo demonstrates two different methods of implementing voice triggers via the PsychPortAudio driver. The BasicSoundInputDemo and a few other scripts demonstrate this as well, but this demo is cut down to show only the essentials of voice trigger support. Please note that this is just a simple threshold-based trigger, nothing fancy. One could implement more clever filtering to make it more robust, but the basic structure would be the same.

  • DrawMirroredTextDemo now also shows how to mirror (flip) text upside down instead of only left vs. right.

  • MovingLineDemo just shows a pair of vertical lines which move horizontally over the screen from left to right. The speed of travel can be set. Why? Because it nicely illustrates the kind of display artifacts and strong motion blur you can get for moving stimuli if you use a flat panel instead of a CRT monitor.

New test scripts in PsychTests

Two tests illustrate the accuracy, or rather inaccuracy, of keypress and mousebuttonpress timestamps. Try them yourself! There are good reasons why special response boxes are still sold and bought for precise reaction time measurements.

  • KeyboardLatencyTest: This test scripts implements a method to measure absolute keyboard or mouse latency, ie., how close the measured keypress time, e.g., via KbCheck or GetMouse is to the real keypress time on your standard keyboard, trackpad our mouse. The script relies on a properly configured PsychPortAudio driver and a sensitive microphone attached to or close to your keyboard or mouse. I’ve tested it with the built-in microphone of a MacBookPro. The measurement procedure consists of you repeatedly hitting keys on the keyboard or buttons on you mouse / trackpad. The noise made by hitting the buttons or keys gets captured by the microphone and timestamped by our audio driver + threshold based “voice trigger” implementation. Keypress / Mouse button press time is also measured via a tight KbCheck, KbTriggerWait or GetMouse loop. The script then compares the timestamps of both methods to compute average keypress latency and variability in timing, assuming/knowing that the audio measurements are usually more accurate and low latency on well working audio hardware. The method is of course not perfect, needs careful tuning of sound thresholds and a well working sound card, and you should obviously not trust the measurements down to the millisecond - or at least first verify correct working of the sound trigger method with measurement equipment before trusting it . Still it provides some quite nice illustration of how large and noisy latencies from standard keyboards and mice can be. Also with identical hardware, latencies can vary significantly depending on operating system and model of keyboard or mouse. Example: On a MacBookPro under OS/X average latencies of 16 msecs for external mouse queries and 30 msecs for internal keyboard queries have been observed. The same machine under Ubuntu Linux 7.1 showed also 30 msecs average latency for the keyboard, but 60 msecs latency for the mouse. Variability of mouse timestamps was lower than that of keyboard timestamps.

  • HIDIntervalTest: This scripts measures the sampling interval of human interface devices (HID), specifically mice and keyboards. During a measurement loop of 10 seconds duration, it asks you to randomly and furiously hit keys on the keyboard, press mouse buttons and move the mouse. Then it plots histograms with the distribution of timestamps collected from mouse button up/down, mouse movement and keypress/release events. The histograms illustrate the sampling – and therefore – quantization of HID devices. Here a few results: On the MacBookPro under OS/X 10.4.11, the internal keyboard as well as buttons on trackpad and mouse are sampled at roughly 8 msec intervals. The sampling frequency of mouse movements however is directly related to the display refresh interval: At 60 Hz refresh, 1000 / 60 = 16.6 msecs. At 75 Hz refresh, 1000 / 75 = 13.333 msecs etc. The same machine under Linux has a constant sampling interval of 8 msecs for mouse, trackpad and keyboard. Some other machine tested under WindowsXP showed a sampling interval of 16 msecs for mouse and keyboard.

Misc other stuff

  • Diederick C. Niehorster contributed a new function ShrinkMatrix and a speed improvement to the existing function Magnify2DMatrix. Both functions are used for shrinking or expanding Matlab matrices.

  • The file extensions of all MEX files for Matlab 7.4 (R2007a) and later on Microsoft Windows have been changed from .dll to .mexw32 - the preferred name extension in new Matlab releases. This to prevent unneccessary warning messages by the upcoming Matlab R2008b about deprecated file extensions.

Psychtoolbox beta update from 2008-07-12 (SVN Revision 1090)


This update, apart from work-arounds for for broken graphics card drivers mainly introduces support for anti-aliasing of visual stimuli while the image processing pipeline is used. So far, use of the imaging pipeline and of multisampled anti-aliasing where mutually exclusive. Simultaneous use of both is available on graphics hardware and operating systems that support the required OpenGL extensions EXT_framebuffer_blit and EXT_framebuffer_multisample.

Hardware support

  • Serial port support: Small improvements to “IOPort”, a new cross-platform driver for control of Input/Output ports and esp. serial ports. At verbosity level zero, the driver shut now really shut up. If opening a port fails at verbosity level zero, no abort due to error is done, instead an invalid handle -1 is returned. This allows code to probe serial ports via trial and error without cluttering the console window of Matlab/Octave. Timing behaviour of blocking writes to serial port improved: Should now really block on Windows until data has been written out the port. On Linux a new polling-for-completion mode allows to poll for write completion instead of blocking. This is useful to get lower latencies on short writes, e.g., for clock calibration routines that are used to sync PTB’s clock with external hardware clocks.

  • KbCheck(-1) now allows to treat all connected keyboards on OS/X as one single keyboard, instead of querying each keyboard in isolation (when a keyboard index of a specific keyboard is passed) or of the primary keyboard alone. Contributed by Andrew Leber.

  • CharAvail Christopher Broussard implemented some speed optimizations for that command.

Improvements to Screen – The Visuals

Most improvements are related to the image processing pipeline. While the detailed documentation is contained in the files referenced below, most functions are accessed and controlled by the PsychImaging function and the basic help for how to use them can be found there. Demos mentioned below demonstrate this stuff in “real world” scripts.

  • Support for multisample anti-aliasing when using the imaging pipeline: If the optional ‘multisample’ parameter in Screen('OpenWindow') or PsychImaging('OpenWindow') is set to a non-zero value, then multisample anti-aliasing will be used in the same way as when the imaging pipeline is disabled. This wasn’t supported up to now, because it requires a totally different internal implementation. Additionally, Screen('OpenOffscreenWindow') with imaging pipeline enabled, honors a new optional ‘multisample’ parameter, so one can enable or disable multisample anti-aliasing for offscreen windows on a per-offscreen windows basis. Please note though that anti-aliased offscreen windows can’t be directly drawn or copied around via Screen('DrawTexture') or Screen('CopyWindow'), neither can’t there images be read-back directly via Screen('GetImage'). Instead one needs to create a “normal” offscreen window of matching size and use Screen('CopyWindow') to create a copy of a multisampled offscreen window into such a normal offscreen window. The copy will be anti-aliased and drawable. This is due to the way the underlying hardware works – The use of Screen('CopyWindow') triggers an explicit multisample resolve and anti-aliasing operation for more control.

  • On MS-Windows and GNU/Linux, most recent NVidia and ATI GPU’s do support anti-aliasing with the imaging pipeline on. On OS/X, only some ATI GPU’s do support this feature when used on “Leopard” version 10.5.3 or later, but support for NVidia GPU’s on “Leopard” is expected to arrive in a future OS/X release.

  • Screen('CopyWindow') will use a new internal implementation on systems that support EXT_framebuffer_blit extension for more flexibility and speed. Should this pretty new code expose any bugs, you can use Screen('Preference', 'ConserveVRAM', 2048); setting to switch back to the old implementation, but don’t forget to report such issues to the forum, should there be any.

  • The subfunction Screen('Blendfunction') optionally allows to set a “color write mask”: You can selectively enable or disable drawing into specific color channels, in case this is of any use. E.g., you could only enable the red channel for drawing ops, so any following drawing commands only change colors in the red channel, but leave the green, blue or alpha components of the framebuffer untouched.

  • Minor other fixes or help text updates.

New built-in workarounds in Screen for broken graphics drivers and operating systems

These workarounds get automatically enabled if the corresponding problem is detected on your system. Some will print out some warning messages to inform you about the problem and possible caveats related to the workaround. Remember: It’s always better to fix the system than to rely on some workaround which can only fix 90% of the problem and isn’t totally for free. Therefore stay informed about graphics driver and operating system updates if your system has problems.

  • MS-Windows with many ATI cards and recent NVidia cards: Crash when trying to use 3D mode. Fixed: You no longer need to provide the special Screen('ConserveVRAM') flags to manually enable workarounds. Should just work, without any known limitations.

  • MS-Windows with many ATI cards and recent NVidia cards/drivers: Beamposition queries fail and therefore get disabled. Certain types of failure can be auto-detected and a workaround is enabled. This workaround should reenable high-precison timestamping on such systems, at the expense of slightly increased processor load in certain cases. The warning message of Screen will tell you about more details and refer you to some help text that explains further caveats of this approach.

  • OS/X with all graphics cards on both “Tiger” and “Leopard”: Wrong conversion of very small values in floating point textures of 16 bit float precision. Very small values (around 10e-9) which should be rounded down to zero, as they are not representable by that format, “wrap around” and result in huge numbers that create severe visual artifacts. This is an operating system bug. Our code now performs this rounding itself, restoring correct behaviour, at the cost of additional computation time in Screen('MakeTexture') when using such floating point textures. If you use 32 bpc floating point textures instead, numerical precision will be much higher, and there are no known problems with that format. 16bpc textures are accurate to 3 digits behind the decimal point, whereas 32 bpc float textures are accurate to around 7-8 digits - sufficient for any conceivable use. However such high precision textures take up twice the amount of memory and have potentially lower drawing speeds– Life is full of trade-offs…

  • Some optimizations to the internal texture creation code to allow for faster texture creation on some broken ATI drivers on Windows: Speedup can be 10x or more.

  • The timestamping code in Screen has been improved further to try to prevent false alerts wrt. broken timestamping on some slightly deficient graphics drivers under rare conditions.

  • Workaround in Screen('DrawDots') and Screen('DrawLines') to prevent hard graphics system lockups on some totally broken OS/X 10.5 systems with NVidia hardware.

  • Workaround in procedural gabor and sine grating shaders for bugs in the GLSL shading language implementation for ATI Radeon HD cards on OS/X 10.5.3 and 10.5.4. The workaround fully resolves the issue. Apple engineering confirms a fix will be available in an upcoming OS release.

  • Small fix to InitializeMatlabOpenGL, contributed by Mingjing Zhang, Vision Research Lab., University of Science and Technology of China. Had trouble loading the GL constants file if PTB was installed in a path with spaces in its name on MS-Windows.

However, there are still a few unresolvable serious bugs in OS/X 10.5.3 and 10.5.4, especially prominent with NVidia 8000 series hardware for which no workaround exists. E.g., multi-display operation (stereo setups) seems to be highly unreliable and dysfunctional. Certain Screen('CopyWindow') commands can caus a hard graphics system lockup for no conceivable reason. Many posts on public internet forums and the Apple mailing lists suggest many more similar serious problems. Only Apple engineering will be able to fix this. Currently we recommend to not upgrade to 10.5.3 or 10.5.4 on machines that are crucial for your productive work!

Misc other stuff

  • MoviePlaybackDemoOSX can now optionally the “Buy a Mac” ads from Apple’s website instead of the boring colliding discs demo movie on “OS/X”. Unfortunately movie playback from the web is only supported on “OS/X”, so the main target audience is missed ;-)
  • MinimalisticOpenGLDemo allows to set flags to demonstrate multisample anti-aliasing with/without imaging pipeline enabled.
  • Other small enhancements to demos, downloaders and installers.

Psychtoolbox beta update from 2008-06-09 (SVN Revision 1064)


This update, apart from the usual bug fixes (mostly for broken graphics card drivers, but also for a few ptb bugs) mainly improves support for high precision drawing and display of visual stimuli. Another major part is consistent support of serial port access for all operating systems and runtime environments. And then there are lots of improvements to single functions.

Hardware support

  • Experimental support for the basic functions of the USB 1024-LS digital I/O box on Apple OS/X. This is implemented but untested – no feedback was received by any of the persons who wanted to try it.

  • Support for Cedrus response boxes of the RBx30 series and compatible XiD devices. See “help CedrusResponseBox” for how to use the new CedrusResponseBox command to operate and query the box. Please note that the current driver only “sort of works” for the basic features of the box, although a lot of time has been spent by multiple people trying to make it work. More advanced features are implemented, but their reliability is low enough to render them useless for most purpose. Basic key queries and button event queries work, so you can actually get responses from your subjects. Queries of the built-in timers work, but due to some interesting design flaws in the protocol, i’m not sure what they should be good for, unless you can get external baseline signals from the TTL trigger input ports. Setup, control and query of the TTL i/o port sometimes (in about one third of all trials) works under some random and unrepeatable circumstances, so good luck if you want to use them. I am still waiting since 30th of April for any helpful comments or suggestions from Cedrus developer support about how one can make their devices more cooperative with software other than their own. Thanks to Jenny Read, Cambridge Research Systems, Jon Peirce, Thomas Tanner and Tobias Wolf for suggestions, code examples, testing or sharing the pain.

  • Improved support for the EGI/Netstation EEG system. Our old NetStation control function apparently only worked on PowerPC based Macintosh computers. The new driver works on all Apple Macintosh computers and should also work on Intel PC under Windows and Linux. Thanks to Gergely Csibra and Zhao Fan for fixing this.

  • The pnet mex file for TCP/UDP/IP support has been recompiled to allow for lower communication latency. This should improve timing for at least NetStation and the iViewX eyetrackers.

  • Serial port support: This update contains the first release of “IOPort”, a new cross-platform driver for control of Input/Output ports. The driver works with Matlab and Octave on all supported operating systems OSX, Linux and Windows. This initial release provides unified support for serial ports, both native ones and serial ports emulated over USB protocol or other protocols. Future versions of the driver are intended to provide support for other types of I/O ports, e.g., parallel ports. As of now, the driver is only used by the CedrusResponseBox M-File, but long-term all code should be switched to this unified driver, e.g., the PR-650 photometer routines etc, so we can get rid of special solutions like PsychSerial or SerialComm.

  • Mouse wheel support: On OS/X the function GetMouseWheel() allows query of the state/movement of the mouse wheels of wheel mice. However, this seems to occassionally crash after multiple “clear all” -> run script -> “clear all” cycles for yet unresolved reasons.

Improvements to Screen – The Visuals

Most improvements are related to the image processing pipeline. While the detailed documentation is contained in the files referenced below, most functions are accessed and controlled by the PsychImaging function and the basic help for how to use them can be found there. Demos mentioned below demonstrate this stuff in “real world” scripts.

  • Much improved HDR/High precision drawing support, including improved GPU capabilities detection, especially on Apple OSX: Psychtoolbox should support drawing of arbitrary color values, even ones with negative signs, on OS X as well. In the past, this feature was only available on MS-Windows and Linux due to some software design restriction in all versions of OS X. PTB can now detect such restrictions and enable a special internal workaround solution that achieves the same without relying on the operating systems support. The ability to draw “negative” color values is mostly useful for subtracting color from a given framebuffer image in combination with alpha-blending, e.g., for fast and efficient drawing of large numbers of gabor patches or superimposed patches. Examples of this technique are demonstrated in BitsPlusPlusAdditiveBlendingForLinearSuperpositionTutorial or GarboriumDemo. There is also a new but not fully finished test script HighColorPrecisionDrawingTest. It allows to get some basic measures of the accuracy (how closely does the drawn color/luminance match the requested one) of drawing commands. Some test cases sometimes give worse numbers than they should due to some quirks in some graphics cards which are unrelated to accuracy but confounded with it. E.g., if the majority of test results tells you that your system can draw with 16 bits of precision, but one or two tests tell you it only has 6 bits or 0 bits of precision, then you can assume that the 16 bits is the more correct number and the other one is the outlier.
  • This functionality is mostly controlled by the special floatprecision flags of Screen('MakeTexture',...) for drawing of high precision textures, and the Screen('ColorRange',....) command for drawing of other primitives and control over the required precision, value range and clamping behaviour of such drawing operations. General control of framebuffer precision is again done via PsychImaging and its subfunctions.

  • High precision display device drivers for most common devices, and a test to test them:
  • CRS Bits++ in all modes – Detail improvements: Support for automatic gamma correction in Mono++ and Color++ modes (see below) and for overlay windows in Mono++ mode. Some automatic fixes for some broken graphics drivers as well.
  • VideoSwitcher by Xiangru Li et al. – A video attenuator device with active amplifiers, useable with standard RGB monitors for high precision luminance output, including a single TTL trigger output port. See help for PsychVideoSwitcher.
  • Generic video attenuator support via Lookup table transforms: Allows to drive any attenuator style device. You create some Luminance to RGB lookup table for your device in a device specific manner. Our driver performs automatic mapping of luminance values to proper RGB values from the table. Supports devices with up to 16 bit luminance resolution.
  • PseudoGray shader aka BitStealing: An algorithm that tries to squeeze out a few extra bits of luminance reproduction on standard 8 bits per color component graphics cards: See help for CreatePseudoGrayLUT
  • ATI 10 bpc framebuffer refinements: See help for PsychHelperCreateARGB2101010RemapCLUT and for PsychtoolboxKernelDriver
  • BrightSideHDR refined: Support for the DR37-P high dynamic range display from BrightSide also received a few detail improvements.

The BitsPlusPlusAdditiveBlendingForLinearSuperpositionTutorial currently demonstrates how to enable and use the different drivers in its source code. While this script used to only demonstrate mode, it its now more generic and will need a new name. The HighPrecisionLuminanceOutputDriversImagingPipelineTest tests accuracy of the different output drivers, except for the CRS Bits++ which has its own test script like in the past.

  • Color management integrated into all opmodes, e.g., gamma correction: This applies only in conjunction with use of the imaging pipeline. It should work with all HDR / high precision output drivers (see above). Read help for PsychColorCorrection for an overview. Currently only a simple gamma correction is implemented, but this is easily extensible.

  • High quality spatial display calibration and geometric undistortion routines, contributed by the Banks Vision Lab at University of California, Berkeley. Read help DisplayUndistortionBVL for an overview of functionality and usage of the calibration procedure. Their website also contains some instructions. The current help text was mostly written by me, so i’m the one to blame for sloppy explanations and they are the ones to praise for high quality calibration routines ;-)

  • Some new PsychImaging subfunctions, e.g., dynamic selection of processing ROI: You can restrict image processing to some subregion of the display to save computation time if you need high redraw rates on high resolution displays, your graphics card is too slow and the stimulus only covers a fraction of the display area.

Online function reference available


Thanks to the clever and enthusiastic work of Tobias Wolf, the help texts of Psychtoolbox are now also available online:

The same link is available from the top page of the Wiki as “Function reference”.

The reference is mostly automatically generated by a clever Python script that we will occassionally run over the whole ‘beta’ distribution. The script automatically extracts, formats, hyperlinks and uploads the help content from all Psychtoolbox M-Files and the online help of most MEX files to the documentation Wiki.

The online reference is imho much more easily readable/browseable due to all the nice clickable cross-links and the much nicer formatting. The content however is almost the same as what you get from your Matlab console by typing help Psychtoolbox, help GetChar, Screen, Screen OpenWindow? etc. Unfortunately there don’t exist any scripts that automatically rewrite documentation :-(

The script is clever but it has the hard job of turning an organically grown mass of help texts, written by many different people and as many different opinions on formatting/writing style but without any formal markup language, into something half-way structured ;-) – iow. formatting glitches are to be expected. If you find small glitches, take them as beautful examples of modern art. If you are really annoyed by some formatting, feel free to find out what goes wrong and contribute fixes to the documentation or even better, volunteer to be the one with good taste and make it your personal mission to beautify our documentation.