Main > Main Forum

USB "Gamepad" encoder questions

Pages: (1/9) > >>

tetsujin:

Hey,

I'm aware of some of the reasons why people use keyboard encoders when creating control panels, but I find the whole idea of wiring up a game controller as a (PS/2 or USB) keyboard (when there's a perfectly good USB game controller protocol) extremely distasteful.  It seems like a solution straight out of 1992, something I'd have used to play X-Wing or Falcon 3.0.  I'm willing to muddle through the sometimes-lackluster USB gamepad support in some emulators in order to avoid connecting a non-keyboard as though it were a keyboard.  So I have some questions.

First, are there any pre-made USB game controller encoders readily available?  I'm aware of a few options:

- Legacy gameport to USB adaptors (workable, though a bit cheesy and they only support 4 buttons)
- Expensive CH Products encoders supporting not enough buttons (only up to five...)
- USB Gamepad hacks (also workable, if a bit cheesy)
- Console Gamepad hacks with console->USB adaptor (I'd be worried about the extra latency from the protocol translator in the middle...  I'd swear I've been bitten by latency with one of my adaptors...)
- Roll-your-own interface using a PIC (examples here and also on Microchip's website - I may take this route.)

My main interest in finding a pre-made encoder is in skipping the work in building my own and in ensuring that latency in the controls is kept low.  I imagine responsiveness would be good with the roll-my-own solution, but I haven't tested that.  This brings me to the second question:

Are there any significant performance disadvantages to a USB gamepad as compared to a keyboard encoder on a PS/2 or USB interface?  In terms of latency, mainly.  Clearly there are solutions along both routes that give support for the proper number of buttons, etc...

I imagine not, but again I have no idea.  Along similar lines, would the difference in latency between using low-speed USB controllers on a high-speed hub vs. using full-speed USB controllers on a high-speed hub be significant in terms of gameplay?  Or would it even be better to use a USB 1.1 hub with low-speed or full-speed devices, to avoid the intermediate step that high-speed hubs take with slower devices (buffering the data in each direction and re-transmitting it at a different speed)?  Or does it even matter in practical gaming terms?

krick:

I believe that the latency on a PS/2 keyboard port is always better than a USB port.

I made a post in this thread where I lay out the advantages of PS/2 vs USB in this respect...
http://forum.arcadecontrols.com/index.php/topic,20387.msg164683.html#msg164683

As for the USB 2.0 hub high-speed/full-speed issue, you should definitely read this article...
http://www.tomshardware.com/consumer/20030909/index.html

NoOne=NBA=:

As far as PRACTICAL differences go, the only ones likely to show their head are:

1) Ease of setup.
Keyboard encoders are alot quicker to hook up than gamepad hacks.

2) If you choose a gamepad hack, the software may not fully support keyswitching by app.
With a keyboard encoder, you can tell P-1 UP to be any key you need for a given app that doesn't support input switching itself.

3) You may find some apps in your desired playlist which will not allow multiple players on the keyboard, but will allow multiple gamepads.

That said, there is not alot of PRACTICAL difference between how most apps handle input on a keyboard vs. a digital gamepad.
You have switches on the device that are either closed, or not closed, and those switches send data via the USB line to let the computer know that you are pressing the switch.
The "perfectly good USB game controller protocol" you mention sends the same TYPE of signals as the keyboard protocol--it just doesn't support as many keys.

I think your aversion to a keyboard encoder is very misplaced, unless you have specific apps that won't support it.
I don't see any reason to reinvent the wheel, as you seem inclined to do, unless there is a way to make it BETTER.

As far as the USB speeds go, I haven't seen any difference between 1.1 devices on a 1.1 port, and 1.1 devices on a 2.0 port.
I don't have any high speed devices to see if there's a practical improvement or not, but I haven't seen any PROBLEMS with the slower devices, so my guess would be that they are sending data fast enough for the processor.
Sending data any faster would likely yield no improvement, from what I can tell.

tetsujin:


--- Quote from: NoOne=NBA= on January 26, 2005, 06:48:18 pm ---That said, there is not alot of PRACTICAL difference between how most apps handle input on a keyboard vs. a digital gamepad.
You have switches on the device that are either closed, or not closed, and those switches send data via the USB line to let the computer know that you are pressing the switch.

I think your aversion to a keyboard encoder is very misplaced, unless you have specific apps that won't support it.
I don't see any reason to reinvent the wheel, as you seem inclined to do, unless there is a way to make it BETTER.
--- End quote ---

As I said, I'm aware of the "advantages" of keyboard hacks.  I'm not particularly interested in hearing more about that, unless you wanted to give me some kind of compelling example of a game I'd want to play that won't work with a proper game controller.  If you just want to tell me you feel differently about keyboard encoders, that's fine.  Opinion noted.  But it doesn't answer my questions about whether there's a practical difference.

Reinventing the wheel?  Not really.  I didn't write the USB standard.  I just want to use it.  But what's wrong with doing things differently now and then, huh?

If USB gamepads support fewer keys than a keyboard, that's news to me.  I'd be interested to hear specific details about that.  It seems like even in low-speed the protocol should be able to handle 50-odd buttons...

The one that I suspect may cause me problems is the fact that there will be several USB devices on the bus.  USB has to time-slice between each device on the bus - which is why I thought that using full-speed devices might be a good idea, they'll transfer the same data in less time.  That could be an advantage of a PS/2 keyboard connection, since it's dedicated and all controls will be on it.  Or even a USB keyboard encoder, if it's the only device on the bus, may get polled more frequently by the system.  Or not, I don't know.

But the thing is, I know some of the numbers involved in this equation, and I have a certain level of understanding of the USB protocol and how it works and how that impacts things, but what I don't have is a practical knowledge of how much latency there has to be to cause a problem in the game.  I can't put it in perspective, which is why I'm asking for perspective.

krick: thanks for the info.

NoOne=NBA=:

I'm going to try to be as nice as possible here.


--- Quote from: tetsujin on January 26, 2005, 10:24:05 pm ---As I said, I'm aware of the "advantages" of keyboard hacks.
--- End quote ---
Apparently not because keyboard hacks SUCK!!!
There are NO advantages to a keyboard hack.

Keyboard encoders are NOT keyboard hacks.
They are USB devices--JUST LIKE GAMEPADS.
That's the point I was making.
They send data that says "Hey, this button is pressed".
There is no difference between a button on a virtual keyboard, and a button on a virtual gamepad.


--- Quote --- I'm not particularly interested in hearing more about that, unless you wanted to give me some kind of compelling example of a game I'd want to play that won't work with a proper game controller.
--- End quote ---
I don't KNOW what you want to play.
Unless a particular game you WANT to play won't accept multiple player inputs from a KEYBOARD, you're wasting your time trying to make a bunch of gamepad controllers.


--- Quote ---But it doesn't answer my questions about whether there's a practical difference.
--- End quote ---


--- Quote from: NoOne=NBA= ---There is not alot of PRACTICAL difference between how most apps handle input on a keyboard vs. a digital gamepad.
--- End quote ---
I thought THAT answered the exact question asked.



--- Quote ---Reinventing the wheel?  Not really.  I didn't write the USB standard.  I just want to use it.  But what's wrong with doing things differently now and then, huh?
--- End quote ---
DIFFERENTLY is one thing, DIFFICULTY is another.
You are planning on making MULTIPLE gamepad encoders, to do what can be done with a SCREWDRIVER on an I-pac.
THAT'S reinventing the wheel in my book.


--- Quote ---If USB gamepads support fewer keys than a keyboard, that's news to me.  I'd be interested to hear specific details about that.  It seems like even in low-speed the protocol should be able to handle 50-odd buttons...
--- End quote ---
You know of an EXISTING gamepad driver with 50 button input?
If so, why are you worried about MULTIPLE gamepads?
Just wire ALL your controls up to ONE, and be done with it.

Wait....that sounds alot like a KEYBOARD encoder, doesn't it?



--- Quote ---The one that I suspect may cause me problems is the fact that there will be several USB devices on the bus.  USB has to time-slice between each device on the bus - which is why I thought that using full-speed devices might be a good idea, they'll transfer the same data in less time.  That could be an advantage of a PS/2 keyboard connection, since it's dedicated and all controls will be on it.  Or even a USB keyboard encoder, if it's the only device on the bus, may get polled more frequently by the system.  Or not, I don't know.
--- End quote ---
Again, why worry about multiple devices if you can hook EVERYBODY up to a 50 button virtual gamepad controller?
And why worry about a 50 key virtual gamepad controller, when you can buy an I-pac4 and be DONE with it?


--- Quote ---But the thing is, I know some of the numbers involved in this equation, and I have a certain level of understanding of the USB protocol and how it works and how that impacts things, but what I don't have is a practical knowledge of how much latency there has to be to cause a problem in the game.  I can't put it in perspective, which is why I'm asking for perspective.
--- End quote ---
That's what I'm saying.
Can you work a screwdriver?
Get an I-pac, or a PS/2 Keywiz if you think the USB latency might be an issue, and FORGET about all that stuff.
Screw the WIRE to the TERMINAL, play the GAME!
No learning, no problems, it just WORKS.

Pages: (1/9) > >>

Go to full version