Psychtoolbox-3.0.17 Beta update "Let them eat pie!"

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.

Thanks Mario! Out of curiosity, when I tested my RPi 4 I also couldn’t get any text output to work, e.g. TextBoundsTest.m, I had errors with font enumeration even though the font was present and at leasy on my other Linux machines the same font names work (on Ubuntu 20.10). Does it work on Raspian?

Text rendering works fine on Raspbian, no problems at all. I think i ran all text demos and tests. All the new floating point fb stuff works at excellent precision - as long as you can do without alpha blending. I hooked up my Bits# and can cofirm the high precision output modes work fine. I ran timing tests with my Videoswitcher and get the same excellent visual stimulus timing as on desktop Linux gpu’s, and as on the older RaspberryPi’s. The original timing and timestamping code for the Rpi 1-3 was developed and contributed by myself, i wasn’t involved in the RPi 4 bringup, but the developers apparently did a good job porting my code to the new driver. My only contribution to RPi 4 was some debugging of a bug introduced into recent Raspian versions, a diagnosis which should help the Rasperry Pi foundation to fix this properly, and a workaround for PTB users shipping with this beta release until upstream fixes it properly. Video capture with two USB web cams worked. Movie playback needs a bit of tweaking for high resolution/fps movies, as explained in our new help file. With that it can run full HD at at least 24 fps, thanks to the Pi’s hardware H264 decoding. The only test movie that doesn’t run at all is our own one and only included movie - the irony! That movie was encoded by some researcher, donated to us, and probably the donor didn’t know that much about video encoding and produces a somewhat faulty/non-standard compliant file, which is tolerated by GStreamers software decoders, but hardware decoders choke on it.

So the only thing that was a hard failure is PsychPortAudio playback over HDMI video – that ends badly on all Pi’s, and i’m not bored enough to look into this anymore anytime soon. I didn’t test the dual-display support due to lack of a 2nd adapter cable, or the gpio’s due to lack of something to connect to. But on the old Pi 2B some gpio’s were wired up to the led’s so i could check that it worked in principle by blinking the led’s.

I’m really quite pleased with the Pi-4’s capabilities and performance. The worst thing i can say about it is that the RPi 400’s keyboard sucks a bit for fast typers like myself. But this was a hobby project mostly, and now after 35 hours of work i got the curiosity out of my system in how much of an upgrade the Pi 4 would be, so on to something different. I just pushed this beta release so that hopefully NeuroDebian can pick it up soon and feed it back into the PTB versions shipping with the distributions.

1 Like