|
 | |  | | Aug31Written by:D. Glen Cardenas Thursday, August 31, 2000 6:00 PM  By default, IDE disk drives transfer data to and from the system using a protocol called "Programmed Input/Output" or PIO. This technique requires the CPU to get into the middle of things by executing commands that shuffle the data to or from RAM and the drive. Thus, the CPU is tied up doing the work of fetching and stuffing. Also, the time overhead involved in putting data in the cache, reading each byte into the CPU, sending it out to the cache again and then routing it to its destination puts a top end to the speed of the transfers.
In typical desktop systems this isn't much of a problem. The system doesn't have much to do during these transfers anyway, so who cares? Even if a user has several applications open at once, seldom is more than one actually doing anything, and during disk I/O, the application will likely be idle anyhow.
Now suppose you have an activity known as "streaming" going on which is pulling lots of data from the drive in real time while the application doing the streaming is simultaneously attempting to process the data as it arrives. Wow! Now we have a problem. The CPU really does have lots to do while data is being transferred and so getting tied up actually DOING the transfers cuts into application processing time.
In all fairness, even at the fastest rate, a disk drive couldn't pump enough data to or from memory fast enough to cause modern high speed CPUs to break into a sweat. Even at this high demand level, there is time to shuffle data, process that data, shuffle it back, service interrupts, update the screen, send a byte to the modem, and so on.
Enter the DAW
Now we have a whole new ball game. Not only is the digital audio application trying to stream data and process in real time, but it needs to stream multiple files for multi-track mixing at the same time and still supply CPU horsepower to real time effects like reverbs and compressors. This forces a limit on the number of tracks in the mix and the number of real time effects that the project can sustain when attempting to perform real time production.
Under this load, even a Pentium 500 will fall short of the goal if it has to worry with PIO along with all of this other processing. If you want to mix more than 6 or 7 tracks using more than a few parametric EQs and one reverb, you will need to free up some major CPU cycles!
The answer is to put the load of data I/O someplace else so the CPU can just go to RAM and expect to find the data already there and process it. This is the idea behind DMA or Direct Memory Access. Using DMA, a system splits the responsibility of data communication among several intelligent sub-systems so each can do a specialized job very well.
DMA may seem like a new idea, but actually it has been around since before the first PC was ever designed. In the PC, sound cards, floppy drives and even SCSI controllers have been using DMA on the ISA bus for a long time. This method requires the ISA chip to referee the DMA transfers between the devices and RAM and thus is called "third party" DMA.
However, the ISA bus is slow. This doesn't bother low-throughput devices like the floppy drive and simple sound cards, but to make DMA effective for high speed disk drives, the ISA bus is useless. The world had to wait for the development of the "local bus" to get the job done. This local bus technology is being implemented today on newer motherboards by the PCI bus.
With PCI, third party DMA is fast enough to become a useful disk access alternative to PIO. Another ability of the PCI bus is the ability for a device connected to it to take control of the bus and perform the transfers without the use of a DMA controller chip. This is referred to as "first party" DMA or more commonly, bus mastering. Using bus mastering, the peripheral device can access system memory the same way as the CPU itself.
Just about everything on the PCI bus (and its offshoot, the AGP connector) can use bus mastering if the designers wish it to. This includes Ethernet controllers, sound cards, Win-modems, display adapters, and so on, although due to little demand for high speed data transfer by these adapters, most of them still stick to PIO. It's important to understand that disk controllers are the bus the master devices on the PCI bus, not the drives themselves. However, for most disk controllers to be operated in bus master mode, they require that the drives themselves at least support multiword DMA mode 2 so the data handshaking controls can be implemented between the drive and the bus mastering controller.
Bus mastering, being an advanced form of DMA, demands very specific motherboard chip set support as well as specific support from the hardware attempting to use it. The operating system must also be able to support it by loading special "bus mastering aware" drivers. This may sound rather complicated, and it is. However, the gain in data transfer speeds and CPU overhead reduction associated with bus mastering is such that there is no way modern digital audio applications could perform acceptably without it.
Luckily, Intel and Windows support it on the board and in the system and most if not all SCSI and IDE controllers can operate using it. Don't think that these manufacturers went through all of this trouble just for us musicians. Be assured, they didn't. This improvement was to facilitate network server applications. However, we can also reap the benefits of this technology.
A Shaky Start
Most all modern SCSI controllers connect to the PCI bus and use bus mastering. This has been SCSI's largest advantage in terms of DAW performance, but that all changed with the advent of IDE's entry into PCI bus mastering. For the record though, from this point on, we will limit the definition of PCI bus mastering to a system whereby the IDE controller transfers data to and from the drive using an enhanced DMA protocol. It is usually referred to as Ultra DMA (or DMA-33/66) or Ultra ATA (UATA or ATA33/66).
In the past, there were a lot of problems getting this to work. The Intel drivers shipped with many motherboards were "behind the curve" in terms of functionality when compared to the Intel drivers installed with Windows. Also, Windows 95 didn't start off supporting bus mastering. Upgrading to 95B was necessary to provide this feature. The same goes for NT4. Service Pack 3 must be installed to provide bus mastering. Many people were tempted, not knowing any better, to install the drivers shipped with the motherboard during setup because, well, they were shipped with the motherboard! It seemed the thing to do.
Unfortunately, these drivers gave poor performance, and sometimes none at all. Even after discovering the mistake and attempting to remove them from Windows, they wouldn't de-install cleanly. This left no alternative but to wipe the drive and re-install Windows and all of the software that came after it. Not fun! As it turns out, just using the native Windows drivers seems the way to go.
There was some early confusion as to which drives would or would not work under bus mastering. In that there are currently 2 types of Ultra DMA in common use, UDMA-33 and UDMA-66, one needs to check the specs. With UDMA-33, this isn't much of an issue any more as almost any disk drive manufactured in the past 2 years is capable of multiword DMA mode 2 or better transfers and thus will run under bus mastering. The same can be said for current motherboards. Most using the Intel 430 FX, HX, VX, TX or 440 FX, LX, EX, BX, GX Pentium chip set will support bus mastering as well as those using the VIA chip set. Naturally, the Intel 810, 820 and 840 chip sets support bus mastering, but this chip set family is plagued with problems in the memory department and so at this point, a DAW using a motherboard with either of these three chip sets is a dicey matter.
Make sure that both the motherboard and disk drive support the newer UDMA-66 if you want this higher performance transfer feature. UDMA-33 will use the same IDE cable between the drive and motherboard as the older PIO system, so if you currently have a newer drive and motherboard but don't use bus mastering, usually all you need to do is go to Windows and switch it on. As mentioned above, UDMA-66 uses a different cable and chip set, so you must make some real effort to upgrade to UDMA-66 from PIO or UDMA-33 even if the drive supports it. If your current motherboard isn't UDMA-66 capable, you can get a separate IDE controller board designed for UDMA-66 which plugs into your PCI bus to get UDMA-66 up and running on your current system.
What is the big deal with the new cable, you ask? As it turns out, the cable is 80 conductor instead of the usual 40 conductor. Both ends still have 40 pin connectors. Huh? Here's the deal. The extra 40 wires are grounds and lie in between the other 40 signal lines acting as shielding. This reduces crosstalk on the lines and enhances reliability. UDMA-66 drives will not function at 66 MB/s without this 80 conductor cable, and will default back down to 33 MB/s if they sense a 40 conductor cable. On the other hand, using an 80 conductor cable on a UDMA-33 drive will likely enhance its performance too, due to the more reliable connection and thus fewer transfer retries.
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.
That Voodoo That You Do
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 unless you are sure the CD player is Ultra DMA compatible.
Tags: | | | | | | | |
|
|