Psychtoolbox 3.0.22.4 "The slog continues" 😮‍💨

Psychtoolbox 3.0.22.4 “The slog continues” was released on 2. December 2026.

You can download it as a zip file from the following link:

https://github.com/Psychtoolbox-3/Psychtoolbox-3/releases/download/3.0.22.4/3.0.22.4.zip

The complete development history can be found in our GitHub repository.
The release tag is “3.0.22.4”, with the full tree and commit logs under the URL:

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

Compatibility changes wrt. Psychtoolbox 3.0.22.3:

  • None.

  • Be reminded that macOS 26 Tahoe and macOS 27 Golden Gate are currently not
    recommended for use with Psychtoolbox, due to severe operating system bugs,
    caused by Apple and only fixable by Apple. These bugs will affect any software
    that tries to achieve robust, reliable, trustworthy and accurate visual stimulus
    presentation timing and timestamping. It causes framerates to be cut in half!
    Only software with broken timing support will not suffer this degradation (iow.
    to my knowledge all other toolkits in existence). This is the situation as of
    macOS 26.0 - 27.2.1, the status of later macOS 27 releases is so far unknown.
    There have not been any improvements of this situation in macOS 27. I have filed
    high quality bug reports for macOS 27.0 to Apple about ~2.5 months ago, but so
    far no meaningful response from them, if or when to expect any fixes or improvements.

Highlights:

  • Ubuntu 26.04-LTS officially tested and supported now on X11, including Octave mex files.

  • Some improvements to visual stimulus presentation on macOS Apple Silicon. Still with
    known problems caused by Apple macOS operating system bugs, including the severe
    performance problems (only achieving a framerate half of what should be possible
    on macOS 26 and 27) which can only be fixed by Apple.

  • Various improvements to our OpenXR VR driver, especially fixes for eye gaze tracking,
    but also hand tracking and wireless/usb PC VR streaming to mobile/standalone HMDs.

All:

  • Improvements to OpenXR handtracking for VR applications. We can now make use
    of the XR_FB_HAND_TRACKING_AIM extension on VR devices that support it, to
    detect, and report properties of, “aim” gestures made by users. This is now
    also supported on Matlab, not just for Octave, as in the previous release.

  • Fix OpenXR based eye gaze tracking! Invert z-axis of gaze matrix, to fix the
    global gazeRay vector. Now it also fully works on eyetracked non HTC VR HMDs.

    Turns out we had this wrong for the OpenXR case, or rather, we had it right for the
    SRanipal HTC Vive special path although I didn’t understand why that “hack” was
    needed, and therefore restricted it to SRanipal, when it should always apply,
    because it is not a hack or a workaround, but proper treatment of the data!

    Additionally switch the coordinate reference frame to a head local one, as
    that was also wrong!

  • OpenXR: Only require OpenXR 1.0 as minimum supported api version, as some common
    VR runtimes like SteamVR don’t fully support and report OpenXR 1.1 yet.

  • Remove Octave graphics_toolkit() overrides from demos and tests, for better
    compatibility with modern Octave plotting.

  • PsychVideoSwitcher(): Work around Octave 11 bug for “weird” empty variables.

  • KbQueueDemo: Make it cope with MacBookPro’s that have a touchbar, just like
    KbCheck does: Allow the key left of 1! as a ESCape surrogate for those machines.

  • Screen+PsychVulkanCore: Mark interop images as dedicated memory allocations, to
    allow for tiled interop for potentially higher performance on some graphics cards,
    e.g., AMD gpu’s.

  • Various other smaller refinements, bug fixes and documentation updates. Various
    internal work on the software, not obviously user visible yet.

Linux:

  • Psychtoolbox was built against Matlab R2026b and Octave 6.4 under Ubuntu 22.04.5-LTS,
    and also for Octave 11.1 on Ubuntu 26.04.1-LTS. It works on Ubuntu 22.04-LTS and
    later, and similar distributions.

  • Ubuntu 26.04.1-LTS has now been validated for research grade production use under
    a native X11 X-Server based desktop GUI environment. Specifically, extensive testing
    was conducted under the KDE Plasma desktop environment v6.6. Other X11 desktops are
    expected to work, but have not been tested.

    The KDE Plasma 6.6 desktop in its X11 edition can be installed on Ubuntu by installing
    the package “plasma-session-x11”. Also recommended is installing the “sddm” login
    manager, to avoid bugs with window switching (broken ALT+Tab) apparently caused by
    the standard “gdm3” login manager. From a terminal both can be easily installed via
    sudo apt install plasma-session-x11 sddm.

  • We now ship mex files for Octave 11.1, as provided by Ubuntu 26.04-LTS, in addition
    to the existing Matlab mex files.

  • Make license activation handling work for the corresponding matlab-psychtoolbox-3
    v3.0.22.4 and later packages, once they are provided by NeuroDebian: On top of other
    current packaging bugs, which break almost all v3.0.22.0 - v3.0.22.3 versions of
    Psychtoolbox in NeuroDebian, except for the packages built for Ubuntu 26.04 LTS,
    the whole license activation is broken for all Matlab variants, despite multiple
    request for getting it fixed. I am not of great hope that it will get fixed sooner
    rather than later, so now a workaround is implemented: Once the user calls a
    PsychLicenseHandling() subfunction for license setup, the software itself will
    download and install a required library, after prompting the user for admin
    authorization. This hack will hopefully become obsolete some fine day.

  • OpenXR backend: Add optimizations for streaming of PC VR content to mobile VR HMDs
    via the open-source Monado-based WiVRn OpenXR runtime and server. WiVRn is another
    way to stream to HMDs, like the Quest 2 and 3, in addition to Valve’s SteamVR.

  • OpenXR Linux: Disable no longer needed workaround for SteamVR Linux bugs.
    The awful hang / crash bug is reported to be fixed since June 2025 and SteamVR
    runtime version 2.11.2, yay! Disable the workaround accordingly and update some
    other comments wrt. SteamVR bugs.

  • PsychPortAudio: Fix “No such entity” warnings on PipeWire enabled systems, like
    Ubuntu 24.04 and later.

  • PsychLinuxConfiguration(): Refine our workaround for Matlab’s broken libvulkan.so.1.
    Mathworks upped up the brokeness with R2026b: It is no longer sufficient to rename
    Matlab’s broken libvulkan.so.1, as that will make Psychtoolbox Vulkan backend work,
    but now completely break Matlabs graphics and plotting at least as testeed on AMD
    graphics, likely also on others. Instead we rename the broken file to disable it, as
    before, but then creaate a symlink to the system installed libvulkan.so.1, so both
    Psychtoolbox and Matlab can use it and are both happy.

  • Screen: Vsync control detection fixes for CI / gpu-less / software rasterized setups,
    to make testing inside CI setups more easy. Problem reported by Ian Andolina, thanks!

Windows:

  • Psychtoolbox was built against Octave 7.3 and Matlab R2026b under Windows 10.

  • OpenXR: Fix HTC Vive SRanipal eye tracking on MS-Windows on recent SteamVR runtimes v2.11 and later, released since summer 2025. We add a hack to force-enable eye
    tracking on SRanipal HMDs, because reporting of eye gaze tracking support on HTC
    VR HMDs like the Vive Pro Eye with SRanipal tracking is broken. It always reports
    gaze tracking as disabled, even when it is live and kicking!

macOS:

  • Psychtoolbox was built against Octave 10.2.0 from HomeBrew on macOS 13.7.8 Ventura
    final update for Intel Macs, and on macOS 15.8.2 Sequoia with Octave 11.1.0 for
    Apple Silicon Macs. The minimum required version of macOS for HDR support on Intel
    Macs, is now macOS 11.

  • Screen(‘OpenWindow’): Rewrite CAMetallayer setup and attachment code for Vulkan display.
    For various historical reasons and as workaround for old macOS 10/11/12 Metal bugs,
    creation, setup and attachment of CAMetalLayers to our onscreen window was split
    up into multiple separate phases, with setup spreading out time-wise from
    beginning of Cocoa window creation to the very end of ‘OpenWindow’ - after the
    sync tests and calibrations.

    These multiple phases seem to cause severe problems at least on macOS 26.6
    Tahoe, possibly also earlier versions, and more minor problems on older macOS
    versions. Observed trouble:

    • Many vkWaitForPresentKHR timeouts.
    • Failure to display anything, or many discarded frames.
    • Failure to do timed presentation, as the presentAt: when target time is ignored.
    • Failure in timestamping - no precise and trustworthy presentedTime timestamps.
    • Early return before present completion.

    All these problems suggest some serious race condition bugs in macOS Metal +
    CoreAnimation setup code paths. The races get triggered by the multi-phase
    way in which we init CAMetalLayers.

    The rewrite seems to fix these issues on macOS 26.6 and later, while not causing new
    issues on macOS 13 - 15. This may now be less reliable on macOS 12 and earlier.

  • PsychVulkan[Core]/macOS: Add workaround for “more than 1 second pause” bug.
    If more than 1 second of time elapses between successive present requests, macOS
    presumably enables some kind of “graphics idle → suspend display” optimizations, and
    then, after a processing a new present request, does not call the Metal drawable presented
    handler, causing hangs and timeouts and broken timestamping in applications that wait for
    and depend on that handlers proper and timely execution.

    The bug has been reported to Apple as FB 24682787 against the macOS 27.0 public release.

    Workaround inside PsychVulkanCore, if requested by PsychVulkan.m on all known
    affected macOS versions:

    Detect the potential for such a 1 sec idle bug during current pending present, and if this
    is likely to happen, immediately repeat a present of the same frame content at the next
    refresh cycle. This should “unjam” the stuck present handler and bring things back in
    order after completion of the “redundant” present. Downside: At least (=usually) one video
    refresh cycle delay, and a onset timestamp that might be reported 1 refresh cycle later
    than actual stimulus onset.

    Upside: We avoid an over 750 msecs stall/hang, broken/not trustworthy at all timestamp,
    error message clutter, and possible followup cascading error if the 1 sec timeout is hit
    again due to the stall.

    Practical results:

    macOS 15: Still not perfect, timeout hangs still happen sometimes in at least some
    configurations and scripts, but the frequency of failures seems to be reduced.

    macOS 26: Untested if this is effective.

    macOS 27.0: Workaround proves completely ineffective! Problem persists unmitigated.

  • Screen: Make it also work under “non-GUI” app, e.g., octave-cli.

  • Eyelink mex for IntelMacs fixed, by rebuilding it against a recent Eyelink SDK.

  • PsychHID: Adapt setup instructions for “Input monitoring” for macOS 13+. Apple has
    changed the GUI layout of the security settings GUI in the last years.

  • Fix macOS version support reporting for macOS 27, as Apple has changed the internal
    naming scheme again.

Enjoy!