Jump to content



Photo
* * * * * 1 votes

This could be big! (USB polling increase from 125 to 1000 Hz)

USB Windows Input lag

  • Please log in to reply
12 replies to this topic

#1 jimmyfingers

jimmyfingers

    Pinball Fan

  • VIP
  • 832 posts

  • Flag: Canada

  • Favorite Pinball: Comet



Posted 24 September 2014 - 12:39 AM

While working recently on assessing VPs newer (PhysMODv5) physics - mainly the flippers - I came across something that may improve more than just input lag for key flipper shots / tricks but affect the overall interaction throughout the game with flippers that may end up representing more realistically the analog / "real" world of pinball.

 

I was having trouble getting the new "Coil Ramp Up" to have much effect with quick presses with any lower setting, which seemed important to keep some other shots from being too adversely affected.  It couldn't seem to be triggered and released quick enough so I resumed some previous research on some USB limitations that would affect keyboard / mouse responses.

 

Windows Operating Systems lock the USB polling rate to 125 Hz yielding at maximum increments of 8 ms for key press and release events (unless a custom driver has been written for the device as with some gaming mice / keyboards).  This results in less "resolution", if you will, in how one's flipper inputs could influence the pinball / game in VP.  There is a method for Windows XP, Vista, and 7 (seemingly not yet working for 8.x) that allows one to increase the rates beyond 125 and up to 1000 Hz.  It depends ultimately on your USB device though as well and out of 3 keyboards I tested only 1 would operate at the 1000 / 1ms rate but 2 out of the 3 mice I tried were capable.  On my X-Arcade Tankstick that I use for my mini cab, unfortunately the keyboard controller / buttons weren't improvable but the mouse buttons were.  With some switching and modifying some key reassignments from autohotkey (previously to use the mouse buttons as Magna Saves) I was able to use the mouse input with the greater sampling points and achieve some more subtle / varied flipper interaction.

 

I used the software available from the following link / instructions for the initial Windows USB driver modifications and polling rate settings.  Please use at your own risk and I'm writing this / posting this topic just as an FYI for those of you who may not have known about this aspect or thought about it's impact in virtual pinball (i.e. I myself can not take on a long support topic for assisting with cases where it does not work or cause any adverse effects - sorry if that sounds bad but I want to be clear before anyone starts down the path).

 

http://www.overclock...1000hz-or-lower

 

The steps are reasonably simpler / easier for Windows XP, Vista, and 7 32-bit (but also for XP 64-bit) then they are for Vista / Windows 64-bit.  A second piece of software was used as well to gauge the results for the overclocking attempts and would clearly depict in ms the time a key was depressed for (if it was only showing as factors of 8 ms, then no improvement on the 125 Hz had been achieved for that device or there may have been a mistake in the process).

 

http://www.passmark....cts/keytest.htm

 

Here is a screen shot of one component (setup.exe) of the first link / downloads provided from that link and it is the configuration screen after the .inf file has been manually installed:

 

Attached File  USB Overclock Capture 1.PNG   24.85KB   27 downloads

(NOTE: the checkbox for "Mouses only" is cleared so that I can see my keyboard devices; Also, as per the instructions on the first link, you have to make sure you do set "filter" to the device you want to install the patch for and alter the sampling rate - the mouse in the case of the screen shot)

 

The "KeyboardTest" program is useful before even attempting to alter the USB polling rate as it can tell you the lowest times / highest speeds for your keyboard, mouse, or other USB input device (would have to at least be emulating key or mouse button presses) for a press and release.  If you can get 16 ms that can be good for the new "Coil Ramp Up" setting to be set at reasonable levels and trigger a nice flipper tap pass, however, anything that is still using 8 ms as a factor will not help with the general variation one could achieve between initial presses / flipper hits as well as time a key is depressed for (on then off).  The KeyboardTest program needs to be installed (not stand alone) and is only for a 30 day trial so might be best to try out on a spare / development PC first but ultimately would need to be installed on one's cabinet / dedicated VP system to confirm whether any USB tweaks and / or devices are actually registering with greater speed / polling intervals.

 

Here is a screen shot of the keytest program showing attempts for quick key presses (taps) from a keyboard:

 

Attached File  USB Overclock Capture 2.PNG   429.16KB   25 downloads

(NOTE: the field "Depress time" indicates 16 ms which was as quick / low as I could get a quick hit of my left shift key to register and release)

 

After modifying the USB driver, I found that with a Dell keyboard I was not able to reduce the detection below 16 or 24 but could achieve points that were no longer just factors of 8 (i.e. 35, 43, 27, etc.) which in turn would translate to VP getting inputs that would fall outside of being forced into 125 Hz / 8 ms intervals and yield more variation in flipper interaction in the game.  On my X-Arcade tankstick modifying and using the mouse buttons for flippers I could get presses as low as 5 ms and variations from every number between that and up.

 

Here is a screen shot of a Dell mouse I was also able to overclock:

 

Attached File  USB Overclock Capture 3.PNG   430.63KB   28 downloads

(NOTE: the "Depress time" is 35 ms and well between the 8 ms factor values of 32 and 40) 

 

The recent post / video I made regarding the Firewpower BMPR / PhysMODv5 Hybrid Flipper Tricks was made while I had my modified X-Arcade Tankstick in use on my development / video capturing system (http://www.vpforums....=+bmpr +flipper).  However, my unmodified "regular" keyboard encoder buttons from the same device were able to do some of the more demanding tricks as well, mainly the flipper tap passes al beit a bit more time sensitive and demanding - but still makeable.  When I measured the key press times for these regular Tankstick buttons I could get as low as 16 ms.

 

One other important thing to note is that it's going to not just be your USB device / encoder / IPAC timing as your physical switches are going to play a role with this type / level of timing detail.  I have physically modified my Tankstick mouse and 3 / 4 (flipper) buttons with actual leaf switches to achieve better interaction / timing / feel.  Regular switches like the micro / cherry ones will have a somewhat more delayed timing for a press / release combo and at least the quick taps will be tougher to achieve.

 

This USB polling interval overclock should not only affect the latest PhysMOD versions of VP that have the new decoupled physics engine running also at 1000 Hz (a convenient coincidence for USB devices capable of 1000 Hz overclocking) but from my understanding with the current VP9x versions the physics loops were directly tied to the FPS (something that posed problems when FPS got too low) and as such as long as a table is achieving 500-1000 FPS with VP99 / VP9x, then these USB implications will also potentially yield improvements for flipper interaction in all current VP versions.

 

I hope this has been relayed / explained well enough to prove useful for some and better improve the virtual pinball experience.

 

 

 

 



#2 randr

randr

    I'm just a hardware guy so...

  • VIP
  • 2,650 posts
  • Location:Minnesota

  • Flag: United States of America

  • Favorite Pinball: Twilight Zone

Posted 24 September 2014 - 03:36 AM

How about limits on my ps2 ipac? Same deal can it also be overclocked?

randr___pinball.png                         


#3 mpad

mpad

    Enthusiast

  • Members
  • PipPipPip
  • 335 posts

  • Flag: Germany

  • Favorite Pinball: AFM, TOM; Timeshock (!), Secrets of the Deep (fx2)

Posted 24 September 2014 - 05:56 AM

Sounds logig and very well explained. I have a razer gaming mouse (old!) that by specs reaches 1000 Hz with a special driver. Too bad my cab is a win 8.1 machine. Another reason to switch back to win 7 :) Will look into this. If anyone is able to try this with the virtuapin V2 plunger please report your findings.


Edited by mpad, 24 September 2014 - 07:30 AM.


#4 jimmyfingers

jimmyfingers

    Pinball Fan

  • VIP
  • 832 posts

  • Flag: Canada

  • Favorite Pinball: Comet



Posted 24 September 2014 - 11:24 PM

How about limits on my ps2 ipac? Same deal can it also be overclocked?

It has no bearing on any ps2 devices as it is solely a USB / Windows thing.  However, my understanding is that with the PS2 interface / devices, it is interrupt based and actually avoids some of these issues / polling at a set rate of 125 Hz.  There seems to be big debates regarding PS2 vs. USB keyboards / mice in gaming communities, which relates to these aspects but too much to get into here nor do I have much more than a summary understanding of the positions of each side in those debates.

 

That being said, before I tried any of the USB overclocking I tried using my X-Arcade Tankstick with the PS2 interface instead of the USB as it has both. This was in hopes of generally achieving more points in time in which an event could be read which was basically what I wanted from the flipper aspects and how I got onto this topic in general.  However, my results were not great and although I got a little more variation / points in time where it could register a depressed key then release, I could not get anything to register below 25 ms using the KeyboardTest program and oddly the timings that kept coming up did not seem to be as random and were more clustered (i.e. 25,26,27 showing up a lot but nothing else between those and the low 30s).

 

Could be related to my Tankstick but I also tried with an older PS2 keyboard I had and also had poor results.  Best thing you can do is try out the KeboardTest software (or something similar) and see what you're getting via your IPAC PS2 connection.



#5 striggell

striggell

    Enthusiast

  • Members
  • PipPipPip
  • 59 posts

  • Flag: Australia

  • Favorite Pinball: Attack From Mars

Posted 25 September 2014 - 04:00 AM

I've got a virtua pin v2 controller I can test with over the next few days.  Might all be in my head but I swear it has more input lag than when I had all my buttons wired through a PS/2 Ipac.

 

This is a pretty common upgrade for sim racers - you can get cables for the Logitech G27 pedals that increase the polling rate to 1000hz - I haven't tried but apparently the pedals become quite a bit more progressive to use with the increased rate.



#6 randr

randr

    I'm just a hardware guy so...

  • VIP
  • 2,650 posts
  • Location:Minnesota

  • Flag: United States of America

  • Favorite Pinball: Twilight Zone

Posted 25 September 2014 - 04:03 AM

I will say I've always used native ps2 for all mame/pincab key encoders as I find they are better for response but modding the usb would help many people I'm sure.

randr___pinball.png                         


#7 senseless

senseless

    Pinball Fan

  • Platinum Supporter
  • 513 posts

  • Flag: Netherlands

  • Favorite Pinball: T2, Black Knight 2K, Monster Bash

  • PS3 Gamer Tag: senseless_mind

Posted 05 November 2016 - 12:16 PM

For Windows 8, 8.1 and 10 please follow the instructions I found on http://esreality.com...n-a/#pid2708554

 

sweetlow - the guy who made hidusbf, has updated his program and it now works on windows 8, 8.1 and 10.

You'll need to disable driver signature enforcement:

Disabling Driver Signature Enforcement In Windows 8,8.1 and 10 Permanently:
Step 1. Open the Windows command promt as “Run as Administrator”.
Step 2. Run “bcdedit -set loadoptions DISABLE_INTEGRITY_CHECKS” (without the “”).
Step 3. To finalize the process run “bcdedit -set TESTSIGNING ON” (without the “”).
Step 4. Reboot and you’re done.
To disable it do step 1 and run these commands on step 2 and 3:
Step 2. “bcdedit -set loadoptions ENABLE_INTEGRITY_CHECKS” (without the “”)
Step 3. “bcdedit -set TESTSIGNING OFF” (without the “”)
Then do step 4 and you’re done.

 

For a link to download sweetlow's hidusbf:
hidusbf
 

After that right click on hidusbf.sys and install

Run setup.exe, tick the box next to the mouse you want to overclock, choose filter on device, and select the polling rate.

 

For USB keyboards you can uncheck the "Mouse only" box in the left corner and select the keyboard you want to overclock, choose filter on device, and select the polling rate.

Click on Restart and the new polling rate is active :)!

 

If you want to verify you can use the Mouserate checker:
http://www.softpedia....shtml#download


Edited by senseless, 05 November 2016 - 08:42 PM.


#8 BorgDog

BorgDog

    We come in peace.. shoot to kill.. shoot to kill.

  • Members
  • PipPipPipPip
  • 1,427 posts
  • Location:Leavenworth, WA

  • Flag: United States of America

  • Favorite Pinball: Alien Star, TNA



Posted 05 November 2016 - 04:10 PM

Thanks for the update on that senseless, it's been on my list to figure out how to get this going on win10, you've saved me a bunch of research, appreciate it.



#9 BorgDog

BorgDog

    We come in peace.. shoot to kill.. shoot to kill.

  • Members
  • PipPipPipPip
  • 1,427 posts
  • Location:Leavenworth, WA

  • Flag: United States of America

  • Favorite Pinball: Alien Star, TNA



Posted 05 November 2016 - 06:38 PM

Your link appears to be missing the .nz after the mega.

 

https://mega.nz/#!rd...C2b2WcKMAny2Dz4



#10 Drybonz

Drybonz

    Really bad at pinball, but having fun.

  • Members
  • PipPipPipPip
  • 1,532 posts

  • Flag: ---------

  • Favorite Pinball: Theatre of Magic

Posted 05 November 2016 - 07:31 PM

I might want to try this, but I'm kind of wondering if it's the type of tweak that was more useful for older USB mice, such as pre-gaming devices with very high polling rates.  I guess I'm asking... if this tweak has been around since WinXP days, is it still relevant on new hardware, etc?



#11 jimmyfingers

jimmyfingers

    Pinball Fan

  • VIP
  • 832 posts

  • Flag: Canada

  • Favorite Pinball: Comet



Posted 05 November 2016 - 08:34 PM

To clarify, it's not at all just for a mouse and can be done on USB keyboards / keyboard encoders as well (if the hardware itself can respond fast enough to take advantage of the change to the USB polling on the connection).  The problem was with the USB driver and at least was still their in Windows 7 - independent of hardware.  I have tried with a few USB keyboards (all directly wired) and had one at least be able to be tweaked.  Back in my original post I link an app that you can test how quickly a key can be depressed and released.  It's only good for a short time period (trialware) as otherwise you have to license it but it showed me the potential on my development workstation.  

 

It should still be relevant for a lot of today's hardware that isn't sold as gaming hardware to start with and of main interest to people playing VP with USB keyboard encoders on their cabs.  My X-Arcade Tankstick didn't do any better after the USB polling increase for the standard buttons, but the trackball / mouse controller and it's L / R buttons did.  So I remapped the mouse buttons to some keys and linked to VP flippers accordingly to get the better response times.  I also have leaf switches on both X-Arcade Tankstick flipper buttons (mouse and regular), to also help with physical triggering and touch sensitivity. 



#12 senseless

senseless

    Pinball Fan

  • Platinum Supporter
  • 513 posts

  • Flag: Netherlands

  • Favorite Pinball: T2, Black Knight 2K, Monster Bash

  • PS3 Gamer Tag: senseless_mind

Posted 05 November 2016 - 08:44 PM

Changed the initial link, somehow I always struggle with the megalinks... copy paste just isn't enough..



#13 Drybonz

Drybonz

    Really bad at pinball, but having fun.

  • Members
  • PipPipPipPip
  • 1,532 posts

  • Flag: ---------

  • Favorite Pinball: Theatre of Magic

Posted 05 November 2016 - 11:08 PM

I noticed that you mentioned your Tankstick, above, and I also have a modded one, so I was curious... I may give it a shot.







Also tagged with one or more of these keywords: USB, Windows, Input lag