Ben Denckla / bdenckla@fas.harvard.edu
December 18, 1994
Introduction
This document covers the audio capabilities of the followingproducts:
"3210 Macs": Apple MacintoshCentris 660AV, Quadra 660AV, Quadra 840AV
"Power Macs":
"AV Power Macs": Apple PowerMacintosh 6100/60AV, 7100/66AV, 8100/80AV
"plain Power Macs": Apple Power Macintosh 6100/60,7100/66, 8100/80
"SI tools": SpectralInnovations' DSP3210/ARTA Developer Toolkit
"SI board": Spectral Innovations' AT&T3210-based, ARTA-compliant NuBus card
"ARTA Macs": 3210 Macs & any Apple Macintosh with theSI board
Many of the capabilities addressed are relevant only to hardwareor software developers, but some may be of interest to end users as well.Please write me with any additions to or comments about this document.
Table of Contents
Overview
Tapping the Serial Digital Audio Data
ARTA Macs
Power Macs
Overview
Cost
Documentation
Software
Assembler
BugLite
Zounds
Extending thetools
3210 Macs & Power Macs --Audio Specifications
Sound input and output is via stereo mini type jacks. Analog todigital and digital to analog conversion is accomplished by a chipconforming to the IT&T ASCO 2300 Audio-Stereo Codec Specification.The chip in the 3210s is called"Singer"; in the Power Macs a slightly different chipcalled "AWAC" (Audio Waveform Amplifier and Converter)is used. The specifications are listed below.
input: 8 k[[Omega]] impedance, 2 Vrms maximum, 82 dBSNR
output: 37 [[Omega]] impedance, 0.9 Vrms maximum, 85 dB SNR
frequency response: 20Hz -- 20KHz +/- 2dB.
total harmonic distortion and noise < 0.05% 20Hz-- 20KHz with a 1 Vrms sine wave input. (5: 38, 8: 46)
The 3210s support sampling rates of 22.05, 24, 44.1, and 48 KHz.The Power Macs support sample rates of 22.05 and 44.1 KHz (8: 9, Wang).As the figures above show, the computers' audio quality is very good, but not equal to most professional digitalaudio equipment. But the fact that better equipmentexists does not invalidate these Macs as serious audio tools. Much of whatpasses for professionalism in the audio industry is actually obsession overtrivial details of sound quality fueled by anxiety about the revolution inmusic production that is being brought about by the increasing quality of consumer audio electronicssuch as these computers.
Sound quality should become a primary concern only when comparingdevices that have similar capabilities and prices. For example, audiospecs are of prime importance in comparing Sony and Panasonic DAT machines. Similarly, thereader should compare the sound quality of these Macs only to hardware withsimilar capabilities and prices. Also, the intended application should bekept in mind when assessing soundquality. For my own work in experimental live electronic music, theirsound quality is fine, but for CD mastering in a professional recordingstudio, the quality would be unacceptable.
As with any audio device, you can hear the AV's noise floor ifyou really crank up your monitoring system. Interestingly, the noise changeswhen you do things like pull down menus, use the disk, etc. This is nottoo surprising considering all the unshielded lines running around insidethe computer. Actually it's kind ofneat. You can sort of play scales by zipping up and down menus. Be awarethat when recording "beep" sounds, you can get some very hissy results, butthis is not noise from the audio components. I suspect that it is anartifact of bad sample rate conversion or just truncation to 8-bit word length.
A minor point which may be of interest to audiophiles is that the CD audiooutput on the 3210s passes through an extra stage of A/D & D/A (5: 39).The effects of this design can be easily heard by changing the samplingrate from 44.1KHz to 22.05KHz in the Sound Control panel while playing a CD with a lot of high frequencies(cymbals, etc.). The CD audio is not documented at all in the Power MacDeveloper Note (8), but I have been told that this design flaw was fixed inthese models.
3210 Macs & Power Macs --Potential for Digital Audio Interfacing
Digital inputs and outputs would provide an important addition tothese computers' audio capabilities, with transfer to and from DAT being the most importantapplication. The ability to do external A/D and D/A would also beattractive to those persons concerned with the highest possiblefidelity.
At present, the only way to do digital interfacing would be topurchase the SI board or a DigidesignNuBus board/interface box combo. The major problem with this approach isthat you end up paying for extra hardware, and avoiding this kind ofexpense is one of the main reasons for doing audio work on these computers.In addition, this or any NuBus-based solution will not work for the 6100AV, which cannot take a NuBus card.
What I plan to do below is to give some data and suggestions forresearch into finding cheap methodsof doing digital audio interfacing forthese computers. Although what I will saybelow is equally applicable to any digital interface standard, I thinkbuilding an optical-only interface is a silly idea since so few pieces ofequipment need this kind of interface. Ideally the interface would haveAES/EBU and/or SP/DIF compatibility.
I see three approaches to digital interfacing for these computers.The first is to build a NuBus card and write a Sound Manager 3.0-compatibledriver for it. This is quite an intimidating task, but I think that it isby no means impossible.
The second approach would be to build a GeoPort device. Apple's documentation repeatedly suggests that an ISDN interface could be builtas a GeoPort device, so why couldn't an AES/EBU interface be a GeoPort device? For one thing, it is unclearwhat the maximum datarate of the GeoPort is. The clock is said to allow up to 920 Kbps (8: 28),which is insufficient to carry raw 16 bit stereo data at 44.1KHz. On theother hand Wang claims that the GeoPort is "in theory capable oftransmitting 4 [Mbps]." In any case, a driver for Sound Manager 3.0 would have to bewritten. Again, this approach seems intimidatingly difficult.
The third approach, and the one which I will most heavily concentrateon, is to build hardware that translates directly to and from AES/EBU orSP/DIF to the computer's own internal serial digital audio data format. No software driver wouldneed to be written if this approach were taken. Morgan Woodson claimsthat, for digital audio output at least, this could be done with a CrystalSemiconductor interface chip and one PAL chip.
Tapping the Serial Digital Audio Data
Access to the computers' serial digital audio output data is possible via the DAV (Digital AudioVideo) connector, which appears on all AV Macs. The DAV connector isinternal to the computer, intended for use by NuBus cards. The DAVconnector allows access to the serial digital audio input data as well, but as far as Iunderstand this access is read-only. This point is not clear in thedocumentation. Even if one could write to this input line, it is unclear how synchronization between the externalsource and the computer would be accomplished. Some hint of how this mightbe accomplished appears in the description of the ATECS (Apple TelecomExternal Clock Synchronizer) chip in the 3210s:
The ATECS is a control chip that can synchronize the DSP and soundsubsystems to an external clock signal received through the Apple Geoportserial port connector. In the absence of an external clock, it generatescrystal-controlled 49.152 MHz timing signals for 48 KHz operation or 45.1584 MHz timing signals for 44.1KHz operation. (5: 16)
The Power Mac documentation (8) makes no reference to such a capability butits GeoPort contains the same serial clock input line as the 3210s. Ingeneral the Power Mac documentation is far more sparse than the 3210documentation, which is very annoying. It is unclear to me what advantage Apple thinks it is gaining by notreleasing detailed technical documentation on its computers.
The 6100AV cannot take a NuBus card because its AV card occupies the PDS which a NuBus adapter wouldrequire. So a standalone, external piece of electronics would have toaccess its DAV connector via a cable. Some ad hoc (and probably inelegant)method would have to be found forgetting the cable out of the computer, like cutting a hole and attaching anew connector to the case or riding on unused pins of an existingconnector.
On all Power Macs, the serial digital audio data signals originate onthe motherboard and appear in the PDS (Processor Direct Slot). The only difference between plain and AVPower Macs is that AV Power Macs have an AV board in their PDS. As far asaudio goes, the only thing the AV boarddoes is physically provide the DAVconnector and connect the appropriate pins of the PDS to the DAV connector. So the DAV connector is notpresent on plain Power Macs but the digital audio signals it containsappear in their PDSs . Unfortunately, the PDS of the 7100 and 8100 is usedfor VRAM, and I imagine that users will frequently fill the 6100s PDS with the NuBus adapter card.
But there may be a way of tapping the PDS on the plain Power Macs withoutoccupying it. I do not think that this presents an electrical problemsince the devices plugged into the PDSs do not use the digital audiosignals. The problem is one of devisinga mechanical way to tap the PDS connector.
The DAV connector is present on the motherboard of the 840AV and onthe NuBus expansion card for the 660AVs, but its physical form and pinoutsare different from the AV Power Mac's DAV connector. Another difference is that the AV Power DAV connector ismeant to be tapped by ribbon cable (8D: 5), whereas the 3210 DAV is meantto be tapped by a special NuBus card. These differences may be quite easyto overcome. "It is possible to design NuBus cards that can access the DAV connectors onboth the [3210 Macs and AV Power Macs]" (8D: 6).
The lack of clarity in the documentation and other difficultiesmentioned above make the design of a digital audio interface a non-trivialundertaking, but, if successful, it would provide an importantcomplementary role to the computers' audio capabilities.
Spectral Innovations' AT&T3210-based, ARTA-compliant NuBus card
This board provides audio capabilities almost identical to those of the3210 Macs. In addition, it has digital I/O, albeit in the somewhatinconvenient format of optical SP/DIF. I suspect that DSP applicationsrunning on it would be somewhat slower than on an 3210 because it has to access main memory via NuBus rather thandirectly.
ARTA (Apple Real Time Architecture) is a realtime operating systemderived in part from AT&T's VCOS (Visible Caching Operating System). ARTA also includes hardwareimplementation guidelines. ARTA Macs contain an AT&T DSP3210 digitalsignal coprocessor,a chip based around a 32-bit floating-point data type. The assembler has aC-like syntax which makes it easier to write in than more traditionalassemblers. On the down side, a difficulty of 3210 assembler programming is that the pipelinedarchitecture leads to latencies which must be carefully considered.
Realtime DSP programming with simultaneous audio input and output can bedone on these Macs. ARTA supports non-realtime DSP processes as well, andcan multitask a mix of the two types. It theoretically supports multipleDSP processors, so two or more 3210s (appearing on SI boards or on a 3210 motherboard) could be usedsimultaneously.
The following is a description of the steps needed to write realtimeDSP programs for ARTA Macs. I include this description because manycomputers' theoretical capabilities are exciting but the exact nature of the stepsneeded to take advantage of these capabilities is what really determinestheir usefulness.
First you will need a 3210 assembler and a few header files. See thesection of James Wang's FAQ entitled "Developing softwarefor the DSP" for more information on how to get these. I think your best bet is to getthe SI tools. A group including myself is presently working to bring out freeware developmenttools for the 3210 including a port of gcc. More information on this canbe found on Eric Kidd's DSP3210 Web page (see "Addresses" section at end ofthis document.) This Web page also contains a lot of other valuable information and URLs having to dowith 3210 Macs.
Apple had a C compiler for the 3210, but Spectral does not distributeit because of its low quality. AT&T does have a good C compiler for the3210 for DOS and Sun, but it has not been ported to the Macintosh.
Your assembler will allow you to compile source files into files with`dspf' resources. These `dspf' resources contain DSP modules, which are bits of 3210 machine code. Inorder to work, DSP modules must be loaded onto the chip and the resultantprocess must be connected to the system's sound input and outputbuffers. You can use the program"BugLite" that comes with the SI tools to do this, butits bug content, like the caloric content of its namesake Bud Lite, may have been reduced but is still significant. I myself started outusing BugLite but eventually wrote my own Think C program to load my DSPcode. An advantage to having the DSP code loaded by your own C programrather than BugLite is that DSP algorithm parameters can be set at (or adjusted during) runtime via keyboard,mouse, or MIDI input. My program framework3210 (which supports onlykeyboard input at present) is freeware and available via ftp (see thesection "Addresses" for URL).
To get a better idea of what actually goes into programming these DSP modules, below Ihave included the key part of the code for a stereo ring modulator using animpulse-excited infinite-Q ringing filter as the carrier. The basicprogramming model for realtime modules is that a module is invoked repeatedly on successive 240-sample chunks ofaudio data and overwrites it with a processed version of the data.
// Get the address of the Left channel All In All Out audiobuffer
GetSectionAddress( r1, LAIAO )
// Get the address of the Right channel All In All Out audio buffer
GetSectionAddress( r4, RAIAO )
// Get the address of the algorithm parameter and memory block
GetSectionAddress( r2, params )
a0 = *r2++ // load y[n-1] into a0
a1 = *r2++ // load y[n-2] into a1
do 239 {
a2 = a0 // store y[n-1] in a2
a0 = -a1 + *r2 * a0 // y[n] = c * y[n-1] - y[n-2]
a1 = a2 // y[n-2] = y[n-1]
// a2 used as scratch: Left = Left * y[0] (y[n] = sin(w*n))
*r1++ = a2 = a0 * *r1
*r4++ = a2 = a0 * *r4 // Right = Right * y[0]
}
r2 = r2 - 4; // make r2 point to y[n-2]'s memory location
// store y[n-2] and then make r2 point to y[n-1]'s memory location
*r2-- = a1 = a1 *r2 = a0 = a0 // store y[n-1]
It appears that ARTA is not part of the Power Mac system software.Nonetheless, Christopher Weare has been able to do realtime DSP on thesemachines, using calls to Standard Sound. Since this is possible, it seemsthat it would be possible to do realtime DSP on any Mac, though Power Macs seem the best candidates due totheir high performance.
An advantage of doing DSP on a Mac's CPU (be it 68K or PowerPC) is that one could choose to write in C orassembler depending on how much speed was needed. Also, only onedevelopment platform is needed: no separate DSP compiler or assembler wouldbe necessary. On the down side, it remains to be seen whether even the PowerPCchip offers the same DSP performance as the 3210. In addition, the designof the 3210s is quite elegant in that it moves DSP tasks off the CPU sothat "normal" processing tasks and background DSP processes do not compete for clockcycles of the CPU.
You need MPW to use many of the SI tools. Unfortunately, plain oldMPW isn't available anymore, so you need to get it from someone with an old versionor buy MPW Pro for about $500. The tools include the assembler, simulator,BugLite graphical DSP module loader, Macsbug D Commands, and Snoopy runtimedebugger. In the following paragraphs, be aware that my criticisms are directed towardsApple, not Spectral Innovations. I am thankful that Spectral bought thetools: otherwise Apple was not going to distribute them at all! The wholeincident makes me want to get a 486(or an SGI Indy), but the problem is that Apple keeps on coming up withproducts that are too brilliant for you to hate them 100%. But you stillhate them a lot for mismanaging things like the ARTA toolkit.
The cost if the SI tools is amazingly prohibitive. I thought my660AV was going to be a real steal for $1820 (Nov. `93) + whatever development tools were needed. Well I had no clue that that"whatever" would be $1315 ($995 for the SI tools + $320 for MPW), 2/3 ofthe price of the computeritself! Now that the computer is 18 months old, discontinued, and eclipsedby Power Macs, the tools are available for $400. The 660AV package made nosense: it did speech generation and recognition (two capabilities that arereally only needed for people with disabilities) right out of the box, but you had to pay $1315 toactually be able to program the thing. If Apple had really cared about the040 Macs, it should have held onto the tools instead of selling them toSpectral and sold them for a reasonable price.
On a related note of screwed-up marketing, consider the fact that TheGeoPort had to be bought separately. Again, we got speechgeneration/recognition right out of the box, but it couldn't do fax/modem.Frankly decibels are the only appropriate unit to measure the ratio of the number of users needing speech functionsto the number who need modem/fax. A clear case of "Gee-whiz! Bells &whistles! Screw the user!" marketing.
Getting back to the price of the toolkit, does the price of such DSPdevelopment software reflect the fact that DSP programming is an esotericactivity, or does it cause DSP programming to remain esoteric? I thought the 660AV was a revolutionin bringing DSP programming onto the personal desktop without additionalhardware.I was wrong, because the cost of the development software shattered theillusion of the bargain.
The documentation comes in two parts. The first is a big stack of 3-holepunched loose-leaf paper, containing about 10 different sections, only twoof which are separated from each other in any manner (you have to huntthrough and separate out the documents). No overall table of contents, not even an overall list of contents.
The second part is a spiral bound, bad photocopy of the AT&TDSP3210 manual. The photocopy is blurry and has at least one page out oforder (the first page of the table of contents, actually). It's unclearwhy they don't just get some from AT&T since AT&T is willing to send outthe real thing for free.
To add insult to injury, a large portion of the documentation isalmost identical to that found in Apple Developer Note #5, which youprobably own anyway if you get the toolkit. But I must admit that thepages marked "Confidential" at a diagonal across them are very endearing: I love thisattitude. (Incidentally, there's nothing on these pages that is ofany interest (much less use) at all.)
Be forewarned that the Spectral's assembler has an undocumentedbug. It miscounts the number of instructions in a "do"block (the instruction set's built-in looping facility) if the block contains lines with more than oneinstruction. For example, lines like "nop; nop; nop"or "3*nop" (an abbreviation for "nop; nop;nop;") cause such miscounting errors. Once you know about this bug, it is only a minor inconvenienceto avoid multi-instruction lines. Watch out for using macros that expandto multiple instructions per line! Thanks to Jeff Boone for pointing thisbug out to me.
Useful tip for first time MPW Shell users: a line reporting an errorin the source file can be "executed" to take you tothat location in the source file.
Although BugLite crashes often, it does so under consistent andnon-critical circumstances. This is annoying, but does not seriouslycompromise its usefulness.
Although one cannot use the sound input and output (mike & speaker) iconsat the same time, you can do realtime processing of sound by hooking up asound input or output by itself and putting the Mac in Playthrough mode(this is done by clicking on "Options" on the "Sound In" part of the Sound Control Panel). This Playthroughmode provides the "phantom" microphone or speaker icon, conceptuallyspeaking.
Sections connected to sound icons in BugLite cannot be connected toother sections. In other words, I had planned to write processing modulesthat could be connected arbitrarily in series, but this appears to beimpossible.
Zounds is a simple stereo sound recording program that comes with thetoolkit. It works, but will crash if you try to open a mono AIFF file withit. This is no big deal, but this should be handled with an error messagedialog, not a crash.
George Warner writes that the AT&T Application Library includes many (about 100?) useful DSP algorithms (FFTs, FIR and IIRfilters) with complete source code. It should sell for about $100. Ithink you would have to call AT&T to find a distributor for this.
Some brilliant system software and hardware design went into the 3210s, andas a result they provide unique audio DSP possibilities for programmers.Though they are no longer produced, they have a fairly wide installed baseso that programs written for them could reach a wide range of users. The Spectral boards provide a viable substitute for the 3210s,and have the advantage of digital audio interfacing. The Power Macs havethe same digital audio hardware as the 3210s, but they lack the 3210 chipand it is not clear whether thePowerPC chip can take its place.
"5": Macintosh Developer NoteNumber 5, Apple Computer, August 1993. Sold by APDA.
"8": Macintosh Developer Note Number 8, AppleComputer, March 1994. Sold by APDA
"8D": the unnumbered developer note on the DAVinterface that is packaged with Developer Note Number 8.
Wang, James, av-faq, v1.5.4 , December 12, 1994.ftp://ftp.csua.berkeley.edu/pub/jwang/av-faq
AT&T DSP3210 Digital Signal Processor Information Manual. Distributedfree by AT&T Microelectronics. 1-800-372-2447
Addresses (in the generalized sense)
Spectral Innovations
San Jose, CA
408-955-0366
macdsp@applelink.apple.com
APDA (Apple Developer's Association):
Cupertino, CA
1-800-282-2732
APDA@applelink.apple.com
URL for Eric Kidd's AT&T DSP3210 site
http://coos.dartmouth.edu/~emk/dsp/
URL for framework3210
ftp://ftp.csjhu.edu/pub/dsp/framework3210/fw3210.sit.hqx
URL for this document
ftp://ftp.csua.berkeley.edu/pub/jwang/av-pmac-audio.rtf
ftp://ftp.csua.berkeley.edu/pub/jwang/
Christopher Weare: weare@galaxy.ucr.edu
Morgan Woodson: morganw@chronos.emu.com
George Warner: warnergt@aloft.att.com