X360 wireless controller problem on Linux

Hi everyone,

I’m using SDL2 as provided in the Steam Linux Runtime and am baffled
by SDL_IsGameController() returning SDL_FALSE for the wireless X360
receiver. At the same time a regular, wired X360 controller works
perfectly with the game controller API. Is this an SDL bug or am I
forgetting about something?

Also, I’ve noticed that the receiver “preallocates” 4 joysticks
regardless of whether they’re connected or not. I don’t have an actual
controller at hand to test this, but will connecting a wireless
controller to the receiver generate hotplug SDL events? And will
SDL_GameControllerGetAttached() properly distinguish between connected
and disconnected wireless controllers?

The system is Debian amd64. I’m initializing the GC subsystem and as I
said, it works perfectly with wired controllers.

Thanks in advance!

Leszek

I just tested this with SDL from HG with the wireless receiver and the xpad
driver.

testgamecontroller
INFO: Controller 0: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: Controller 1: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: Controller 2: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: Controller 3: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: There are 4 game controller(s) attached (4 joystick(s))

With the userspace xboxdrv (you need one instance per controller or so I
understood)

testgamecontroller
INFO: Joystick 0: Xbox Gamepad (userspace driver) (guid
0000000058626f782047616d65706100)
INFO: There are 0 game controller(s) attached (1 joystick(s))

So it seems the xboxdrv is not recognized by SDL as a controller (though
this driver is probably better, as the lights in the controller work as
they should and it’s userspace based).

Gabriel.

2013/11/21 Leszek Godlewski > Hi everyone,

I’m using SDL2 as provided in the Steam Linux Runtime and am baffled
by SDL_IsGameController() returning SDL_FALSE for the wireless X360
receiver. At the same time a regular, wired X360 controller works
perfectly with the game controller API. Is this an SDL bug or am I
forgetting about something?

Also, I’ve noticed that the receiver “preallocates” 4 joysticks
regardless of whether they’re connected or not. I don’t have an actual
controller at hand to test this, but will connecting a wireless
controller to the receiver generate hotplug SDL events? And will
SDL_GameControllerGetAttached() properly distinguish between connected
and disconnected wireless controllers?

The system is Debian amd64. I’m initializing the GC subsystem and as I
said, it works perfectly with wired controllers.

Thanks in advance!

Leszek


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Gabriel.

Well, I’m having a 100% repro rate using xpad here. Any suggestions
(apart from getting the debug symbols and seeing what’s happening
inside SDL_IsGameController for which I don’t have time at the
moment)?

Regards,

Leszek

2013/11/21 Gabriel Jacobo :> I just tested this with SDL from HG with the wireless receiver and the xpad

driver.

testgamecontroller
INFO: Controller 0: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: Controller 1: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: Controller 2: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: Controller 3: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: There are 4 game controller(s) attached (4 joystick(s))

With the userspace xboxdrv (you need one instance per controller or so I
understood)

testgamecontroller
INFO: Joystick 0: Xbox Gamepad (userspace driver) (guid
0000000058626f782047616d65706100)
INFO: There are 0 game controller(s) attached (1 joystick(s))

So it seems the xboxdrv is not recognized by SDL as a controller (though
this driver is probably better, as the lights in the controller work as they
should and it’s userspace based).

Gabriel.

2013/11/21 Leszek Godlewski <@Leszek_Godlewski>

Hi everyone,

I’m using SDL2 as provided in the Steam Linux Runtime and am baffled
by SDL_IsGameController() returning SDL_FALSE for the wireless X360
receiver. At the same time a regular, wired X360 controller works
perfectly with the game controller API. Is this an SDL bug or am I
forgetting about something?

Also, I’ve noticed that the receiver “preallocates” 4 joysticks
regardless of whether they’re connected or not. I don’t have an actual
controller at hand to test this, but will connecting a wireless
controller to the receiver generate hotplug SDL events? And will
SDL_GameControllerGetAttached() properly distinguish between connected
and disconnected wireless controllers?

The system is Debian amd64. I’m initializing the GC subsystem and as I
said, it works perfectly with wired controllers.

Thanks in advance!

Leszek


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Gabriel.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I’m using SDL2 as provided in the Steam Linux Runtime and am baffled
by SDL_IsGameController() returning SDL_FALSE for the wireless X360
receiver. At the same time a regular, wired X360 controller works
perfectly with the game controller API. Is this an SDL bug or am I
forgetting about something?

Can you run “testjoystick” and see what GUID it reports for the wireless
controller?

–ryan.

Yeah, I will do that tomorrow. I have neither a controller nor the
receiver at hand right now.

Regards,

Leszek

2013/11/21 Ryan C. Gordon :>

I’m using SDL2 as provided in the Steam Linux Runtime and am baffled
by SDL_IsGameController() returning SDL_FALSE for the wireless X360
receiver. At the same time a regular, wired X360 controller works
perfectly with the game controller API. Is this an SDL bug or am I
forgetting about something?

Can you run “testjoystick” and see what GUID it reports for the wireless
controller?

–ryan.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I’ve been using an Xbox 360 wireless controller for a while. The
wireless usb transceiver shows up as 4 controllers under Fedora 14 and
Ubuntu 12.04 (even if no controllers are powered on). It doesn’t show
up at all under Fedora 19. I always assumed this stuff was down to the
Linux devices backend not knowing enough about this specialized
device.–
Terry Welsh
www.reallyslick.com

2013/11/21 Gabriel Jacobo :

I just tested this with SDL from HG with the wireless receiver and the xpad
driver.

testgamecontroller
INFO: Controller 0: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: Controller 1: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: Controller 2: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: Controller 3: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: There are 4 game controller(s) attached (4 joystick(s))

One receiver can receive up to four joysticks, can it not?On Thu, Nov 21, 2013 at 3:37 PM, Terry Welsh wrote:

I’ve been using an Xbox 360 wireless controller for a while. The
wireless usb transceiver shows up as 4 controllers under Fedora 14 and
Ubuntu 12.04 (even if no controllers are powered on). It doesn’t show
up at all under Fedora 19. I always assumed this stuff was down to the
Linux devices backend not knowing enough about this specialized
device.

Terry Welsh
www.reallyslick.com

2013/11/21 Gabriel Jacobo :

I just tested this with SDL from HG with the wireless receiver and the xpad
driver.

testgamecontroller
INFO: Controller 0: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: Controller 1: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: Controller 2: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: Controller 3: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: There are 4 game controller(s) attached (4 joystick(s))


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

It can. In fact, the XInput API only allows 4 controllers.

But will SDL2 generate plug events when joysticks connect and
disconnect from a receiver?

2013/11/21 Andre D :> One receiver can receive up to four joysticks, can it not?

On Thu, Nov 21, 2013 at 3:37 PM, Terry Welsh wrote:

I’ve been using an Xbox 360 wireless controller for a while. The
wireless usb transceiver shows up as 4 controllers under Fedora 14 and
Ubuntu 12.04 (even if no controllers are powered on). It doesn’t show
up at all under Fedora 19. I always assumed this stuff was down to the
Linux devices backend not knowing enough about this specialized
device.

Terry Welsh
www.reallyslick.com

2013/11/21 Gabriel Jacobo :

I just tested this with SDL from HG with the wireless receiver and the xpad
driver.

testgamecontroller
INFO: Controller 0: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: Controller 1: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: Controller 2: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: Controller 3: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: There are 4 game controller(s) attached (4 joystick(s))


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Sounds like you’re using a different driver and it’s giving you a
different GUID. What distribution/version? Also, can you generate a
mapping string for it? :slight_smile:

JosephOn Thu, Nov 21, 2013 at 04:11:57PM +0100, Leszek Godlewski wrote:

Well, I’m having a 100% repro rate using xpad here. Any suggestions
(apart from getting the debug symbols and seeing what’s happening
inside SDL_IsGameController for which I don’t have time at the
moment)?

Regards,

Leszek

2013/11/21 Gabriel Jacobo :

I just tested this with SDL from HG with the wireless receiver and the xpad
driver.

testgamecontroller
INFO: Controller 0: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: Controller 1: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: Controller 2: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: Controller 3: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: There are 4 game controller(s) attached (4 joystick(s))

With the userspace xboxdrv (you need one instance per controller or so I
understood)

testgamecontroller
INFO: Joystick 0: Xbox Gamepad (userspace driver) (guid
0000000058626f782047616d65706100)
INFO: There are 0 game controller(s) attached (1 joystick(s))

So it seems the xboxdrv is not recognized by SDL as a controller (though
this driver is probably better, as the lights in the controller work as they
should and it’s userspace based).

Gabriel.

2013/11/21 Leszek Godlewski

Hi everyone,

I’m using SDL2 as provided in the Steam Linux Runtime and am baffled
by SDL_IsGameController() returning SDL_FALSE for the wireless X360
receiver. At the same time a regular, wired X360 controller works
perfectly with the game controller API. Is this an SDL bug or am I
forgetting about something?

Also, I’ve noticed that the receiver “preallocates” 4 joysticks
regardless of whether they’re connected or not. I don’t have an actual
controller at hand to test this, but will connecting a wireless
controller to the receiver generate hotplug SDL events? And will
SDL_GameControllerGetAttached() properly distinguish between connected
and disconnected wireless controllers?

The system is Debian amd64. I’m initializing the GC subsystem and as I
said, it works perfectly with wired controllers.

Thanks in advance!

Leszek


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Gabriel.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Debian amd64 testing, all up to date.

inequation at gunship:~/projects/SDL/test$ ./testgamecontroller
INFO: Joystick (not recognized as game controller) 0: Xbox 360
Wireless Receiver (XBOX) (guid 030000005e0400009102000007010000)
INFO: Joystick (not recognized as game controller) 1: Xbox 360
Wireless Receiver (XBOX) (guid 030000005e0400009102000007010000)
INFO: Joystick (not recognized as game controller) 2: Xbox 360
Wireless Receiver (XBOX) (guid 030000005e0400009102000007010000)
INFO: Joystick (not recognized as game controller) 3: Xbox 360
Wireless Receiver (XBOX) (guid 030000005e0400009102000007010000)
INFO: There are 0 game controller(s) attached (4 joystick(s))
inequation at gunship:~/projects/SDL/test$

As far as I can tell, this is the same GUID as in SDL_gamecontrollerdb.h…

The port is USB 2.0, not 1.1, in case anyone wondered, and the device uses xpad.

inequation at gunship:~/projects/SDL/test$ lsusb -t
/: Bus 08.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 07.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 06.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 05.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
|__ Port 1: Dev 2, If 0, Class=Vendor Specific Class, Driver=, 12M
|__ Port 2: Dev 4, If 0, Class=Wireless, Driver=btusb, 12M
|__ Port 2: Dev 4, If 1, Class=Wireless, Driver=btusb, 12M
|__ Port 2: Dev 4, If 2, Class=Vendor Specific Class, Driver=, 12M
|__ Port 2: Dev 4, If 3, Class=Application Specific Interface, Driver=, 12M
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/6p, 480M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/6p, 480M
|__ Port 5: Dev 7, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 3: Dev 9, If 0, Class=Vendor Specific Class, Driver=xpad, 12M
|__ Port 3: Dev 9, If 1, Class=Vendor Specific Class, Driver=, 12M
|__ Port 3: Dev 9, If 2, Class=Vendor Specific Class, Driver=xpad, 12M
|__ Port 3: Dev 9, If 3, Class=Vendor Specific Class, Driver=, 12M
|__ Port 3: Dev 9, If 4, Class=Vendor Specific Class, Driver=xpad, 12M
|__ Port 3: Dev 9, If 5, Class=Vendor Specific Class, Driver=, 12M
|__ Port 3: Dev 9, If 6, Class=Vendor Specific Class, Driver=xpad, 12M
|__ Port 3: Dev 9, If 7, Class=Vendor Specific Class, Driver=, 12M
|__ Port 6: Dev 3, If 0, Class=Video, Driver=uvcvideo, 480M
|__ Port 6: Dev 3, If 1, Class=Video, Driver=uvcvideo, 480M
inequation at gunship:~/projects/SDL/test$

And just to make sure, kernel module is loaded:

inequation at gunship:~/projects/SDL/test$ lsmod | grep xpad
xpad 17096 0
ff_memless 12755 1 xpad
usbcore 134993 11
xpad,btusb,uhci_hcd,uvcvideo,usb_storage,ehci_hcd,ehci_pci,usbnet,cdc_acm,cdc_wdm,cdc_ether
inequation at gunship:~/projects/SDL/test$

I guess I have no choice but to actually debug the SDL_IsGameController() call.

Regards,

Leszek

2013/11/22 T. Joseph Carter :> Sounds like you’re using a different driver and it’s giving you a different

GUID. What distribution/version? Also, can you generate a mapping string
for it? :slight_smile:

Joseph

On Thu, Nov 21, 2013 at 04:11:57PM +0100, Leszek Godlewski wrote:

Well, I’m having a 100% repro rate using xpad here. Any suggestions
(apart from getting the debug symbols and seeing what’s happening
inside SDL_IsGameController for which I don’t have time at the
moment)?

Regards,

Leszek

2013/11/21 Gabriel Jacobo :

I just tested this with SDL from HG with the wireless receiver and the
xpad
driver.

testgamecontroller
INFO: Controller 0: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: Controller 1: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: Controller 2: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: Controller 3: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: There are 4 game controller(s) attached (4 joystick(s))

With the userspace xboxdrv (you need one instance per controller or so I
understood)

testgamecontroller
INFO: Joystick 0: Xbox Gamepad (userspace driver) (guid
0000000058626f782047616d65706100)
INFO: There are 0 game controller(s) attached (1 joystick(s))

So it seems the xboxdrv is not recognized by SDL as a controller (though
this driver is probably better, as the lights in the controller work as
they
should and it’s userspace based).

Gabriel.

2013/11/21 Leszek Godlewski <@Leszek_Godlewski>

Hi everyone,

I’m using SDL2 as provided in the Steam Linux Runtime and am baffled
by SDL_IsGameController() returning SDL_FALSE for the wireless X360
receiver. At the same time a regular, wired X360 controller works
perfectly with the game controller API. Is this an SDL bug or am I
forgetting about something?

Also, I’ve noticed that the receiver “preallocates” 4 joysticks
regardless of whether they’re connected or not. I don’t have an actual
controller at hand to test this, but will connecting a wireless
controller to the receiver generate hotplug SDL events? And will
SDL_GameControllerGetAttached() properly distinguish between connected
and disconnected wireless controllers?

The system is Debian amd64. I’m initializing the GC subsystem and as I
said, it works perfectly with wired controllers.

Thanks in advance!

Leszek


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Gabriel.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Oh, okay - the GUID is different indeed. I must’ve been mesmerized by
the numbers! :slight_smile: I’ll check if the button mapping works.

Controller DB GUID:
030000005e0400001907000000010000
My GUID:
030000005e0400009102000007010000

I’ll be testing later on if the “regular” button mapping works alright.

2013/11/22 Leszek Godlewski <@Leszek_Godlewski>:> Debian amd64 testing, all up to date.

inequation at gunship:~/projects/SDL/test$ ./testgamecontroller
INFO: Joystick (not recognized as game controller) 0: Xbox 360
Wireless Receiver (XBOX) (guid 030000005e0400009102000007010000)
INFO: Joystick (not recognized as game controller) 1: Xbox 360
Wireless Receiver (XBOX) (guid 030000005e0400009102000007010000)
INFO: Joystick (not recognized as game controller) 2: Xbox 360
Wireless Receiver (XBOX) (guid 030000005e0400009102000007010000)
INFO: Joystick (not recognized as game controller) 3: Xbox 360
Wireless Receiver (XBOX) (guid 030000005e0400009102000007010000)
INFO: There are 0 game controller(s) attached (4 joystick(s))
inequation at gunship:~/projects/SDL/test$

As far as I can tell, this is the same GUID as in SDL_gamecontrollerdb.h…

The port is USB 2.0, not 1.1, in case anyone wondered, and the device uses xpad.

inequation at gunship:~/projects/SDL/test$ lsusb -t
/: Bus 08.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 07.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 06.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 05.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
|__ Port 1: Dev 2, If 0, Class=Vendor Specific Class, Driver=, 12M
|__ Port 2: Dev 4, If 0, Class=Wireless, Driver=btusb, 12M
|__ Port 2: Dev 4, If 1, Class=Wireless, Driver=btusb, 12M
|__ Port 2: Dev 4, If 2, Class=Vendor Specific Class, Driver=, 12M
|__ Port 2: Dev 4, If 3, Class=Application Specific Interface, Driver=, 12M
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/6p, 480M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/6p, 480M
|__ Port 5: Dev 7, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 3: Dev 9, If 0, Class=Vendor Specific Class, Driver=xpad, 12M
|__ Port 3: Dev 9, If 1, Class=Vendor Specific Class, Driver=, 12M
|__ Port 3: Dev 9, If 2, Class=Vendor Specific Class, Driver=xpad, 12M
|__ Port 3: Dev 9, If 3, Class=Vendor Specific Class, Driver=, 12M
|__ Port 3: Dev 9, If 4, Class=Vendor Specific Class, Driver=xpad, 12M
|__ Port 3: Dev 9, If 5, Class=Vendor Specific Class, Driver=, 12M
|__ Port 3: Dev 9, If 6, Class=Vendor Specific Class, Driver=xpad, 12M
|__ Port 3: Dev 9, If 7, Class=Vendor Specific Class, Driver=, 12M
|__ Port 6: Dev 3, If 0, Class=Video, Driver=uvcvideo, 480M
|__ Port 6: Dev 3, If 1, Class=Video, Driver=uvcvideo, 480M
inequation at gunship:~/projects/SDL/test$

And just to make sure, kernel module is loaded:

inequation at gunship:~/projects/SDL/test$ lsmod | grep xpad
xpad 17096 0
ff_memless 12755 1 xpad
usbcore 134993 11
xpad,btusb,uhci_hcd,uvcvideo,usb_storage,ehci_hcd,ehci_pci,usbnet,cdc_acm,cdc_wdm,cdc_ether
inequation at gunship:~/projects/SDL/test$

I guess I have no choice but to actually debug the SDL_IsGameController() call.

Regards,

Leszek

2013/11/22 T. Joseph Carter :

Sounds like you’re using a different driver and it’s giving you a different
GUID. What distribution/version? Also, can you generate a mapping string
for it? :slight_smile:

Joseph

On Thu, Nov 21, 2013 at 04:11:57PM +0100, Leszek Godlewski wrote:

Well, I’m having a 100% repro rate using xpad here. Any suggestions
(apart from getting the debug symbols and seeing what’s happening
inside SDL_IsGameController for which I don’t have time at the
moment)?

Regards,

Leszek

2013/11/21 Gabriel Jacobo :

I just tested this with SDL from HG with the wireless receiver and the
xpad
driver.

testgamecontroller
INFO: Controller 0: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: Controller 1: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: Controller 2: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: Controller 3: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: There are 4 game controller(s) attached (4 joystick(s))

With the userspace xboxdrv (you need one instance per controller or so I
understood)

testgamecontroller
INFO: Joystick 0: Xbox Gamepad (userspace driver) (guid
0000000058626f782047616d65706100)
INFO: There are 0 game controller(s) attached (1 joystick(s))

So it seems the xboxdrv is not recognized by SDL as a controller (though
this driver is probably better, as the lights in the controller work as
they
should and it’s userspace based).

Gabriel.

2013/11/21 Leszek Godlewski <@Leszek_Godlewski>

Hi everyone,

I’m using SDL2 as provided in the Steam Linux Runtime and am baffled
by SDL_IsGameController() returning SDL_FALSE for the wireless X360
receiver. At the same time a regular, wired X360 controller works
perfectly with the game controller API. Is this an SDL bug or am I
forgetting about something?

Also, I’ve noticed that the receiver “preallocates” 4 joysticks
regardless of whether they’re connected or not. I don’t have an actual
controller at hand to test this, but will connecting a wireless
controller to the receiver generate hotplug SDL events? And will
SDL_GameControllerGetAttached() properly distinguish between connected
and disconnected wireless controllers?

The system is Debian amd64. I’m initializing the GC subsystem and as I
said, it works perfectly with wired controllers.

Thanks in advance!

Leszek


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Gabriel.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

OK, so I’ve submitted a patch for this X360 controller receiver:
http://lists.libsdl.org/pipermail/sdl-libsdl.org/2013-November/092022.html

I’ve got another question, though - I’ve read somewhere that Steam Big
Picture somehow forwards its controller mapping to SDL in the games it
launches. What is the mechanism for it? Commandline arguments,
environment variable, some kind of IPC? I can’t find any
documentation, and I’m getting bug reports for my game that show
symptoms of not actually receiving this mapping from SBP.

Regards,

Leszek

2013/11/22 Leszek Godlewski <@Leszek_Godlewski>:> Oh, okay - the GUID is different indeed. I must’ve been mesmerized by

the numbers! :slight_smile: I’ll check if the button mapping works.

Controller DB GUID:
030000005e0400001907000000010000
My GUID:
030000005e0400009102000007010000

I’ll be testing later on if the “regular” button mapping works alright.

2013/11/22 Leszek Godlewski <@Leszek_Godlewski>:

Debian amd64 testing, all up to date.

inequation at gunship:~/projects/SDL/test$ ./testgamecontroller
INFO: Joystick (not recognized as game controller) 0: Xbox 360
Wireless Receiver (XBOX) (guid 030000005e0400009102000007010000)
INFO: Joystick (not recognized as game controller) 1: Xbox 360
Wireless Receiver (XBOX) (guid 030000005e0400009102000007010000)
INFO: Joystick (not recognized as game controller) 2: Xbox 360
Wireless Receiver (XBOX) (guid 030000005e0400009102000007010000)
INFO: Joystick (not recognized as game controller) 3: Xbox 360
Wireless Receiver (XBOX) (guid 030000005e0400009102000007010000)
INFO: There are 0 game controller(s) attached (4 joystick(s))
inequation at gunship:~/projects/SDL/test$

As far as I can tell, this is the same GUID as in SDL_gamecontrollerdb.h…

The port is USB 2.0, not 1.1, in case anyone wondered, and the device uses xpad.

inequation at gunship:~/projects/SDL/test$ lsusb -t
/: Bus 08.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 07.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 06.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 05.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
|__ Port 1: Dev 2, If 0, Class=Vendor Specific Class, Driver=, 12M
|__ Port 2: Dev 4, If 0, Class=Wireless, Driver=btusb, 12M
|__ Port 2: Dev 4, If 1, Class=Wireless, Driver=btusb, 12M
|__ Port 2: Dev 4, If 2, Class=Vendor Specific Class, Driver=, 12M
|__ Port 2: Dev 4, If 3, Class=Application Specific Interface, Driver=, 12M
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/6p, 480M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/6p, 480M
|__ Port 5: Dev 7, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 3: Dev 9, If 0, Class=Vendor Specific Class, Driver=xpad, 12M
|__ Port 3: Dev 9, If 1, Class=Vendor Specific Class, Driver=, 12M
|__ Port 3: Dev 9, If 2, Class=Vendor Specific Class, Driver=xpad, 12M
|__ Port 3: Dev 9, If 3, Class=Vendor Specific Class, Driver=, 12M
|__ Port 3: Dev 9, If 4, Class=Vendor Specific Class, Driver=xpad, 12M
|__ Port 3: Dev 9, If 5, Class=Vendor Specific Class, Driver=, 12M
|__ Port 3: Dev 9, If 6, Class=Vendor Specific Class, Driver=xpad, 12M
|__ Port 3: Dev 9, If 7, Class=Vendor Specific Class, Driver=, 12M
|__ Port 6: Dev 3, If 0, Class=Video, Driver=uvcvideo, 480M
|__ Port 6: Dev 3, If 1, Class=Video, Driver=uvcvideo, 480M
inequation at gunship:~/projects/SDL/test$

And just to make sure, kernel module is loaded:

inequation at gunship:~/projects/SDL/test$ lsmod | grep xpad
xpad 17096 0
ff_memless 12755 1 xpad
usbcore 134993 11
xpad,btusb,uhci_hcd,uvcvideo,usb_storage,ehci_hcd,ehci_pci,usbnet,cdc_acm,cdc_wdm,cdc_ether
inequation at gunship:~/projects/SDL/test$

I guess I have no choice but to actually debug the SDL_IsGameController() call.

Regards,

Leszek

2013/11/22 T. Joseph Carter :

Sounds like you’re using a different driver and it’s giving you a different
GUID. What distribution/version? Also, can you generate a mapping string
for it? :slight_smile:

Joseph

On Thu, Nov 21, 2013 at 04:11:57PM +0100, Leszek Godlewski wrote:

Well, I’m having a 100% repro rate using xpad here. Any suggestions
(apart from getting the debug symbols and seeing what’s happening
inside SDL_IsGameController for which I don’t have time at the
moment)?

Regards,

Leszek

2013/11/21 Gabriel Jacobo :

I just tested this with SDL from HG with the wireless receiver and the
xpad
driver.

testgamecontroller
INFO: Controller 0: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: Controller 1: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: Controller 2: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: Controller 3: X360 Wireless Controller (guid
030000005e0400001907000000010000)
INFO: There are 4 game controller(s) attached (4 joystick(s))

With the userspace xboxdrv (you need one instance per controller or so I
understood)

testgamecontroller
INFO: Joystick 0: Xbox Gamepad (userspace driver) (guid
0000000058626f782047616d65706100)
INFO: There are 0 game controller(s) attached (1 joystick(s))

So it seems the xboxdrv is not recognized by SDL as a controller (though
this driver is probably better, as the lights in the controller work as
they
should and it’s userspace based).

Gabriel.

2013/11/21 Leszek Godlewski <@Leszek_Godlewski>

Hi everyone,

I’m using SDL2 as provided in the Steam Linux Runtime and am baffled
by SDL_IsGameController() returning SDL_FALSE for the wireless X360
receiver. At the same time a regular, wired X360 controller works
perfectly with the game controller API. Is this an SDL bug or am I
forgetting about something?

Also, I’ve noticed that the receiver “preallocates” 4 joysticks
regardless of whether they’re connected or not. I don’t have an actual
controller at hand to test this, but will connecting a wireless
controller to the receiver generate hotplug SDL events? And will
SDL_GameControllerGetAttached() properly distinguish between connected
and disconnected wireless controllers?

The system is Debian amd64. I’m initializing the GC subsystem and as I
said, it works perfectly with wired controllers.

Thanks in advance!

Leszek


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Gabriel.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I’ve got another question, though - I’ve read somewhere that Steam Big
Picture somehow forwards its controller mapping to SDL in the games it
launches. What is the mechanism for it? Commandline arguments,
environment variable, some kind of IPC? I can’t find any
documentation, and I’m getting bug reports for my game that show
symptoms of not actually receiving this mapping from SBP.

It comes in through an environment variable: Steam sets
SDL_GAMECONTROLLERCONFIG.

–ryan.

Right. Thank you! I’m off to fixing my own bugs, then. :wink:

Regards,

Leszek

2013/11/22 Ryan C. Gordon :>

I’ve got another question, though - I’ve read somewhere that Steam Big
Picture somehow forwards its controller mapping to SDL in the games it
launches. What is the mechanism for it? Commandline arguments,
environment variable, some kind of IPC? I can’t find any
documentation, and I’m getting bug reports for my game that show
symptoms of not actually receiving this mapping from SBP.

It comes in through an environment variable: Steam sets
SDL_GAMECONTROLLERCONFIG.

–ryan.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org