Electronicks / JoyShockMapper

A tool for PC gamers to play games with DualShock 4s, JoyCons, and Pro Controllers. Gyro aiming, flick stick.
Other
372 stars 20 forks source link

Polling rate optimization #115

Closed mirh closed 10 months ago

mirh commented 11 months ago

We do know the highest achievable reporting frequencies for all the major controllers (putting aside that they may have then their special knobs and levers). Now, I don't really have a horse in the likely race between latency and battery (and I don't know, stability too perhaps?), but if the maximum the connected hardware can do is X then it seems just wasteful for the software to update every X/5.

JibbSmart commented 11 months ago

If the player's monitor has a higher refresh rate, it's better to match it (or exceed it) to make sure the camera/cursor moves with every new rendered frame

Electronicks commented 10 months ago

JSM uses SDL2 as the background controller processing engine. It polls at 1kHz (1ms period) maximum which should be plenty for all common use case. It is also great for low polling rate controllers such as first party switch controllers as JSM controls the update speed, not the controller. If polling at the controller's speed is important, JSM_legacy uses a custom backend called JoyShockLibrary with limited controller support and functionalities, but does process updates as soon as they are avialable.

Please use whichever version suits your needs.