Subject: Re: audio interrupt implementation
To: None <port-mac68k@NetBSD.ORG>
From: SUNAGAWA Keiki <kei_sun@ba2.so-net.ne.jp>
List: port-mac68k
Date: 05/01/1998 00:58:14
Colin, should I send the message not only via mail-list, but
also directly to you?  Which do you like?

Colin Wood <cwood@ichips.intel.com> wrote:

Colin> Really?  Could you tell me how?  I tried for a month
Colin> and couldn't get anything remotely pleasing out of
Colin> either an EASC or an ASC.  I haven't looked into it
Colin> in a while since I've been busy with work and ADB
Colin> stuff.
>> Uh, it's a loop of copying data into sound buffer and
>> waiting some time, basically.

Colin> Hmmmm....maybe I wasn't waiting long enough :-)

Sorry, I had a fever...

>> I'll attatch test program at the end of this mail.  It
>> can play two sound files simultaneously.

Colin> Cool!

>> I'm using Indigo and Droplet sound file which were
>> extracted System file of MacOS and converted to raw data.

Colin> What did you use to do the conversion?  The sound
Colin> file I was trying was a non-ulaw .au file (which is
Colin> supposed to be raw data), but maybe there is
Colin> something about the format that I don't quite
Colin> understand.

I used SoundMaster to convert them into the SoundEdit
format, IIRC.

>> They may be copyrighted and not be redistributed, though.

Colin> That's alright, I have a copy of both :-)

Colin> Ah!  That's what it does.  Now if I can only figure
Colin> out what all the other bits do.  BTW, bit 0x800
Colin> simply identifies the sound hardware.  The ASC should
Colin> have 0x00, while there are 'B' and 'E' types of EASC
Colin> hardware which have 0x0B and 0x0E in 0x800,
Colin> respectively.

Oh, it's good. I didn't know that since I don't have any
machine which has EASC chip.

>> I didn't find that mode yet, ether.  Areas from 0x000 to
>> 0x1ff and from 0x200 to 0x3ff seems to be treated as left
>> channnel both.

Colin> Hmmm....really?  How strange.  I guess I need to grab
Colin> a pair of headphones so I'll know for sure whether or
Colin> not it's in stereo.  When the onboard speaker mixes
Colin> them together, it's kind of hard to tell.

I checked the test program in all combination of the 4 of
#if-#endif of it, but only headphone plugged.  So I don't
know of the result for speaker.  According to GMFH, SE/30 is
always stereo mode, it may become little clear by testing
the program in it.

Colin> I tried this as well, but I can't seem to get either
Colin> the ASC or the EASC to actually generate an
Colin> interrupt.

>> It's so strange.  Do you mean that VIA2 emulation of RBV
>> is broken?

Colin> No, at least not under MacOS.  However, I have no
Colin> documentation that lists the actual physical address
Colin> of the RBV registers.  The Guide to the Macintosh
Colin> Family Hardware (2nd ed) on lists the symbol names
Colin> for the addresses without giving numerical
Colin> equivalents.  The kernel has some assumed addresses
Colin> for many of the VIA2 emulation registers in the RBV,
Colin> but I'm not absolutely positive.  As it turns out, we
Colin> (NetBSD) don't use most of the stranger VIA2
Colin> registers (like vACR), so I don't think it has
Colin> mattered so far.

Oh, I see.  Hmm, Do the header files of the CodeWarrior or
so solve this situation?  I'll look at it, anyway.

Colin> BTW, have I sent you my C pseudocode for the .Sound
Colin> driver?  If you want it, please let me know.

>> No, I didn't received it.  Would you send me?  I have
>> disassembled one from IIcx or ci's ROM, btw.

Colin> I have it available as a gzipped tar file (both for a
Colin> Q700 and a IIci):

Colin> ftp://www.macbsd.com/pub/NetBSD/contrib/incoming/ender/sound.tar.gz

Colin> Thanks for sending me your code.  I'll have to take a
Colin> look at it this weekend.  Hopefully, my pseudocode
Colin> will be of some use to you.

Thanks.  I'll check it out.

--
SUNAGAWA Keiki <kei_sun@ba2.so-net.ne.jp>
Happy Hacking!