The Dark Underbelly of PCI

Computer Hardware Alert! This is a somewhat technical article about the device manager in Windows XP and (gasp!) BIOS settings and how they impacted installing an Adaptec Firewire interface. You have been warned!

I had some hardware conflicts installing the card (sleepy yet?) into my (yawn) Athlon 2000+ rig. If you’re still awake…

The Problem

My Athlon 2000+ is my gaming rig, or rather was my gaming rig until my primary notebook computer developed intermittent hard drive failures. So now, the 2000+ is my temporary production machine, except I’ve rather grown to like it now that I have it set up in my upstairs livingroom / studio.

Upon installing the card and attaching my firewire backup drive, I immediately started getting delayed write errors. This is very bad, because it means data is being corrupted by not being written completely back to the device. This leads to hard drive corruption: files no longer open or disappear, the system starts “acting up” as important program files are damaged. Bad bad bad!

The Investigation

A quick search on the net revealed the usual pitter patter of “mine sucks too!” among the hardware forums. It’s apparently a common problem. I was at first suspicious that it was, again, the p.o.s. Via chipset on my motherboard, but three credible courses of action (COA) presented themselves:

  1. Disable the write caching for the drive in the Device Manager
  2. Set PCI Latency to 0
  3. Set the packet size for hard disk data transfers to 1K

COA1 is a matter of choosing “Optimize for Quick Detachment” for the particular drive. This disables write caching, so data is written immediately to the drive. This means you wait longer while saving occurs, but it also means that you can unplug the device quicker because the operating system isn’t spooling data in the background.

In my case, the setting was already set, but I hadn’t rebooted the machine. Rebooting is always a good idea when installing hardware and finishing up with the device driver install. You’re not always prompted to reboot, but you should.

COA2 is something you set in your PC’s BIOS, which is the “Basic Input and Ouput System”. It’s your PC’s primordial hind-brain, performing the most naked and humble of digital functions. You might not have even been aware of it, as modern operating systems like Windows and Linux build on top of it. But rest assured, beneath that shiny GUI throbs a primitive digital computer that still thinks like an 4.77MHz 8088.

The BIOS has, of course, been updated regularly since 1981 to handle new system devices: the plug-in card architecture, for example, has changed several times as newer, faster technologies have been blessed by the industry. As with any evolving system, this has lead to conflicts. The particular conflict that concerned me was the AGP video card versus the PCI bus.

COA2 called for reducing the PCI latency, which is the amount of time any one device can “hog the computer”. There are easily a dozen devices that must share; if any one hogs too much, then another device might starve and throw a fit…or crash. Imagine that there is one dish of mashed potatoes being passed around the dinner table, and the “latency” is the amount of time that each person is allowed to hold and partake of servings. If the latency is half a second, there’s no time for the person to grab a meaningful portion, or even try. If the latency is 10 minutes, then no one else gets to eat. So there’s a balancing that needs to occur for optimum eating pleasure, and you could achieve that by choosing a latency of maybe 15 seconds. But I digress.

Anyway, my computer’s BIOS doesn’t have a lower PCI Latency setting of 32. However, it does have AGP performance settings. AGP is the special data connection used for video cards, which have to process vast amounts of data very quickly, otherwise your games will have slow, sucky frame rates. It’s particularly important in 3D games that use a lot of textures, but I won’t get into that. Anyway, to squeeze that last drop of speed out of the video card, you can set the computer system to let the AGP connection have priority. This means that it probably will stomp over other devices…say the PCI device that is responsible for saving my data back to a firewire hard drive?

The Solution

So long story short, I disabled the performance settings for the AGP slot and the write problems went away.

So the moral of the story is: optimizing for game performance may detract from data i/o performance. If you can afford it, use a dedicated pc for games and keep its # of drives and devices to a minimum.

P.S. I never got around to doing COA#3. It’s specific to your hard drive manufacturer, and I was too lazy to open up the firewire drive enclosure to figure out who it was.