Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: USB vs PS/2 vs COM vs LPT  (Read 101094 times)

0 Members and 1 Guest are viewing this topic.

AndyWarne

  • Trade Count: (+18)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1938
  • Last login:April 11, 2021, 03:37:09 am
    • Ultimarc
Re: USB vs PS/2 vs COM vs LPT
« Reply #160 on: September 27, 2010, 04:46:08 am »

It is clear in from both programs that regardless of USB keyboard packet size, there can only be retrieved a maximum of ONE KEY per 8ms, thus 4 simultaneous key presses, like in my example above, will still need to communicate four packets, with lag between each one that equals to Windows default USB polling rate, on this particular computer of mine. As I was saying all along.


I despair, I really do...

You can see from your USB trace that your keyboard is only sending one key increment on each subsequent packet. So its no surprise that the Passmark test is picking up each key 7ms after the previous one. You have already had the limitations of the keyboard matrix scan system explained to you, and I have also previously posted a USB trace which shows the result of a system which does not use a matrix (I-PAC).
I also stated before that the Passmark lag when using an I-PAC is zero. You dont appear to believe this, so, although I am not sure why, I took a screenshot:


Driver-Man

  • Guest
  • Trade Count: (0)
Re: USB vs PS/2 vs COM vs LPT
« Reply #161 on: September 27, 2010, 08:04:09 am »
Quote from: AndyWarne
You can see from your USB trace that your keyboard is only sending one key increment on each subsequent packet. So its no surprise that the Passmark test is picking up each key 7ms after the previous one.

Your USB trace shows a packet is sent for each key, just the same as mine.




DIFFERENCE:
- Your USB packets contains all the keys, each 32 bytes long
- My USB packets contain some sequence, each 8 bytes long

- In your case there is 2ms lag in between each packet
- I can make 2ms lag by simply setting polling rate to 500Hz

You are not really achieving anything by sending the full information in the first 32 bytes, since you will still be sending as many of those packets as keys were pressed, just like my USB trace shows too. You are stuffing 5x32 = 160 bytes down the USB pipe just to signal 5 keys are down!?


Quote
I also stated before that the Passmark lag when using an I-PAC is zero. You dont appear to believe this, so, although I am not sure why, I took a screenshot:

Your USB trace contradicts that. Operating System is different?  Have you been fiddling with your USB polling rate? -- I think you should try that again with the same operating system where you run that USB trace, they can not both be true, so I think you have some bug, perhaps buffer overflow with all those unnecessary bytes sent there, superfluously.
« Last Edit: September 27, 2010, 08:14:19 am by Driver-Man »

Marsupial

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 511
  • Last login:April 17, 2024, 09:00:56 pm
  • I am teh Mars!
Re: USB vs PS/2 vs COM vs LPT
« Reply #162 on: September 27, 2010, 08:31:10 am »
netiquette...

An "Internet troll" or "Forum Troll" or "Message Board Troll" is a person who posts outrageous message to bait people to answer. Forum Troll delights in sowing discord on the forums.  A troll is someone who inspires flaming rhetoric, someone who is purposely provoking and pulling people into flaming discussion.  Flaming discussions usually end with name calling and a flame war.
 
A classic troll is trying to make us believe that he is a genuine skeptic with no hidden agenda.  He is divisive and argumentative with need-to-be-right attitude, "searching for the truth",  flaming discussion, and sometimes insulting people or provoking people to insult him.  Troll is usually an expert in reusing the same words of its opponents and in turning it against them.

They usually have an agenda. Very few trolls come to out of pure skepticism. A Troll is generally a person who is extremely skeptical of the main forum subject.
He is generally interested to make other forum members look stupid. A troll will sometimes use insults to provoke other people to insult him. Then, he will complain to moderators of being insulted and will request that his opponents get banned from further discussion.

He (and in 90% of cases it is he) tries to start arguments and upset people.

Sometimes, Internet troll is trying to spin conflicting information, is questioning in an insincere manner, flaming discussion, insulting people, turning people against each other, harassing forum members,  ignoring warnings from forum moderators.

Trolling is a form of harassment that can take over a discussion. Well meaning defenders can create chaos by responding to trolls. The best response is to ignore it, or to report a message to a forum moderator. Moderators usually delete troll messages or block trolls.  Negative emotions stirred up by trolls leak over into other discussions. Normally affable people can become bitter after reading an angry interchange between a troll and his victims, and this can poison previously friendly interactions between long-time users.

Finally, trolls create a paranoid environment, such that a casual criticism by a new arrival can elicit a ferocious and inappropriate backlash.

When trolls are ignored they step up their attacks, desperately seeking the attention they crave. Their messages become more and more foul, and they post ever more of them.

Alternatively, they may protest that their right to free speech is being curtailed. 

Perhaps the most difficult challenge for a webmaster is deciding whether to take steps against a troll that a few people find entertaining. Some trolls do have a creative spark and have chosen to squander it on being disruptive. There is a certain perverse pleasure in watching some of them. Ultimately, though, the webmaster has to decide if the troll actually cares about putting on a good show for the regular participants, or is simply playing to an audience of one -- himself.

Next time you are on a message board and you see a post by somebody whom you think is a troll, and you feel you must reply, simply write a follow-up message entitled "Troll Alert" and type only this:

The only way to deal with trolls is to limit your reaction and not to respond to trolling messages.  It is well known that most people don't read messages that nobody responds to, while 99% of forum visitors first read the longest and the largest threads with the most answers.
 

FYI: trolling is NOT encouraging the community, in the long run it is irritating to the community members, the moderators, and only helps in encouraging people to not read interesting threads anymore. Nothing good can come out of a troll.

If the moderators don't have a good discussion with the man that talks about himself in the 3rd person, I encourage people to stop posting on this and any other of his threads - don't feed the troll, don't encourage him. Note that all the good discussions of this thread were done while he wasn't trolling, between distant posts of him, and when he posts, we only rechew the same data over and over.

All that had to be said on the topic has been said and proven, yet the guy can't see the light. An empty bottleneck is not a problem (there is more then ennough time to process all keypress in emulation software between every emulated cycle), but an annoying troll is.

I suggest to everyone to use the ignore button on his username, too.
-Mars

Derrick Renaud

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 299
  • Last login:December 06, 2024, 04:31:44 pm
Re: USB vs PS/2 vs COM vs LPT
« Reply #163 on: September 27, 2010, 08:38:56 am »
Do you not see the "bottleneck"?





Do you?  Obviously not.  As I've said before you need to READ & Understand what has been posted in this thread.  Which you still have not done.

Raw Input does not get it's input from the Keyboard & Mouse Client or the OS Keyboard and mouse services.  It gets it directly from the USB services.  In otherwords, it gets it RAW at the USB poll rate.

Just because you take a picture of a red sky at dusk, does not mean the sky is always red.  Look out the window and see it is blue (or black at night.)

You demanded a document before you would listen to any other proof given to you, which you have since been given.  Very nice of Andy to do so, I would have never bothered looking up proof for something I know has been true for 10 years.

Now that you have been given proof, please re-read this thread and understand the other proofs given.

You refused to ever consider how windows could somehow read input directly from individual keyboards.  You still seem to be stuck thinking it is at the legacy level.  When at the level it can not individually read keyboards.

But whatever, keep enjoying the red sky in your world.

I can no longer believe that Driver-Man is doing anything but trolling.

« Last Edit: September 27, 2010, 03:33:24 pm by Derrick Renaud »

JustMichael

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1438
  • Last login:September 27, 2015, 01:19:40 am
  • Mmmmm!! Cheesecake!!
Re: USB vs PS/2 vs COM vs LPT
« Reply #164 on: September 27, 2010, 08:48:01 am »
I have heard stories of person(s) who aren't happy unless they are arguing.   :badmood:  I have also heard they don't care if they are right or wrong, they just want to argue.   :blah:  Has anyone else heard of such person(s)?   ;)

Lewis Black

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 101
  • Last login:October 17, 2012, 08:14:10 am
  • Baaaah Eff it!
Re: USB vs PS/2 vs COM vs LPT
« Reply #165 on: September 27, 2010, 08:54:47 am »
If nothing else this has been a very educational thread, but I still I eagerly await the troll's flame-out.
« Last Edit: September 27, 2010, 09:11:44 am by Lewis Black »

SavannahLion

  • Wiki Contributor
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5986
  • Last login:December 19, 2015, 02:28:15 am
Re: USB vs PS/2 vs COM vs LPT
« Reply #166 on: September 27, 2010, 09:02:37 am »
Quote from: Malenko
What exactly was the point of this thread again?

Everyone can obtain their own numbers now, after that, the point is whatever you choose it to be. You could also ask your friendly neighborhood Driver-Man to make you a better driver for that crappy USB connection of yours.

At this point, I would not install anything you wrote. I would recommend the same to anyone else looking at any of your software. You present a danger copying and pasting code you apparently do not even bother reviewing or understanding. See my next point.

Quote
Quote from: JustMichael
Now that is a very good question!

Don't you see 7ms lag between each key would mean only about TWO KEYS per frame @60 FPS animation?

This statement is so patently ludicrous you should be kicked out of here for it. Simply playing a game with the keyboard would prove this statement wrong.

Rather than seeking education and understanding, Driver has done nothing but attempt to disprove nearly every statement that has been written here. Only when that evidence is painfully overwhelming does Driver switch his argument to another focus. Where is the value in a thread filled with nonsense counter arguments?

This thread needs to end.
« Last Edit: September 27, 2010, 09:05:03 am by SavannahLion »

MonMotha

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2378
  • Last login:February 19, 2018, 05:45:54 pm
Re: USB vs PS/2 vs COM vs LPT
« Reply #167 on: September 27, 2010, 09:23:17 am »
Since I was scratching my head over this one, Driver-Man's "port 0x81" appears to come from the USB endpoint number.  Of course, this is not an IO port at all; it's just an identifier to separate out some of the traffic on the USB line from other traffic, but that's the only place I can think of this number coming from.  Actual IO port 0x81 would be part of the configuration registers for the 8237 DMA controller that was used on the ISA bus.  I believe those registers still exist for use with the LPC bus, but I could be wrong.  I certainly wouldn't expect applications or the OS to look for or place keyboard data there.  If you did so on a PC where those registers were active, the results could be...interesting.

Somewhat spotty compatibility with older OSes when you deviate from the "boot compatible" keyboard device.  I even have a device that should be boot compliant which works fine under 98SE and XP, but performs poorly for gaming under 2K.  Haven't tested it with Win7 yet, but I'll bet it's ok.  If it is, it will probably see the light of day eventually.  PS/2 just works, though, and I've seen a lot of folks here resort to using it when the USB side of things doesn't go their way.  That's why I tend to coax folks into using PS/2 for key input if they have the port available to them, and have never had anyone be disappointed with the performance they experience for doing so.  If nothing else, it does an excellent job for this application, and doesn't use up a USB port that could be used for something else a little less mundane.

This is a little off-topic, but it sounds like you may have some experimental data I can use (saving me the trouble of setting up one of my USB dev boards to determine it myself).  If you declare your usage as a keyboard but with "variable" (non-array) format data, 1 bit each corresponding to a pre-defined keycode, does it work in Windows or any OS for that matter?  Clearly, this is not boot protocol compatible, but I can see nothing in the HID standard that would prohibit it.  This would let you send all 104 keycodes of a standard PC keyboard using only a 13 byte report (albeit without the ability to indicate RolloverError if ghosting occured and with a potentially quite large report descriptor).
« Last Edit: September 27, 2010, 09:25:34 am by MonMotha »

DillonFoulds

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 605
  • Last login:August 27, 2019, 05:04:44 am
Re: USB vs PS/2 vs COM vs LPT
« Reply #168 on: September 27, 2010, 10:52:56 am »
I think my ~9s on 100m Track and Field disproves driver-man all together, but I'm willing to try out an LPT solution to see if it actually makes any difference...

AndyWarne

  • Trade Count: (+18)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1938
  • Last login:April 11, 2021, 03:37:09 am
    • Ultimarc
Re: USB vs PS/2 vs COM vs LPT
« Reply #169 on: September 27, 2010, 11:38:47 am »

You are not really achieving anything by sending the full information in the first 32 bytes, since you will still be sending as many of those packets as keys were pressed, just like my USB trace shows too. You are stuffing 5x32 = 160 bytes down the USB pipe just to signal 5 keys are down!?



Ok here we go again. You have missed out the captures above this which show no keys pressed, the ones which send all zeros.
So, we start with no keys pressed (all zeros). Then the next packet, 2ms later, when all keys are pressed, contains all the keys. Thats all we need to know.
But for info, now, after that another 4 packets are sent, with all the keycodes. These form no part in the process as the host already knows all 5 keys are pressed. These packets are simply repeating data already sent.
So, why are they sent? Well... the host polls the device at 2ms intervals. Usually the device will send a NAK unless it has some data to send. The trace does not show the NAKed polls as I have turned off "Disply NAKed transactions" in the view to avoid clutter.
The device has "Acked" 5 transactions and sent data. The reason I do this is just in case the host might have missed the first one. I could just send one packet every time there is a change but I send 5 (or more accurately I respond to 5 requests from the host). There is no advantage to be gained by sending only one packet so I send 5. This does not slow the process as the host gets the 5 keys in one go, on the first packet. The others are just to "make sure".

Many USB devices ACK all requests from the host and send data on all requests. I just happen to ACK 5 then stop sending unnecessarily until the next state change.

The only part you need to look at are the transaction with no keys and the one after it with 5 keys.
« Last Edit: September 27, 2010, 11:40:25 am by AndyWarne »

saint

  • turned to the Dark Side
  • Supreme Chancellor
  • Trade Count: (+6)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 6149
  • Last login:Yesterday at 09:23:48 am
  • I only work in cyberspace...
    • Build Your Own Arcade Controls
Re: USB vs PS/2 vs COM vs LPT
« Reply #170 on: September 27, 2010, 11:41:08 am »
Excellent post. I'm going to borrow this in the future.

This thread is still alive due to the interesting technical bits that keep coming out. When they stop this thread will be locked.

netiquette...

An "Internet troll" or "Forum Troll" or "Message Board Troll" is a person who posts outrageous message to bait people to answer. Forum Troll delights in sowing discord on the forums.  A troll is someone who inspires flaming rhetoric, someone who is purposely provoking and pulling people into flaming discussion.  Flaming discussions usually end with name calling and a flame war.
 
A classic troll is trying to make us believe that he is a genuine skeptic with no hidden agenda.  He is divisive and argumentative with need-to-be-right attitude, "searching for the truth",  flaming discussion, and sometimes insulting people or provoking people to insult him.  Troll is usually an expert in reusing the same words of its opponents and in turning it against them.

They usually have an agenda. Very few trolls come to out of pure skepticism. A Troll is generally a person who is extremely skeptical of the main forum subject.
He is generally interested to make other forum members look stupid. A troll will sometimes use insults to provoke other people to insult him. Then, he will complain to moderators of being insulted and will request that his opponents get banned from further discussion.

He (and in 90% of cases it is he) tries to start arguments and upset people.

Sometimes, Internet troll is trying to spin conflicting information, is questioning in an insincere manner, flaming discussion, insulting people, turning people against each other, harassing forum members,  ignoring warnings from forum moderators.

Trolling is a form of harassment that can take over a discussion. Well meaning defenders can create chaos by responding to trolls. The best response is to ignore it, or to report a message to a forum moderator. Moderators usually delete troll messages or block trolls.  Negative emotions stirred up by trolls leak over into other discussions. Normally affable people can become bitter after reading an angry interchange between a troll and his victims, and this can poison previously friendly interactions between long-time users.

Finally, trolls create a paranoid environment, such that a casual criticism by a new arrival can elicit a ferocious and inappropriate backlash.

When trolls are ignored they step up their attacks, desperately seeking the attention they crave. Their messages become more and more foul, and they post ever more of them.

Alternatively, they may protest that their right to free speech is being curtailed. 

Perhaps the most difficult challenge for a webmaster is deciding whether to take steps against a troll that a few people find entertaining. Some trolls do have a creative spark and have chosen to squander it on being disruptive. There is a certain perverse pleasure in watching some of them. Ultimately, though, the webmaster has to decide if the troll actually cares about putting on a good show for the regular participants, or is simply playing to an audience of one -- himself.

Next time you are on a message board and you see a post by somebody whom you think is a troll, and you feel you must reply, simply write a follow-up message entitled "Troll Alert" and type only this:

The only way to deal with trolls is to limit your reaction and not to respond to trolling messages.  It is well known that most people don't read messages that nobody responds to, while 99% of forum visitors first read the longest and the largest threads with the most answers.
 

FYI: trolling is NOT encouraging the community, in the long run it is irritating to the community members, the moderators, and only helps in encouraging people to not read interesting threads anymore. Nothing good can come out of a troll.

If the moderators don't have a good discussion with the man that talks about himself in the 3rd person, I encourage people to stop posting on this and any other of his threads - don't feed the troll, don't encourage him. Note that all the good discussions of this thread were done while he wasn't trolling, between distant posts of him, and when he posts, we only rechew the same data over and over.

All that had to be said on the topic has been said and proven, yet the guy can't see the light. An empty bottleneck is not a problem (there is more then ennough time to process all keypress in emulation software between every emulated cycle), but an annoying troll is.

I suggest to everyone to use the ignore button on his username, too.
--- John St.Clair
     Build Your Own Arcade Controls FAQ
     http://www.arcadecontrols.com/
     Project Arcade 2!
     http://www.projectarcade2.com/
     saint@arcadecontrols.com

Driver-Man

  • Guest
  • Trade Count: (0)
Re: USB vs PS/2 vs COM vs LPT
« Reply #171 on: September 27, 2010, 08:28:08 pm »
Quote from: SavannahLion
Quote
Don't you see 7ms lag between each key would mean only about TWO KEYS per frame @60 FPS animation?
This statement is so patently ludicrous you should be kicked out of here for it. Simply playing a game with the keyboard would prove this statement wrong.

That statement is mathematical equation -> 0.016 / 0.007 = 2.29


Quote from: Marsupial
Forum Troll delights in sowing discord on the forums. A troll is someone who inspires flaming rhetoric, someone who is purposely provoking and pulling people into flaming discussion. Flaming discussions usually end with name calling and a flame war.

You are talking about Eris, the Greek goddess of discord, quarrel, strife and conflict. Sometimes equated with the war goddess Enyo, her name translates into Latin as Discordia. However, there are two sides to this "coin", which is beautifully put in Hesiod's "Works and Days" (700BC):

- "So, after all, there was not one kind of Strife alone, but all over the earth there are two. As for the one, a man would praise her when he came to understand her; but the other is blameworthy: and they are wholly different in nature. For one fosters evil war and battle, being cruel: her no man loves; but perforce, through the will of the deathless gods, men pay harsh Strife her honour due. But the other is the elder daughter of dark Nyx, and the son of Cronus who sits above and dwells in the aether, set her in the roots of the earth: and she is far kinder to men. She stirs up even the shiftless to toil; for a man grows eager to work when..."
« Last Edit: September 28, 2010, 03:54:02 pm by Driver-Man »

emerica

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 219
  • Last login:September 18, 2024, 09:27:07 pm
  • Goodtimes!
    • My ongoing projects
Re: USB vs PS/2 vs COM vs LPT
« Reply #172 on: September 27, 2010, 08:36:36 pm »
I can't believe I read this whole thread. What is the point again?

Oh yeah...The Ipac and Keywiz work perfectly, plain and simple. So I applaud Andy, Randy, and Saint (project arcade) for making things easy for the rest of us. Thank you.  :applaud:

BTW, I'm still trying to figure out what that smiley face is supposed to be in Bezerk. 

I saw the best minds of my generation destroyed by madness, starving hysterical.

Driver-Man

  • Guest
  • Trade Count: (0)
Re: USB vs PS/2 vs COM vs LPT
« Reply #173 on: September 27, 2010, 08:48:42 pm »
I can't believe I read this whole thread. What is the point again?

It's over.  


What you could do now is if you can perform the simple test on your machine and show us the results.

* USBTrace 1.3.0
http://www.topshareware.com/USBTrace-transfer-42419.htm

* Passmark keyboard test
http://www.passmark.com/products/keytest.htm


TEST: Press [Q+W+E+R] at the same time, hold for a few seconds and then release them all in the same time. Then simply capture the screenshots and put it up here like we did on previous page. Can you do that please?

JustMichael

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1438
  • Last login:September 27, 2015, 01:19:40 am
  • Mmmmm!! Cheesecake!!
Re: USB vs PS/2 vs COM vs LPT
« Reply #174 on: September 27, 2010, 09:19:12 pm »
And what exactly are these two programs supposed to "prove"?   ???

Marsupial

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 511
  • Last login:April 17, 2024, 09:00:56 pm
  • I am teh Mars!
Re: USB vs PS/2 vs COM vs LPT
« Reply #175 on: September 27, 2010, 09:43:53 pm »
And what exactly are these two programs supposed to "prove"?   ???

that Driver-Man is a troll.
-Mars

Driver-Man

  • Guest
  • Trade Count: (0)
Re: USB vs PS/2 vs COM vs LPT
« Reply #176 on: September 27, 2010, 10:01:26 pm »
Quote
And what exactly are these two programs supposed to "prove"?

Statistics. Relax, it's over. Ask MonMotha to explain.
  

Quote from: AndyWarne
You have missed out the captures above this which show no keys pressed, the ones which send all zeros.

There was nothing above, that was the first set of data - 5 keys down.

YOU:



ME:



Quote
So, we start with no keys pressed (all zeros).

No, you start with 5 packets, each 32 bytes long, and each holding absolutely the same information saying 5 keys are down.


Quote
Then the next packet, 2ms later, when all keys are pressed, contains all the keys. Thats all we need to know.

No, you first send one packet with all 5 keys down, then 2ms later another one with that SAME information, and again, and again, and again. Then you release those five keys and then you again send 5 packets of 32 bytes, this time all zeros, 5 x 32 = 160 bytes just to signal 5 keys went up.

Quote
But for info, now, after that another 4 packets are sent, with all the keycodes. These form no part in the process as the host already knows all 5 keys are pressed. These packets are simply repeating data already sent. So, why are they sent? Well... the host polls the device at 2ms intervals.

No, there is no traffic going on EVERY 2ms, ONLY when you press or release a key, it is clear from the time intervals. -- You have steady 2ms intervals when you make simultaneous 5 key press, but you can then notice a longer pause when you hold down the keys before you release.


Quote
I could just send one packet every time there is a change but I send 5 (or more accurately I respond to 5 requests from the host). There is no advantage to be gained by sending only one packet so I send 5. This does not slow the process as the host gets the 5 keys in one go, on the first packet. The others are just to "make sure".

How can you control that number of packets sent? Encoder? Driver?
« Last Edit: September 27, 2010, 10:03:53 pm by Driver-Man »

JustMichael

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1438
  • Last login:September 27, 2015, 01:19:40 am
  • Mmmmm!! Cheesecake!!
Re: USB vs PS/2 vs COM vs LPT
« Reply #177 on: September 28, 2010, 02:01:39 am »
Quote from: AndyWarne
You have missed out the captures above this which show no keys pressed, the ones which send all zeros.

There was nothing above, that was the first set of data - 5 keys down.

I am guessing his software program is smart enough to skip the zero packets before the first keypress.  I would bet this is why we missed out on those zero packets.

Quote from: Driver-Man
Quote from: AndyWarne
So, we start with no keys pressed (all zeros).

No, you start with 5 packets, each 32 bytes long, and each holding absolutely the same information saying 5 keys are down.

He was telling us about the packets that came before the ones shown.

Quote from: Driver-Man
Quote from: AndyWarne
Then the next packet, 2ms later, when all keys are pressed, contains all the keys. Thats all we need to know.

No, you first send one packet with all 5 keys down, then 2ms later another one with that SAME information, and again, and again, and again. Then you release those five keys and then you again send 5 packets of 32 bytes, this time all zeros, 5 x 32 = 160 bytes just to signal 5 keys went up.

He sends the packet more than once to ensure that it gets there intact.  Why 5 times?  Arbitrary number I guess.

Or possibly:

2 times would be sufficient in case the first got "lost" but then you multiply that by "the rule of 2 1/2" and you get 5 times.  The "rule of 2 1/2" I refer to is a "rule" I learned a long time ago.  First you figure out how much whatever will be enough for your needs, multiply it by 2 1/2 and you're guaranteed to have enough (even under unforeseen circumstances).

Quote from: Driver-Man
Quote from: AndyWarne
But for info, now, after that another 4 packets are sent, with all the keycodes. These form no part in the process as the host already knows all 5 keys are pressed. These packets are simply repeating data already sent. So, why are they sent? Well... the host polls the device at 2ms intervals.

No, there is no traffic going on EVERY 2ms, ONLY when you press or release a key, it is clear from the time intervals. -- You have steady 2ms intervals when you make simultaneous 5 key press, but you can then notice a longer pause when you hold down the keys before you release.

Just because he only shows you part of the traffic doesn't mean the rest of the traffic doesn't exist.  AndyWarne even stated he turned off tracking of the NAK responses:
So, why are they sent? Well... the host polls the device at 2ms intervals. Usually the device will send a NAK unless it has some data to send. The trace does not show the NAKed polls as I have turned off "Disply NAKed transactions" in the view to avoid clutter.
The NAK responses are all the 2ms responses that aren't being shown.  There would be 85 NAK's responses alone between the first set of keys down and the keys up.  I think showing those 85 responses would be a big waste of space.

Quote from: Driver-Man
Quote from: AndyWarne
I could just send one packet every time there is a change but I send 5 (or more accurately I respond to 5 requests from the host). There is no advantage to be gained by sending only one packet so I send 5. This does not slow the process as the host gets the 5 keys in one go, on the first packet. The others are just to "make sure".

How can you control that number of packets sent? Encoder? Driver?

I think you are confused again and AndyWarne even clarified his statement.  There is only 1 packet being sent each time the host makes a request.  He just sends a data packet that has the keys as a response to the host's request and then resends that same data packet to the next 4 requests.

riley454

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 24
  • Last login:November 03, 2010, 07:16:26 am
Re: USB vs PS/2 vs COM vs LPT
« Reply #178 on: September 28, 2010, 07:24:32 am »
MY HEAD HURTS :blah:

Can someone please simplify what is the best way to connect a mame panel that plays everything from space invaders to mortal combat 4 up to a pc without the geek talk?

CheffoJeffo

  • Cheffo's right! ---saint
  • Wiki Master
  • Trade Count: (+2)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7784
  • Last login:July 14, 2025, 12:11:49 pm
  • Worthless button pusher!
Re: USB vs PS/2 vs COM vs LPT
« Reply #179 on: September 28, 2010, 07:30:54 am »
Can someone please simplify what is the best way to connect a mame panel that plays everything from space invaders to mortal combat 4 up to a pc without the geek talk?

Sure -- RTFW.

 :afro:

Working: Not Enough
Projects: Too Many
Progress: None

Santoro

  • Purveyor of Shiny Arcade Goodness
  • Santoro
  • Trade Count: (+32)
  • Full Member
  • *
  • Offline Offline
  • Posts: 3055
  • Last login:July 14, 2025, 03:43:29 pm
  • Boycott Quarters!!!
    • ArcadeReplay!
Re: USB vs PS/2 vs COM vs LPT
« Reply #180 on: September 28, 2010, 07:37:18 am »
MY HEAD HURTS :blah:

Can someone please simplify what is the best way to connect a mame panel that plays everything from space invaders to mortal combat 4 up to a pc without the geek talk?

IMHO this is a purely academic conversation that doesn't change any of the MAME conventional wisdom as captured in the Wiki. 

newmanfamilyvlogs

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1694
  • Last login:June 15, 2022, 05:20:38 pm
    • forum.arcadecontrols.com/index.php/topic,103584.msg1096585.html#msg1096585
    • Newman Family Vlogs
Re: USB vs PS/2 vs COM vs LPT
« Reply #181 on: September 28, 2010, 08:28:03 am »
Just for fun..  here's an unfiltered USBTrace history dump for banging on 7 keys simultaneously on a MiniPac:

http://cotmm.org/arcade/minipac_7buttons.html

Held them for a moment and smashed on a few times before the trial version's buffer filled up.

Edit:
and just for comparison sake, a trace where I rapidly press a single button:
http://cotmm.org/arcade/minipac_singlekey.html
« Last Edit: September 28, 2010, 08:34:22 am by cotmm68030 »

MonMotha

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2378
  • Last login:February 19, 2018, 05:45:54 pm
Re: USB vs PS/2 vs COM vs LPT
« Reply #182 on: September 28, 2010, 09:16:39 am »
Statistics. Relax, it's over. Ask MonMotha to explain.

I'm done arguing with you.  Leave me the heck out of this.

AndyWarne

  • Trade Count: (+18)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1938
  • Last login:April 11, 2021, 03:37:09 am
    • Ultimarc
Re: USB vs PS/2 vs COM vs LPT
« Reply #183 on: September 28, 2010, 10:11:27 am »

How can you control that number of packets sent? Encoder? Driver?


Thats just a number I decided to use when I was writing the firmware. Some devices only ACK one packet after a state change and some ACK all packets all of the time even when there is no state change. In fact the majority of devices just ACK all host requests and send the data at the specified poll rate. This just seems unnecessary to me so I stop at 5. No point in rambling on repeating yourself over and over again.....

MonMotha

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2378
  • Last login:February 19, 2018, 05:45:54 pm
Re: USB vs PS/2 vs COM vs LPT
« Reply #184 on: September 28, 2010, 11:49:07 am »
Thats just a number I decided to use when I was writing the firmware. Some devices only ACK one packet after a state change and some ACK all packets all of the time even when there is no state change. In fact the majority of devices just ACK all host requests and send the data at the specified poll rate. This just seems unnecessary to me so I stop at 5. No point in rambling on repeating yourself over and over again.....

Isn't this what HID IDLE is supposed to address?  Of course, IDLE seems to me like an overly complex solution to address such a simple problem.

Driver-Man

  • Guest
  • Trade Count: (0)
Re: USB vs PS/2 vs COM vs LPT
« Reply #185 on: September 28, 2010, 01:21:21 pm »
Quote from: cotmm68030
Just for fun..  here's an unfiltered USBTrace history dump for banging on 7 keys simultaneously on a MiniPac:

http://cotmm.org/arcade/minipac_7buttons.html

Held them for a moment and smashed on a few times before the trial version's buffer filled up.

If you could do more controlled test, so instead of "banging" and 7 buttons, try just 3 or 4 buttons, and make precise, firm simultaneous push, hold for a sec or two, and the then release them all in the same time. That should produce sufficient and more readable data, anyway here's what I conclude...

Code: [Select]
#7 0.172194 = 00 01 02 00 - Button A down
#11 0.188163 = 00 01 01 00 - Button B down
#15 0.196286 = 00 01 01 00 - Button B down
#19 0.204161 = 00 01 01 00 - Button B down
#23 0.212153 = 00 00 01 00 - Button C down / Button B up?
#27 0.220165 = 00 01 01 00 - Button B down
#31 0.228163 = 00 01 01 00 - Button B down
...holding down for 0.672 sec
#35 0.900140 = 01 00 01 00 - Button C down / Button B up?
...still holding for 0.136 sec more
#39 1.036147 = 00 00 00 00 - All buttons up
...pause
#43 1.172134 = 00 01 00 00 - Button D down / ?? up
#47 1.180117 = 00 02 00 00 - Button E down / ?? up
.
.

* 4 bytes long buffer,
looks like this is "MOUSE" type device.

* It has steady minimum latency of 8 ms,
but no constant polling rate, signals only state change

=======================================================
MAXIMUM INPUTS PER FRAME @60 FPS = 1/60 / 0.008 = 2.083

With this same pooling rate, this device could potentially do 4 x 2 = 8 inputs per frame @60fps, if it was not mouse/kbd device, or maybe if it only had different driver, who knows.


Quote
and just for comparison sake, a trace where I rapidly press a single button:
http://cotmm.org/arcade/minipac_singlekey.html

Code: [Select]
..missing 3 packets?
 #7 0.011828 = 00 00 1A 00 00 00 00 00 00 00 00 00 00 00 00 00 - down
#11 0.015812 = 00 00 1A 00 00 00 00 00 00 00 00 00 00 00 00 00 - down
#15 0.059869 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - up
#19 0.063845 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - up
#23 0.067835 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - up
#27 0.071836 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - up
#31 0.075843 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - up
...pause
#35 0.143824 = 00 00 1A 00 00 00 00 00 00 00 00 00 00 00 00 00 - down
#39 0.147805 = 00 00 1A 00 00 00 00 00 00 00 00 00 00 00 00 00 - down
#43 0.151797 = 00 00 1A 00 00 00 00 00 00 00 00 00 00 00 00 00 - down
#47 0.155807 = 00 00 1A 00 00 00 00 00 00 00 00 00 00 00 00 00 - down
#51 0.159800 = 00 00 1A 00 00 00 00 00 00 00 00 00 00 00 00 00 - down
...holding button down for 0.068 sec
#55 0.227818 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - up
#59 0.231805 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - up
#63 0.235802 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - up
#67 0.239807 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - up
#71 0.243808 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - up
...pause
#75 0.291894 = 00 00 1A 00 00 00 00 00 00 00 00 00 00 00 00 00 - down
.
.


* 16 bytes long buffer, 5 packets per state change?
this is different device, or it has second controller

* It has steady minimum latency of 4 ms,
but no constant polling rate, signals only state change

=======================================================
MAXIMUM INPUTS PER FRAME @60 FPS = 1/60 / 0.004 = 4.17 ?


With this same polling rate, this device has potential to produce 4 x 16 = 64 inputs per frame, which possibly comes down to 16 inputs due to redundancy, however due to the keyboard driver, or something, this seem to be limited to only about 4 inputs per frame @60fps, minus "keys up" aka. "break codes". -- It's inconclusive, please do 3 and 4 simultaneous press test with this device too. [edit: We still have not quite established how windows drivers work and what particular method of READING the input is employed in MAME.



*** More tests & statistics...


X-Arcade trackball USB trace:



* 4 bytes long buffer,
this is "MOUSE" type device

* It has *unsteady* latency, minimum ~2-6 ms,
but no constant polling rate, signals only state change

=======================================================
MAXIMUM INPUTS PER FRAME @60 FPS = 1/60 / 0.002 = 8.33

With this same pooling rate, this device could potentially do 4 x 8 = 32 inputs per frame @60fps, if it was not mouse/kbd device, or maybe if it only had different driver, who knows.



PC GamePad (DualShock clone) USB trace:




* 8 bytes long buffer,
this is "Generic USB Joystick" device

* It has steady latency of 2 ms,
the first one that actually has constant output stream

=======================================================
MAXIMUM INPUTS PER FRAME @60 FPS = 1/60 / 0.002 x 8 = 66.7 ?

This a bit more complicated as there are two analog sticks too, and I can't really tell from this data sample if there is any redundancy there as well. In any case, this device is constantly pushing data down the USB at steady 2ms intervals and in this test I did not press any buttons at all.
« Last Edit: September 28, 2010, 04:29:53 pm by Driver-Man »

newmanfamilyvlogs

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1694
  • Last login:June 15, 2022, 05:20:38 pm
    • forum.arcadecontrols.com/index.php/topic,103584.msg1096585.html#msg1096585
    • Newman Family Vlogs
Re: USB vs PS/2 vs COM vs LPT
« Reply #186 on: September 28, 2010, 01:32:09 pm »
the trackball was sending a fair bit of data that makes it harder to read. i disconnected the trackball for the following traces:

http://cotmm.org/arcade/minipac_6buttons.html
Six buttons pushed on and off, slowly and as simultaneously as I could manage

http://cotmm.org/arcade/minipac_4buttons.html
Four buttons pressed in various combination.

http://cotmm.org/arcade/minipac_twobuttons.html
Two buttons pressed in a more controlled fashion.

http://cotmm.org/arcade/minipac_twoalternate.html
Two buttons alternating as fast as I could hit them.


Malenko

  • KNEEL BEFORE ZODlenko!
  • Trade Count: (+58)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 14019
  • Last login:July 02, 2025, 09:03:11 pm
  • Have you played with my GingerBalls?
    • forum.arcadecontrols.com/index.php/topic,142404.msg1475162.html
Re: USB vs PS/2 vs COM vs LPT
« Reply #187 on: September 28, 2010, 02:37:16 pm »
MAXIMUM INPUTS PER FRAME @60 FPS = 1/60 / 0.008 = 2.083

When why can I jump and fire while circle strafing in a FPS game?
If you're replying to a troll you are part of the problem.
I also need to follow this advice. Ignore or report, don't reply.

Driver-Man

  • Guest
  • Trade Count: (0)
Re: USB vs PS/2 vs COM vs LPT
« Reply #188 on: September 28, 2010, 03:02:22 pm »
MAXIMUM INPUTS PER FRAME @60 FPS = 1/60 / 0.008 = 2.083

When why can I jump and fire while circle strafing in a FPS game?

Holding a third key will not impact the two other keys you are "tapping", you will still be able to report both jump and fire in the same frame. However, if you start from complete still, and then press all three in the same time, then in the 1st frame you will do two of those three actions, and in the very next frame program will pull the 3rd one from the buffer (even if you release them all by this time) and so this would be impossible to notice... but, in Donkey Kong, try to stand still and then *TAP* "jump+arrow key" and see if you can do it at all (jump sideways).


I have to fix some numbers in my previous post...

Malenko

  • KNEEL BEFORE ZODlenko!
  • Trade Count: (+58)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 14019
  • Last login:July 02, 2025, 09:03:11 pm
  • Have you played with my GingerBalls?
    • forum.arcadecontrols.com/index.php/topic,142404.msg1475162.html
Re: USB vs PS/2 vs COM vs LPT
« Reply #189 on: September 28, 2010, 03:25:30 pm »

Holding a third key will not impact the two other keys you are "tapping", you will still be able to report both jump and fire in the same frame. However, if you start from complete still, and then press all three in the same time, then in the 1st frame you will do two of those three actions, and in the very next frame program will pull the 3rd one from the buffer (even if you release them all by this time) and so this would be impossible to notice... but, in Donkey Kong, try to stand still and then *TAP* "jump+arrow key" and see if you can do it at all (jump sideways).


I have to fix some numbers in my previous post...

but I do that all the time, turn face to barrel standing jump backwards...... in street fight I'll hold tap D+F+medium kick with chun li all the time, in bad dudes I tap up+forward+jump+atack to spin kick.........
If you're replying to a troll you are part of the problem.
I also need to follow this advice. Ignore or report, don't reply.

Driver-Man

  • Guest
  • Trade Count: (0)
Re: USB vs PS/2 vs COM vs LPT
« Reply #190 on: September 28, 2010, 03:46:57 pm »
Ok, can you make "SIMULTANEOUS 3 BUTTON TEST" and "SIMULTANEOUS 4 BUTTON TEST", then put up screenshot of the USB trace here? [Edit: two tests, both can be done in one session]


« Last Edit: September 28, 2010, 04:25:21 pm by Driver-Man »

newmanfamilyvlogs

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1694
  • Last login:June 15, 2022, 05:20:38 pm
    • forum.arcadecontrols.com/index.php/topic,103584.msg1096585.html#msg1096585
    • Newman Family Vlogs
Re: USB vs PS/2 vs COM vs LPT
« Reply #191 on: September 28, 2010, 03:53:17 pm »
I don't follow 'simultaneous 3 and 4 button'. You mean you want seven buttons simultaneously?

Driver-Man

  • Guest
  • Trade Count: (0)
Re: USB vs PS/2 vs COM vs LPT
« Reply #192 on: September 28, 2010, 04:02:15 pm »
First do one, then the other test,  you can do it both in one session.

1. Start session

2. Press THREE buttons in the same time
...hold ~2 seconds

3. Release all three buttons in the same time
...wait ~5 seconds

4. Press FOUR buttons in the same time
...hold ~2 seconds

5. Release all four buttons in the same time

6. Capture the screen and upload the image here


* Maybe also apply filters, so to only show "IN" packets with "DATA".
« Last Edit: September 28, 2010, 04:26:15 pm by Driver-Man »

Marsupial

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 511
  • Last login:April 17, 2024, 09:00:56 pm
  • I am teh Mars!
Re: USB vs PS/2 vs COM vs LPT
« Reply #193 on: September 28, 2010, 04:14:21 pm »
I tought this topic was over?


Oh, that's right...

it won't be over until its either locked, or Driver-Man is revoked rights to post into it... I almost forgot.


edit: quote:
It's over. 

« Last Edit: September 28, 2010, 04:17:21 pm by Marsupial »
-Mars

Driver-Man

  • Guest
  • Trade Count: (0)
Re: USB vs PS/2 vs COM vs LPT
« Reply #194 on: September 28, 2010, 04:22:27 pm »
Argument is over. Conclusion is - "it depends".

No one is arguing anymore, we are simply sharing information now.  :cheers:



newmanfamilyvlogs

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1694
  • Last login:June 15, 2022, 05:20:38 pm
    • forum.arcadecontrols.com/index.php/topic,103584.msg1096585.html#msg1096585
    • Newman Family Vlogs
Re: USB vs PS/2 vs COM vs LPT
« Reply #195 on: September 28, 2010, 04:36:30 pm »
Filtered of three down, then up, then four down, then up.

Then successively pressing several keys and remaining down, then all up.

Filtered to only data in.
http://cotmm.org/arcade/minipac_3then4.html

Smeghead

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 415
  • Last login:November 05, 2015, 11:41:08 pm
  • Better Smeg than dead
    • MY MAME BUILDS
Re: USB vs PS/2 vs COM vs LPT
« Reply #196 on: September 28, 2010, 04:48:49 pm »
WTF is an LPT port any more these days anyway    :lol
My MAME Build:


JustMichael

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1438
  • Last login:September 27, 2015, 01:19:40 am
  • Mmmmm!! Cheesecake!!
Re: USB vs PS/2 vs COM vs LPT
« Reply #197 on: September 28, 2010, 04:55:46 pm »
Driver-Man,
I am curious as to why you seem to think that Mame only gets 1 key for each time a USB device gets polled even though as you have already seen, USB devices like the I-PAC transmit all their keypresses in one data packet?

CheffoJeffo

  • Cheffo's right! ---saint
  • Wiki Master
  • Trade Count: (+2)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7784
  • Last login:July 14, 2025, 12:11:49 pm
  • Worthless button pusher!
Re: USB vs PS/2 vs COM vs LPT
« Reply #198 on: September 28, 2010, 04:56:55 pm »
Argument is over. Conclusion is - "it depends".

No.

The conclusion is that the USB (EDIT) interfaces available from Ultimarc and Groovy Game Gear work fine, despite the fact that they are not LPT-based.

Everybody who has a cab and has played two player simultaneous games has hit at least 6 keys simultaneously, with the SF and 4-player crews hitting more.

If there were a problem, then I am certain that they, or at least kowal, would have already raised the issue.

The particular topic that you are pursuing has been beaten to death eleventy12! times before, but you want somebody to teach you about it. Read Tiger-Heli's encoder tome. Read the multitude of threads here on the topic (we have had some particularly juicy ones on the topic of USB, PS/2, keyboard and gamepads).

Stop being a twerp and sucking the life out of things because you don't understand.

PS - 60-in-1 boards are illegal!

« Last Edit: September 28, 2010, 06:05:31 pm by CheffoJeffo »
Working: Not Enough
Projects: Too Many
Progress: None

newmanfamilyvlogs

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1694
  • Last login:June 15, 2022, 05:20:38 pm
    • forum.arcadecontrols.com/index.php/topic,103584.msg1096585.html#msg1096585
    • Newman Family Vlogs
Re: USB vs PS/2 vs COM vs LPT
« Reply #199 on: September 28, 2010, 04:58:48 pm »

Stop being a twerp and sucking the life out of things because you don't understand.

PS - 60-in-1 boards are illegal!


Dammit, I just laughed out loud in my office and everyone looked at me. Thanks  :D