PCI Latency patch
for VIA Chipsets:
Questions and Answers

Copyright (C) 2001, George E. Breese. All Rights Reserved.

Version 0.14 4/20/01

Important notes:

This product could, in a rare case, damage a computer. Use it carefully and at your own risk.

If you have installed a previous version of this driver, uninstall it before installing this version.

All credit for research on this patch is given to the site au-ja! Their page review-kt133a-1.html describes the problem and solution in German.

I wish to thank the staff of www.viahardware.com for promoting my work. They have been supportive of my drivers since I first began creating them.

License: This software is licensed, not sold. The author of this product has granted you a license to use this product, subject to the following conditions. By possessing, using, or attempting to use this product, you assume all liability for its use. You agree never to take legal action, civil or criminal, against its author for any reason. You may redistribute this product in its original form only. You may not charge money for distribution of the product, unless all such charges are remitted to the author immediately upon payment. The author retains ownership of all intellectual properties embodied in this product.

This driver has one known bug. If run on Windows 2000, it will not re-apply the patch when the computer returns from "hibernation".

The v0.11 driver is identical to the v0.10 driver, except that v0.11 resets the PCI bus arbitration to 96 CLKs where v0.10 disabled PCI bus arbitration.

The v0.12 driver is identical to the v0.11 driver, except that v0.12 resets the "Disconnect enable when STPGNT Detected" flag in register 52. This register was first mentioned by 'Wotsupnow' on the viahardware.com forum on 4/18/01.

Tracey-Anne in New Zealand gets special thanks for her contribution to version 0.12 of this driver. At my request, she checked every setting of register 52 and determined which one solved problems with crackling audio on her SoundBlaster Live card.

The v0.14 driver corrects a bug in v0.12. The changes to register 52 should only be performed on Athlon chipsets. The 598 and 691 specifications show different uses for register 52. Thanks to simonv in Holland for reporting the bug.

What is it?

This is a driver for Windows 9X, NT, and 200X. It is intended to stabilize the PCI bus of computers that have certain Via chipsets.

NOTE: This driver does not actually configure PCI latency. It refers to PCI latency because it is the nickname that users have given to the problem.

Do I need it?

If your computer has any of the following symptoms:

AND, if your computer has a VT82C686B chip on its motherboard, along with one of the following chips:

then you might need this driver.

VIA has acknowledged a problem with their VT82C686B controller chip. The VT82C686B is a chip that is responsible for, among other things, controlling the IDE bus. When overloaded by an incorrectly-configured motherboard, the chip can cause corruption and/or lockups. The SoundBlaster LIVE! card seems to make the problem worse.

To confirm that your computer has the correct chipset, try any of the following.

How do I install it?

You should have received this in a .ZIP compressed file. Extract the entire .ZIP file to a suitable location.

If your computer is running Windows 95, 98, 98 Second Edition, or ME, then run SETUP_9X.BAT .

If your computer is running Windows NT 4.0 or 2000, then run SETUP_NT.BAT.

After running the appropriate .BAT file, restart the computer.

How do I know that it is working?

Copy large files to and from multiple hard disks while playing sound files. The files should be at least 100MB in size. If the computer freezes during such activity when this driver is absent, but works when the driver is present, then the driver is working.

What could go wrong with this driver?

Just about anything can go wrong. Your computer may display a "blue screen of death". The computer may become unstable. This driver may not help your computer at all.

A common problem reported by users of the v0.10 driver was distortion of sound coming from SoundBlaster LIVE! cards. This v0.11 version may improve the problem. Please report your findings to the email address at the end of this document.

How do I uninstall it?

The driver can be uninstalled from the Add / Remove Programs section of Control Panel. The driver will be removed immediately, but the PCI bus settings will continue to be in effect until the system is restarted.

If the computer is unstable, the driver can still be removed. Boot the computer in Safe Mode and then use the Add / Remove Programs section of Control Panel to uninstall the driver.

How much memory does this driver use?

This driver uses almost no memory at all. Its only job is to reprogram the chipset one time at startup.

Windows drivers are special programs. They have a special section that only occupies memory while the driver is starting. Nearly all of this driver's program code is located in this special section.

How did you make this driver?

I used notes from the Internet. I stumbled onto a thread of conversation at www.viahardware.com on the subject and became curious. A user finally reported that the au-ja site had a potential solution to the problem. Their site said the only solution was to use WPCREDIT and WPCRSET. I knew that some people, myself included, have problems with those utility programs, so I offered to implement the solution in a friendlier form.

To create the driver files, I used portions of a driver I'd already written. The previous driver speeds up Via-based motherboards by enabling memory interleave.

The source code of this driver is a mix of assembly-language and C++ code. To compile it, I use Microsoft Visual C++ 6.0 and Microsoft's free Windows 2000/ME DDK. My Windows 9X VxD is based upon Microsoft's generic sample VxD, and my NT kernel driver is actually an Visual C++ AppWizard-generated DLL file with some carefully-chosen compiler and linker options.

Will you give us the source code?

I do not wish to share the source code at this time. It is not formatted cleanly, and I may elect to use it in a commercial product later.

But, for technically-inclined people, here is the key portion of the source code. This is the only portion that I consider to be key to this problem.

	//
	// Modify the necessary PCI flags in this Via chipset.
	//
	// In register 0x70, disable PCI Master read caching (bit 2)
	// and Delay Transaction (bit 1).
	//
	u70 = read_pci(0, 0, 0, 0x70, 1);
	u70 &= 0xF9;
	write_pci(0, 0, 0, 0x70, u70, 1);
	//
	// Reset PCI arbitration timeout to 3x32 clocks (set to 96 clocks). I hate to
	// force an entire byte of data into an already-set register, but oh well.
	// The only other bit set is described by Via as "(enable) Fair arbitration
	// between PCI and CPU".
	//
	write_pci(0, 0, 0, 0x75, 0x83, 1);
	//
	// Clear the "Disconnect enable when STPGNT Detected" flag. (v0.12) This
	// solve any problems with sound distortion caused by registers 70 and 75.
	// Thanks to Tracey-Anne in NZ for checking this register bit-by-bit!
	// (v0.14) Thanks to SimonV in Holland for noting that this is not for
	// Pro133's! It is for Athlons only.
	//
	if(bAthlon)
	{
		u52 = read_pci(0, 0, 0, 0x52, 1);
		u52 &= 0x7F;
		write_pci(0, 0, 0, 0x52, u52, 1);
	}
	//
	// All done!
	//

How do I contact you?

If you wish to offer feedback on this driver, send email to feedback@networking.tzo.com . Please note that I do not check this mailbox frequently, and I do not answer questions about installation or use of this driver.