71 / stadiacontroller

Command line application that emulates an Xbox 360 controller from a wired Stadia controller on Windows.
ISC License
171 stars 22 forks source link

[Feature Request] Support for second Stadia Controller #11

Open Krokette opened 2 years ago

Krokette commented 2 years ago

Hello, Do you think that it would be possible to add support for a second Stadia controller ? I looked a bit to your code and it seems to be possible but I don't know Go nor do I know about Xinput, DirectInput and those things.

I'm a dev too so if you have an idea how to do it, maybe I could try to adapt it myself.

Thanks a lot

cwright814 commented 2 years ago

Workaround for those who want to connect multiple controllers (might give a hint on how to code a proper fix):

Prerequisite: Install "Process Hacker".

  1. Open "Process Hacker".
  2. Plug in a controller, then start "stadiacontroller.exe".
  3. Within "Process Hacker", right-click the "stadiacontroller.exe" you just started, then click "Suspend".
  4. Unplug the controller, then repeat steps 2-4 for any additional controllers as necessary (may only work up to 4).
  5. Plug in all controllers.
  6. Within "Process Hacker", right-click on each "stadiacontroller.exe" that you suspended and unsuspend them.

After following these steps, all controllers should be working as expected. To clarify, you should have an instance of "stadiacontroller.exe" for every controller you want connected. If you have issues with the default DInput device causing duplicated inputs (unrelated to this), you can use the program "HidHide" to mask the DInput devices so that only the virtual XInput devices are visible to the games you want to play.

GreenMan36 commented 1 year ago

I'd also like this feature, I have 5 stadia controllers with bluetooth enabled but I have to go trough this hassle.

71 commented 1 year ago

Thanks for the workaround @cwright814! I won't have my controller for a couple of days but I'll investigate how to fix this when I can. Having a single instance of stadiacontroller.exe manage all the controllers would be nice, but even now I find it strange that you have to pause the process to start a new instance. If anyone reading this has the Rust toolchain installed, I'd be curious to know if the Rust version of stadiacontroller (in the same repo) also has this problem.

Edit: I just realized that I won't be able to repro the problem even after a few days since I only own one controller. I'll try to submit changes for the Rust version, but won't be able to debug them or test them myself.