# New PTB, macOS Mojave, DrawText plugin problem?

**URL:** <https://psychtoolbox.discourse.group/t/new-ptb-macos-mojave-drawtext-plugin-problem/3562>\
**Category:** Bugs & Features\
**Tags:** macos\
**Created:** [December 6, 2020, 4:37am UTC](https://psychtoolbox.discourse.group/t/new-ptb-macos-mojave-drawtext-plugin-problem/3562 "2020-12-06T04:37:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![denis.pelli](https://yyz2.discourse-cdn.com/free1/user_avatar/psychtoolbox.discourse.group/denis.pelli/32/7_2.png) [@denis.pelli](https://psychtoolbox.discourse.group/u/denis.pelli)\
**Post date:** [December 6, 2020, 4:37am UTC](https://psychtoolbox.discourse.group/t/new-ptb-macos-mojave-drawtext-plugin-problem/3562/1 "2020-12-06T04:37:42Z")

</div>

Hi Mario and friends,  
I’m using macOS 10.14.6 Mojave.  
MATLAB 9.6 (R2019a) Update 8  
MacBook Pro (15-inch, 2017)  
I just upgraded to Psychtoolbox 3.0.17. Was that a mistake?  
(I did read the release notes, which require Catalina. But if we absolutely need Catalina, shouldn’t UpdatePsychtoolbox at least issue a warning about the OS version? The error messages I got are not at all suggestive of having the wrong OS version.)  
Error below.  
I’d be grateful for help or advice.  
Denis Pelli

UpdatePsychtoolbox issues a warning:

> > UpdatePsychtoolbox  
> > UpdatePsychtoolbox(‘/Users/denispelli/Dropbox/MATLAB/Psychtoolbox’)

Updating via Matlabs integrated SVNKit: This can take multiple minutes.  
There may be no output to this window to indicate progress until the update is complete.  
Please be patient …  
Update to SVN revision 11608 succeeded!

Your MATLAB/OCTAVE path has been updated. Now trying to save the new MATLAB/OCTAVE path…

Running post-install routine…

PTB-INFO: Connection to Psychtoolbox kernel support driver instance #0 (Revision 1) established.  
PTB-INFO: Connection to Psychtoolbox kernel support driver instance #1 (Revision 1) established.  
PTB-INFO: Disconnecting from kernel driver instance #1 for detected Intel GPU for safety reasons. setenv(‘PSYCH\_ALLOW\_DANGEROUS’, ‘1’) to override.  
Trying to trigger an update of the fontconfig cache if that should prove neccessary.  
This may take a couple of seconds, or sometimes even minutes. Please be patient…  
**INTERNAL PSYCHTOOLBOX ERROR**  
\*\* error: Psycherror\_OpenGL\*\*  
\*\* general description: OpenGL call returned an error\*\*  
\*\* specific description: GL\_INVALID\_FRAMEBUFFER\_OPERATION\_EXT\*\*  
\*\* module name: Screen\*\*  
\*\* subfunction call: OpenWindow\*\*  
\*\* file name: /Users/kleinerm/projects/OpenGLPsychtoolbox/Psychtoolbox-3/PsychSourceGL/Source/Common/Screen/PsychTextureSupport.c\*\*  
\*\* function name: PsychCreateTexture\*\*  
\*\* line number: 166\*\*  
**Something went wrong with text renderer setup. Read ‘help DrawTextPlugin’ for troubleshooting.**

Based on help DrawTextPlugin, I searched for and deleted one instance of libfreetype.6.dylib in X11. That made no difference. Running UpdatePsychtoolbox again produced the same error.

Running DrawFormattedTextDemo produced a fatal error.  
**\>\> DrawFormattedTextDemo**  
**PTB-INFO: Retina display. Enabling panel fitter for scaled Retina compatibility mode.**  
**INTERNAL PSYCHTOOLBOX ERROR**  
\*\* error: PsychError\_InvalidWindowRecord\*\*  
\*\* general description: An Invalid window record was referenced.\*\*  
\*\* module name: Screen\*\*  
\*\* subfunction call: OpenWindow\*\*  
\*\* file name: /Users/kleinerm/projects/OpenGLPsychtoolbox/Psychtoolbox-3/PsychSourceGL/Source/Common/Screen/WindowHelpers.c\*\*  
\*\* function name: PsychCheckIfWindowRecordIsValid\*\*  
\*\* line number: 61\*\*  
**INTERNAL PSYCHTOOLBOX ERROR**  
\*\* error: PsychError\_InvalidWindowRecord\*\*  
\*\* general description: An Invalid window record was referenced.\*\*  
\*\* module name: Screen\*\*  
\*\* subfunction call: WindowKind\*\*  
\*\* file name: /Users/kleinerm/projects/OpenGLPsychtoolbox/Psychtoolbox-3/PsychSourceGL/Source/Common/Screen/WindowHelpers.c\*\*  
\*\* function name: PsychCheckIfWindowRecordIsValid\*\*  
\*\* line number: 61\*\*  
**Error using Screen**  
**See error message printed above.**

**Error in sca (line 30)**  
\*\* if Screen(‘WindowKind’, win) == 1\*\*

**Error in DrawFormattedTextDemo (line 178)**  
\*\* sca;\*\*

---

<div class="post-metadata">

**Author:** ![mariokleiner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mariokleiner](https://psychtoolbox.discourse.group/u/mariokleiner)\
**Post date:** [December 6, 2020, 5:19pm UTC](https://psychtoolbox.discourse.group/t/new-ptb-macos-mojave-drawtext-plugin-problem/3562/2 "2020-12-06T17:19:53Z")

</div>

> [@denis.pelli](#):
>
> Hi Mario and friends,  
> I’m using macOS 10.14.6 Mojave.  
> MATLAB 9.6 (R2019a) Update 8  
> MacBook Pro (15-inch, 2017)  
> I just upgraded to Psychtoolbox 3.0.17. Was that a mistake?  
> (I did read the release notes, which require Catalina. But if we absolutely need Catalina, shouldn’t UpdatePsychtoolbox at least issue a warning about the OS version? The error messages I got are not at all suggestive of having the wrong OS version.)  
> Error below.  
> I’d be grateful for help or advice.  
> Denis Pelli

Hi Denis,

while only Catalina is tested going forward, and officially supported in case of trouble, the expectation is that all versions since 10.11 El Capitan should continue to work. I just spent 2 hours going through our code and there has not been any change in the relevant code that could cause this error. The only thing that changed is that the build system is now Catalina 10.15.7 instead of High Sierra 10.13.6, and the SDK is now the Catalina SDK instead of the Mojave SDK. This is certainly yet another Apple macOS bug, maybe this time in the Apple XCode SDK’s.

So let’s see what the iToys company screwed up this time.

Restart Matlab, or “clear all”.

% Let’s skip error detection and see how far we get:  
Screen(‘Preference’,‘ConserveVRAM’, 512);  
% Run some demo, e.g.:  
InitializeMatlabOpenGL(, 1, 1);  
PerceptualVBLSyncTest or LinesDemo or DrawSomeTextDemo.

Do they work?

Then you can do this in the command window or a script:  
PsychDebugWindowConfiguration;  
w = Screen(‘Openwindow’, 0);  
glClear(GL.COLOR\_BUFFER\_BIT);  
glClearColor(0.5, 0.5, 0.5, 1.0);  
glClear(GL.COLOR\_BUFFER\_BIT);  
v = glReadPixels(0, 0, 1, 1, GL.RED, GL.UNSIGNED\_BYTE)  
glPixelStorei(GL.UNPACK\_ALIGNMENT, 1);  
glClearColor(1,1,1,1);  
glGetString(GL.VENDOR)  
glGetString(GL.RENDERER)  
glGetString(GL.VERSION)  
glGetString(GL.EXTENSIONS)  
sca;

And let me know on which one it aborts with an OpenGL error. These are the  
only calls that could in theory trigger an OpenGL error in this scenario, but in practice none of them can, except if Apple screwed up badly - which is of course their thing.

[Work time spent so far to diagnose Apples screwup: 3 hours]  
-mario

---

<div class="post-metadata">

**Author:** ![denis.pelli](https://yyz2.discourse-cdn.com/free1/user_avatar/psychtoolbox.discourse.group/denis.pelli/32/7_2.png) [@denis.pelli](https://psychtoolbox.discourse.group/u/denis.pelli)\
**Post date:** [December 7, 2020, 4:07am UTC](https://psychtoolbox.discourse.group/t/new-ptb-macos-mojave-drawtext-plugin-problem/3562/3 "2020-12-07T04:07:56Z")

</div>

dear mario  
many thanks. I restarted MATLAB. All the suggested tests run fine, with no error. Here’s the print out.  
Just in case, I reran UpdatePsychtoolbox, and got the same error, below.  
Any more tests I can run?  
best  
denis  
p.s.  
TYPO: “Trying to trigger an update of the fontconfig cache if that should prove **neccessary**.”  
should be “necessary”.

**\>\> Screen(‘Preference’,‘ConserveVRAM’, 512);**  
PTB-INFO: Connection to Psychtoolbox kernel support driver instance #0 (Revision 1) established.  
PTB-INFO: Connection to Psychtoolbox kernel support driver instance #1 (Revision 1) established.  
PTB-INFO: Disconnecting from kernel driver instance #1 for detected Intel GPU for safety reasons. setenv(‘PSYCH\_ALLOW\_DANGEROUS’, ‘1’) to override.  
**\>\> InitializeMatlabOpenGL([], 1, 1);**  
**\>\> PerceptualVBLSyncTest**  
PTB-INFO: Retina display. Enabling panel fitter for scaled Retina compatibility mode.

PTB-INFO: This is Psychtoolbox-3 for Apple OS X, under Matlab 64-Bit (Version 3.0.17 - Build date: Dec 2 2020).  
PTB-INFO: OS support status: OSX version 10.14 is not - or no longer - officially supported or tested at all for this release.  
PTB-INFO: Type ‘PsychtoolboxVersion’ for more detailed version information.  
PTB-INFO: Most parts of the Psychtoolbox distribution are licensed to you under terms of the MIT License, with  
PTB-INFO: some restrictions. See file ‘License.txt’ in the Psychtoolbox root folder for the exact licensing conditions.

PTB-INFO: For information about paid priority support, community membership and commercial services, please type  
PTB-INFO: ‘PsychPaidSupportAndServices’.

PTB-INFO: OpenGL-Renderer is ATI Technologies Inc. :: AMD Radeon Pro 560 OpenGL Engine :: 2.1 ATI-2.11.22  
PTB-INFO: Renderer has 4096 MB of VRAM and a maximum 3840 MB of texture memory.  
PTB-INFO: VBL startline = 1800 , VBL Endline = 1850  
PTB-INFO: Measured monitor refresh interval from beamposition = 16.666460 ms [60.000743 Hz].  
PTB-INFO: Will use beamposition query for accurate Flip time stamping.  
PTB-INFO: Measured monitor refresh interval from VBLsync = 16.665882 ms [60.002825 Hz]. (50 valid samples taken, stddev=0.081338 ms.)  
PTB-INFO: Small deviations between reported values are normal and no reason to worry.  
PTB-INFO: Psychtoolbox imaging pipeline starting up for window with requested imagingmode 33793 …  
PTB-INFO: Will use 8 bits per color component framebuffer for stimulus drawing.  
PTB-INFO: Enabling panel fitter. Providing virtual framebuffer of 1280 x 800 pixels size.  
PTB-INFO: Will use 8 bits per color component framebuffer for stimulus post-processing (if any).

INFO: PTB’s Screen(‘Flip’, 10) command seems to have missed the requested stimulus presentation deadline  
INFO: a total of 2 times out of a total of 576 flips during this session.

INFO: This number is fairly accurate (and indicative of real timing problems in your own code or your system)  
INFO: if you provided requested stimulus onset times with the ‘when’ argument of Screen(‘Flip’, window [, when]);  
INFO: If you called Screen(‘Flip’, window); without the ‘when’ argument, this count is more of a ‘‘mild’’ indicator  
INFO: of timing behaviour than a hard reliable measurement. Large numbers may indicate problems and should at least  
INFO: deserve your closer attention. Cfe. ‘help SyncTrouble’, the FAQ section at [www.psychtoolbox.org](http://www.psychtoolbox.org) and the  
INFO: examples in the PDF presentation in PsychDocumentation/Psychtoolbox3-Slides.pdf for more info and timing tips.

**\>\> LinesDemo**  
PTB-INFO: Retina display. Enabling panel fitter for scaled Retina compatibility mode.

PTB-INFO: This is Psychtoolbox-3 for Apple OS X, under Matlab 64-Bit (Version 3.0.17 - Build date: Dec 2 2020).  
PTB-INFO: OS support status: OSX version 10.14 is not - or no longer - officially supported or tested at all for this release.  
PTB-INFO: Type ‘PsychtoolboxVersion’ for more detailed version information.  
PTB-INFO: Most parts of the Psychtoolbox distribution are licensed to you under terms of the MIT License, with  
PTB-INFO: some restrictions. See file ‘License.txt’ in the Psychtoolbox root folder for the exact licensing conditions.

PTB-INFO: For information about paid priority support, community membership and commercial services, please type  
PTB-INFO: ‘PsychPaidSupportAndServices’.

PTB-INFO: OpenGL-Renderer is ATI Technologies Inc. :: AMD Radeon Pro 560 OpenGL Engine :: 2.1 ATI-2.11.22  
PTB-INFO: Renderer has 4096 MB of VRAM and a maximum 3840 MB of texture memory.  
PTB-INFO: VBL startline = 1800 , VBL Endline = 1850  
PTB-INFO: Measured monitor refresh interval from beamposition = 16.666257 ms [60.001475 Hz].  
PTB-INFO: Will use beamposition query for accurate Flip time stamping.  
PTB-INFO: Measured monitor refresh interval from VBLsync = 16.665689 ms [60.003520 Hz]. (50 valid samples taken, stddev=0.080244 ms.)  
PTB-INFO: Small deviations between reported values are normal and no reason to worry.  
PTB-INFO: Psychtoolbox imaging pipeline starting up for window with requested imagingmode 33793 …  
PTB-INFO: Will use 8 bits per color component framebuffer for stimulus drawing.  
PTB-INFO: Enabling panel fitter. Providing virtual framebuffer of 1280 x 800 pixels size.  
PTB-INFO: Will use 8 bits per color component framebuffer for stimulus post-processing (if any).

minsmooth =

1

maxsmooth =

64

**\>\> DrawSomeTextDemo**  
PTB-INFO: Retina display. Enabling panel fitter for scaled Retina compatibility mode.

PTB-INFO: This is Psychtoolbox-3 for Apple OS X, under Matlab 64-Bit (Version 3.0.17 - Build date: Dec 2 2020).  
PTB-INFO: OS support status: OSX version 10.14 is not - or no longer - officially supported or tested at all for this release.  
PTB-INFO: Type ‘PsychtoolboxVersion’ for more detailed version information.  
PTB-INFO: Most parts of the Psychtoolbox distribution are licensed to you under terms of the MIT License, with  
PTB-INFO: some restrictions. See file ‘License.txt’ in the Psychtoolbox root folder for the exact licensing conditions.

PTB-INFO: For information about paid priority support, community membership and commercial services, please type  
PTB-INFO: ‘PsychPaidSupportAndServices’.

PTB-INFO: OpenGL-Renderer is ATI Technologies Inc. :: AMD Radeon Pro 560 OpenGL Engine :: 2.1 ATI-2.11.22  
PTB-INFO: Renderer has 4096 MB of VRAM and a maximum 3840 MB of texture memory.  
PTB-INFO: VBL startline = 1800 , VBL Endline = 1850  
PTB-INFO: Measured monitor refresh interval from beamposition = 16.666665 ms [60.000005 Hz].  
PTB-INFO: Will use beamposition query for accurate Flip time stamping.  
PTB-INFO: Measured monitor refresh interval from VBLsync = 16.665097 ms [60.005652 Hz]. (50 valid samples taken, stddev=0.109848 ms.)  
PTB-INFO: Small deviations between reported values are normal and no reason to worry.  
PTB-INFO: Psychtoolbox imaging pipeline starting up for window with requested imagingmode 33793 …  
PTB-INFO: Will use 8 bits per color component framebuffer for stimulus drawing.  
PTB-INFO: Enabling panel fitter. Providing virtual framebuffer of 1280 x 800 pixels size.  
PTB-INFO: Will use 8 bits per color component framebuffer for stimulus post-processing (if any).  
Requested font: Courier New, got: Courier New  
Requested font: Times, got: Times  
**\>\> PsychDebugWindowConfiguration;**

**\>\> w = Screen(‘Openwindow’, 0);**  
PTB-INFO: Retina display. Enabling panel fitter for scaled Retina compatibility mode.

PTB-INFO: This is Psychtoolbox-3 for Apple OS X, under Matlab 64-Bit (Version 3.0.17 - Build date: Dec 2 2020).  
PTB-INFO: OS support status: OSX version 10.14 is not - or no longer - officially supported or tested at all for this release.  
PTB-INFO: Type ‘PsychtoolboxVersion’ for more detailed version information.  
PTB-INFO: Most parts of the Psychtoolbox distribution are licensed to you under terms of the MIT License, with  
PTB-INFO: some restrictions. See file ‘License.txt’ in the Psychtoolbox root folder for the exact licensing conditions.

PTB-INFO: For information about paid priority support, community membership and commercial services, please type  
PTB-INFO: ‘PsychPaidSupportAndServices’.

PTB-INFO: OpenGL-Renderer is ATI Technologies Inc. :: AMD Radeon Pro 560 OpenGL Engine :: 2.1 ATI-2.11.22  
PTB-INFO: Renderer has 4096 MB of VRAM and a maximum 3840 MB of texture memory.  
PTB-INFO: VBL startline = 1600 , VBL Endline = -1  
PTB-INFO: Beamposition queries unsupported or defective on this system. Using basic timestamping as fallback.  
PTB-INFO: Timestamps returned by Screen(‘Flip’) will be therefore less robust and accurate.  
PTB-INFO: Measured monitor refresh interval from VBLsync = 0.000000 ms [inf Hz]. (0 valid samples taken, stddev=0.000000 ms.)  
PTB-INFO: Small deviations between reported values are normal and no reason to worry.  
PTB-WARNING: ==================================================================================================================  
PTB-WARNING: DESKTOP COMPOSITOR IS ACTIVE! ALL FLIP STIMULUS ONSET TIMESTAMPS WILL BE VERY LIKELY UNRELIABLE AND LESS ACCURATE!  
PTB-WARNING: STIMULUS ONSET TIMING WILL BE UNRELIABLE AS WELL, AND GRAPHICS PERFORMANCE MAY BE REDUCED!  
PTB-WARNING: DO NOT USE THIS MODE FOR RUNNING REAL EXPERIMENT SESSIONS WITH ANY REQUIREMENTS FOR ACCURATE TIMING!  
PTB-WARNING: ==================================================================================================================  
PTB-INFO: All display tests and calibrations disabled. Assuming a refresh interval of 60.000000 Hz. Timing will be inaccurate!  
PTB-INFO: Psychtoolbox imaging pipeline starting up for window with requested imagingmode 33793 …  
PTB-INFO: Will use 8 bits per color component framebuffer for stimulus drawing.  
PTB-INFO: Enabling panel fitter. Providing virtual framebuffer of 1280 x 800 pixels size.  
PTB-INFO: Will use 8 bits per color component framebuffer for stimulus post-processing (if any).  
**\>\> glClear(GL.COLOR\_BUFFER\_BIT);**  
**glClearColor(0.5, 0.5, 0.5, 1.0);**  
**glClear(GL.COLOR\_BUFFER\_BIT);**  
**v = glReadPixels(0, 0, 1, 1, GL.RED, GL.UNSIGNED\_BYTE)**  
**glPixelStorei(GL.UNPACK\_ALIGNMENT, 1);**  
**glClearColor(1,1,1,1);**  
**glGetString(GL.VENDOR)**  
**glGetString(GL.RENDERER)**  
**glGetString(GL.VERSION)**  
**glGetString(GL.EXTENSIONS)**  
**sca;**

v =

uint8

128

ans =

‘ATI Technologies Inc.’

ans =

‘AMD Radeon Pro 560 OpenGL Engine’

ans =

‘2.1 ATI-2.11.22’

ans =

'GL\_ARB\_color\_buffer\_float GL\_ARB\_depth\_buffer\_float GL\_ARB\_depth\_clamp GL\_ARB\_depth\_texture GL\_ARB\_draw\_buffers GL\_ARB\_draw\_elements\_base\_vertex GL\_ARB\_draw\_instanced GL\_ARB\_fragment\_program GL\_ARB\_fragment\_program\_shadow GL\_ARB\_fragment\_shader GL\_ARB\_framebuffer\_object GL\_ARB\_framebuffer\_sRGB GL\_ARB\_half\_float\_pixel GL\_ARB\_half\_float\_vertex GL\_ARB\_imaging GL\_ARB\_instanced\_arrays GL\_ARB\_multisample GL\_ARB\_multitexture GL\_ARB\_occlusion\_query GL\_ARB\_pixel\_buffer\_object GL\_ARB\_point\_parameters GL\_ARB\_point\_sprite GL\_ARB\_provoking\_vertex GL\_ARB\_seamless\_cube\_map GL\_ARB\_shader\_objects GL\_ARB\_shader\_texture\_lod GL\_ARB\_shading\_language\_100 GL\_ARB\_shadow GL\_ARB\_shadow\_ambient GL\_ARB\_sync GL\_ARB\_texture\_border\_clamp GL\_ARB\_texture\_compression GL\_ARB\_texture\_compression\_rgtc GL\_ARB\_texture\_cube\_map GL\_ARB\_texture\_env\_add GL\_ARB\_texture\_env\_combine GL\_ARB\_texture\_env\_crossbar GL\_ARB\_texture\_env\_dot3 GL\_ARB\_texture\_float GL\_ARB\_texture\_mirrored\_repeat GL\_ARB\_texture\_non\_power\_of\_two GL\_ARB\_texture\_rectangle GL\_ARB\_texture\_rg GL\_ARB\_transpose\_matrix GL\_ARB\_vertex\_array\_bgra GL\_ARB\_vertex\_blend GL\_ARB\_vertex\_buffer\_object GL\_ARB\_vertex\_program GL\_ARB\_vertex\_shader GL\_ARB\_window\_pos GL\_EXT\_abgr GL\_EXT\_bgra GL\_EXT\_bindable\_uniform GL\_EXT\_blend\_color GL\_EXT\_blend\_equation\_separate GL\_EXT\_blend\_func\_separate GL\_EXT\_blend\_minmax GL\_EXT\_blend\_subtract GL\_EXT\_clip\_volume\_hint GL\_EXT\_debug\_label GL\_EXT\_debug\_marker GL\_EXT\_depth\_bounds\_test GL\_EXT\_draw\_buffers2 GL\_EXT\_draw\_range\_elements GL\_EXT\_fog\_coord GL\_EXT\_framebuffer\_blit GL\_EXT\_framebuffer\_multisample GL\_EXT\_framebuffer\_object GL\_EXT\_framebuffer\_sRGB GL\_EXT\_geometry\_shader4 GL\_EXT\_gpu\_program\_parameters GL\_EXT\_gpu\_shader4 GL\_EXT\_multi\_draw\_arrays GL\_EXT\_packed\_depth\_stencil GL\_EXT\_packed\_float GL\_EXT\_provoking\_vertex GL\_EXT\_rescale\_normal GL\_EXT\_secondary\_color GL\_EXT\_separate\_specular\_color GL\_EXT\_shadow\_funcs GL\_EXT\_stencil\_two\_side GL\_EXT\_stencil\_wrap GL\_EXT\_texture\_array GL\_EXT\_texture\_compression\_dxt1 GL\_EXT\_texture\_compression\_s3tc GL\_EXT\_texture\_env\_add GL\_EXT\_texture\_filter\_anisotropic GL\_EXT\_texture\_integer GL\_EXT\_texture\_lod\_bias GL\_EXT\_texture\_mirror\_clamp GL\_EXT\_texture\_rectangle GL\_EXT\_texture\_shared\_exponent GL\_EXT\_texture\_sRGB GL\_EXT\_texture\_sRGB\_decode GL\_EXT\_timer\_query GL\_EXT\_transform\_feedback GL\_EXT\_vertex\_array\_bgra GL\_APPLE\_aux\_depth\_stencil GL\_APPLE\_client\_storage GL\_APPLE\_element\_array GL\_APPLE\_fence GL\_APPLE\_float\_pixels GL\_APPLE\_flush\_buffer\_range GL\_APPLE\_flush\_render GL\_APPLE\_object\_purgeable GL\_APPLE\_packed\_pixels GL\_APPLE\_pixel\_buffer GL\_APPLE\_rgb\_422 GL\_APPLE\_row\_bytes GL\_APPLE\_specular\_vector GL\_APPLE\_texture\_range GL\_APPLE\_transform\_hint GL\_APPLE\_vertex\_array\_object GL\_APPLE\_vertex\_array\_range GL\_APPLE\_vertex\_point\_size GL\_APPLE\_vertex\_program\_evaluators GL\_APPLE\_ycbcr\_422 GL\_ATI\_blend\_equation\_separate GL\_ATI\_blend\_weighted\_minmax GL\_ATI\_separate\_stencil GL\_ATI\_texture\_compression\_3dc GL\_ATI\_texture\_env\_combine3 GL\_ATI\_texture\_float GL\_ATI\_texture\_mirror\_once GL\_IBM\_rasterpos\_clip GL\_NV\_blend\_square GL\_NV\_conditional\_render GL\_NV\_depth\_clamp GL\_NV\_fog\_distance GL\_NV\_light\_max\_exponent GL\_NV\_texgen\_reflection GL\_NV\_texture\_barrier GL\_SGI\_color\_matrix GL\_SGIS\_generate\_mipmap GL\_SGIS\_texture\_edge\_clamp GL\_SGIS\_texture\_lod ’

WARNING: This session of your experiment was run by you with the setting Screen(‘Preference’, ‘SkipSyncTests’, 2).  
WARNING: This means that some internal self-tests and calibrations were skipped. Your stimulus presentation timing  
WARNING: may have been wrong. This is fine for development and debugging of your experiment, but for running the real  
WARNING: study, please make sure to set Screen(‘Preference’, ‘SkipSyncTests’, 0) for maximum accuracy and reliability.

> >

**\>\> UpdatePsychtoolbox**  
UpdatePsychtoolbox(‘/Users/denispelli/Dropbox/MATLAB/Psychtoolbox’)

Updating via Matlabs integrated SVNKit: This can take multiple minutes.  
There may be no output to this window to indicate progress until the update is complete.  
Please be patient …  
Update to SVN revision 11608 succeeded!

Your MATLAB/OCTAVE path has been updated. Now trying to save the new MATLAB/OCTAVE path…

Running post-install routine…

PTB-INFO: Connection to Psychtoolbox kernel support driver instance #0 (Revision 1) established.  
PTB-INFO: Connection to Psychtoolbox kernel support driver instance #1 (Revision 1) established.  
PTB-INFO: Disconnecting from kernel driver instance #1 for detected Intel GPU for safety reasons. setenv(‘PSYCH\_ALLOW\_DANGEROUS’, ‘1’) to override.  
Trying to trigger an update of the fontconfig cache if that should prove neccessary.  
This may take a couple of seconds, or sometimes even minutes. Please be patient…  
INTERNAL PSYCHTOOLBOX ERROR  
error: Psycherror\_OpenGL  
general description: OpenGL call returned an error  
specific description: GL\_INVALID\_FRAMEBUFFER\_OPERATION\_EXT  
module name: Screen  
subfunction call: OpenWindow  
file name: /Users/kleinerm/projects/OpenGLPsychtoolbox/Psychtoolbox-3/PsychSourceGL/Source/Common/Screen/PsychTextureSupport.c  
function name: PsychCreateTexture  
line number: 166  
Something went wrong with text renderer setup. Read ‘help DrawTextPlugin’ for troubleshooting.

Done with post-installation. Psychtoolbox is ready for use.

---

<div class="post-metadata">

**Author:** ![mariokleiner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mariokleiner](https://psychtoolbox.discourse.group/u/mariokleiner)\
**Post date:** [December 7, 2020, 12:11pm UTC](https://psychtoolbox.discourse.group/t/new-ptb-macos-mojave-drawtext-plugin-problem/3562/4 "2020-12-07T12:11:44Z")

</div>

Ok, that’s annoying. So with the error checking during Screen(‘Openwindow’) disabled - that’s what that first **Screen(‘Preference’,‘ConserveVRAM’, 512);** does - ‘OpenWindow’ completes without apparent malfunctions, showing the nice new welcome logo, passing all other non-OpenGL correctness and timing tests. Demos seem to run without visual artifacts or apparent trouble judging from the output? And the specific sequence of the only OpenGL commands during ‘OpenWindow’ which could in theory trigger an error do not trigger an error when executed manually from the Matlab prompt outside the context of ‘OpenWindow’.

This problem has some similarity to the one reported in:  
[Screen() Failure](https://psychtoolbox.discourse.group/t/screen-failure/3499) for macOS Sierra 10.12  
but also possibly and some remote similarity to [MAC OS PsychError\_InvalidWindowRecord](https://psychtoolbox.discourse.group/t/mac-os-psycherror-invalidwindowrecord/3557) for Catalina although the latter one has too little information and is not quite identical.

Can you check if demos like the ones you ran here, LinesDemo, DrawSomeTextDemo, etc. do work after a restart of Matlab without using the `Screen(‘Preference’,‘ConserveVRAM’, 512);` ie. with regular error handling enabled? I’d assume they fail as well, because what happens inside UpdatePsychtoolbox is just opening a hidden onscreen window and drawing a little text string - this to trigger a potential update of the fontconfig database if needed.

It executes this sequence :

> <https://github.com/kleinerm/Psychtoolbox-3/blob/bbd6ca0f2c5e3547eadb8c012146c38cc717a837/Psychtoolbox/PsychtoolboxPostInstallRoutine.m#L661>

Assuming this all fails as well, because it is some weird interaction bug between OpenGL calls and other code that has nothing to do with OpenGL and should not cause such an error at all, it is time to get out the big guns. The following Technical note teaches you how to install and use Apples OpenGL Profiler, attach it to the running (freshly started!) Matlab process, set a breakpoint on OpenGL errors and start tracing. Then run a test sequence:

PsychDebugWindowConfiguration;  
w = Screen(‘Openwindow’, 0);  
sca;

The profiler should halt Matlab execution once the OpenGL error is encountered during ‘Openwindow’ and the trace should hopefully point in the general direction of where the problem happens.

> **[Technical Note TN2178: Real world profiling with the OpenGL Profiler](https://developer.apple.com/library/archive/technotes/tn2178/_index.html#//apple_ref/doc/uid/DTS40007990-CH1-SECTION1)**

---

<div class="post-metadata">

**Author:** ![denis.pelli](https://yyz2.discourse-cdn.com/free1/user_avatar/psychtoolbox.discourse.group/denis.pelli/32/7_2.png) [@denis.pelli](https://psychtoolbox.discourse.group/u/denis.pelli)\
**Post date:** [December 11, 2020, 9:51am UTC](https://psychtoolbox.discourse.group/t/new-ptb-macos-mojave-drawtext-plugin-problem/3562/5 "2020-12-11T09:51:17Z")

</div>

Dear Mario  
Thank you. Things have changed (for the better), though I don’t understand why.

Restarting MATLAB and running just the code you pointed me to from UpdatePsychtoolbox produces the same error that I reported from UpdatePsychtoolbox.

INTERNAL PSYCHTOOLBOX ERROR  
error: Psycherror\_OpenGL  
general description: OpenGL call returned an error  
specific description: GL\_INVALID\_FRAMEBUFFER\_OPERATION\_EXT  
module name: Screen  
subfunction call: OpenWindow  
file name: /Users/kleinerm/projects/OpenGLPsychtoolbox/Psychtoolbox-3/PsychSourceGL/Source/Common/Screen/PsychTextureSupport.c  
function name: PsychCreateTexture  
line number: 166  
Something went wrong with text renderer setup. Read ‘help DrawTextPlugin’ for troubleshooting.

With fresh start of MATLAB.  
LinesDemo runs fine.  
DrawSomeTextDemo runs fine.  
InitializeMatlabOpenGL(, 1, 1); runs fine  
PerceptualVBLSyncTest runs fine  
This block of code you gave me runs fine.

> PsychDebugWindowConfiguration;  
> w = Screen(‘Openwindow’, 0);  
> glClear(GL.COLOR\_BUFFER\_BIT);  
> glClearColor(0.5, 0.5, 0.5, 1.0);  
> glClear(GL.COLOR\_BUFFER\_BIT);  
> v = glReadPixels(0, 0, 1, 1, GL.RED, GL.UNSIGNED\_BYTE)  
> glPixelStorei(GL.UNPACK\_ALIGNMENT, 1);  
> glClearColor(1,1,1,1);  
> glGetString(GL.VENDOR)  
> glGetString(GL.RENDERER)  
> glGetString(GL.VERSION)  
> glGetString(GL.EXTENSIONS)  
> sca;

I ran  
Screen(‘Preference’,‘ConserveVRAM’, 512);  
Followed by the code from UpdatePsychtoolbox.  
It ran fine.  
After restarting MATLAB  
DrawFormattedTextDemo  
runs fine.  
And UpdatePsychtoolbox runs fine!

Thus, the ONLY error I now find is the section of UpdatePsychtoolbox fails when run alone without Screen(‘Preference’,‘ConserveVRAM’, 512);

I don’t understand why the error I originally reported for UpdatePsychtoolbox is gone. It seemed solid when I reported it. Now it’s gone. Now the error appears only when I run the section of UpdatePsychtoolbox code that you pointed me to:

| if ~IsLinux | |
| --- | --- |
| | % If this is not Linux, then open an invisible onscreen window and |
| | % draw some dummy text with the plugin text renderer, just to |
| | % trigger a (re-)build of the fontconfig cache if that should prove |
| | % neccessary. Such a rebuild can take many seconds to even minutes |
| | % and looks to the user like a hang, so do it here, with proper |
| | % warning. We skip this on Linux, as the OS will take care of |
| | % proper rebuilds appropriately, so we don’t expect to ever run |
| | % into this problem: |
| | fprintf(‘Trying to trigger an update of the fontconfig cache if that should prove neccessary.\n’); |
| | fprintf(‘This may take a couple of seconds, or sometimes even minutes. Please be patient…\n’); |
| | drawnow; |
| | |
| | oldRenderer = Screen(‘Preference’, ‘TextRenderer’, 1); |
| | oldLevel = Screen(‘Preference’, ‘WindowShieldingLevel’, -1); |
| | oldVerbo = Screen(‘Preference’, ‘Verbosity’, 0); |
| | oldTsMode = Screen(‘Preference’, ‘VBLTimestampingmode’, -1); |
| | |
| | try |
| | win = Screen(‘OpenWindow’, 0, 0, [0 0 100 100]); |
| | Screen(‘DrawText’, win, ‘Ola!’); |
| | Screen(‘Flip’, win); |
| | Screen(‘CloseAll’); |
| | catch |
| | fprintf(‘Something went wrong with text renderer setup. Read ‘‘help DrawTextPlugin’’ for troubleshooting.\n\n\n’); |
| | end |
| | |
| | Screen(‘Preference’, ‘TextRenderer’, oldRenderer); |
| | Screen(‘Preference’, ‘WindowShieldingLevel’, oldLevel); |
| | Screen(‘Preference’, ‘Verbosity’, oldVerbo); |
| | Screen(‘Preference’, ‘VBLTimestampingmode’, oldTsMode); |
| end | |

The only explanation I can think of is that you’ve fixed something in the master, and I’ve updated my code here by running UpdatePsychtoolbox.  
Best  
Denis

---

<div class="post-metadata">

**Author:** ![mariokleiner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mariokleiner](https://psychtoolbox.discourse.group/u/mariokleiner)\
**Post date:** [December 11, 2020, 6:55pm UTC](https://psychtoolbox.discourse.group/t/new-ptb-macos-mojave-drawtext-plugin-problem/3562/6 "2020-12-11T18:55:02Z")

</div>

There hasn’t been any change wrt. macOS from my side. Does UpdatePsychtoolbox work even after you restart Matlab? There isn’t anything in UpdatePsychtoolbox apart from that snippet that touches OpenGL, so they should behave the same under same starting conditions.

My best guess would be to try the snippet with the ‘WindowShieldingLevel’ calls removed. Those make sure the “onscreen window” is created in an invisible state, as we don’t want to popup a window that serves no real purpose and just distracts or confuses. Maybe the iToys company broke something wrt. rendering into hidden windows if the 10.15 SDK with which the mex file was build it more recent than the \<= 10.14 macOS it is running on?

-mario

---

<div class="post-metadata">

**Author:** ![mariokleiner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mariokleiner](https://psychtoolbox.discourse.group/u/mariokleiner)\
**Post date:** [December 19, 2020, 11:40pm UTC](https://psychtoolbox.discourse.group/t/new-ptb-macos-mojave-drawtext-plugin-problem/3562/7 "2020-12-19T23:40:11Z")

</div>

Ok, fixed in latest beta release. Needless to say it was another screwup by Apple which we work around now. macOS Catalina is a gift that keeps giving…

The last two weeks alone created a loss of 1000 Euros in unpaid work time spent dealing with Apples screwups after accounting for a user paying for priority support. If not many more labs will start contributing soon by buying our new services, and Apple continues to suck as much as they did the last 10 years, supporting macOS really makes no business sense, except as a gigantic charity act. And i’m getting tired of charity acts. So far the uptake is underwhelming. But lets see what next year brings…
