USB Controller/Adapter polling rate tweaking

Prerequisites: 

- Any USB game controller, USB adapter for other gaming consoles like Playstation 2 or Gamecube, or halfway decent USB mouse
- Windows XP Service Pack 2 or older or Linux 2.6.12 or newer

Version History:
January 22nd, 2009 - Windows portion of guide written
January 24th, 2009 - Linux portion of guide written
January 25th, 2009 - Addendum created to mention issues with XP SP3
January 28th, 2009 - Guide finalized and published
January 29th, 2009 - Sources updated as main source of Hex information for usbport.sys was confirmed

Disclaimer: This howto is to be done at your own risk as changing the polling rate on some devices may have unforseen side effects.

As somebody who plays both classic games and rhythm games I know that timing is everything on the controller. Many of us know all too well that jumping too early or too late will make us miss the jump completely for games like Megaman. However, unlike the older controllers, USB is not the best solution for gaming as it wasn't designed for it.

USB utilizes a polling rate to capture input from it's devices (measured in hertz) with the default set at 125 hz or 125 refreshes per second. Now while that seems enough to read all movements, the reality is that when comparing that to milliseconds that means that it refreshes every 8 milliseconds which for some games where precise timing is require is unacceptable. For many console adapters this often sticks out like a sore thumb as sometimes button presses are not read at all due to their cheap design. Thankfully, the polling rate can be changed for better response to 250 hz (4 ms), 500 hz (2 ms), and 1,000 hz (1 ms). Many top of the line USB mouse products often make their drivers so that the polling rate of the hardware is changed for better response as a result, but for other products workarounds are required.

With this in mind, for those utilizing Windows XP SP2 here's how to access these polling rates:
1. Find usbport.sys (Ex: C:\WINDOWS\system32\Drivers\usbport.sys)
2. Make a backup of usbport.sys as a precaution. (Ex: usbport.bak)
3. Open usbport.sys in a hex editor
4. Look for hex offset 00015D00 or do a search for the hex string 3C 08 73 09 C6 86 0A 01. (Note: Some people may have 3C 08 73 09 C6 86 02 01 instead of 3C 08 73 09 C6 86 0A 01 do not replace the 0A as doing so will make USB stop working.)
5. Replace the string with one of the following:
Replace the string with either :
- B0 04 73 09 52 8A 0A 01 for 4ms polling
- B0 02 73 09 52 8C 0A 01 for 2ms polling
- B0 01 73 09 52 8A 0A 01 for 1ms polling (Note, cheaper USB mice will not see a speed difference at this point and on cheaper motherboards this may not work at all.)
6. Save the file, restart the computer, and make sure all input devices work at the rate that was chosen.

Note: For those uncomfortable with editing the usbport.sys file I have attached a USB port tweaker program to this tutorial. (Note, I have it named as .rar_.mp3 due to upload limitations, but it's actually a rar file so change the file extension appropriately.)

For Linux, in 2006 the mainline kernel was patched to allow for the USB polling rate to be changed. With that in mind there are two ways to do this. First a parameter can be added to the kernel commandline:
-usbhid.mousepoll=[polling interval] (For polling interval, 250, 500, or 1000 would be entered.)

The second method is when the driver is built as a module in which case the following command would go into either /etc/modprobe.conf or /etc/modules.conf depending on the distribution:
- options usbhid mousepoll=[polling interval]

For those wanting to see a manual example the following command can be used, albeit it will only operate at that speed until the system is restarted:
- modprobe usbhid mousepoll=[polling interval]

Addendum: Due to changes to usbport.sys for Windows XP SP3 the method mentioned above does not work and most solutions available are spotty at best. Also, due to my personal dislike of the OS, I will not cover Windows Vista at this point in time.

Sources:
Raziel for the hex information on usbport.sys (Was posted by him in late 2003 onto a FPS forum that shutdown in early 2006)
www.linux-gamers.net for the Linux information

Reference: