SOLUTION: Windows controllers flipping between Player 1 and Player 2.

Arcade cabinet hardware and accessories
Post Reply
User avatar
Aval0n
Posts: 5
Joined: January 2nd, 2019, 3:59 am
Location: Arizona
eBay: Aval0n2016
Initials: AVA

SOLUTION: Windows controllers flipping between Player 1 and Player 2.

Post by Aval0n »

Solution summary: Uses Windows WDK tool 'devcon' to identify and disable Player2 USB device on user logoff, and re-enable upon user login. This forces Player1 controller to be detected first by the system and gain direct input/xinput P1 role.
Must be run as user with admin privileges
Skill level required: novice to moderate.
_________________________________________________________________________________________________________________________________________________________________________________________________

For a long while now I have been looking for a solution to the rock-paper-scissors bit that Windows does when it reboots on which one of my controllers get Player1. I was able to slightly mitigate this by putting Player1 controller board into the Super Speed USB ports and Player2 into the USB2.0 ports, but it only worked about 70% of the time. That's still enough to be maddening. Windows does a horrible job at handling P1, P2 with directinput / xinput game controllers. Some folks have switched to keyboard emulator boards like Dual Strike 2 to get around this, but I didn't want to sacrifice the convenience of xinput as it rewards default xbox button mappings for all games. I will outline the solution below in case this might help anyone else going crazy with this.

You need to acquire devcon which is part of the Windows Development Kit. I run Windows 10 x64, but it's available all the way back to Server 2003. You can find it here;
https://docs.microsoft.com/en-us/window ... ad-the-wdk
(Alternatively, you can try just downloading the devcon binary provided it's compatible with your windows version from the link below. Thx artik for the link)
http://delphintipz.blogspot.com/2012/07 ... abled.html


Once downloaded and installed, 'devcon' will exist in your 'C:\Program Files (x86)\Windows Kits\Tools\x64\' path. (If you have 32-bit Windows probably just C:\Program Files\)
This path will be referenced several times throughout the guide. The devcon command will not run if you are not in this path.



IDENTIFY PLAYER2 CONTROLLER


(Admittedly method 2 may be more simple, but not everyone will want to take the effort to take apart the cabinet and start unplugging things.)

METHOD 1 - Disable a controller and reboot your PC to see which one doesn't work.

From an elevated command prompt (Right Click --> Run as Administrator) run the following command from the path listed above;
devcon find usb*
This will produce a list of connected USB devices.
Mine showed up as;

USB\VID_045E&PID_C528E\14D61D5 : Xbox 360 Controller for Windows <-- This one wound up being my Player 2 controller
USB\VID_045E&PID_C528E\14D62D5 : Xbox 360 Controller for Windows

Command to disable (Must be run from path listed above);
devcon disable "@USB\VID_045E&PID_C528E\14D61D5"
You will need to replace the USB address with yours. Don't forget to add the @ and double quotes. This will disable the specified controller upon reboot and it will stay off until the opposite command is executed. (Just swap 'disable' with 'enable'.) You have a 50/50 shot.

METHOD 2 - Unplug your Player 1 controller, reboot and run the following command (from path listed above);
devcon find usb*
You should only have 1 controller showing now and should be your Player 2 controller. Take note of the USB address listed for the scripts below.

CREATING THE SCRIPTS
Make a folder somewhere of your choosing to create the 2 scripts required. I opted to create 'C:\P1 scripts'. Use notepad or your favorite text editor and input;
"C:\Program Files (x86)"\Windows Kits\Tools\x64\devcon disable "@USB\YOURADDRESSTHATYOUIDENTIFIED"
Save this script as 'P1 logoff.bat'

Repeat the process above replacing 'disable' with 'enable' and save as 'P1 logon.bat'
Now that you have your two scripts created, you need to set them to execute at the appropriate times.

Run 'gpedit.msc' and navigate to Local Computer Policy->User Configuration->Windows Settings->Scripts (Logon/Logoff)
In the right field, double click 'Logon', click 'Add' , click 'Browse', navigate to the folder you created with the scripts and select the logon script.
Do the same process for the logoff script.

You are done.
This solved the problem completely for me and my friend. Hopefully it's beneficial for you.
Last edited by Aval0n on September 17th, 2019, 6:15 am, edited 1 time in total.
User avatar
artik
Please Continue...
Posts: 37
Joined: January 30th, 2019, 9:56 am
Location: Paris
eBay: jeff.artik

Re: SOLUTION: Windows controllers flipping between Player 1 and Player 2.

Post by artik »

To optimize your guide:

devcon.exe is only 3mb!
Simply DL it here: http://delphintipz.blogspot.com/2012/07 ... abled.html (32 or 64bits version).

Place it in your program file folder, and call it with the full path in your .bat scripts. In my case :

"c:/Program Files/Devcon/devcon" enable "@USB\VID_045E&PID_02D1\7EED804A21DA"
newbong
Please Continue...
Posts: 4
Joined: October 30th, 2018, 2:12 am
Location: Seattle
eBay: newbong85

Re: SOLUTION: Windows controllers flipping between Player 1 and Player 2.

Post by newbong »

thanks for sharing. This was really annoying me.
User avatar
Aval0n
Posts: 5
Joined: January 2nd, 2019, 3:59 am
Location: Arizona
eBay: Aval0n2016
Initials: AVA

Re: SOLUTION: Windows controllers flipping between Player 1 and Player 2.

Post by Aval0n »

I could not find a solution anywhere else. I looked for ages. I'm glad this is helping others!
User avatar
Aval0n
Posts: 5
Joined: January 2nd, 2019, 3:59 am
Location: Arizona
eBay: Aval0n2016
Initials: AVA

Re: SOLUTION: Windows controllers flipping between Player 1 and Player 2.

Post by Aval0n »

artik wrote: February 21st, 2019, 1:49 am To optimize your guide:

devcon.exe is only 3mb!
Simply DL it here: http://delphintipz.blogspot.com/2012/07 ... abled.html (32 or 64bits version).

Place it in your program file folder, and call it with the full path in your .bat scripts. In my case :

"c:/Program Files/Devcon/devcon" enable "@USB\VID_045E&PID_02D1\7EED804A21DA"
Thanks for the tip. When I tend to make guides, I usually do it from official sources as they are more likely to stand the test of time. Also devcon.exe has a few different versions and d/l'ed directly may not work with all OS's. And 3rd party websites are more pron to malware.
I certainly understand not wanting the xtra bloat! I added your link to the guide for folks who want to go that way.
Thanks!
User avatar
artik
Please Continue...
Posts: 37
Joined: January 30th, 2019, 9:56 am
Location: Paris
eBay: jeff.artik

Re: SOLUTION: Windows controllers flipping between Player 1 and Player 2.

Post by artik »

At the end, I bought an I-PAC 2 (two players) connected to only 1 USB port, and all this problem solved without workaround. I-PAC 4 (4players) also exists.

Thanks anyway Aval0n! your guide really helped me few months :)
Jolezef
Please Continue...
Posts: 2
Joined: November 19th, 2018, 4:02 pm
Location: Canada
eBay: SireConci
Initials: ZEF

Re: SOLUTION: Windows controllers flipping between Player 1 and Player 2.

Post by Jolezef »

Just wanted to thank you guys for this solution.

Solved my problem in 15 minutes.
User avatar
markedkiller78
Pony fucker
Posts: 7580
Joined: August 17th, 2008, 6:53 pm
Location: Glasgow
eBay: markedkiller78
Initials: MAL

Re: SOLUTION: Windows controllers flipping between Player 1 and Player 2.

Post by markedkiller78 »

Wow, thanks for posting this. 8-)
Image
S3M80
Please Continue...
Posts: 3
Joined: July 17th, 2020, 8:40 am
Location: Indonesia
eBay: S3ms3m

Re: SOLUTION: Windows controllers flipping between Player 1 and Player 2.

Post by S3M80 »

Got it sorted and now all done thanks for the sharing
User avatar
Inky
Posts: 44
Joined: March 16th, 2013, 10:37 am
Location: Northumberland, UK
eBay: Technical_medic
Initials: SCH

Re: SOLUTION: Windows controllers flipping between Player 1 and Player 2.

Post by Inky »

I was looking round the whole internet for a solution to this but nothing - I can't believe it was here all along!

I spent ages trying to get briankendall / devreorder to work but I wasn't even sure it was going to cover all my use cases - your method worked great though.

I was having issues with my brook fighting board's I have two in my Windows 10 system and they've always been an issue.

Since they auto detect the system they are connected to they can act a little weird and sometimes dont appear as the same controller.

They act differently if I start them connected to a PC vs a mac with bootcamp

They act differently if I reconnect the USB after windows starts vs if connect it before.

Anyway your instructions where absolutely great to get me started with Devcon.

The brook fighting boards being what they are I had to extend it a little more to make it consistently happy.

If I just used your script as is I would find my player two brook fighting board would stall and be unresponsive for some reason, it was showing no activity at all on my USB hub when the other one would be constantly blinking???

Madness, I did find a work around though - to make everything consistent ,I've found if I power them up with a separate powered USB HUB then start my regular PC running Windows 10 they are reasonably consistent at being detected as a 360 controller.

(With the fighting boards - You can hold a button on startup to force modes, but the buttons can change with updates and I don't have enough buttons on my control panel for its liking)

On Shutdown - I made sure I shut down BOTH players at a shutdown. P1 then P2, i think looking back perhaps the other way would have been fine to?

Code: Select all

"C:\Gaming\devcon\devcon.exe" disable "@USB\VID_045E&PID_02D1\7EED804EA5E7"
TIMEOUT 5
"C:\Gaming\devcon\devcon.exe" disable "@USB\VID_045E&PID_02D1\7EED804E8AA8"
On Boot up - I made sure player 1 was restarted first it was consistently fine - but if I just then restarted the board connected to player two I found the brook would be odd about being restarted and auto detecting into another systems controller at times it would stall as above and stop responding. (as above, this also occurred if I just used your script as posted)

However, If in the same boot script I stopped it again and then restarted it was happier a lot more of the time.

Code: Select all

"C:\Gaming\devcon\devcon.exe" enable "@USB\VID_045E&PID_02D1\7EED804EA5E7"
TIMEOUT 2
"C:\Gaming\devcon\devcon.exe" enable "@USB\VID_045E&PID_02D1\7EED804E8AA8"
TIMEOUT 3
"C:\Gaming\devcon\devcon.exe" disable "@USB\VID_045E&PID_02D1\7EED804E8AA8"
TIMEOUT 3
"C:\Gaming\devcon\devcon.exe" enable "@USB\VID_045E&PID_02D1\7EED804E8AA8"
In anycase I hope this helps others with the same issue. I do find P2 boots up unresponsive the odd time still but over 90% time its fine.
Iruhami
Posts: 1
Joined: July 8th, 2020, 11:08 pm
Location: Belgium
eBay: Kunios

Re: SOLUTION: Windows controllers flipping between Player 1 and Player 2.

Post by Iruhami »

Inky wrote: April 30th, 2021, 11:57 am I was looking round the whole internet for a solution to this but nothing - I can't believe it was here all along!

I spent ages trying to get briankendall / devreorder to work but I wasn't even sure it was going to cover all my use cases - your method worked great though.

I was having issues with my brook fighting board's I have two in my Windows 10 system and they've always been an issue.

Since they auto detect the system they are connected to they can act a little weird and sometimes dont appear as the same controller.

They act differently if I start them connected to a PC vs a mac with bootcamp

They act differently if I reconnect the USB after windows starts vs if connect it before.

Anyway your instructions where absolutely great to get me started with Devcon.

The brook fighting boards being what they are I had to extend it a little more to make it consistently happy.

If I just used your script as is I would find my player two brook fighting board would stall and be unresponsive for some reason, it was showing no activity at all on my USB hub when the other one would be constantly blinking???

Madness, I did find a work around though - to make everything consistent ,I've found if I power them up with a separate powered USB HUB then start my regular PC running Windows 10 they are reasonably consistent at being detected as a 360 controller.

(With the fighting boards - You can hold a button on startup to force modes, but the buttons can change with updates and I don't have enough buttons on my control panel for its liking)

On Shutdown - I made sure I shut down BOTH players at a shutdown. P1 then P2, i think looking back perhaps the other way would have been fine to?

Code: Select all

"C:\Gaming\devcon\devcon.exe" disable "@USB\VID_045E&PID_02D1\7EED804EA5E7"
TIMEOUT 5
"C:\Gaming\devcon\devcon.exe" disable "@USB\VID_045E&PID_02D1\7EED804E8AA8"
On Boot up - I made sure player 1 was restarted first it was consistently fine - but if I just then restarted the board connected to player two I found the brook would be odd about being restarted and auto detecting into another systems controller at times it would stall as above and stop responding. (as above, this also occurred if I just used your script as posted)

However, If in the same boot script I stopped it again and then restarted it was happier a lot more of the time.

Code: Select all

"C:\Gaming\devcon\devcon.exe" enable "@USB\VID_045E&PID_02D1\7EED804EA5E7"
TIMEOUT 2
"C:\Gaming\devcon\devcon.exe" enable "@USB\VID_045E&PID_02D1\7EED804E8AA8"
TIMEOUT 3
"C:\Gaming\devcon\devcon.exe" disable "@USB\VID_045E&PID_02D1\7EED804E8AA8"
TIMEOUT 3
"C:\Gaming\devcon\devcon.exe" enable "@USB\VID_045E&PID_02D1\7EED804E8AA8"
In anycase I hope this helps others with the same issue. I do find P2 boots up unresponsive the odd time still but over 90% time its fine.
Thank you very much Inky,

I have been using Brook Fighting Board for over a year now and thanks to you and your script, my problem is solved. :thumbup: :thumbupright:
User avatar
Ploppers
Please Continue...
Posts: 79
Joined: January 10th, 2020, 8:52 am
Location: Canberra
eBay: ploppers

Re: SOLUTION: Windows controllers flipping between Player 1 and Player 2.

Post by Ploppers »

Hey guys after trying and failing, I figured out Windows was always preferring to put my P2 Brooks as P1, even when I did the above tricks.

So I had a look at my ID's;

"@USB\VID_045E&PID_02D1\7EED804ED526"

"@USB\VID_045E&PID_02D1\7EED805FE024"

So the common string between them was;

"@USB\VID_045E&PID_02D1\7EED80"

Notice how the top one is 7EED804ED526 and the bottom one is 7EED805FE024 ?

Well my P2 was the 804, and P1 was 805, so with my setup Windows likes setting the 'lower' number brooks as P1 like 99% of the time. So I just rewired it, removed all my scripts and haven't had the problem since :)

Hope this helps someone who's problem isn't solved by the above solutions.

EDIT: Looking at Aval0n's;
Aval0n wrote: January 9th, 2019, 5:44 am USB\VID_045E&PID_C528E\14D61D5 : Xbox 360 Controller for Windows <-- This one wound up being my Player 2 controller
USB\VID_045E&PID_C528E\14D62D5 : Xbox 360 Controller for Windows
Common String = USB\VID_045E&PID_C528E\14D6

so, USB\VID_045E&PID_C528E\14D61D5 will preferred as P1, as its 1 less than USB\VID_045E&PID_C528E\14D62D5 .

And for Inky's
Inky wrote: April 30th, 2021, 11:57 am

Code: Select all

"C:\Gaming\devcon\devcon.exe" disable "@USB\VID_045E&PID_02D1\7EED804EA5E7"
TIMEOUT 5
"C:\Gaming\devcon\devcon.exe" disable "@USB\VID_045E&PID_02D1\7EED804E8AA8"
Common String = USB\VID_045E&PID_02D1\7EED804E

so, USB\VID_045E&PID_02D1\7EED804E8AA8 will be preferred as P1, as 8 is less than A in Hex, USB\VID_045E&PID_02D1\7EED804EA5E7 will usually initialized by windows second.

Seems all 3 of us picked the higher number Brooks as our P1 hahah, doomed from the start!
B-boppin' and Ploppin', Jackin' and Whackin', Windmill Providin' ...
User avatar
Inky
Posts: 44
Joined: March 16th, 2013, 10:37 am
Location: Northumberland, UK
eBay: Technical_medic
Initials: SCH

Re: SOLUTION: Windows controllers flipping between Player 1 and Player 2.

Post by Inky »

Ploppers wrote: October 10th, 2021, 9:27 am Hey guys after trying and failing, I figured out Windows was always preferring to put my P2 Brooks as P1, even when I did the above tricks.

So I had a look at my ID's;

"@USB\VID_045E&PID_02D1\7EED804ED526"

"@USB\VID_045E&PID_02D1\7EED805FE024"

So the common string between them was;

"@USB\VID_045E&PID_02D1\7EED80"

Notice how the top one is 7EED804ED526 and the bottom one is 7EED805FE024 ?

Well my P2 was the 804, and P1 was 805, so with my setup Windows likes setting the 'lower' number brooks as P1 like 99% of the time. So I just rewired it, removed all my scripts and haven't had the problem since :)

Hope this helps someone who's problem isn't solved by the above solutions.

EDIT: Looking at Aval0n's;
Aval0n wrote: January 9th, 2019, 5:44 am USB\VID_045E&PID_C528E\14D61D5 : Xbox 360 Controller for Windows <-- This one wound up being my Player 2 controller
USB\VID_045E&PID_C528E\14D62D5 : Xbox 360 Controller for Windows
Common String = USB\VID_045E&PID_C528E\14D6

so, USB\VID_045E&PID_C528E\14D61D5 will preferred as P1, as its 1 less than USB\VID_045E&PID_C528E\14D62D5 .

And for Inky's
Inky wrote: April 30th, 2021, 11:57 am

Code: Select all

"C:\Gaming\devcon\devcon.exe" disable "@USB\VID_045E&PID_02D1\7EED804EA5E7"
TIMEOUT 5
"C:\Gaming\devcon\devcon.exe" disable "@USB\VID_045E&PID_02D1\7EED804E8AA8"
Common String = USB\VID_045E&PID_02D1\7EED804E

so, USB\VID_045E&PID_02D1\7EED804E8AA8 will be preferred as P1, as 8 is less than A in Hex, USB\VID_045E&PID_02D1\7EED804EA5E7 will usually initialized by windows second.

Seems all 3 of us picked the higher number Brooks as our P1 hahah, doomed from the start!
Awesome stuff I hope it helps others! That noted, I haven't double checked but early in my trouble shooting I tried turning things round. I felt at the time that there's a lot of factors at play here e.g. - what type of game controller windows detects, the addresses of the USB controller for the hub/port the Brooks are connected to, I found it was different if it was plugged in on boot vs if windows was already loaded and some other crazy behaviours - For me all these can change the player number a controller is set to in windows 10.

The only way I found to get it to be (more) consistent was adding in a powered USB Hub. Also clearly anyone playing with the buttons as the PC was booting and thus selected controller types would change the player number - (which led to all kinds of confusion for me when the kids were bashing buttons as the thing booted up :roll: :mad: )

Maybe this works if they are in the "right" USB ports on the same controller and your PC is booting and initialising your controllers at the "same" time.

Defeated by alphanumeric ordering! :lolno: :lol:

All said though, I've not had a problem since I started using the script.
User avatar
Aval0n
Posts: 5
Joined: January 2nd, 2019, 3:59 am
Location: Arizona
eBay: Aval0n2016
Initials: AVA

Re: SOLUTION: Windows controllers flipping between Player 1 and Player 2.

Post by Aval0n »

Been a long while since I've logged into the forum. Very happy to see several folks here getting some use out of the this.
Post Reply