Latest release

PTB BETA "Red Alert!" provides the following improvements and bug fixes.


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

All 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.
    PTB BETA "Red Alert!" SP4
  • New ProceduralSmoothedDiscMaskDemo by Ian Andolina.
  • Small "help GStreamer" fix.
  • Welcome splash is no longer asking for donations.

Psychtoolbox 3.0.14 beta release "Yellow Alert!"

@kleinerm kleinerm released this Oct 7, 2017 · 90 commits to beta since this release

New features and improvements:


  • 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 insted 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 kbqueue flag 4 for raw motion event delivery.
  • PsychPowerMate: New functions for background recording of knob turns and knob presses.
  • 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/DaqDeviceFind: Improve USB-HID interface detection. This may make DaqDeviceFind 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 3.0.14 beta release "Kafkaesque!"

@kleinerm kleinerm released this Aug 20, 2017 · 157 commits to beta since this release

Linux improvements and fixes:

  • PsychOpenHMDVR: Fixes and hacks to make Rift CV1 work better. Add source of openhmdkeepalivedaemon.
  • 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.

General improvements:

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

Psychtoolbox 3.0.14 beta release "Beamtenmikado"

@kleinerm kleinerm released this Aug 9, 2017 · 183 commits to beta since this release

PTB BETA release "Beamtenmikado"

New feature, for Linux only:

  • 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 only tested with the Rift DK2 on standard PC and the RaspberryPi-2. Test with a CV1 was unsuccessful - the display didn't light up - although no such problems were reported by other users of OpenHMD, so may be a local problem. No other HMDs available for testing - HTC Vive or Sony PSVR results would be interesting.

General improvements for all OS'es:

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

Linux fixes and small improvements:

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

Windows fixes:

  • 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 3.0.14 beta release "Kalsarikännit"

@kleinerm kleinerm released this Jun 11, 2017 · 227 commits to beta since this release


  • 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 release-ready but unreleased new OculusVR driver for 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 3.0.14 beta release "Spooling up the spinner!"

@kleinerm kleinerm released this May 11, 2017 · 290 commits to beta since this release

Psychtoolbox 3.0.14 beta release "Spooling up the spinner"

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. Apart from those, the following user visible fixes, improvements and new features have been added:


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


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


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

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

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