From: REEKES@applelink.apple.com (Jim Reekes)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Crippled LC Sound Chip? (was Re: Sound Manager Phooey!)
Date: 8 Oct 92 19:40:09 GMT
Followup-To: comp.sys.mac.programmer
Organization: Apple Computer, Inc.

In article <bernard-061092095702@kashmir.cs.colorado.edu>,
bernard@cs.colorado.edu (Bernie Bernstein) wrote:
> 
> In article <1992Oct5.022712.3448@news.cs.brandeis.edu>,
> dan@chaos.cs.brandeis.edu (Dan Schwarz) wrote:
> > 
> > In article <w=mz_wc@rpi.edu> johnsd2@rpi.edu writes:
> > >I am having a problem with an extension I am writing. This extension
> > >is really a background app (type='appe'), which plays sounds asynchronously
> > >in the background (which sounds are specified with annother program, that
> > >works);
> > ...
> > >This strange freeze happens on a friends LC whenever
> > >the sound is played, even  from an APPL. (but only if its
> > >asynchronously)
> > 
> > Speaking as a programmer who has done some SERIOUS sound manager hacking,
> > I can sympathize with your frustration. Here's what I can tell you:
> > 
> > * the Mac LC uses a crippled version of the Apple Sound Chip. So does the LC II
> > and Classic II, by the way. Major difference is that this chip can only handle
> > monophonic sound output, and cannot support simultaneous sound recording &
> > playback.
> 
> I recently wrote a hack which listens to the sound input device, filling a
> bunch of buffers. It then plays back random buffers while continuing to
> fill or replace the other buffers. Everything is done asynchronously.
> According to the above quote, this is impossible to do on a Mac LC.
> 
> I have been getting email from several LC users who say that the program
> seems to fill the buffers correctly, but nothing is played back. This seems
> to fit with the "crippled chip" theory.
> 
> Is there any gestalt call to see if the current machine has the "crippled
> chip"? I would like my program to continue to work the way it is now on
> most machines, but use a workaround for the crippled machines.

All of this talk about a sound chip being "crippled" is off target.  The
Mac LC was designed to have the sound chip that is does.  It wasn't
crippled.

The Mac LC has Sound Hardware that mimics _some_ of the functionality of
the Apple Sound Chip.  It cannot do stereo.  It only has one FIFO.  This
FIFO is shared by both input and output.  You cannot record and playback
at the same time on a Mac LC because of this.

We've added a Gestalt bit to determine if the machine can do this.  It's
in System 7.1.

/* built-in hardware can play and record simultaneously */
gestaltPlayAndRecord = 6,

For older system releases you can check if the machine can perform stereo.
If this is true, then you should be able to record and playback at the
same time.  Always check for the gestaltPlayAndRecord first, since this
is alway more accurate than the gestaltStereoCapability flag.

-----------------------------------------------------------------------
Jim Reekes, Polterzeitgeist  |     Macintosh Toolbox Engineering
                             |          Sound Manager Expert
Apple Computer, Inc.         | RAll opinions expressed are mine, and do
20525 Mariani Ave. MS: 81-KS |   not necessarily represent those of my
Cupertino, CA 95014          |       employer, Apple Computer Inc.S