Page 7
(Part 3)
SCSI vs. IDE Bus Mastering for DAWs, Part 3
by D. Glen Cardenas and Jose M. Catena
Cont. from Page 6; Back to TOC

 

As one example of the kinds of things that can go wrong, this is an experience Glen, one of this article's authors, had setting up his new DAW.

"When I set up my first DAW system 2 years ago, I picked up one of the new Western Digital 13 gig drives and tried to set it up for bus mastering. When I tried, the stupid thing kept defaulting to DOS mode! Nothing I did helped until a friend suggested I poke around on the WD web site for clues. I hunted for quite some time until I came across an obscure reference to the fact that all of these new drives were being shipped enabled for UDMA-66 by default. If a user wanted to use UDMA-33 instead, they needed to download this little program that will talk to the drive and tell it to switch modes. Fancy that! I downloaded and ran the utility. Within a few moments I had bus mastering running and a benchmark reading of 3.53% CPU usage for streaming transfers and an estimated track count of over 80 tracks of digital audio. I understand that these drives are no longer being shipped with UDMA-66 as the default. I wonder if my letter had anything to do with that!"

To make things a bit more livable, almost all UDMA-66 drives made today will auto-switch between 33 and 66 depending on the abilities of the controller and the cable. Incidents like the one described above are now, hopefully, a thing of the past. After all, drive manufacturers WANT you to buy these new drives regardless of whether or not you can use the enhanced throughput. This way, they only need to make one type of interface for their drives. Again, this isn't to make our lives easier, but theirs.

Another example of things that go "bump in the night" is from a series of posts on the PC-DAW news group where a fellow tried to enable bus mastering in NT4 only to be told by the Microsoft utility he was running that there were no such drives in his system. Between convincing his system that he has the authority to hack the registry and finding drivers that would work, he got it set up but still an air of mystery hangs over his system because it simply didn't follow the rules during set-up. When you have to resort to shaking chicken bones over the tower and smoking chunks of cactus to make things work, you know you're dealing with Windows.

A Drawback to using Bus Mastering  and CD ROMs is that if you put a CD drive on a bus mastering channel, you must be sure it is Ultra DMA compatible. This is a good reason to never put a hard disk from which you will be streaming data and a CD drive (player or recorder) on the same IDE channel.

Bus Mastering and DMA
What is the difference between regular DMA and bus mastering? Plenty! First, let's look at bus mastering again but from a DMA point of view. A bus is a data transport. Bus mastering is a very advanced means of transporting data to and from devices and/or memory using the PCI bus as a conduit. A device that issues read and write operations to memory and/or I/O slave devices is considered the master, although a master device can have slave memory and/or I/O ports available to be accessed by other masters. For example, an Ethernet controller must convey data it receives from over the LAN and must also access data to send over the LAN as a bus master, but acts as a slave when the CPU, acting as a master, programs it to initialize and to specify where it must get and put data. Only one bus master can own, or "drive" the bus at a given instant, and the bus is responsible for arbitrating bus master requests from the various bus master devices. A bus master device will request access to the bus, which is granted immediately providing no other master has it at the moment. If another master device has been granted access, the new one must wait until the first one completes its single or burst transfer, or the bus arbiter times out and yanks the access away in favor of the new requesting master, which ever happens first. If an operation is interrupted by a timeout, it is resumed when that issuing master receives its turn again. The CPU is a bus master device, and is always present. The Intel PIIX family of IDE controllers found in all modern Intel chipsets for the x86 family are bus master devices. The SoundBlaster Live! is a bus master device that accesses main memory through the bus to read samples. There are many peripherals which use bus mastering on the PCI bus to free the CPU from actually doing every transfer, for example, video cards, network cards, SCSI controllers, other storage devices, and so on. Note that bus mastering transfers do not require and therefore do not tie up the DMA channels like normal DMA devices do.

Normal DMA is controlled by a chip. The DMA chip itself is a bus master device. It can be programmed by the CPU to perform transfers from memory to I/O, or I/O to memory (some also allow memory to memory, but is not in the case with the PC, although two DMA channels can be used to do that given some fancy driver footwork). Therefore, the DMA system acts as a bus master to perform the programmed operation while the CPU can be doing something else. The DMA controller sends a signal to the CPU when the transfer is complete. DMA is used to perform transfers without CPU intervention to or from peripherals that don't have bus master capabilities. DMA issues accesses similar to standard bus I/O accesses, but with the addition of handshaking lines DMA_Request and DMA_Acknowledge. These signals are present on the bus for each DMA channel. A slave device must handle these handshaking lines to be able to be operated through DMA. Obviously, this is a much simpler system than having to support all the complex and necessary logic in a bus master device. The main limitations of a DMA capable slave compared with a bus master peripheral, are:

1) The DMA slave is passive. It is the CPU which must specify the transfers to be done. The bus master device can perform transfers by its own initiative without restrictions.

2) DMA can only transfer blocks of contiguous memory content, and only one block for each programmed transaction. The bus masters can access memory or I/O following any pattern without restriction.

3) In the case of the PC, the DMA device can only transfer blocks of up to 64 KBytes, and always on 64 KByte boundaries, which limits its utility. In older PCs, the DMA system could only access the first megabyte of memory. Later it was extended to the first 16 megabytes and currently the DMA device can more often access all memory, but always within 64 KByte boundaries for each operation.

4) DMA is generally slower, although there are new faster modes and burst timing modes achieving considerable throughputs. These modes must be specifically supported by the slaves in order to used them. The original Intel 8237 DMA controller was extremely slow. So slow that disk transfers were more efficiently done by the CPU using PIO mode 4 because DMA would become the bottleneck. In the best theoretical case (that was never meet) it could only transfer 4 MB/s. The reality was more like 1 MB/s.

Go to Page 8 (Part 3); Back to TOC