Psychtoolbox interfaces between Matlab or Octave and the computer hardware. The PTB core routines provide access to the display frame buffer and color lookup table, reliably synchronize with the vertical screen retrace, support sub-millisecond timing, expose raw OpenGL commands, support video playback and capture as well as low-latency audio, and facilitate the collection of observer responses. Ancillary routines support common needs like color space transformations and the QUEST threshold seeking algorithm.

Psychtoolbox has many active users, an active forum, and is widely cited. PTB-3 is based on the deprecated Psychophysics Toolbox Version 2 with its Matlab C extensions rewritten to be more modular and to use OpenGL on the back end. The current version supports at least Matlab R2021b, and Octave 5 and later on Linux, and Octave 6.4 on macOS, and Windows.

Psychtoolbox News

Psychtoolbox beta updated

kleinerm

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 “3.0.18.3”, with the full tree and commit logs under the URL:

https://github.com/Psychtoolbox-3/Psychtoolbox-3/tree/3.0.18.3

General

  • 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

kleinerm

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 “3.0.18.2”, with the full tree and commit logs under the URL:

https://github.com/Psychtoolbox-3/Psychtoolbox-3/tree/3.0.18.2

General

  • 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! (https://www.mathworks.com/solutions/neuroscience.html)

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

Linux

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

macOS

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

Windows

  • 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

kleinerm

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 “3.0.18.1”, with the full tree and commit logs under the URL:

https://github.com/Psychtoolbox-3/Psychtoolbox-3/tree/3.0.18.1

General

  • Minor cleanups, mostly irrelevant to end users.

macOS

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

Windows

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

News Archive