DMA Sound
ZXNet echo conference «real.speccy»
From Tim Kelly → To All 3 September 1999
The guys from the KGS Association have written a certain amount of software for the subject,
there is a convenient description, recommendations for assembly and configuration. Is it needed here?
The volumes are large enough, I can throw them in small parts, programmatically ;)
[Team Kelly] [I ZX]
Hasta la vista.
Tim Kelly
...Be the rider yourself. Not necessarily on a horse
and wearing a hat with a star, that’s not the main thing.
(c) V.P. Krapivin
... tim_...@mail.ru 500:622/1@zxnet http://www.chat.ru/~tim_kelly
From Eugene Safronov → To All 3 September 1999
Well, recently they sent me some information on Subj, I bring it to your attention.
>=== Kus-kus-kus! (Let's start chewing on the file *DMAINFO1.$W*) ===
░░░░░░░░ Witchcraft ░░░░░
░▒▒▒▒▒▒▒▒░ ░▒▒▒▒▒░░
░▒▓▓▓▓▓▓▓▓▒░ ░ ░ ░▒▓▓▓▓▓▒▒░
░▒▓████████▓▒░ ░▒░ ░▒░ ░▒▓█████▓▓▒░
░▒▓███▓▓███▓▒░▒▓▒░ ░▒▓▒░▒▓███▓▓███▓▒░
░▒▓███▓▒▓███▓▒▓█▓▒░ ░▒▓█▓▒▒▓███▓▒▓███▓▒░
░▒▓███▓▒▓███▓▒▓██▓▒░▒▓ ██▓▒▓███▓▒▒▓███▓▒░
░▒▓███▓▒▒▓███▓▒▓███▓▒▓█ ██▓▒▓███▓▒▒▒▓███▓▒░
░▒▓███▓▒▒▓███▓▒▓████▓██ ██▓▒▒▓███▓▓▓████▓▒░
░▒▓███▓▒▒▓███▓▒▓███████ ██▓▒▒▓██████▓███▓▒░
░▒▓███▓▒▒▓███▓▒▒▓███▓█▓█ ██▓▒▒▓███▓▓▓▒▓███▓▒░
░▓▓███▓▓▓███▓▒░▒▓███▓▓▓█ ██▓▒░▒▓███▓▒▒▓███▓▒░
░▒▓█████████▓▒░ ░▒▓▓▓▒▒▒▓▓▓▒░░▒▓███▓▒▒▓███▓▒░
░▒▓▓▓▓▓▓▓▓▓▒░ ░▒▒▒░░░▒▒▒░ ░▒▓▓▓▒░░▒▓▓▓▒░
░▒▒▒▒▒▒▒▒▒░ ░░░ ░░░ ░▒▒▒░ ░▒▒▒░
░░░░░░░░░ ░░░ ░░░
┌────┐
┌──┐ ┌┘▒▒▒▒│
│▒▒│ ┌─────┐ │▒▒┌──┘┌────┐
┌┴──┤ │▒▒▒▒▒└┐│▒▒└┐ ┌┘▒▒▒▒└┐
│▒▒▒│ │▒▒┌┐▒▒││▒▒▒│ │▒▒┌┐▒▒│
└┐▒▒│ │▒▒││▒▒││▒▒┌┘ │▒▒││▒▒│
│▒▒│ │▒▒││▒▒││▒▒│ │▒▒││▒▒│
┌┘▒▒└┐│▒▒││▒▒││▒▒│ │▒▒└┘▒▒│
│▒▒▒▒││▒▒││▒▒││▒▒│ └┐▒▒▒▒┌┘
└────┘└──┘└──┘└──┘ └────┘
~Sound is the vibrations of the air
that sway our ears and
through them are perceived
by the brain, of course, if you have one.~
Hi, all!
I was prompted to write this article by rumors persistently walking
(wandering) across the expanses of our vast homeland, in particular in
fido. So what is a DMA Ultrasound Card (yes, DMA, not Direct
Sound). Let's start with its sound capabilities:
Number of channels: 4
Bit depth: 8
Reg. level. volume: 0-63(6 bit)
Sampling frequency: up to 3.5 MHz (7MHz with TURBO)
Maximum size of supported memory: 16 MB.
(why not a sound card for SPRINTER?!)
Because. This does not threaten speckies, as standard it is used up to 1MB.
Maximum sample size: 64kb
(because DMA sees pages not of 16 kB, like Z80, but of 64 kB!)
In general, the length of the sample is not limited, it is simply broken
into segments multiples of 64kB.
Programming the card is VERY easy, all you need isinsert into the appropriate ports the number of the bank in which the sample is located, its
address in the bank, length, volume, RATE parameter and allow the operation of the programmable channel. So that they don’t say later that we haven’t given any examples of programming, we present ready-made procedures. So, let's go:
1. Poll for card availability.
TEST xor a ;\
ld bc,#dc77 ; > DMA reset
out (c),a ;/
ld b,#0c ;take a 16-bit port (address register)
ld de,#1234 ;throw
out (c),e ;into
out (c),d ;any number
in a,(c) ;read it from port
cp e
jr nz,noDMA ;compare it with the one thrown
in a,(c)
cp d
jr nz,noDMA ;if not it, then DMA absent
present -------- ;otherwise, enjoy your listening!
noDMA -------- ;everything is clear.
Unlike the test on General Sound, the computer does not hang up.
2. Playback sample
Mode equ #48 ;0th channel, memory reading, without autoloading,
;ki, address increase, easy access by
;query
Rate equ 16 ;sampling frequency in kHz
Bank equ 0 ;0th bank
Address equ 0 ;address in format DMA (i.e. if the sample is
;in the 16th page of the computer, then for DMA there will be
;address-#0000, at 17-#8000, etc. to #ffff)
Len equ #2000 ;sample length 8kB
Volume equ 63 ;volume 0-63
Mask equ 0 ;mask for channel
PLAYER ld bc,#8c77 ;set general
sub a ;mode (one time
out (c),a ;after reset).
ld b,#fd ;set the mode of the first
ld a,#34 ;channel of the first timer (also one
out (c),a ;time after reset).
ld b,#3d ;set
ld de,3500/Rate;frequency
out (c),e ;samples
out (c),d ;for sample.
ld b,#bc ;will program the mode
ld a,Mode ;channel
out (c),a ;DMA.
ld a,Bank ;will program the bank
ld b,#07 ;DMA for
out (c),a ;the first channel.
ld hl,Adres ;set
ld b,#0c ;initial
out (c),l ;address
out (c),h ;sample.
ld hl,Len ;length
ld b,#1c
out (c),l ;sample.
out (c),h
ld a,Volume ;set
ld b,#3f ;volume
out (c),a ;sounds.
ld a,Mask ;allow
ld b,#ac ;work
out (c),a ;of the first channel.
ret
Now you can do whatever you wantyou want, and sample will
play on the background until it plays all 8kB. You can loop
playback, you just need to set 4 bits in the Mode byte.
The parameters of this player set that the sample is loaded at
address #c000 page #10.
Most often questions (disputes) arise about the sampling frequency
(RATE), I will explain in detail: m\s 8237A (8237A-4, 8237A-5, analogue -
1810VT37) operates, according to the scheme, with a maximum sampling frequency
3.5MHz (7MHz some modifications with TURBO), finding such
application in the field of sound is very difficult, because maximum
sampling frequency .wav 48KHz. Therefore, in all characteristics related to sound, 48KHz is written. I hope this issue has been sorted out.
The operating principle is based on direct memory access (Direct Memory Access - DMA). In addition to its sound capabilities, the device can be used as an accelerator for operations with blocks, because 8237
has a command similar to ldir which executes 2 times (4
times at 7MHz) faster than the Z80. Hence the following benefits:
1) transfer of a memory-to-memory block;
2) filling the address space with a byte.
Because y 8237 page size 64kb, it becomes possible to transfer data for Z80 operation without problems with pages.
Sending a block is possible if there are 2 free
channels. INIn addition to the 8237, the device uses two 8253 timers (8254, analogue - 580vi53). Each timer has 3 channels, 6 in total, 4 of which are assigned to audio channels. The programmer can use the remaining 2 channels at its discretion to obtain interruptions of 30...150 Hz.
If you change the sampling frequency, you can programmatically set any computer speed (50%...100% speed), i.e. you can get
any INT. I saw demo ADRINALIZ with a speed of 60% of the nominal speed - cool!!!
.mod playback is carried out by interruptions, real time
y processor DMA Sound Card takes 1000 cycles per INT (9000 at peak).
When using the device as With the accelerator you can write a scroll of the entire screen for INT +25000 cycles of the processor freely, and with a 8237 scroll+ multicolor of the entire screen + 10000 clock cycles of the processor freely. Another possibility of the DMA Ultrasound Card is
playing .wav files from a screw in real time with CD quality,
stereo 44 kHz, unlimited length. Well, listen. mod and
at the same time work with VG93 without any problems at all.
Somehow the thought flashed in the echo that ~... the author doesn’t
know about the graph sopp...~, it would be more correct not to graph sopp, but an axel for working with
blocks. And in general, who else but the author knows about this.
Because .wav playback is carried out by interruptions and there is an
opportunity to receiveinterruptions at different frequencies, then you can
play the sound in a format similar to MPEG, fortunately you have enough free time for unpacking (theoretical developments are already underway).
Now about the issue with the card slowing down the processor: if only was
.wav with a sampling frequency of 1.75 MHz, then it would slow down the percentage by 50% when playing. Those who are at least a little familiar with arithmetic
can estimate how long it will take for a person to play .wav
48 kHz (approximately 3-5%). The idea of increasing the clock speed of DMA to 12-14 MHz flashed.
Firstly: DMA is a sound card, and then there are its auxiliary functions;
Secondly: all this will significantly affect the price;
Thirdly: scope for There are a lot of experiments, but what you get will no longer be a DMA Sound Card.
A 7 MHz clock is quite sufficient and the sheep are safe and the wolves are well fed. The only improvement that can be welcomed is the connection of the ~slave~ PDP 8237 controller, with the aim of increasing the number of channels to 7 (4-sound and 3 for servicing peripheral devices as on the PC).
As for the emulation of the general, sound drive, ay - This is possible both in hardware and software. Someone suggested
add a z80 or similar processor to your memory card, etc.
I’ll answer right away: nothing good will come of it, we’ll have some kind of
symbiosis of general sound with directaccess to your own memory. It seems to me that this is pointless (has anyone seen the Sound
Blaster + Pentium III on the pussie?), because the workload of the process will be no more than
10-15%. There can be no talk of cheapness in relation to the GS after such a modification, because... The processor will pull with it both ROM and additional logic. The biggest advantage of this card is its independence
from ROM, unlike the general sound, I have no doubt that the glitches in the general ROM will last until the next millennium.
Now about assembling the card: the circuit is really large, but
there is nothing complicated to repeat. The assembly is carried out
gradually. There is a method for assembling and debugging the card, which describes in great detail how, what and where to solder, where to poke and what to press. All kinds of tests are given. For debugging
you only need a logic probe on one small circuit (the circuit
of which is given there). It is quite possible to assemble a map in 3-4
weeks.
Alexander Kulik once wrote in response to Tim Kelly, saying:~...
I have seen such authors. They sent all sorts of tapes and said that this was their “brainchild”, but in reality...~. I also didn’t immediately believe that the DMA Ultrasound Card played like that until I assembled it
and tested it in action. The sound quality on the DMA Ultrasound Card is not inferior to AWE32 (don’t believe me? You can ask y KGS INC and yAfendi-
kova).
A certain Dmitry Moskaluk wrote: ~...why is there a good
sound card on the spectrum if its price is three times (another stone in the side of GS - author's note) of the computer itself...~. About the cost: the card cost me 15 bucks(!). M\s 8237 costs - 1.50 bucks, m\s 8253
1 buck each, 2 bucks for 8 pieces 572pa1 and logic for the rest, and
polygon.
By the way, as far as I know, there are two cards: one by
Inozemtsev Alexey, the second by HARD from WITCHCRAFT (i.e. me).
Indeed, there is a software base for this card - .mod, .wav players, Digital Studio editor, and about twenty
fully voiced toys. Now a .mod editor and
other software are being written.
Since the DMA Ultrasound Card is not a commercial development (unlike
GS), any information is provided to everyone freely (disinterestedly and free of charge).
You can contact us or the author via fido via Kislyak
Pavel Mikhailovich/PAWEL from Real Software (2:454.11/25).
ANYONE WHO IS INTERESTED IN INFORMATION ON THIS MAP WANTS TO COLLECT IT OR FOR OTHER QUESTIONS WRITE TO:
343581, Ukraine, Donetsk region,
Dzerzhinsk, Kirovo village,
st. Yunosti 16/48
Dmitry Mikhalchenkov.
We express our deep gratitude to Pawel for providingmail.
─────────────────────────────
With respect, Dmitry Mikhalchenkov &
Alexey Inozemtsev.
>=== Yum-yum-yum! (They grabbed the file *DMAINFO1.$W*) ===
In addition to this, there is some more information and software,
if necessary, with the permission of the Moderator/CoModerator, throw it in the echo.
Eugene
_/*E-Mail*/_: s_eu...@chat.ru _/*http*/_://www.chat.ru/~s_eugene
_ICQ_: 41902137 _WM_: 296063254208 [Team VPU 107] [I ZX]
... Momed 14400 is good, but 33600 is even better!
From Musa Khaybullin → To All 7 September 1999
My on-board systems found that on Saturday September 04, 1999 00:08, Tim
Kelly wrote All:
TK> The guys from the KGS Association have written some software
TK> for the subject, there is a convenient description, recommendations for assembly and configuration.
TK> Is it needed here? The volumes are quite large, I can throw in small
TK> parts, programmatically ;)
Go ahead, any work on this topic is interesting to see ;)
Sincerely, Musa Khaybullin.
From Roman Milukov → To All 8 September 1999
Hello, Eugene!
3 Sep 1999 you wrote here:
ES> In addition to this, there is some more information and software,
ES> if necessary, with the permission of the Moderator/CoModerator, throw it in the echo.
We need a diagram!
All the best.
Best regards Roman.
From Tim Kelly → To All 17 September 1999
... tim_...@mail.ru 500:622/1@zxnet http://www.chat.ru/~tim_kelly