We investigate an obscure PC parameter that may be responsible for some otherwise 'incurable' soundcard stuttering problems.
Back in SOS December 2002, as part of my 'Bionic PC' collection of BIOS tweaks for better music performance, I mentioned the PCI Latency Timer setting. When a device such as a PCI expansion card gets hold of the PCI buss, this Timer starts counting down, and when it reaches zero it releases the buss to let other devices have their turn. If there are none waiting, it can grab the buss again and continue. The PCI Latency Timer can range in value from zero to 255 clock cycles. When it's set to zero, a device will give up the buss immediately if another device needs it, but as the timer value increases the device will continue using the buss for progressively longer before 'letting go', while other devices wait their turn.
If all devices have high settings they may each have to wait longer before they get a chance to send their own data over the PCI buss, but once they get hold of it they will themselves be able to hang on to it for a longer period. However, if all devices have low settings they tend to swap control more often, sometimes preventing large data bursts, resulting in increased overheads and therefore reduced performance (just as using very small soundcard buffers results in increased CPU overhead). However, system stability may improve because no device has to wait for the buss.
Most of the time the default BIOS Latency Timer setting for PCI devices (usually 32 or 64 clocks) is a compromise that works well, and some motherboards even hardwire a default value rather than let you change it in the BIOS. However, occasionally some PCs exhibit problems that just don't respond to the normal array of procedures, and sometimes they can be traced back to the Latency Timer. Top of the list for musicians are audio and video glitching and stuttering problems, occasional lock-ups when playing sounds, audio distortion, and sometimes even continuous white noise instead of music coming from the output socket. Some people have also suffered inexplicable non-audio problems, such as corruption when copying files between hard drives.
The common factor in all these problems tends to be that there's loads of data travelling to and fro on the PCI buss, and some such problems have eventually been attributed to system devices that ignore the default PCI Latency Timer setting. Instead they use a value specified by their device driver software, a value that may even change from one driver revision to another — which may explain why driver updates can cure some problems but make others worse.
The most common culprits tend to be AGP graphics cards (although AGP is a different type of expansion slot, it still shows up on a scan of PCI devices, and interacts with the PCI buss). Some cards are forced by their manufacturers to a very high setting, and can therefore hog the buss. The setting can be as high as 255 clocks, although some systems round it down to the nearest multiple of eight — in this case, 248.
With many general-purpose applications this won't be noticed, since graphics performance is often of the essence, but when you're trying to record and play back lots of simultaneous audio channels you may run into conflicts. In such cases, reducing the PCI Latency Timer setting of an AGP card to 128 (or less) can sometimes completely cure occasional stuttering problems with other PCI devices, and rarely results in any degradation in video performance. Many Matrox graphic cards have the default setting of a modest 64, whereas several different ATI Radeon and Nvidia cards found in both desktop and laptop PCs have been found to be set at 255. Such trends among manufacturers may explain why some ranges of graphic cards end up being preferred by musicians as being more 'compatible' with audio hardware and software, when a simple change to the PCI Latency Timer might level the playing field a bit.
- I mentioned, in my recent review of Emu's 1820M (see SOS June 2004), that I found the font used for its PatchMix DSP inserts and scribble strips rather difficult to read, and others obviously agree. Emu user 'freideuter' has created a new replacement font that's a tiny 15kb zipped download containing four BMP files. You just copy these into the existing 'Creative Professional\E-MU PatchMix DSP\Skins\Default\images' folder (saving the original ones first, just in case), and then restart PatchMix DSP. In my opinion the new font is a great improvement.
- The handy Miditest 2.2 utility that I mentioned in the PC Notes colums of April 2004 is now up to version 2.6, and since I last looked at it, it has benefited from some useful tweaks. As well as a few bug fixes, Miditest now offers a set of tick boxes to allow you to select what types of MIDI data to include in the test. A brand-new test report has also been implemented, which reveals yet more facts about your MIDI interface. The report even includes details of your MIDI interface's latency and jitter performance, which are extremely welcome.
Various PCI Latency Timer utilities have been written to solve specific Timer-related problems. However, until now I haven't come across an easy-to-use Windows utility that lets you examine and change PCI Latency timings for individual devices. Enter Double Dawg, from SOS Forum contributor Mark Knutson. This free utility runs under Windows 2000 and XP and provides a simple readout of all devices found on the PCI buss, along with their current latency timings.
Non buss-mastering devices and those that are hardwired show up with a zero setting (see the opening screenshot), but you can override the setting of any 'non-zero' device by typing a new value into the adjacent box. Clicking on the 'Set Latency' button makes these new values 'take' immediately, so you can see what effect they have on your soundcard's performance. The settings revert to their original default every time you boot up, so you'll need to run Double Dawg each time to change them, although Mark can also supply Double Dawg Boot-O-Magic to do this automatically, for a modest $10 shareware payment.
I examined the Timer settings for a few soundcards, to get a feel for typical figures. The majority of soundcards seem to adopt the BIOS or motherboard default setting, including Emu's 1820M and Yamaha's SW1000XG, but Echo's Mia and Indigo both have a high forced value of 192, presumably to give them more of a chance against various graphics cards.
My Matrox G450 graphics card also adopts the default setting, unless I set this to 32 or 248, in which case it reverts to 64, presumably to prevent graphic performance degradation at one end and PCI buss hogging at the other. Sometimes values change from one driver update to another — like, for example, Universal Audio's UAD1 DSP card, which temporarily jumped to a forced value of 255 in version 2.0, to compete with a few other soundcards that do the same, but dropped back to the default BIOS value in version 2.1. One RME HDSP Multiface user reported a value of 255, and one MOTU interface user claimed that his interface had a PCI Latency Timer value of zero. If true, that might explain some of the system-specific problems that some PC MOTU users have been having. I've been collating a list of devices that either use the default timer value or force their own value.
If you're using a DSP card, such as Universal Audio's UAD1 or TC's Powercore, alongside your soundcard, you may have to be even more careful about relative timings, since you have two audio devices sharing PCI bandwidth. Depending on what relative proportion of DSP plug-ins and audio tracks you typically have in your songs, you may get more 'balanced' performance by tweaking your soundcard or DSP card PCI Latency Timer.
If you're not having any problems with your audio, don't be tempted to start radically altering every PCI Latency Timer in sight. You may simply make everything worse! However, if you have unexplained glitching that doesn't respond to increasing soundcard buffer sizes, disabling background tasks and setting Windows XP's processor scheduling to 'Background services', Double Dawg may just help you solve your problems.
Some people suggest simply giving most devices a high setting such as 176, to 'open up' the PCI buss for larger data bursts, maximising its bandwidth, and giving the soundcard an even higher setting, of 255. Personally, I prefer to tread far more carefully, since we're trying to balance the PCI buss requirements of the various devices so that none causes drop-outs for another. Some may require a higher priority than others to achieve the best results, so forcing your soundcard to the highest value may prove counterproductive, and may even reduce the stability of your PC. It's difficult to predict the outcome of lots of changes at once, particularly if you have video or gaming requirements, and it's possible to cause data corruption during hard-drive reads and writes with some extreme settings — as well as crashes, allegedly.
The most obvious approach is to identify any device with a latency setting much higher than the rest and try reducing this if it seems sensible. For instance, graphics cards could be reduced from 255 down to 128 or 96 to see if audio stuttering can be cured without affecting graphic performance, while a network device currently set at 128 might be reduced to 32. Running benchmark tests before and after the changes may help to identify performance gains (particularly in disk transfer rates), although in many cases I doubt that you'll measure any difference.
One musician did find that after increasing the overall BIOS setting from 32 to 96 he could reduce his ASIO buffer latency from about 40ms at 44.1kHz right down to 12ms, although I suspect this was probably because another device forced to a higher setting provided less competition. However, I came across more conclusive evidence on a UAD1 forum, where one user who only managed to run two instances of the 1176 LN compressor plug-in without crackles managed to run six after reducing a few PCI Latency timings (soundcard, USB card, Firewire card, and mostly the graphics card, from 248 to 80).
To sum up, this can be a hugely confusing area, even for the expert, since you'll find a different combination of PCI and AGP devices in each PC, and they and their particular driver versions may interact in various ways. Don't assume that tweaking a few Timer values will solve every soundcard problem — it won't. However, if you're having glitches that won't go away, it's another area to investigate that might just pay dividends.
Have you ever wondered what proportion of your hard drives are devoted to Windows, its applications, your audio files, samples, and so on?
I've used utilities in the past that display drive contents as tiny pie charts, but a program called Spacemonger is far more informative. It provides a window showing file contents as rectangles whose size on screen is proportional to their file-size, so you can instantly see what's taking up most of the space. You can make this window any size you like, up to full screen, zoom in and out to view the contents of folders, choose how much detail to display, open or delete files, and change various preferences. It's a single 212Kb file that runs on WIndows 95, 98, and NT (it worked fine for me on XP as well). Best of all, it's freeware.