Subject: DMA problem found, PAS driver "ready"
To: None <current-users@netbsd.org>
From: John F. Woods <jfw@jfwhome.funhouse.com>
List: current-users
Date: 08/10/1998 07:45:50
Once I decided on a culprit, it wasn't hard to find evidence pointing
the finger of blame. Watching the front of my computer while playing
a high-speed stereo sample demonstrated that the noise,
stereo-channel-flipping, and DMA halts happened at the same time as
disk activity! I use an Adaptec 1542B controller, and a little
research indicated that it typically holds the ISA bus for 11
microseconds during DMA (releasing for 4); at a sample rate of 88200
samples per second (44100*2 channels), a sample is needed every 11.3
microseconds, which pretty much is doomed by the Adaptec. (I was also
seeing problems at 22050*2 samples per second, but that could be
fussy timing caused by a lack of any FIFO on the ProAudioSpectrum
card, combined with a narrow timing window for DMA (probably something
like "request sample on rising edge of sample clock, play sample on
falling edge of sample clock--OR DIE!").
I changed the AHA driver to set the bus-on/bus-off timing to 4us/12us
(which was Adaptec's recommendation for rotten old streaming tape
hardware), and now 22KHz stereo plays "reliably" on my system (I even
tried an fsck in the background), but 44KHz still locks up (which is a
bit odd, there ought to be a microsecond to spare at full rate). I
plan to verify this explanation by playing a WAV file from disk under
DOS -- my previous "it works under DOS" test was a .MOD player, which
(of course) didn't do any disk I/O. (All I have to do now is find a
two-minute 44.1KHz stereo WAV...)
The latest version of the driver (for anyone who wants to test it now
that it works ;-) is in
ftp://ftp.funhouse.com/pub/pas_native.c
ftp://ftp.funhouse.com/pub/pas_reg.h
ftp://ftp.funhouse.com/pub/pas_var.h
ftp://ftp.funhouse.com/pub/aha.c (if you need it)