PS/2 vs. USB keyboards: performance and energy consumption

6

2

As far as I know, PS/2 keyboards are interrupt driven, while USB are polled. Typically a PS/2 keyboard was assigned IRQ_1 on Windows.

I'm not a hardware expert, but at a first glance it seems like the PS/2 keyboards are more efficient. So here are my questions:

  1. On modern day computers, are PS/2 keyboard better (or faster), and if so, would it be noticeable at all? ( ..: in gaming)
  2. Since they don't need polling, do PS/2 keyboards save energy compared to USB? (notice I'm not talking only about the peripheral here, but about the overall computer energy consumption).
  3. In case PS/2 had any advantage over USB, would adding a PS/2 adapter to my USB keyboard make the device as good as an actual PS/2 keyboard? Conversely, would adding a USB adapter to a PS/2 make it as bad as a USB KB?

2 in more detail:

USB needs active polling. So the CPU must dedicate some of its cycles to scan for keypresses, meaning that the number of cycles available for other tasks is lower. This can cause the CPU frequency to rise, hence the power consumption would be higher. An interesting case: Let's say we put two identical computers side to side, one using a PS/2 keyboard and the other using a USB keyboard of the same model, and we keep them switched on for a whole day. If we only press a single key during the day, the amount of CPU time the PS/2 keyboard has required is much lower that the USB counterpart. So in a CPU with an extreme dynamic frequency scaling, the USB keyboard would have required more power overall. Also, the USB protocol needs to manage several devices, and I guess this management makes processing a USB keypress computationally more expensive that the dedicated IRQ in case of PS/2 keyboards.

These are the kind of considerations I was asking in #2, taking into account the PC as a whole, and not only how much does the keyboard suck from the 5 V input.


It seems that the polling thing is only up to USB 2.0, and according to Wikipedia, USB 3.0 gets rid of polling:

improved bus utilization – a new feature is added (using packets NRDY and ERDY) to let a device asynchronously notify the host of its readiness (no need of polling)

(USB 3.0 keyboards are rare as of today. I only know about a Gigabyte keyboard showcased this year at COMPUTEX, and I doubt it uses USB 3.0 to get rid of polling, but instead to provide a USB 3.0 hub right on the keyboard).

I'm also trying to find hard data on what is the polling rate for a USB KB. Some people says 125 Hz, and there are some tweaks up to 1 kHz. By comparison, consoles like PS3 poll at 100 Hz, and XBox at 125 Hz. Even if 1 KHz were the case, it seems negligible on a GHz CPU (0,000001 % of CPU cycles/second). These numbers lead to another question: for gaming purposes, how better (if any) would be for a PS/2 keyboard to generate 1,000 interrupts per second?

Mister Smith

Posted 2012-09-10T08:07:36.017

Reputation: 575

follow up question: https://hardwarerecs.stackexchange.com/q/9328/9394

– Ablaze – 2018-06-09T19:50:58.107

1I'd note tho, many modern systems don't have PS/2. – Journeyman Geek – 2012-09-10T11:15:36.407

True, but some desktop motherboards still come with it. – Mister Smith – 2012-09-10T11:45:21.750

Answers

5

Response Times PS/2 vs. USB Keyboards:

There are a number of interesting results, but the point relevant to this question is that there was a fairly significant variance between keyboards, and all the USB keyboards tested had a longer effective scan interval (18.77 ms - 32.75 ms) than the PS/2 keyboards (2.83 ms - 10.88 ms).

More information from this Super User question itself: Do USB or PS/2 keyboards respond faster?


Power Consumption between the two devices and overall Power Consumption: (Referencing HP documentation)

  • USB
    Operating voltage: + 5VDC ± 5%
    Power consumption: 50 mA maximum (with three LEDs ON)

  • PS/2
    Operating voltage: + 5 VDC ± 5% Power consumption: 50 mA maximum (with three LEDs ON)


My take on it:

So the maximum possible power consumption will be +5 V and the motherboard must have accounted for this power for the PS/2 port irrespective of its actual consumption. And we know the USB does give us +5 V of power output on it. The actual power consumption varies a little from brand to brand. Some say it consumes 50 mA, and some say it's 70 mA, with a roof of 100 mA.

Nothing I have read so far says or show more than 100 mA of actual consumption. In fact, Windows also reports 70 mA of actual power required. But my MacBook shows a requirement of 100 mA on the USB. So the USB keyboard actual power consumption could be a little higher that the PS/2 keyboard. I am attaching a couple of images below.

On Windows

Windows USB

On MacBook

Mac USB


Explaining the updated question in #2:

  • Well, there is only one USB controller, but every USB port is interfaced individually. So the protocol makes the device exclusive for every port.

  • Every USB device connected to a port is interfaced individually. When a device is connected to the port, the port tells us which device is connected. This is like having a dedicated port per device, and the controller has the bus capabilities of sending multiple requests simultaneously to the processor.

  • In my reckoning, the amount of power / CPU time taken by the PS/2 or USB keyboard would be same. And if the USB keyboard was heavy on processing and power, people would have not used them inter-changeably. And we would have also read a lot more tech articles on them!

  • My personal argument on this would be that Apple just gives you USB ports on the Mac Minis and iMacs, so would Apple do it if it was so power and process intensive? Even most of the new Dell machines don't have PS/2 ports on them (leave all the assembled and custom hardware aside).

aliasgar

Posted 2012-09-10T08:07:36.017

Reputation: 3 608

This USB keyboard link is 5V / 100mA.

– Matthew Wai – 2018-07-14T10:00:12.897

Thanks for your time. I've edited the question to better explain #2. – Mister Smith – 2012-09-10T11:41:32.397

@MisterSmith : have written my explanation for your #2 to explain it better. And I guess that's just my take on things! – aliasgar – 2012-09-10T12:29:39.977

0

  1. This is personal opinion, but I wouldn't expect any noticeable difference. It would be a lot more dependant on the keyboard's hardware construction/quality (e.g. how quick it processes keypresses, how fast it reacts to you pushing a key, etc.). The interrupt would halt other things being processed, but programs or games would still have to react to it first. It's not like the whole game logic sits in the interrupt handler.
  2. I don't have the PS/2 spec in mind, but considering USB is usually something like 5 V 500 mA, which would result in 2.5 W. Now look at CPUs and GPUs that might (esp. on a gaming PC) take more than 250 W alone, this feels VERY neglectable.
  3. Definitely not! Even if there's an advantage, you're adding another step/stage, which would kill the whole advantage by linking both technologies one after the other. Let's assume USB's reaction time would be 0.1 seconds and PS/2's reaction time would be 0.05 seconds. With an adapter you'd be most likely somewhere around 0.15 seconds or maybe even higher.

Edit after your edit:

I'm assuming you'd like to improve your reaction times or whatever. If your question is really just theoretically, ignore this. If you'd like to "optimize" your gaming experience, just grab a USB keyboard made for gaming. These usually offer a more consistent key press behaviour and might have other features (e.g. detecting how deep or long you press rather than just pressed/not pressed). I wouldn't even try to worry about PS/2 at all, especially due to the fact how limited PS/2 ports are on today's hardware. You probably don't want to win a few milliseconds in input handling while losing more time due to lower memory bandwidth or other things.

Also something completely different to consider for gaming: Typical refresh rate on today's desktop PCs is 60 Hz. That means 60 frames per second or approx. 16.67 ms per frame. This leads to the fact that, even if you're polling 1000 times per second, you won't notice any reaction faster (compared to let's say 100 times per second). Sure, calculations might be faster (e.g. simulating the game world at 100, 500 or even 1000 frames per second), but I'd still say you won't notice any real difference at all.

Mario

Posted 2012-09-10T08:07:36.017

Reputation: 3 685

I'm not so sure about #3. USB to PS/2 is a simple wiring adapter, and many gaming KBs include it. So the KB would thus be able to detect the protocol used at power-on. And about #2, I was thinking mostly on the CPU cycles that would be needed for USB polling, not on the keyboard itself. – Mister Smith – 2012-09-10T09:43:36.100

1@MisterSmith - USB to PS/2 is NOT a simple wiring adapter in the general case. There are some devices (including a lot of gaming keyboards) that support both interfaces on the same connector (via simple wiring adapter), but in the general case this is NOT true. As to #2, the amount of power/cycles used to poll the USB keyboard vs respond to PS/2 interrupts is so small as to be irrelevant. – Michael Kohne – 2012-09-10T11:59:07.277

@Michael Kohne Yup, you are right. I was just reading about users whose KB only supported USB and the adapter didn't work. So that seems to be the answer for #3. – Mister Smith – 2012-09-10T12:08:31.240

Yeah, forgot about that point. It really depends on the implementation, but if you're having a simple wire adapter, then you're not really using any adapter at all (you're just using another connector). Also reminds me of Microsoft controllers being released during the early years of USB having those short adapter cables that unfortunately didn't work with older hardware. – Mario – 2012-09-10T23:11:28.830