Where is the "above" error message from PsychImaging?

Dear Mario and friends
I get the following error a lot. PsychImaging fails when I try to open a window. Usually I clear all and then I’m fine for days. However, the error message doesn’t actually say what the problem it is. It merely says read the error above, yet no error appeared above. I’m pasting the print out. Below it i’m printing my code that called PsychImaging. I use this code every day, so I’d have thought it’s solid. But now I’m not so sure. I flagged the mysterious sentence by “****************”



PTB-INFO: Connection to Psychtoolbox kernel support driver instance #0 (Revision 1) established.
PTB-INFO: Disconnecting from kernel driver instance #0 for detected Intel GPU for safety reasons. setenv(‘PSYCH_ALLOW_DANGEROUS’, ‘1’) to override.

Total of 16000 trials should take about 1600 minutes to run.
:: Your screen resolution is at its native maximum 2560 x 1600. Excellent!
Using default microphone.
PTB-INFO: Using modified PortAudio V19.6.0-devel, revision unknown
PsychPortAudio initialized. Will use CoreAudio for audio.
PTB-INFO: New audio device -1 with handle 0 opened as PortAudio stream:
PTB-INFO: For 1 channels Capture: Audio subsystem is Core Audio, Audio device name is Built-in Microphone
PTB-INFO: Real samplerate 48000.000000 Hz. Input latency 52.666667 msecs, Output latency 0.000000 msecs.
Open and close WaitForSpeech took 1.2 s.
1146: Calling MacDisplaySettings. … Done (2.5 s)
1162: OpenWindow. … Error using Screen
See error message printed above. ****************

Error in PsychImaging (line 2210)
[win, winRect] = Screen(‘OpenWindow’, screenid, clearcolor, winRect, pixelSize,
numbuffers, stereomode, multiSample, imagingMode, specialFlags, clientRect,
fbOverrideRect, vrrParams);

Error in OpenWindow (line 23)

Error in CriticalSpacing (line 1164)

Error in runCrowdingBeta (line 288)

>     function [window,r]=OpenWindow(o)
>     % [window,r]=OpenWindow(o);
>     % Moved this into a subroutine so that we can reuse the same code when we
>     % close and reopen the window to flip the screen horizontally, when we use
>     % a mirror.
>     white=255;
>     % Detect HiDPI mode, e.g. on a Retina display.
>     screenBufferRect=Screen('Rect',o.screen); % What the software sees.
>     screenRect=Screen('Rect',o.screen,1); % What the observer sees.
>     o.hiDPIMultiple=RectWidth(screenRect)/RectWidth(screenBufferRect);
>     if true
>         PsychImaging('PrepareConfiguration');
>         if o.flipScreenHorizontally
>             PsychImaging('AddTask','AllViews','FlipHorizontal');
>         end
>         if o.hiDPIMultiple~=1
>             PsychImaging('AddTask','General','UseRetinaResolution');
>         end
>         % Mario says the virtual frame buffer makes the back buffer more
>         % reliable, for better performance.
>         PsychImaging('AddTask','General','UseVirtualFramebuffer');
>         if o.useFractionOfScreenToDebug==0
>             [window,r]=PsychImaging('OpenWindow',o.screen,white);
>         else
>             screenBufferRect=Screen('Rect',o.screen); % What the software sees.
>             r=round(o.useFractionOfScreenToDebug*screenBufferRect);
>             r=AlignRect(r,screenBufferRect,'right','bottom');
>             [window,r]=PsychImaging('OpenWindow',o.screen,white,r);
>         end        
>     else
>         [window,r]=Screen('OpenWindow',o.screen,white,screenBufferRect);
>     end
>                           model: 'MacBook10,1'
>                 modelDescription: 'MacBook (Retina, 12-inch, 2017)'
>                     manufacturer: 'Apple Inc.'
>                     psychtoolbox: 'Psychtoolbox 3.0.16'
>                           matlab: 'MATLAB 9.6 (R2019a)'
>                           system: 'macOS 10.14.6'
>                         hostName: 'Denis-MacBook'
>                         userName: 'Denis Pelli'
>                       MACAddress: '8c:85:90:c5:2d:4e'
>                        screenMex: 'Screen.mexmaci64 Dec 16 2019'
>                          screens: 0
>                           screen: {[0]}
>                             size: {[2560 1600]}
>                          maxSize: {[2560 1600]}
>                               mm: {[259 161]}
>                   openGLRenderer: {'Intel(R) HD Graphics 615'}
>                     openGLVendor: {'Intel Inc.'}
>                    openGLVersion: {'2.1 INTEL-12.10.17'}
>         psychtoolboxKernelDriver: 'PsychtoolboxKernelDriver 1.1'
>                   drawTextPlugin: 1
>                   psychPortAudio: 1
>                          summary: 'MacBook10,1-macOS-10.14.6-PTB-3.0.16'

I’ve seen similar cryptic messages on my iMac every so often. Perhaps you can run with a higher verbosity setting to see if you can capture the chain of events that led to the error?

Does it make a difference if you use setenv('PSYCH_ALLOW_DANGEROUS', '1')?

Dear Ian

Thx. I’ll try that, and report when the error happens again. it’s not every time.



I would bet you set Screen Verbosity to 0 or similar to suppress any helpful error messages and add a little mystery to the show.

But to reiterate this: Without the PSYCH_ALLOW_DANGEROUS setting, PTB will not use the kernel driver on Intel graphics chips, so many timing precision enhancement and diagnostic measures are disabled. Iff you set PSYCH_ALLOW_DANGEROUS though, and your MacBook breaks, you get to keep both parts :-/ . Life’s full or risks…

Oops. Yes, you’re right. I’ll push verbosity back up.

It’s still dismaying that the error message declares that the error message appears, when it fact it can easily consult the verbosity level to know that it doesn’t. Could we at least add a parenthetical, as follows?

"(provided you have not reduced Screen Verbosity below 1)"

People reporting mysterious problems happening without associated error messages after disabling all error reporting (duh!) has caused enough wasted time at least for myself. I think this is at least the 2nd time you reported the absence of error messages after disabling error messages - or maybe i misremember and it was somebody else making the same mistake twice.

I’ve disabled the ability of user code to suppress that error message in future PTB versions. Whenever error happen which lead to an error abort, PTB does not let you suppress associated error messages. Afaics only one message was the exception, reporting “sync failure”, the most likely error message to see with a correct script.

Problem hopefully solved.

great. thanks.

at some point i would welcome a discuss about how to handle psychtoolbox warnings and errors. the current situation basically reserves the Command Window for Psychtoolbox messages, greatly interfering with its use by the experimenter. Psychtoolbox developers and users have different perspectives, and it would be great to devise a scheme that addresses both perspectives.

thanks for making sure this essential error message gets through.