NaN Hz and NearestResolution

Testing the PsychToolbox on his iBook, Frans Cornelissen, discovered and
reported a bug:
> A tiny issue is that "NearestResolution"
> will not correctly find the resolution requested when 'hz' is set to
> anything else but NaN.

A new, fixed, version of NearestResolution is enclosed. It will ignore
frame rate when frame rate information is lacking (ie NaN).

The underlying problem is that at least some built-in LCD screen drivers
(iBook, G4 PowerBook, and probably others) report the frame rate as NaN
Hz for all video modes. (I haven't gone back to check Apple's rules; this
may qualify as a driver bug.) This value is, in turn, reported by SCREEN
'Resolution' and 'Resolutions'. You can always get the actual frame rate
for the current mode by calling FrameRate, which provides the result of
an accurate measurement rather than asking the driver. However, with
these drivers there is no way to find out what frame rate a non-current
mode would run at, except for switching to that mode and measuring it, eg
by calling FrameRate. It is tempting to simply assume that the actual
rate is 60 Hz whenever the returned value is NaN, but I can't think of
any reason that this should always be true.

ResolutionTest will reveal whether your drivers report frame rate or not.

best

denis

p.s.
The new NearestResolution.m is enclosed. It will be incorporated in the
next release of PsychToolbox.


NOTE: denis.pelli@... is my preferred email address. Please use that
address. My "verizon.net" address will go away soon, partly because
Verizon forces me to use that as my return address.