allegro5 icon indicating copy to clipboard operation
allegro5 copied to clipboard

More than 4 XInput controllers - only 4 recognised

Open arganoid opened this issue 4 years ago • 3 comments

It has been reported to me that if eight Xbox One controllers are connected, my game only sees four of them. What I would have thought should be happening is that the first four are recognised as XInput controllers, and the rest are recognised as DirectInput controllers. Does Allegro do this? I have ordered some XInput controllers to test this.

I've experienced a similar issue using Steam Remote Play Together, which streams the host's screen to the clients, and their controller inputs to the host. It's supposed to emulate XInput controllers until all four slots are full, and then emulate DirectInput controllers for the rest. But in practice what I'm seeing is that four XInput controllers show up for the host, but after that clients can't connect any more controllers.

arganoid avatar Nov 20 '20 14:11 arganoid

The liballeg.org documentation states outright that DirectInput and XInput drivers are mutually exclusive. It's likely that trying both will, depending on the exact user setup, expose XInput controllers to DirectInput API as well and cause issues. If your game can handle more than four controllers, I would suggest allowing the users to switch to DirectInput through options menu.

Based on marketing of Microsoft consoles, it appears that newer versions of XInput API do, in fact, allow up to 8 concurrent controllers, but I don't know which Windows versions, if any, implement those.

stan423321 avatar Dec 27 '20 16:12 stan423321

The documentation is outdated, as discussed here: https://www.allegro.cc/forums/thread/618290/1048176#target

As for the 5+ XInput controllers issue, I have tried switching to pure DirectInput mode, also discussed on the linked thread, but that doesn't work with Steam Remote Play Together either. The good news is that Steam's own input API is about to add support for 5+ XInput controllers, so my plan is to stop using the Allegro controller stuff and use Steam Input instead.

arganoid avatar Dec 27 '20 16:12 arganoid

Apologies for disruptance, then.

stan423321 avatar Dec 27 '20 16:12 stan423321