From: Steve Bollinger <buzz@apple.com>
Subject: Re: Stereo sound problem (?) on mac games
X-Useragent: Nuntius v1.1.1d20
X-Xxdate: Mon, 19 Apr 93 19:34:37 GMT
X-Xxmessage-Id: <A7F83ECD5E013847@pyd.apple.com>
Organization: Apple Computer, Inc.
Lines: 192

In article <1qsfak$skc@network.ucsd.edu> Doug P. Book,
dpb@sdchemw2.ucsd.edu writes:
>Hi.  I think I have a problem with the stereo sound output on my Quadra
>900, but I am not totally sure because my roomate has the same problem
>on his PowerBook 170.  Any info or experience anyopne has would be
>greatly appreciated.
>
>When I hook my Quadra up to my home stereo system, the following types
>of sounds (mono, as far as I can tell) all play fine through BOTH
>speakers:
>
>system beeps  (already provided ones such as Indigo and ones I record)
>
>Armor Alley
>Spectre
>Spaceward Ho!
>
>
>But, the following games only play out of the left channel:
>
>Lemmings
>Out of This World  (awesome game, BTW)
>Glider 4.0
>OIDS
>
>
>But still, STEREO system beeps do play in stereo, through BOTH speakers.
>(The one I'm specifically referrring to is Apocolyptic Beginning, which
>my roommate downloaded from some ftp site (sumex?))
>
>
>All of the symptoms are the same on my rommates 170 (he can't run
>OOTW because he doesn't have color).
>
>We're both running system 7.1
>
>
>
>Does anyone with Lemmings or the other three games I mentioned above get
>sound out of both speakers on a Mac II class, Quadra, LC, PowerBook 140
or
>greater, Centris, SE/30, etc... (stereo) machine?
>
>I used to have a Mac II, and I sort of rememeber Lemmings playing in
>stereo on that machine, not just on the left channel.  (I could be
>mistaken, though.  If there were a problem with the Quad 900's and PB
>170's, I am wondering why the system beeps still play in stereo?  If
there
>isn't a problem with our machines, I wonder why the 4 games above are
>apparantly written to support only one channel of stereo when they
>could just use mono sounds so the mono sound would at least come out of
>both speakers  (like Spectre, etc. do)?
>
>Quadra 900's and PowerBook 170's have the same ROMS (to my knowledge),
>so maybe this is a ROM problem?  (if so, though, why wouldn't System 7.1
>patch over this problem?)
>
>
>
>
>Thanks for any help you can provide!

In article <1993Apr18.213827.9974@kth.se> Jon Wtte,
d88-jwa@hemul.nada.kth.se writes:
>Mac sound hardware is diverse; some macs play in stereo and
>mix the output (the SE/30 for instance) while others play in
>stereo but ONLY has the left channel for the speaker, while
>some are "truly" mono (like the LC)
>
>Developers know that stuff played in the left channel is
>guaranteed to be heard, while the right channel isn't. Some
>send data to both, some only send data to the left channel
>(the first is preferrable, of course)

Okay, I guess its time for a quick explanation of Mac sound.

The original documentation for the sound hardware (IM-3) documents how to
make sound by directly accessing hardware.  Basically, you jam values
into all the even bytes from SoundBase to SoundBase+0x170. This was
because
of how the Mac 128 (and some later machines) generated sound was by
scanning
this block and D/Aing every even byte (the odd bytes went to the floppy on
some machines).

When the Mac II (and Apple Sound Chip) was invented, it was designed to
generate stereo sound. It was also designed to be compatible with we had
once
documented. So storing bytes at the even values at SoundBase meant "I
want to
play a mono sound" and so it was emulated. But Apple had since retracted
the
documentation on SoundBase and decided not to document the lowest layers
of
sound generation. So apple never explained where to stuff bytes if you
want
to make stereo sound.

Enter game developers. The sound driver and current sound manager are
inconveniently lame for making games. Furthermore, people who port from
the
IBM don't want to learn more APIs. So, it has become popular for game
writers to write to SoundBase to make sound, since it is very easy.

Since the Mac II, Apple has had many different kind of sound output
hardware,
and the only things they have in common are that writing to SoundBase
works.
On some hardware, (Mac II, IIx, IIcx, IIci at least), writing to SoundBase
gets you mono sound through both speakers. On some Macs (Quadra
700/900/950
at least) writing to SoundBase gets you mono sound on the left channel
only.
Both are technically correct interpretations of the original
specification,
but one is obviously preferable for asthetic reasons.

If developers use the Sound Manager (and I think the sound driver), mono
sounds will (typically) come out through both channels regardless of the
underlying hardware. It is possible to specify you want to generate left
channel only, but no one does. If developers write to sound base, their
games will only come out the left on some games.

The other problem, the original Mac II only producing left channel sound
on the internal speaker, while the SE/30 mixes both, isn't really related.
It is due to the post generation amplification used on the motherboards of
the different machines. It only affects true stereo sounds. Sounds which
are actually mono, will play on the internal speaker, no matter what
machine
you have.

Now, to more directly address the question, the games you list:
>Lemmings
>Out of This World  (awesome game, BTW)
>Glider 4.0
>OIDS
and also
Hellcats,
Super Tetris
Oxyd
(and many more, these are just what I've tested)

Cheat and write to SoundBase and so are only left channel on Quadras.


Other games you list:
>Armor Alley
>Spectre
>Spaceward Ho!
and also
PGA Tour Golf
Civilization
(and more, these are again only from personal experience)

Use the sound manager and work fine on all machines.

The more of the story is to developers: DON'T CHEAT!
Really, I am absolutely, positively not allowed to do what I am about to
do,
but I'm going say it anyway.
Stop cheating on sound!
Really soon, you will be sorry, as even those without external speakers
will be disappointed with your sound on future hardware. The grace period
is about to end.
The Sound Manager is understandable now, and works pretty well and will
work
even better soon, so use it.

In conclusion:
To Doug, it isn't a hardware problem, at least, not a bug.
To Jon, it isn't a choice to developers as to whether they want to send
sound
to both channels. If they do it the right way, it is taken care of
automatically. If you cheat, there is not way to make it work on all
hardware.


Have fun.

Disclaimer number 1:
I don't work on sound here at Apple, I'm just pretty well informed.
So don't write me with sound questions.

Disclaimer number 2:
If it says up above that I wrote anything like "the grace period is about
to end" then it is a bug in your news feed, since I am catagorically not
allowed to say anything like that. You know what I mean.

Disclaimer number 3:
I don't speak for Apple, just me.

-Steve Bollinger
