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 Matlab R2012a+ and Octave 3.8 and later on Linux, and Octave 4.4.1 on MacOSX, and Windows.

Psychtoolbox News

Psychtoolbox beta updated

kleinerm

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:

https://github.com/Psychtoolbox-3/Psychtoolbox-3/tree/PTB_Beta-2019-02-07_V3.0.15

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.

Linux:

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

Windows:

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

OSX:

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

Enjoy!

Psychtoolbox beta updated

kleinerm

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:

https://github.com/Psychtoolbox-3/Psychtoolbox-3/tree/PTB_Beta-2018-11-25_V3.0.15

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.

Windows:

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

OSX:

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

Enjoy!

Psychtoolbox beta updated

kleinerm

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:

https://github.com/Psychtoolbox-3/Psychtoolbox-3/tree/PTB_Beta-2018-11-08_V3.0.15

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 setup.py 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 (http://www.psychopy.org/). 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 (https://github.com/Psychtoolbox-3/Psychtoolbox-3/issues/505).

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

Linux:

  • 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 libportaudio.so.2, 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.

Windows:

  • 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 (https://ftp.gnu.org/gnu/octave/windows/octave-4.4.1-w64-installer.exe). 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 https://docs.microsoft.com/en-gb/windows-hardware/drivers/audio/low-latency-audio). 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.

OSX:

  • 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 (https://formulae.brew.sh/formula/octave)

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

Enjoy!

News Archive