Subject: Re: OSS audio emulation [ossaudio(3)] is still source-incompatible with Linux....
To: Frederick Bruckman <fb@enteract.com>
From: Greg A. Woods <woods@weird.com>
List: tech-userlevel
Date: 05/09/2001 00:21:44
[ On Tuesday, May 8, 2001 at 22:30:34 (-0500), Frederick Bruckman wrote: ]
> Subject: Re: OSS audio emulation [ossaudio(3)] is still source-incompatible  with Linux....
>
> 8-bit... yuck. It does look better in PseudoColor with your patch --

seems there's a bug in the morphic worlds too -- you have to explicitly
set the depth to 8 with the world menu, then "appearance...", then "set
display depth...".  For some reason it defaults to 16.  I don't think it
did that in 2.7, but I've thrown away my 2.7 image....  Morphic things
look pretty flat until you correct the screen depth setting....

> without it, it doesn't make a new color map, and that really doesn't
> leave enough colors for Squeak.

well actually without my patch it does make a new colour map, but only
in the hidden window that the squeak window is "embedded" (that's how
they tricked it so that it can embed in a browser window too).  However
since the squeak window completely obliterates the hidden window you
just end up with the root window colour map in the squeak window because
the window manager never sees you enter any part of the hidden window.

When debugging I actually undid the embedding in the hidden window to
see what was going on....  :-)

> Just for grins, I tried restarting the
> Xserver with "-bpp 8 -cc {0,1,2,3,4,5}", and Squeak won't run if the
> root window is anything but PseudoColor. It does this...
> 
> X Error of failed request:  BadMatch (invalid parameter attributes)
>   Major opcode of failed request:  1 (X_CreateWindow)
>   Serial number of failed request:  8
>   Current serial number in output stream:  14
> 
> both with and without your patch.

I don't quite understand either -- I've got an NCD terminal that's got a
TrueColor visual but I get the same BadMatch when I arrange to have it
selected first.  Same with GrayScale.  I'm not much of an X11 programmer
and I just barely understand some of this colour mapping stuff
(especially at the Xlib level, even with all the books open in front of
me! :-), but I don't see why TrueColor and GrayScale shouldn't work at
8-bits if they work at 16 & 24 & 32 bits....

(my xdpyinfo attached at the end if you're interested....)

Indeed in some/most parts of the Smalltalk side of things there's still
apparently full support for monochrome (i.e. depth < 2), even in the
basic Morph classes.  (I'd really love to do my normal smalltalk
programming on my 1600x1200 paper-white rock-solid mono screen!!!!!)

> Linux evidently has both a /dev/dsp and a /dev/audio, so it's wrong to
> hard-code /dev/dsp anyway. The ideal solution might be for programs to
> respect the value of AUDIODEVICE. [Do as I say, not as I do :-)]

That would make sense!  ;-)

-- 
							Greg A. Woods

+1 416 218-0098      VE3TCP      <gwoods@acm.org>     <woods@robohack.ca>
Planix, Inc. <woods@planix.com>;   Secrets of the Weird <woods@weird.com>

name of display:    worm:0.0
version number:    11.0
vendor string:    Network Computing Devices Inc.
vendor release number:    3003
maximum request size:  65536 bytes
motion buffer size:  0
bitmap unit, bit order, padding:    32, MSBFirst, 32
image byte order:    MSBFirst
number of supported pixmap formats:    2
supported pixmap formats:
    depth 1, bits_per_pixel 1, scanline_pad 32
    depth 8, bits_per_pixel 8, scanline_pad 32
keycode range:    minimum 8, maximum 254
focus:  window 0x240000e, revert to PointerRoot
number of extensions:    9
    DEC-XTRAP
    MIT-SUNDRY-NONSTANDARD
    NCD-SETUP
    NCD-SIE
    SHAPE
    ServerManagementExtension
    XIdle
    XInputExtension
    XTEST
default screen number:    0
number of screens:    1

screen #0:
  dimensions:    1280x1024 pixels (342x273 millimeters)
  resolution:    95x95 dots per inch
  depths (2):    1, 8
  root window id:    0x29
  depth of root window:    8 planes
  number of colormaps:    minimum 1, maximum 1
  default colormap:    0x21
  default number of colormap cells:    256
  preallocated pixels:    black 1, white 0
  options:    backing-store YES, save-unders YES
  largest cursor:    unlimited
  current input event mask:    0xd0001d
    KeyPressMask             ButtonPressMask          ButtonReleaseMask        
    EnterWindowMask          SubstructureRedirectMask PropertyChangeMask       
    ColormapChangeMask       
  number of visuals:    6
  default visual id:  0x22
  visual:
    visual id:    0x22
    class:    PseudoColor
    depth:    8 planes
    available colormap entries:    256
    red, green, blue masks:    0x0, 0x0, 0x0
    significant bits in color specification:    8 bits
  visual:
    visual id:    0x23
    class:    DirectColor
    depth:    8 planes
    available colormap entries:    8 per subfield
    red, green, blue masks:    0x7, 0x38, 0xc0
    significant bits in color specification:    8 bits
  visual:
    visual id:    0x24
    class:    GrayScale
    depth:    8 planes
    available colormap entries:    256
    red, green, blue masks:    0x0, 0x0, 0x0
    significant bits in color specification:    8 bits
  visual:
    visual id:    0x25
    class:    StaticColor
    depth:    8 planes
    available colormap entries:    256
    red, green, blue masks:    0x7, 0x38, 0xc0
    significant bits in color specification:    8 bits
  visual:
    visual id:    0x26
    class:    TrueColor
    depth:    8 planes
    available colormap entries:    8 per subfield
    red, green, blue masks:    0x7, 0x38, 0xc0
    significant bits in color specification:    8 bits
  visual:
    visual id:    0x27
    class:    StaticGray
    depth:    8 planes
    available colormap entries:    256
    red, green, blue masks:    0x0, 0x0, 0x0
    significant bits in color specification:    8 bits