[Help] PS/2 Max Sample Rate

Associate
Joined
11 Jun 2020
Posts
1
This may seem like a completely random or useless topic. After all, USB devices have come a long way since the PS/2 port. However, I have a weird obsession with figuring out whether or not a PS/2 port can compete currently with any USB mice. For those unaware, a PS/2 port works by sending interrupts to the CPU, telling it to completely stop what it's currently doing to process the information sent by the keyboard/mouse, while a USB connection goes to a USB Host Controller which processes the information to something that the CPU can understand, which is then sent to the CPU for processing when the CPU has time. To figure out the delays of USB and PS/2 ports I have obtained the following information, all of which has been obtained with information regarding keyboards as there is a severe lack of data for any mice data to be conclusive.



MCU + Scanning = 2.5ms delay (obtained and gathered through wooting one keyboard)

USB Host Controller = 2 nanoseconds to 2.047 milliseconds (obtained through the USB Host Controller specification sheet which is made public by Intel)



PS/2 Max Sample Rate = 200hz (5ms)

USB Max Sample Rate = 1000hz (1ms)



This isn't the end of the story though. Through some forums, I have found reports of successful overclocks to mice that resulted in upwards of 8000hz on a mouse, albeit by jumping through a lot of inevitable roadblocks. However, I have found no such reports with regards to overclocking a PS/2 port's sample rate. Taking a look at the data I currently have, a USB mouse is bound to be somewhere around a delay of 3.502ms - 5.547ms (calculated by adding delay for MCU, scanning, and polling rate) while a PS/2 connection is 7.5ms by default (calculated by adding delay for MCU, scanning, and sample rate). If a PS/2 port were to be overclocked successfully to 1000hz without any instability or issues being presented, the input delay would be reduce to 3.5ms, beating out a standard USB mouse by 0.002ms - 2.47ms assuming completely perfect scenarios.



This is where the forum post comes in. If a PS/2 port can be overclocked to say 1000hz, a PS/2 port could be definitively better than a USB port for response time. The unfortunate part is that I currently do not have a motherboard or a mouse with PS/2 ports. If anyone is interested in helping and has hardware on hand that is capable, or has past experience with doing an overclock for the sample rate of a PS/2 port, please do comment your results for a max overclock, instability you might have come across, or any other similar findings.



For those curious as to why I might consider doing this in the first place, I am currently planning to see if I can design a PS/2 mouse with optical switches to reduce input lag in competitive shooters such as CS GO or Valorant, but currently do not have the data regarding PS/2 sample rates to be able to decide whether or not there would be less input delay. If I am misinformed about the delay regarding the sample rate from a PS/2 port, please do correct me as well. I could very well misunderstand the difference between polling and sample rates, miscalculated something, not accounted for other factors, and so on.
 
If a PS2 port works via interrupts can you even "overclock" it in any meaningful way? I'd assume the effective rate would be controlled by global execution boundaries and interrupt priority flags/masks? and the only way to override that would be to make the mouse interrupts non-maskable which would likely cause lots of problems due to the frequency of them blocking other processing.

EDIT: From my understanding you will struggle to get the button to pixel delay on a modern system below 9ms best case with the device input latency being only a small part of that - even halving the current proportion of the delay that is from the input device wouldn't reduce the overall full system delay by much.
 
Back
Top Bottom