HD recording on XL/XE --------------------- "Making a dream come true?" By Frankenstein I came up with this idea when using the Black Box from CSS and a 40MB SCSI harddisk with my Atari 800XL. After doing some tests on the HD r/w speed I figured it would be possible to have HD recording/playing on our little machine (who needs an Atari Falcon anyway?). It's already possible to play (about) 15kHz samples while loading on a normal 1050 diskdrive. The SIO can be interrupted using a custom display list with many short DLI's. This was done in a demo from the GateKeeper, called 'the miracle'. In this program the SIO is interrupted after every two scanlines, to play a sample. Good for about 7.5 kHz. A miracle it was, when I discovered that it's possible to interrupt the SIO every single scanline, so a sample from 15kHz could be played during a disk read operation. So what? Well, at first I thought this trick could be used to record samples on a harddisk (with help of the Black Box). Wrong! It seems that the Black Box loads complete sectors in one pass without using data transfer interrupts. That is, the processors main loop is used to handle everything. Then I thought, maybe it's possible to re-write the HD I/O routines.... After disassembling the I/O bank from the Black Box O.S., I discovered that I had to less information about the actual data transmission between the computer and the Black Box. I found out that a VIA (6522) was used and started to dig into the working of this chip. Some things were clear, but most things weren't. So, there my dream of harddisk recording ended. Then AlphaSys (Arjan) told me about his new piece of hardware, the 'eight-link'. It's a cable which connects two Atari 8-bitters using the cartridge port. The link can transfer eight bits parallel from one computer to the other. The transfer rate is very high. And now the new idea; why not use one computer for sampling and a second one for harddisk I/O? Using the eight-link and some buffers the dream might come true. Because the sample-cartridge needs the cartridge port, the SLAVE computer must have a second port for the 'eight-link'. According to AlphaSys this is can be done by installing a second PIA on top of the existing one. THE PROJECT ----------- For everybody who's interested, contact me! Let's see what we need.... HOST Computer requirements - Black Box (HD interface) - Harddisk (SCSI) - HOST software SLAVE Computer requirements: - Sample cartridge - Build-in 'eight-link' - SLAVE software HARDWARE -------- The Black Box can be ordered from CSS. The harddisk can be bought from any normal computershop. The sample cartridge can be ordered from ANG Software. AlphaSys is the man behind the 'eight-link', so let's hope he will soon officially release this hardware. SOFTWARE -------- The HOST program can use normal DOS read/write for the harddisk. If it's too slow, we could think about directly accessing HD sectors (which is ofcourse faster). The program must be able to RECIEVE data from the 'eight-link'. The SLAVE program should be able to take samples from a sample cartridge and SEND data to the HOST computer. THE STATIC SOLUTION ------------------- The HOST computer needs time to save the sampled data. Because a sample stream may not be interrupted, we need buffers. SAMPLER -> SLAVE -> LINK -> HOST -> HD | | _________ ________ |Buffer A | |Buffer X| |Buffer B | |________| |Buffer C | |Buffer D | |_________| The sample rate depends on the transfer rate of the 'eight-link' and the Black Box/HD. The highest possible sample rate in kHz is equal to the slowest transfer rate from the Black Box/HD or the 'eight-link'. E.g. when the Black Box can write to the HD with a speed of 10kB per second, but the 'eight-link' can do 20kB in a second, then the highest possible sample rate is 10kHz (using 4-bits samples!). PS: A second idea is to use the SLAVE computer as special mouse handling hardware. :-) THE DYNAMIC SOLUTION -------------------- After showing my ideas to AlphaSys, he came up with the idea of using two buffers on the SLAVE computer side and one buffer on the HOST side. This appears to be a much more dynamic solution. SAMPLER -> SLAVE -> LINK -> HOST -> HD | | ________ ________ |Buffer A| |Buffer X| |Buffer B| |________| |________| The highest sample rate doesn't have to be equal to the slowest tranfer rate anymore. It now depends on the average rate of the 'eight-link' and the HD-write operation. The formula (dynamic recording): Link-Speed * HD-Speed Sample-Speed = --------------------- Link-Speed + HD-Speed E.g. the 'eight-link' can do 20kB in one second, but the HD-write does 5kB in one second.... 20 * 5 Sample-Speed = ------ = 4 KB/sec. 20 + 5 This corresponds with a sample rate of 8 kHz (using 4-bit samples). EIGHT-LINK SPEED ---------------- Since I don't own an "Eight-Link" yet, I had to rely on information from AlphaSys. At first he was a little too optimistic about the transfer rate. We can now say that the maximum speed will be about 30kB per second. HARD DRIVE SPEED ---------------- I've tested the speed of some HD equiped XL/XE systems. They were all using the Black Box. The owners of the systems are: Mega Magazine, Beco Tel, ANG-Software and Louis (ANG BBS). HD System Write Read ------------ ----------- ------------ Mega 40MB 5.8 kB/sec. 19.7 kB/sec. Beco 20MB 5.8 kB/sec. 12.8 kB/sec. Beco 140MB 5.6 kB/sec. 12.8 kB/sec. ANG 20MB 5.8 kB/sec. 14.9 kB/sec. Louis 40MB 5.8 kB/sec. 13.9 kB/sec. PSEUDO CODE ----------- Finally I'll supply the pseudo-code for both methods (Static and Dynamic). The static method is merely included to show the basic idea. The dynamic method can be achieved by using a timer interrupt for sampling, while the main loop is used to send buffer data to the host computer. ************************************** * SLAVE PROGRAM (STATIC) * ************************************** Buffer A = BUFSIZE Buffer B = BUFSIZE Buffer C = BUFSIZE Buffer D = BUFSIZE IF HOST <> 'OK' THEN END SAMPLE in Buffer A, until it's full. SAMPLE in Buffer B, until it's full. WHILE HOST = 'OK' SAMPLE in Buffer C, until it's full. in the meantime SEND Buffer A + B to the HOST. SAMPLE in Buffer D, until it's full. (during this time, the HOST should save Buffer A + B to disk) SAMPLE in Buffer A, until it's full. in the meantime SEND Buffer C + D to the HOST. SAMPLE in Buffer B, until it's full. (during this time, the HOST should save Buffer C + D to disk) WEND END ************************************** * HOST PROGRAM (STATIC) * ************************************** Buffer X = BUFSIZE * 2 BLOCKS = 100 OPEN HD output file SEND 'OK' to SLAVE FOR i = 1 to BLOCKS RECIEVE Buffer X (A + B) from SLAVE WRITE Buffer X (A + B) to HD RECEIVE Buffer X (C + D) from SLAVE WRITE Buffer X (C + D) to HD NEXT i SEND 'END' to SLAVE CLOSE HD output file END ************************************** * SLAVE PROGRAM (DYNAMIC) * ************************************** ---- MAIN PROGRAM ---- Buffer A = BUFSIZE Buffer B = BUFSIZE STATUS = "REST" SET INTERRUPT ON IF HOST <> 'OK' THEN END STATUS = "Buffer A" WHILE HOST = 'OK' WAIT until STATUS = "REST" STATUS = "Buffer B" SEND Buffer A to HOST WAIT until STATUS = "REST" STATUS = "Buffer A" SEND Buffer B to HOST WEND SET INTERRUPT OFF END ---- INTERRUPT PROGRAM ---- IF STATUS <> "REST" IF STATUS = "Buffer A" SAMPLE in Buffer A IF Buffer A is full STATUS := "REST" ENDIF ENDIF IF STATUS = "Buffer B" SAMPLE in Buffer B IF Buffer B is full STATUS := "REST" ENDIF ENDIF ENDIF ************************************** * HOST PROGRAM (DYNAMIC) * ************************************** Buffer X = BUFSIZE BLOCKS = 100 OPEN HD output file SEND 'OK' to SLAVE FOR i = 1 to BLOCKS RECEIVE Buffer X (A) from SLAVE WRITE Buffer X (A) to HD RECEIVE Buffer X (B) from SLAVE WRITE Buffer X (B) to HD NEXT i CLOSE HD output file END