Need some USB help!!!!!

gamefixer

Well-known member
Joined
Feb 27, 2005
Messages
9,082
Reaction score
551
Location
Colorado
I'm building a 4 player Towerfall Ascension cabinet for a guy here in the area. I'm using Brooks Universal Fighting boards as the players interface.

No matter what I do I CAN NOT get these boards to stay put. In other words, upon a power cycle the players move. 1 might become 2, 2 might become 3 and so on.... Its never the same...

Anyone know of a way to lock these things down? I've found some utilities that do this but they all talk about MAME and this isnt MAME.

I've tried plugging all four boards into a powered hub, non powered hub, directly to the USB 3.0 ports on the mobo, into a USB 2.0 expansion card... NOTHING WORKS!!!!

If I plug them in one at a time after power up from left to right they keep their player order during that power up.

Thanks guys!
 

Attachments

  • IMG_4993.JPG
    IMG_4993.JPG
    113.5 KB · Views: 26
  • IMG_4994.JPG
    IMG_4994.JPG
    132.9 KB · Views: 36
Last edited:
It was the Ouya's only worthwhile game. That is probably the Steam version, though. It is amazingly fun. I play it with my son and his friends.
 
The game is an absolute blast, just wish I could get the controllers to stay put.
 
There might be a more elegant solution, but it seems you might be able to hack something together with devcon. See the answer at the bottom of this page:
https://superuser.com/questions/343...ysically-re-plug-a-usb-drive-to-read-it-again

So, it seems to suggest that you'd need to have each device on its own hub (seems like you might already have enough, given you've tried 2 different external hubs, a usb expansion card, and the built in ports) . Then you could remove each hub and re-scan one at a time. You could maybe put this into a batch script that auto-runs when windows starts up. It would look something like this (you can go into device manager to find out the VID and PID for each of your hubs while they're plugged in before you start):

devcon remove USB\VID_<VID of hub you want for player 1>*PID_<VID of hub you want for player 1>*
devcon rescan
devcon remove USB\VID_<VID of hub you want for player 2>*PID_<VID of hub you want for player 2>*
devcon rescan
devcon remove USB\VID_<VID of hub you want for player 3>*PID_<VID of hub you want for player 3>*
devcon rescan
devcon remove USB\VID_<VID of hub you want for player 4>*PID_<VID of hub you want for player 4>*
devcon rescan

Seems pretty hack-ish, but it looks like the USB spec doesn't really provide for manually determining enumeration order. So you're left to either dealing with it in your SW application (which is apparently not an option), or playing some tricks like this.
 
There might be a more elegant solution, but it seems you might be able to hack something together with devcon. See the answer at the bottom of this page:
https://superuser.com/questions/343...ysically-re-plug-a-usb-drive-to-read-it-again

So, it seems to suggest that you'd need to have each device on its own hub (seems like you might already have enough, given you've tried 2 different external hubs, a usb expansion card, and the built in ports) . Then you could remove each hub and re-scan one at a time. You could maybe put this into a batch script that auto-runs when windows starts up. It would look something like this (you can go into device manager to find out the VID and PID for each of your hubs while they're plugged in before you start):

devcon remove USB\VID_<VID of hub you want for player 1>*PID_<VID of hub you want for player 1>*
devcon rescan
devcon remove USB\VID_<VID of hub you want for player 2>*PID_<VID of hub you want for player 2>*
devcon rescan
devcon remove USB\VID_<VID of hub you want for player 3>*PID_<VID of hub you want for player 3>*
devcon rescan
devcon remove USB\VID_<VID of hub you want for player 4>*PID_<VID of hub you want for player 4>*
devcon rescan

Seems pretty hack-ish, but it looks like the USB spec doesn't really provide for manually determining enumeration order. So you're left to either dealing with it in your SW application (which is apparently not an option), or playing some tricks like this.

I'll get to reading. Hopefully I can make sense of it all. :)
 
I wonder if theres a "devcon add" that I can use much like remove? Reason I'm wondering is....

Lets say the PC is rebooted. All of the USB controllers PID and VID numbers will already be added and operational as far as Windows is concerned. If I remove the first one and rescan for it wont it be added to the last on the list of the USB devices? Hmm... Maybe by scanning and removing the others they will move up the list? Hmm...
 
Yeah, I don't really see the equivalent "add" command on this list:
https://msdn.microsoft.com/en-us/windows/hardware/drivers/devtest/devcon-general-commands

Like you were saying, my hope would be that removing them and rescanning them in order would result in them being added in some sort of deterministic fashion, though I could be totally wrong!

It's at least worth an experiment. If this fails, then you could possibly rig up some solution with an arduino that controlled some relays to supply the power to the controllers in a certain order. Could have some batch file send a string over the serial port upon boot, which the arduino could detect and use as a signal to power up the controllers in order. I'm hoping you can find a less hardware-intensive solution, but at least there are options :)
 
Last edited:
Perhaps this utility is applicable to your situation?

https://github.com/briankendall/devreorder

"A utility for reordering and hiding controllers for games using DirectInput 8. It's implemented using a wrapper DLL and can be used to change the behavior of a single game or your entire system.

The main use of this tool is to bring some sanity to older DirectInput games that rely on the enumeration order of devices to determine the controller order in game (even though they are not supposed to do that). After Windows XP, and especially starting with Windows 8, the enumeration order of controllers is quite arbitrary and will change after rebooting Windows or unplugging and replugging in your devices. This can wreck havoc on games where you have carefully set up controller bindings for players 1-4, only to find that they are totally ruined the next time you boot up Windows."
 
Perhaps this utility is applicable to your situation?

https://github.com/briankendall/devreorder

"A utility for reordering and hiding controllers for games using DirectInput 8. It's implemented using a wrapper DLL and can be used to change the behavior of a single game or your entire system.

The main use of this tool is to bring some sanity to older DirectInput games that rely on the enumeration order of devices to determine the controller order in game (even though they are not supposed to do that). After Windows XP, and especially starting with Windows 8, the enumeration order of controllers is quite arbitrary and will change after rebooting Windows or unplugging and replugging in your devices. This can wreck havoc on games where you have carefully set up controller bindings for players 1-4, only to find that they are totally ruined the next time you boot up Windows."

I bet that would do the trick!

But, theres always one of those isnt there, all four controllers have the same name, same VID and same PID.

I wonder how any of them are working!
 
Install a Program called USBLyzer. It looks into the devices and finds all sorts of cool information. There may be something to see as to how there addressed
 
Install a Program called USBLyzer. It looks into the devices and finds all sorts of cool information. There may be something to see as to how there addressed

OK, I'll try that tomorrow.

Thanks for all the pointers guys.
 
Same guy is thinking about a 4 player Gauntlet based on the new PC game.

UGH.. I've got to figure this out. :)
 
does the game use a config file (text file ideally) that stores the assignments? or is it always first one plugged in is p1, second is p2? If so rather than changing the enumeration order you might be able to detect the order, and re-assign for the game automatically before it launches

or experiment with devcon disable/enable instead of remove to see if it has any effect... (edit, unremove?)

or worst case, put in an output board as well, that powers up the devices one at a time during the boot up process (ie trips a relay to switch the usb power line)
 
Last edited:
does the game use a config file (text file ideally) that stores the assignments? or is it always first one plugged in is p1, second is p2? If so rather than changing the enumeration order you might be able to detect the order, and re-assign for the game automatically before it launches

or experiment with devcon disable/enable instead of remove to see if it has any effect... (edit, unremove?)

or worst case, put in an output board as well, that powers up the devices one at a time during the boot up process (ie trips a relay to switch the usb power line)

No config file that I was able to find. Seems to me that it detects first powered up and so on. If I plug them in left to right it always works correctly.
 
I'm going to try time delayed relays. I have a 4 port hub with a power switch on each port and turning them on in order works so I'm going to wire the timers to control the switches.
 
I bet that would do the trick!

But, theres always one of those isnt there, all four controllers have the same name, same VID and same PID.

Looks like a poorly thought out device

Most USB interfaces have a means to uniquify / serialize the device IDs using on-chip flash. If you can figure out what device they use (pobably an FTDI since they're cheap and ubiquitous), you can rewrite the flash so you can distinguish them.

Otherwise the only solution is to make a board that sequences powerup to the boards so they enumerate in a predictable order.
 
Or.... you could hard-wire unused inputs on the boards and use them as DIP switches to identify which board is which, and have the game itself redo the mapping.
 
Back
Top Bottom