# WaitBlankTest error

**URL:** <https://psychtoolbox.discourse.group/t/waitblanktest-error/1192>\
**Category:** Uncategorized\
**Created:** [June 29, 2002, 2:21am UTC](https://psychtoolbox.discourse.group/t/waitblanktest-error/1192 "2002-06-29T02:21:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Allen\_Ingling](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Allen\_Ingling](https://psychtoolbox.discourse.group/u/Allen_Ingling)\
**Post date:** [June 29, 2002, 2:21am UTC](https://psychtoolbox.discourse.group/t/waitblanktest-error/1192/1 "2002-06-29T02:21:12Z")

</div>

Here's another error that cropped up; it occurred in both Classic with OS X  
as the boot system and 9.2.2 as the boot. I noticed the report that my  
video driver SetClut doesn't wait for blanking, but the advice to turn it  
off in screen preference lost me.  
  
Chris  
---------   
Chris Chase, Ph.D.  
Associate Professor of Psychology  
Claremont McKenna College  
850 Columbia Ave.  
Claremont, CA 91711  
  
[chris.chase@...](mailto:chris.chase@...)  
909-607-3668  
  
------  
  
WaitBlankingTest  
We time a loop that calls SCREEN WaitBlanking or SetClut. If the loop  
is thus synched to the display blanking, the iteration rate (Hz) of  
our loop will match the official FrameRate.  
  
\*\*\* Screen 0 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ATY,RageM3p29s (.Display\_Rage128 version 1.0f95) in slot ATI  
8 bit dacs. 1024x768 60 Hz.  
Supports: cscGetClutBehavior  
Prefs: SetClutDriverWaitsForBlanking 0.  
1 MaxPriorityForBlankingInterrupt.  
0 SetClutDriverWaitsForBlanking.  
  
WaitBlanking is using blanking interrupt to synch with 60 Hz display:  
 60 Hz: priority 0  
 60 Hz: priority 0.5  
 60 Hz: priority 1  
  
WaitBlanking is using SetClut to synch with 60 Hz display:  
NOTE: SetClutDriverWaitsForBlanking was zero, so this test will probably run  
too fast.  
 30 Hz: priority 0  
 30 Hz: priority 0.5  
 30 Hz: priority 1  
 47 Hz: priority 2  
 47 Hz: priority 7  
  
Directly calling SetClut to synch with 60 Hz display:  
??? Double trouble! An error occurred while restoring screens to report  
another error.  
WaitBlanking can't wait. Your video driver's SetClut doesn't wait for  
blanking, so you need to turn off SCREEN Preference  
WaitBlankingAlwaysCallsSetClut.  
  
Error in ==\> Chase:Applications (Mac OS  
9):MatLab:Toolbox:Psychtoolbox:PsychBasic:SCREEN.mex  
Error in ==\> Chase:Applications (Mac OS  
9):MatLab:Toolbox:Psychtoolbox:PsychBasic:CloseScreen.m  
On line 45 ==\> SCREEN(screenNumber,'Gamma',[0:255]',8);  
  
  
Warning: Ignoring error 1 in attempt to run "CloseScreen.m".  
??? WaitBlanking can't wait. Your video driver's SetClut doesn't wait for  
blanking, so you need to turn off SCREEN Preference  
WaitBlankingAlwaysCallsSetClut.  
  
Error in ==\> Chase:Applications (Mac OS  
9):MatLab:Toolbox:Psychtoolbox:PsychBasic:SCREEN.mex  
Error in ==\> Chase:Applications (Mac OS  
9):MatLab:Toolbox:Psychtoolbox:PsychTests:WaitBlankingTest.m  
On line 170 ==\>   
SCREEN(whichScreen,'Preference','AskSetClutDriverToWaitForBlanking',0); % no  
  
»

---

<div class="post-metadata">

**Author:** ![Allen\_Ingling](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Allen\_Ingling](https://psychtoolbox.discourse.group/u/Allen_Ingling)\
**Post date:** [June 30, 2002, 1:41am UTC](https://psychtoolbox.discourse.group/t/waitblanktest-error/1192/2 "2002-06-30T01:41:07Z")

</div>

> \>\> Here's another error that cropped up; it occurred in both Classic with OS X  
> \>\> as the boot system and 9.2.2 as the boot. I noticed the report that my  
> \>\> video driver SetClut doesn't wait for blanking, but the advice to turn it  
> \>\> off in screen preference lost me.  
> \>\>   
> \>\> Chris  
> \>\> ---------  
> \>\> Chris Chase, Ph.D.  
> \>\> Associate Professor of Psychology  
> \>\> Claremont McKenna College  
> \>\> 850 Columbia Ave.  
> \>\> Claremont, CA 91711  
> \>\>   
> \>\> [chris.chase@...](mailto:chris.chase@...)  
> \>\> 909-607-3668  
> \>\>   
> \>\> ------  
> \>\>   
> \>\> WaitBlankingTest  
> \>\> We time a loop that calls SCREEN WaitBlanking or SetClut. If the loop  
> \>\> is thus synched to the display blanking, the iteration rate (Hz) of  
> \>\> our loop will match the official FrameRate.  
> \>\>   
> \>\> \*\*\* Screen 0 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> \>\> ATY,RageM3p29s (.Display\_Rage128 version 1.0f95) in slot ATI  
> \>\> ...  
> \>\> ??? Double trouble! An error occurred while restoring screens to report  
> \>\> another error.  
> \>\> WaitBlanking can't wait. Your video driver's SetClut doesn't wait for  
> \>\> blanking, so you need to turn off SCREEN Preference  
> \>\> WaitBlankingAlwaysCallsSetClut.  
> \>\>   
> \> ...  
> \>   
> \> dear chris  
> \>   
> \> thanks for the bug report.  
> \>   
> \> 1. the advice it's giving is good, though aimed more at experts than  
> \> typical users. It's saying that it's unacceptable to ask it to wait  
> \> for blanking by calling SetClut when you've declared (via SCREEN  
> \> Preference SetClutWaitsForBlanking) that SetClut doesn't wait. To  
> \> make your request consistent with your assertion, you should set  
> \> SCREEN Preference WaitBlankingAlwaysCallsSetClut to zero. E.g.  
> \> SCREEN(screenNumber,'Preference','WaitBlankingAlwaysCallsSetClut',0);  
> \>   
> \> However, users won't usually want to mess with these parameters. The  
> \> parameters are set up initially in OpenScreen.m. Some test programs  
> \> need to adjust them for their tests, but always restore when they're  
> \> done.  
> \>   
> \> The message indicated that WaitBlankingTest needed work, which I've now done.  
> \>   
> \> 2. I'm enclosing new improved versions of WaitBlankingTest.m and  
> \> SCREEN.mex, with improved handling of that parameter. Hopefully the  
> \> errors are gone.  
> \>   
> \> best  
> \>   
> \> denis

Dear Denis,  
  
These new files fixed the problem. Here's the report run under Classic:  
  
»waitblankingtest  
WaitBlankingTest  
We time a loop that calls SCREEN WaitBlanking or SetClut. If the loop  
is thus synched to the display blanking, the iteration rate (Hz) of  
our loop will match the official FrameRate.  
\*\*\* Chris Chase's Classic Mac OS Compatibility/499, Mac OS 9.2 \*\*\*\*\*\*\*\*\*\*\*  
G3, 500 MHz, memory bus 67 MHz, 44.981 Mflop/s  
Psychtoolbox 2.5, 25 June 2002, Matlab 5.2.1.1421  
No serial port arbitration.  
\*\*\* Screen 0 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
Classic Mac OS Compatibility/499 Macintosh 4A (.Display\_Video\_Apple\_BB200  
version 1)  
8 bit dacs. 1024x768 60 Hz.  
Prefs: SetClutDriverWaitsForBlanking 0.  
 - - - - - - - - - - - - - - - - - - - - - - - - -  
WaitBlanking is using blanking interrupt to synch with 60 Hz display:  
 60 Hz: priority 0  
 55 Hz: priority 0.5  
 - - - - - - - - - - - - - - - - - - - - - - - - -  
WaitBlanking is using SetClut to synch with 60 Hz display:  
NOTE: SetClutDriverWaitsForBlanking was zero, so this test will probably run  
too fast.  
7544 Hz: priority 0  
3191 Hz: priority 0.5  
2363 Hz: priority 1  
1387 Hz: priority 2  
6730 Hz: priority 7  
 - - - - - - - - - - - - - - - - - - - - - - - - -  
Directly calling SetClut to synch with 60 Hz display:  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
»  
  
Thanks.  
  
Chris  
---------   
Chris Chase, Ph.D.  
Associate Professor of Psychology  
Claremont McKenna College  
850 Columbia Ave.  
Claremont, CA 91711  
  
[chris.chase@...](mailto:chris.chase@...)  
909-607-3668
