Jump to content



Photo
- - - - -

USB Input Controllers and Lag


  • Please log in to reply
17 replies to this topic

#1 paulstevens

paulstevens

    Hobbyist

  • Members
  • PipPip
  • 36 posts

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

  • Favorite Pinball: Medieval Madness

Posted 22 November 2016 - 09:10 PM

In terms of cabinet builds, what are the better USB input controller boards out there?

 

I am interested only in input controllers at the moment with the idea of having the lowest amount of USB input lag possible.  (I have a Leobodnar hdmi lag test tool and found a monitor with 20.0mS lag. Next on my list to minimize is USB Input lag)

 

I am looking at the VirtuaPin Control board, UltiMarc U-HID, I-PAC and others.

 

Basically I want to find (or build) the product with the fastest response time from pressing a cabinet flipper button to the flipper actually moving the ball on the playfield screen. 

 

Is a keyboard encoder the best idea?  Or should I look for something that presents as a joystick?

 

I have also read that mouse buttons are reported "faster" than keyboard buttons, so I might want to map VPX/VPM flipper buttons to mouse buttons, then use a controller that sends a cabinet button closure out as a mouse button event.

 

Finally, I've read about "overclocking" the usb 3.0 controller port from 125Hz to 1000Hz, 2000Hz or more.  I found the driver but am under the impression that works only for "mouse" devices (buttons included?) but don't know if that would help for a device presenting as a keyboard or joystick.  

 

Does that even matter if VPX/VPM use DirectInput?

 

Thanks for the ideas on my quest to reduce lag wherever possible.



#2 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,331 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 22 November 2016 - 09:45 PM

I don't think you'll have any problem with USB lag with any of those options, and you shouldn't have to worry about any crazy tweaking like overclocking ports.

 

There was a time when the conventional wisdom among video gamers held that PS/2 style keyboard interfaces were inherently faster than USB inputs.  There's a kernel of truth to this in terms of the technical design, in that PS/2 keyboard ports generate hardware interrupts whereas all USB devices are polled.  And it might have even been true for practical purposes at one time, like maybe in the Windows 98 era.  But this is all pretty much ancient history in my opinion.  Of all the technical questions asked here, "why is my input controller laggy" is one you basically never see.  People here use all of the products you mentioned, and they all just work.

 

I'd recommend going with a keyboard input device rather than something that looks like joystick buttons, just because it'll be a little easier to get it working with more software.  VP and Pinball X work equally well with either, but you might eventually come across an app you want to use that doesn't have a joystick setup option.  Even then you can make it work using third-party software that maps the joystick to keyboard keys (xpadder is one), but it's more to set up and more things to go wrong (and given your worries about lag, more software layers to slow things down).  Keyboard input is almost universal, so it makes things a little simpler to have that as your native device input mechanism.


Edited by mjr, 22 November 2016 - 09:48 PM.


#3 paulstevens

paulstevens

    Hobbyist

  • Members
  • PipPip
  • 36 posts

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

  • Favorite Pinball: Medieval Madness

Posted 22 November 2016 - 10:40 PM

Andy at Ultimarc replied that the U-HID polling interval is 5mS but that he can supply firmware that calls out any rate I want.  Like you, he is doubtful it will make a different because of other layers in the problem, but if the reduction is polling interval helps, why not try it.  I believe USB3.0 spec allows that interval to be as short as 125uS (8000Hz).  I'd imaging 1mS (1000Hz) would be a reasonable figure to request.

 

An important point I forgot to make is that I am configuring VPX/VPM outside of a cabinet, and this is my first attempt.  My impressions about flipper lag may be influenced by the KEYBOARD I am using.  I can definitely feel a slight but noticeable lag when I press "shift" and see the flipper go.

 

I wonder now if that lag will be diminished or less noticeable if I use one of the controller boards discussed above instead of a keyboard.

 

Thanks.


Edited by paulstevens, 22 November 2016 - 10:46 PM.


#4 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,331 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 22 November 2016 - 11:34 PM

Andy at Ultimarc replied that the U-HID polling interval is 5mS but that he can supply firmware that calls out any rate I want.  Like you, he is doubtful it will make a different because of other layers in the problem, but if the reduction is polling interval helps, why not try it.  I believe USB3.0 spec allows that interval to be as short as 125uS (8000Hz).  I'd imaging 1mS (1000Hz) would be a reasonable figure to request.

 

Yeah, USB 3 has a "subframe" scheme that allows for 125us packet times, but I'm not sure that any of the input devices out there are actually USB 3 devices, so they probably can't take advantage of it.  It's there more for throughput than for latency - it's more commonly used on devices like disk drives that are moving lots of bytes.  (More packets per second = more bytes per second, because the number of bytes per packet is also limited.)

 

Anyway, humans really aren't capable of perceiving latency in the 5ms range.  People have measured this experimentally, and the bare minimum is usually found to be in the 25ms range.

 

 

An important point I forgot to make is that I am configuring VPX/VPM outside of a cabinet, and this is my first attempt.  My impressions about flipper lag may be influenced by the KEYBOARD I am using.  I can definitely feel a slight but noticeable lag when I press "shift" and see the flipper go.

 

It's possible, but I'd be surprised unless you have some really weird keyboard.  It's more likely that the lag is coming from your video monitor rather than anything on the input side.  Are you using a TV of some kind (as opposed to a computer monitor)?  If so, that would be the first place I'd look.

 

Most TVs these days do lots of processing to the video signal before it hits the display, and that processing often inserts latency up into the 100ms range.  That's well into the zone where it becomes obvious and painful for playing video games.  If yours is "slight but noticeable", it's probably around 60ms, which is very much in the typical TV range.  Fortunately, most TVs can go a little faster than their factory settings if you tweak things in the setup menus.  Look for a "game mode" setting; that usually selects the best combination of options for video gaming, including minimal latency.  If you don't see that, turn off anything that looks like it's meant to tweak picture quality, especially if it has to do with motion smoothing or increasing frame rates.  

 

And some TVs are just bad at this no matter what settings you select.  If you look for "gaming tv latency" or "tv input lag", you can find sites where people have compiled measurements for different models.  There's an amazingly big range out there, from about 15ms at the best to 150ms at the worst.


Edited by mjr, 23 November 2016 - 12:19 AM.


#5 paulstevens

paulstevens

    Hobbyist

  • Members
  • PipPip
  • 36 posts

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

  • Favorite Pinball: Medieval Madness

Posted 23 November 2016 - 12:13 AM

Agreed on ~25mS being the threshhold humans can perceive lag.  Unfortunately I may be one of those who can sense that (my kids are not).  Plus I have several real pinball machines that I am keenly aware of their performance, even using an o'scope to measure the delay from when a WPC-95 flipper opto board goes low to when the flipper coil is energized (about 3mS).

 

If you add up all the sources of Virtual Pinball lag, I believe it makes sense to reduce it where possible.

 

Your point about gaming TV latency is well taken.  To that end I got a LeoBodnar hdmi input lag tool to measure my choices, and I wound up getting a set with 20.0mS input lag.  The TV I am developing on has 35mS lag.  So that lag, coupled with whatever the Keyboard lag (and windows 10 USB stack plus VPX plus VPM, ...) adds up to a lag I notice and hence want to reduce.

 

5mS input lag for a keyboard controller, taken by itself, is not bad.  But add that 5mS to 20 or 30mS, then it is noticeable.  If I can reduce that 5mS from the keyboard controller to 1mS, then I want to try that and whatever happens know that I did all I could to reduce the lag where I can.

 

ps - as for TVs for gaming, according to rtings.com, a previous year Vizio model had the lowest hdmi input lag they ever measured, about 13mS.  The 24 inch Dell computer monitor I have (hdmi) measures 14mS.  I can't imagine cabinet builders with 40" playfield monitors having anything much less than 20mS from the HDMI portion.  So, either they are not as sensitive to lag as I am, or they have other stuff in their configurations optimized better than I have (very likely).   

 

Or, perhaps the usb input controllers they are using have less lag than the USB keyboard I am using right now.  Don't know.  I just want to control what I can.

 

pps - I also notice flipper lag with the 14mS Dell monitor and my keyboard.  So again, I want to reduce what I can where I can, including usb input controller and of course any settings in VPX / VPM (I am using true exclusive full screen mode.)

 

Thanks!!!



#6 Slydog43

Slydog43

    Pinball Wizard

  • Platinum Supporter
  • 3,008 posts
  • Location:Hackettstown, NJ

  • Flag: United States of America

  • Favorite Pinball: Addams Family, All Williams 90's Games

Posted 23 November 2016 - 12:13 AM

check out http://www.displayla...splay-database/ for a good database of input lag.  I'm just now playing around with increasing usb polling rate with win10x64, but not sure if there is any difference from 250 to 1000hz.  Love how easy it is to test flipper lag with latest 10.2.



#7 xantari

xantari

    Enthusiast

  • Platinum Supporter
  • 154 posts

  • Flag: United States of America

  • Favorite Pinball: Star Trek TNG

Posted 23 November 2016 - 12:19 AM

Zebsboards plunger includes all The inputs you would need for flippers and what not, and you would get a plunger out of the deal as well. No need for ultimarc or other controllers

#8 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,331 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 23 November 2016 - 12:26 AM

I'm just now playing around with increasing usb polling rate with win10x64, but not sure if there is any difference from 250 to 1000hz.  Love how easy it is to test flipper lag with latest 10.2.

 

Note that it can actually be counterproductive to increase the rate beyond a certain point, because it adds CPU and USB overhead.  Even if you could discern the difference between 4ms and 1ms input device latency with all other things being equal (you can't), the very fastest TVs out there will still be setting your latency floor at 15ms.  



#9 Slydog43

Slydog43

    Pinball Wizard

  • Platinum Supporter
  • 3,008 posts
  • Location:Hackettstown, NJ

  • Flag: United States of America

  • Favorite Pinball: Addams Family, All Williams 90's Games

Posted 23 November 2016 - 12:48 AM

at least with vpx I like to have ramp up speed set to 0 instead of the default table value of 3.  this makes a huge difference in flipping speed.  mjr, I like to tinker just since I like to tinker, thanks for your input.  Also getting better VPM integration recently and hopefully that will also help.



#10 paulstevens

paulstevens

    Hobbyist

  • Members
  • PipPip
  • 36 posts

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

  • Favorite Pinball: Medieval Madness

Posted 23 November 2016 - 12:56 AM

Zebsboards plunger includes all The inputs you would need for flippers and what not, and you would get a plunger out of the deal as well. No need for ultimarc or other controllers

THe store is closed for a while.  Thanks for the tip, though.



#11 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,331 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 23 November 2016 - 01:35 AM

at least with vpx I like to have ramp up speed set to 0 instead of the default table value of 3.  this makes a huge difference in flipping speed.

 

I think that a value of 3 translates to 30ms ramp-up time, so yeah, that would be getting into noticeable territory.  The idea behind the ramp-up is that real flipper solenoids take non-zero time to come up to full strength.  But I've actually been doing some empirical measurements of real flipper action (with the help of iPhone 240fps video), and I can back up your instincts here - 30ms is *way* too long a ramp-up time.  Real 90s era flippers, when unloaded (no ball present), can complete the whole flip arc in about 20ms.  Come to think of it, that's just the flip time, from the moment the flipper starts moving to the point where it completes the upward arc; I haven't tried getting the button in the frame to see if there's any latency.  But I suspect that's pretty close to zero.

 

The VPX ramp-up time isn't actually pure latency; it ramps the torque level across the interval, so the flipper does start moving immediately even with a non-zero setting.  But it'll move slower at first that way.  My own subjective sense is that VPX flippers are considerably slower than the real thing in general, but I haven't done any measurement of VPX to compare.

 

 

at least with vpx I like to have ramp up speed set to 0 instead of the default table value of 3.  this makes a huge difference in flipping speed.  mjr, I like to tinker just since I like to tinker...

 

Certainly a fine instinct - real experimental data always beats theory.  Especially in the PC world where so much of the theory goes out of date quickly and becomes urban legend/superstitution.



#12 paulstevens

paulstevens

    Hobbyist

  • Members
  • PipPip
  • 36 posts

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

  • Favorite Pinball: Medieval Madness

Posted 23 November 2016 - 02:04 AM

mjr you have given me another reason to pull out the scope again.  Recently I measured wpc button to response time of about 3mS, the time from when the cabinet button is pressed to when the flipper coil first receives power.  Next I'll measure the time from when it receives power to when the end of stroke switch is activated.  That will tell us how long it actually takes for the flipper to start moving until when it reaches end of stroke.

 

The reason there is not zero latency from button press to when flipper gets energized is because the button press is read by the WPC controller, stuff happens, and eventually the WPC controller sends power to the flipper coil.  With WPC, Williams and Bally flippers became under software control.  Prior to that (System 11C and earlier), there was zero latency from button press to flipper power because the cabinet switch did provide coil power - there was not computer+software to add any delays.

 

DJRobX might be looking at VPM WPC emulation a bit to see if the flipper latency there is in the 3mS range or not.  I think he said it was as high as 10mS which is too long.

 

Meanwhile, my parallel quest for other ways to reduce latency in the VPX experience.


Edited by paulstevens, 23 November 2016 - 02:05 AM.


#13 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,331 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 23 November 2016 - 04:26 AM

mjr you have given me another reason to pull out the scope again.  Recently I measured wpc button to response time of about 3mS, the time from when the cabinet button is pressed to when the flipper coil first receives power.  Next I'll measure the time from when it receives power to when the end of stroke switch is activated.  That will tell us how long it actually takes for the flipper to start moving until when it reaches end of stroke.

 

The reason there is not zero latency from button press to when flipper gets energized is because the button press is read by the WPC controller, stuff happens, and eventually the WPC controller sends power to the flipper coil.  With WPC, Williams and Bally flippers became under software control.  Prior to that (System 11C and earlier), there was zero latency from button press to flipper power because the cabinet switch did provide coil power - there was not computer+software to add any delays.

 

You can probably measure that better than I can with the video approach - my time resolution at 240fps is about 4ms, so an event that takes 3ms will be ambiguous at best.  

 

I've actually been measuring an S11 machine, which as you say has direct wiring from the button to the flipper.  And what's more, it's a copper leaf switch, not an opto interruptor like the Fliptronic games.  I doubt that the opto adds any delay even in the millisecond range (maybe microseconds), but I can easily believe that it can take a few milliseconds for 6509 software to respond to the switch state change.

 

At any rate, the VPX ramp-up time isn't at all meant to simulate latency of that type.  It would be pretty silly to include that in the simulation, since the PC hardware/software environment already introduces latency on the same order of magnitude organically.  The VPX ramp-up time is supposed to capture the electromechanical behavior of the coil, the theory being that the coil doesn't come up to full strength the instant the voltage switches on.  And maybe you could argue that there's also some inertia, play, and static friction in the mechanical linkages that also has to be overcome before the flipper comes up to full speed.  There's probably some truth to all of it, but as I was saying, it doesn't seem to happen on a time scale that I can see in 240fps video; the flipper seems to move in a nice s = 1/2 a t^2 curve right from the first 4ms snapshot.



#14 paulstevens

paulstevens

    Hobbyist

  • Members
  • PipPip
  • 36 posts

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

  • Favorite Pinball: Medieval Madness

Posted 23 November 2016 - 05:31 AM

The 6809 in System 11 has no role in flipper behavior.  The cabinet button switch completes the flipper circuit - as soon as the leaf switch closes, the coil is energized.  Consequently, System 11 (and prior) games have essentially zero lag - the only lag is the electromagnetic coil charging and electromechanical behavior you mentioned above.  Anecdotally, the first time I did a flipper rebuild (on a System 11B Taxi) I was amazed at how much mechanical resistance is in all the linkages and the flipper bushing.  Changing those to new allowed me to complete all the ramp shots. 

 

The physics in VPX is what I find so incredible - the devs have done a fantastic job with it.  I can't begin to pretend what all the options do. 

 

Coil Ramp Up for instance - not sure what that does.  I did try changing it to 0 from 3 but am not sure I felt any difference in terms of lag or response.  It still felt a bit slow to me.



#15 Ben Logan

Ben Logan

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 2,275 posts
  • Location:California

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

  • Favorite Pinball: System 11

Posted 23 November 2016 - 04:22 PM

Great discussion,guys. Read the whole thread.

#16 hlr53

hlr53

    Pinball Fan

  • Gold Supporter
  • 683 posts
  • Location:Kettering OH

  • Flag: United States of America

  • Favorite Pinball: 1964 Williams Palooka Joe

Posted 29 November 2016 - 05:51 PM

Yep, very good reading.

 

Just a FYI: I haven't had time to hook up my Pinscape and buttons yet (doing after Christmas) so I am using a wireless Steam controller in the interim on an i7 with a GTX1080 (overkill but I play other stuff on my system besides pinball) on a 40" Haier set to VGA gaming mode. Have an active adapter to HDMI in on the GPU. I'm currently playing Pinball Arcade, FX2 and Zaccaria. Future and Visual installs are coming in a few weeks. During Thanksgiving eight different family members played (everyone LOVED it including our Millenials) and no one noticed lag on any of the games. I just don't see it as a big issue as far as type of controller goes?

 

With that said, I can certainly appreciate your sensitivity to flipper lag. My eyes had extreme sensitivity to large screen 60hz CRT monitors. My eyes would go into horrible convulsions if I stayed on them too long. My monitors HAD to refresh at 85hz. With flat panels nowadays, no issues.


Edited by hlr53, 29 November 2016 - 05:58 PM.

Former Cab: 40" Haier, 28" I-INC, i7-6700, 1080 GPU, v3DMD, 4D7 solenoids. Altec-Lansing speakers and sub. Artwork by Stuzza. Printing by Brad Bowman. VR HP reverb


#17 beaker801

beaker801

    Hobbyist

  • Members
  • PipPip
  • 16 posts

  • Flag: United States of America

  • Favorite Pinball: Terminator 2

  • 360 Gamer Tag: beaker801

Posted 18 July 2018 - 02:12 AM

So this is both a bump post and a question for those involved.  It has been nearly 2 years since this was posted.  Was wondering if new technology and equipment have decreased the lag most people have experienced.  I know the newer 4k tvs have significantly reduced their input lag, but what about graphics cards and the newer usb controllers?

 

 



#18 gtxjoe

gtxjoe

    VPF Veteran

  • VIP
  • 5,152 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness, AbraCadabra



Contributor

Posted 18 July 2018 - 03:28 AM

USB devices havent changed

From Sw side, FastFlips is the latest SW tweak to minimize flipper lag