black screen?

hi all

i must be doing something dumb, but i can't seem to get anything other than a black screen. the following complete program runs to completion, but the window is initially blue, and then black the whole time. it ought to be white for at least 1 second.

i'm running MATLAB 7.2.0.283 (R2006a) under Mac OS X 10.4.8 on an iBook. I think i've got the latest "beta" of the Psychtoolbox (updated today), but it might be "stable", since i don't remember any way to find that out. PsychtoolboxVersion returns an empty string.

any advice?

best

denis

t=GetSecs;
window = Screen('OpenWindow',0);
fprintf('%.0f s. window is open\n',GetSecs-t);
Screen('FillRect',window,0);
pause(1);
Screen('FillRect',window,255);
pause(1);
Screen('CloseAll');
fprintf('%.0f s. window is closed\n',GetSecs-t);


PTB-INFO: This is the OpenGL-Psychtoolbox version 3.0.8. Type 'PsychtoolboxVersion' for more detailed version information.
PTB-INFO: Psychtoolbox is licensed to you under terms of the GNU General Public License (GPL). See file 'License.txt' in the
PTB-INFO: Psychtoolbox root folder for a copy of the GPL license.



OpenGL-Extensions are: GL_ARB_transpose_matrix GL_ARB_vertex_program GL_ARB_vertex_blend GL_ARB_window_pos GL_ARB_shader_objects GL_ARB_vertex_shader GL_EXT_multi_draw_arrays GL_EXT_clip_volume_hint GL_EXT_rescale_normal GL_EXT_draw_range_elements GL_EXT_fog_coord GL_APPLE_client_storage GL_APPLE_specular_vector GL_APPLE_transform_hint GL_APPLE_packed_pixels GL_APPLE_fence GL_APPLE_vertex_array_object GL_APPLE_vertex_program_evaluators GL_APPLE_element_array GL_APPLE_flush_render GL_NV_texgen_reflection GL_NV_light_max_exponent GL_IBM_rasterpos_clip GL_SGIS_generate_mipmap GL_ARB_shading_language_100 GL_ARB_imaging GL_ARB_point_parameters GL_ARB_texture_env_crossbar GL_ARB_texture_border_clamp GL_ARB_multitexture GL_ARB_texture_env_add GL_ARB_texture_cube_map GL_ARB_texture_env_dot3 GL_ARB_multisample GL_ARB_texture_env_combine GL_ARB_texture_compression GL_ARB_texture_mirrored_repeat GL_ARB_shadow GL_ARB_depth_texture GL_ARB_shadow_ambient GL_ARB_fragment_program GL_ARB_fragment_shader GL_ARB_occlusion_query GL_ARB_point_sprite GL_ARB_vertex_buffer_object GL_ARB_pixel_buffer_object GL_EXT_compiled_vertex_array GL_EXT_framebuffer_object GL_EXT_texture_rectangle GL_ARB_texture_rectangle GL_EXT_texture_env_add GL_EXT_blend_color GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_texture_lod_bias GL_EXT_abgr GL_EXT_bgra GL_EXT_stencil_wrap GL_EXT_texture_filter_anisotropic GL_EXT_separate_specular_color GL_EXT_secondary_color GL_EXT_blend_func_separate GL_EXT_shadow_funcs GL_EXT_texture_compression_s3tc GL_EXT_texture_compression_dxt1 GL_EXT_blend_equation_separate GL_EXT_texture_mirror_clamp GL_APPLE_ycbcr_422 GL_APPLE_vertex_array_range GL_APPLE_texture_range GL_APPLE_float_pixels GL_ATI_texture_float GL_APPLE_pixel_buffer GL_NV_blend_square GL_NV_fog_distance GL_ATI_texture_mirror_once GL_ATI_text_fragment_shader GL_ATI_blend_equation_separate GL_ATI_blend_weighted_minmax GL_ATI_texture_env_combine3 GL_ATI_separate_stencil GL_SGIS_texture_edge_clamp GL_SGIS_texture_lod GL_SGI_color_matrix



PTB-INFO: OpenGL-Renderer is ATI Technologies Inc. :: ATI Radeon 9600 XT OpenGL Engine :: 1.5 ATI-1.4.18
PTB-INFO: Renderer has 32 MB of VRAM and a maximum 28 MB of texture memory.
PTB-Info: VBL startline = 768 , VBL Endline = 805
PTB-Info: Measured monitor refresh interval from beamposition = 16.601601 ms [60.235156 Hz].
PTB-Info: Measured monitor refresh interval from VBLsync = 16.601128 ms [60.236872 Hz]. (50 valid samples taken, stddev=0.044597 ms.)
PTB-Info: Small deviations between reported values are normal and no reason to worry.
3 s. window is open
5 s. window is closed
>>

Denis Pelli
Professor of Psychology and Neural Science


On Oct 16, 2006, at 7:53 PM, Denis Pelli wrote:

> hi all
>
> i must be doing something dumb, but i can't seem to get anything
> other than a black screen. the following complete program runs to
> completion, but the window is initially blue, and then black the
> whole time. it ought to be white for at least 1 second.
>
> i'm running MATLAB 7.2.0.283 (R2006a) under Mac OS X 10.4.8 on an
> iBook. I think i've got the latest "beta" of the Psychtoolbox
> (updated today), but it might be "stable", since i don't remember
> any way to find that out. PsychtoolboxVersion returns an empty string.
>
> any advice?

Denis,

Since I'm an PTB-3 novice as well, this may be entirely wrong. But I
think that OpenGL takes its RGB inputs as floats between 0 and 1. So
if 0 happens to be black and 255 wraps in some weird way it might
explain your observations.

I'm trying to figure out exactly what the OpenGL imaging model is,
since I'm not entirely comfortable letting it map floats in some way
through a gamma table to produce my stimuli until I understand it
better. OpenGL does appear to have a mode of specifying RGB values
as integers and I think that is true of the gamma table as well.
And OpenGL seems to want to treat gamma correction with the
simplistic power law model of the actual gamma function, something
else that I'm not willing to adopt. On the other hand, the nice
thing about using [0-1] floats is that your representation is
independent of DAC depth. Figuring this out will affect how we port
the calibration routines to OS/X. If anyone out there in
Psychtoolbox-land has got this all figured out, a summary or pointer
to previous forum traffic would be great. (One nice way to provide a
summary, if someone is so moved, would be to add to the Wiki now at
http://psychtoolbox.org and then provide a pointer to that on the
forum.)

Later,

David
when i type PsychtoolboxVersion it produces an empty string.

correction.

i ran PsychtoolboxVersion again, and it's working:

3.0.8 - Flavor: beta - Corresponds to SVN Revision 504
For more info visit:

sorry for the false alarm.

best

denis


Denis Pelli
Professor of Psychology and Neural Science


On Oct 17, 2006, at 1:24 PM, Denis Pelli wrote:

dear keith, david, & mario

thanks!

0. i haven't tried it yet, but i'm confident that FLIP will fix it. thanks.

1. GratingDemo?
formerly, when we opened a window with no special arguments it opened as a WHITE window. in my case it's opening BLACK (on my iBook and my Powerbook). I discovered this by running GratingDemo, and was trying to find the minimal program that exhibited the problem. I suppose that GratingDemo must be ok for other people, but I just get a black screen forever. Shouldn't the window open to white? when i run GratingDemo, and get the black screen forever, i escape by repeatedly hitting command-period, command-zero, and "clear screen". eventually MATLAB notices and i get back to the now-visible command window:

>> GratingDemo
clear screen
clear screen
clear screen
Error in ==> GratingDemo at 77
window = Screen('OpenWindow', whichScreen);

as far as i can tell, there is nothing wrong with GratingDemo per se. The error message (which makes no sense to me) indicates that the problem is occurring in the call to OpenWindow.

if indeed, GratingDemo works for other people, then i suppose I might have an INIT conflict, some other program that is messing up both my iBook and Powerbook. (However, all my OS9 demos run fine under Classic, e.g. GratingDemo.) However, while i do have a lot of cute icons in my menu bar, none are exotic: stuffit's magic menu, RSS, popchar, timbuktu, iSync, ....

Any suggestions?

2. what is the status of PsychtoolboxVersion? The diagnostic text that spews out when i run Screen says
PTB-INFO: ... Type 'PsychtoolboxVersion' for more detailed version information.
however, when i type PsychtoolboxVersion it produces an empty string.

best

denis

Denis Pelli
Professor of Psychology and Neural Science


On Oct 16, 2006, at 9:44 PM, ks@... wrote:
Hi Denis,

On PTB 3, you need to use the "Flip" command to see anything.

keith

On Oct 17, 2006, at 11:23 AM, Mario Kleiner wrote:

The Screen('Flip', window); command is missing to actually show your
stimulus onscreen. In PTB's double-buffered drawing model, all drawing
commands are directed to an offscreen buffer (backbuffer). Executing
'Flip' shows the content of the backbuffer on the display device
(frontbuffer). 'Flip'ping the buffers is meant literally, it happens
in sync with retrace at a sub-microsecond timescale, completely immune
to any kind of timing jitter in the system. Understanding the Flip
command is key to PTB's way of timing stimulus presentations. It not
only guarantees accurate stimulus onset without any tearing, it also
provides stimulus onset timestamps that are more accurate than the
ones you would get via GetSecs().

The mapping of colors to framebuffer content and of framebuffer
content to DAC output values is identical to all old PTB's. Range is
0-255, the hardware gamma tables map the 0-255 range of pixel values
in the framebuffer to the DAC output range of 0-255 (8-Bit DACS),
0-1023 (10-Bit DACS) and so on. OpenGL would also allow float'ing
point specification of color values, which would be an advantage for
some applications, but it is not enabled by default.

Apart from the new 'LoadNormalizedGammaTable' command to load hw
cluts/gamma tables, we also have the old 'LoadCLUT' command as on
OS-9, to keep old code compatible.

best,
-mario

--- In psychtoolbox@yahoogroups.com, David Brainard <brainard@...> wrote:
>
>
> On Oct 16, 2006, at 7:53 PM, Denis Pelli wrote:
>
> > hi all
> >
> > i must be doing something dumb, but i can't seem to get anything
> > other than a black screen. the following complete program runs to
> > completion, but the window is initially blue, and then black the
> > whole time. it ought to be white for at least 1 second.
> >
> > i'm running MATLAB 7.2.0.283 (R2006a) under Mac OS X 10.4.8 on an
> > iBook. I think i've got the latest "beta" of the Psychtoolbox
> > (updated today), but it might be "stable", since i don't remember
> > any way to find that out. PsychtoolboxVersion returns an empty string.
> >
> > any advice?
>
> Denis,
>
> Since I'm an PTB-3 novice as well, this may be entirely wrong. But I
> think that OpenGL takes its RGB inputs as floats between 0 and 1. So
> if 0 happens to be black and 255 wraps in some weird way it might
> explain your observations.
>
> I'm trying to figure out exactly what the OpenGL imaging model is,
> since I'm not entirely comfortable letting it map floats in some way
> through a gamma table to produce my stimuli until I understand it
> better. OpenGL does appear to have a mode of specifying RGB values
> as integers and I think that is true of the gamma table as well.
> And OpenGL seems to want to treat gamma correction with the
> simplistic power law model of the actual gamma function, something
> else that I'm not willing to adopt. On the other hand, the nice
> thing about using [0-1] floats is that your representation is
> independent of DAC depth. Figuring this out will affect how we port
> the calibration routines to OS/X. If anyone out there in
> Psychtoolbox-land has got this all figured out, a summary or pointer
> to previous forum traffic would be great. (One nice way to provide a
> summary, if someone is so moved, would be to add to the Wiki now at
> http://psychtoolbox.org and then provide a pointer to that on the
> forum.)
>
> Later,
>
> David
>



Reg 1:

I think command period and command zero don't have meaning in Matlab 7
anymore. CTRL+C is the abort key on all systems afaik.

The command 'sca' is a shortcut for Screen('CloseAll'), more easy to type.

In Screen('OpenWindow'), PTB starts up with a blue screen or black
screen, depending on the 'VisualDebugLevel' preferece setting to
indicate that the internal tests are running. After the first
Screen('Flip') command, you'll get the background color provided in
the [color] argument of 'OpenWindow', or the default white color.

Don't know why GratingDemo does not work for you, but it looks as if
one of PTB's internal startup tests during OpenWindow fails. The
diagnostic output that would tell you about the cause is suppressed in
that demo by some preference settings at the top of the script.

best,
-mario


--- In psychtoolbox@yahoogroups.com, Denis Pelli <denis.pelli@...> wrote:
>
> dear keith, david, & mario
>
> thanks!
>
> 0. i haven't tried it yet, but i'm confident that FLIP will fix it.
> thanks.
>
> 1. GratingDemo?
> formerly, when we opened a window with no special arguments it opened
> as a WHITE window. in my case it's opening BLACK (on my iBook and my
> Powerbook). I discovered this by running GratingDemo, and was trying
> to find the minimal program that exhibited the problem. I suppose
> that GratingDemo must be ok for other people, but I just get a black
> screen forever. Shouldn't the window open to white? when i run
> GratingDemo, and get the black screen forever, i escape by repeatedly
> hitting command-period, command-zero, and "clear screen". eventually
> MATLAB notices and i get back to the now-visible command window:
>
> >> GratingDemo
> clear screen
> clear screen
> clear screen
> Error in ==> GratingDemo at 77
> window = Screen('OpenWindow', whichScreen);
>
> as far as i can tell, there is nothing wrong with GratingDemo per se.
> The error message (which makes no sense to me) indicates that the
> problem is occurring in the call to OpenWindow.
>
> if indeed, GratingDemo works for other people, then i suppose I might
> have an INIT conflict, some other program that is messing up both my
> iBook and Powerbook. (However, all my OS9 demos run fine under
> Classic, e.g. GratingDemo.) However, while i do have a lot of cute
> icons in my menu bar, none are exotic: stuffit's magic menu, RSS,
> popchar, timbuktu, iSync, ....
>
> Any suggestions?
>
> 2. what is the status of PsychtoolboxVersion? The diagnostic text
> that spews out when i run Screen says
> > PTB-INFO: ... Type 'PsychtoolboxVersion' for more detailed version
> > information.
> however, when i type PsychtoolboxVersion it produces an empty string.
>
> best
>
> denis
>
> Denis Pelli
> Professor of Psychology and Neural Science
> http://psych.nyu.edu/pelli/
>
>
> On Oct 16, 2006, at 9:44 PM, ks@... wrote:
> Hi Denis,
>
> On PTB 3, you need to use the "Flip" command to see anything.
>
> keith
>
> On Oct 17, 2006, at 11:23 AM, Mario Kleiner wrote:
>
> > The Screen('Flip', window); command is missing to actually show your
> > stimulus onscreen. In PTB's double-buffered drawing model, all drawing
> > commands are directed to an offscreen buffer (backbuffer). Executing
> > 'Flip' shows the content of the backbuffer on the display device
> > (frontbuffer). 'Flip'ping the buffers is meant literally, it happens
> > in sync with retrace at a sub-microsecond timescale, completely immune
> > to any kind of timing jitter in the system. Understanding the Flip
> > command is key to PTB's way of timing stimulus presentations. It not
> > only guarantees accurate stimulus onset without any tearing, it also
> > provides stimulus onset timestamps that are more accurate than the
> > ones you would get via GetSecs().
> >
> > The mapping of colors to framebuffer content and of framebuffer
> > content to DAC output values is identical to all old PTB's. Range is
> > 0-255, the hardware gamma tables map the 0-255 range of pixel values
> > in the framebuffer to the DAC output range of 0-255 (8-Bit DACS),
> > 0-1023 (10-Bit DACS) and so on. OpenGL would also allow float'ing
> > point specification of color values, which would be an advantage for
> > some applications, but it is not enabled by default.
> >
> > Apart from the new 'LoadNormalizedGammaTable' command to load hw
> > cluts/gamma tables, we also have the old 'LoadCLUT' command as on
> > OS-9, to keep old code compatible.
> >
> > best,
> > -mario
> >
> > --- In psychtoolbox@yahoogroups.com, David Brainard <brainard@>
> > wrote:
> > >
> > >
> > > On Oct 16, 2006, at 7:53 PM, Denis Pelli wrote:
> > >
> > > > hi all
> > > >
> > > > i must be doing something dumb, but i can't seem to get anything
> > > > other than a black screen. the following complete program runs to
> > > > completion, but the window is initially blue, and then black the
> > > > whole time. it ought to be white for at least 1 second.
> > > >
> > > > i'm running MATLAB 7.2.0.283 (R2006a) under Mac OS X 10.4.8 on an
> > > > iBook. I think i've got the latest "beta" of the Psychtoolbox
> > > > (updated today), but it might be "stable", since i don't remember
> > > > any way to find that out. PsychtoolboxVersion returns an empty
> > string.
> > > >
> > > > any advice?
> > >
> > > Denis,
> > >
> > > Since I'm an PTB-3 novice as well, this may be entirely wrong. But I
> > > think that OpenGL takes its RGB inputs as floats between 0 and 1. So
> > > if 0 happens to be black and 255 wraps in some weird way it might
> > > explain your observations.
> > >
> > > I'm trying to figure out exactly what the OpenGL imaging model is,
> > > since I'm not entirely comfortable letting it map floats in some way
> > > through a gamma table to produce my stimuli until I understand it
> > > better. OpenGL does appear to have a mode of specifying RGB values
> > > as integers and I think that is true of the gamma table as well.
> > > And OpenGL seems to want to treat gamma correction with the
> > > simplistic power law model of the actual gamma function, something
> > > else that I'm not willing to adopt. On the other hand, the nice
> > > thing about using [0-1] floats is that your representation is
> > > independent of DAC depth. Figuring this out will affect how we port
> > > the calibration routines to OS/X. If anyone out there in
> > > Psychtoolbox-land has got this all figured out, a summary or pointer
> > > to previous forum traffic would be great. (One nice way to provide a
> > > summary, if someone is so moved, would be to add to the Wiki now at
> > > http://psychtoolbox.org and then provide a pointer to that on the
> > > forum.)
> > >
> > > Later,
> > >
> > > David
> > >
> >
> >
> >
>