Re: SetEntries doesn't wait for blanking

>Hi,
> I wonder if you can help. I've been out of Mac programming for a while, but
>a number of years ago, I wrote programs to present images for picture
>recognition experiments. Because the images were large and I was using Mac
>IIs,
>I used palette switching to hide the drawing operations, using the
>SetEntries
>system call. This has worked perfectly well on every system I've used. I'm
>currently using a PowerMac 7500 and was, until recently, running System
>7.5.5
>(my university withdrew support for Macs just before MacOS 7.6 came out).
>I've
>recently installled MacOS 8.1 and since then, none of the programs using
>SetEntries have worked properly. It used to be the case that SetEntries was
>synchronised with the vertical blank signal. Now, I can't work out what it's
>doing. The only way I can get my code to behave is if I call SetEntries,
>then wait
>for my vertical blank counter to increment before continuing execution of
>the
>program. If I do the opposite --- wait for a vertical blank, then call
>SetEntries --- I
>observe visible glitches during presentation and erasing of images. I
>tried the
>second strategy first because it seemed logical to me that if SetEntries
>was no
>longer waiting for a vertical blank, switching cluts when a signal had
>occurred
>was a sensible thing to do. However, the way SetEntries appears to be
>working,
>it's almost as if a separate thread or subprocess is being created to do
>the switch
>while the main program continues executing. Can you shed any light on this?
> Apart from intellectual curiosity, I'm concerned about the issue because my
>reseach collaborator has recently moved to a new university (in the US)
>and he
>will be using the software for some studies either on a G4 or an iMac,
>running
>MacOS 9.2. My fear is that the weird behaviour I'm observing is something
>specific to the 7500 or MacOS 8.1 and that if I send him modified code, it
>will
>malfunction on his machine.
> Thanks for any help or advice you can give,
>
>Alan Milne,
>Department of Psychology,
>University of Aberdeen.
>
>p.s. I've run your TimeVideo program on my Mac with the screen set to 8 bits
>640x480 pixels. (I can't paste the results into this message because I'm
>using a
>PC).
>Amongst the results are:
>dontWaitForVBL = 1, delay 127ns per RGB triplet.
>cscSetEntries duration = 0.03 frames
>cscSetEntries suppresses ints. for 0.0 frames.

dear alan

i'm cc-ing to the psychtoolbox forum because others may be interested.

your observation is correct. at some point, and it may have been with
system 8.1, apple changed the default behavior of their buit-in video
drivers to no longer wait for blanking (VBL) which is what they had
always done before. note that this change does not affect third-part
cards, since they have their own drivers, which may or may not wait for
blanking, but don't care what version of the Mac OS you're using.

the good news is that in the most recent system releases apple has
enhanced many of their drivers to support a new call that turns on or off
waiting for blanking. the documentation for this new call is obscure, and
i don't recall the name, off the top of my head. the Psychtoolbox test
program ScreenTest, which corresponds to TimeVideo, but has been
enhanced, includes testing for availability of that call. it ought to be
possible to find the apple tech note on this by searching for "video
driver" "control and status call" and "VBL".

also, SetEntries is a fairly high level call. eventually it results in a
low-level control and status control call to the driver. my videotoolbox
provides glue to make it easy to make that driver call directly. this
will happen more immediately, and may help reduce some of your timing
uncertainty.

or, you might consider switching from C to MATLAB and using the
PsychToolbox which solves all these problems for you, to the extent
possible.

good luck

best

denis


NOTE: denis.pelli@... is my preferred email address. Please use that
address. My "verizon.net" address will go away soon.
> >Hi,
...
> >I used palette switching to hide the drawing operations, using
the
> >SetEntries
> >system call. This has worked perfectly well on every system
I've used. I'm
> >currently using a PowerMac 7500 and was, until recently,
running System
> >7.5.5
...
> >since I installled MacOS 8.1 SetEntries no longer waits for
blanking ...

> >Alan Milne,
> >Department of Psychology,
> >University of Aberdeen.

>dear alan
> ...
>the good news is that in the most recent system releases
apple has
>enhanced many of their drivers to support a new call that turns
on or off
>waiting for blanking. the documentation for this new call is
obscure, and
>i don't recall the name, off the top of my head.
>...
>denis

dear alan

see forum message 582
http://groups.yahoo.com/group/psychtoolbox/message/582

best

denis