libretro / ludo

A libretro frontend written in golang
https://ludo.libretro.com/
GNU General Public License v3.0
583 stars 68 forks source link

Bluetooth Xbox One controller throws error #342

Open zenmaster24 opened 3 years ago

zenmaster24 commented 3 years ago

Hi,

Running Ubuntu 19.04 with Budgie - running ludo from the cli throws the following error:

GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
panic: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)

goroutine 1 [running, locked to thread]:
github.com/go-gl/glfw/v3.3/glfw.acceptError(0xc000107e60, 0x1, 0x1, 0x85ed00, 0x0)
    /home/travis/gopath/pkg/mod/github.com/go-gl/glfw/v3.3/glfw@v0.0.0-20200222043503-6f7a984d4dc4/error.go:174 +0x216
github.com/go-gl/glfw/v3.3/glfw.Init(0xc0000ae6c0, 0xc0000901b0)
    /home/travis/gopath/pkg/mod/github.com/go-gl/glfw/v3.3/glfw@v0.0.0-20200222043503-6f7a984d4dc4/glfw.go:37 +0x4e
main.main()
    /home/travis/gopath/src/github.com/libretro/ludo/main.go:85 +0x2f4

I am trying to use an Xbox One controller via bluetooth that works successfully with RetroArch.

Cheers

aspendlove commented 3 years ago

I also got this error making me unable to open the app. I am using an 8bitdo sn30 pro in x-input mode

shavs commented 3 years ago

I also got this error - I'm using an 8BitDo Lite, updated to the latest firmware (1.03).

kivutar commented 3 years ago

This appear to be a go-glfw 3.3 error. Can you please report the bug here and link to this issue? https://github.com/go-gl/glfw

zenmaster24 commented 3 years ago

This appear to be a go-glfw 3.3 error. Can you please report the bug here and link to this issue? https://github.com/go-gl/glfw

Hi kivutar - done.

Thanks

kivutar commented 2 years ago

This might be fixed now.

shavs commented 2 years ago

I've spent a little bit of time testing this using the 8BitDo Lite connected via Bluetooth

I get:

GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
[ALSOFT] (EE) Failed to set real-time priority for thread: Operation not permitted (1)
[ALSOFT] (EE) Failed to set real-time priority for thread: Operation not permitted (1)

This appears in stdout when running 0.14.12. I'm on Arch Linux, up to date (as of 2021/07/12), and running Ludo as a normal user. This happens when starting Ludo. I am unable to navigate the menus using the controller.

shavs commented 2 years ago

Important to note - this prevents it from crashing, but doesn't allow me to navigate using the controller.

kivutar commented 2 years ago

I switched to GLFW gamepad db for detection. It might work with the latest release now.

shavs commented 2 years ago

I've tried 0.15.2, and I'm still getting:

GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
[ALSOFT] (EE) Failed to set real-time priority for thread: Operation not permitted (1)
[ALSOFT] (EE) Failed to set real-time priority for thread: Operation not permitted (1)

Pairing the controller to emulate a Switch Pro (toggling the controller to "S") seems to work, as the controller emulates the Switch Pro controller (and I think the "X" mode uses XInput). However, this prevents easy switching from Switch to Ludo (via the toggle switch), as only (as far as I know) only one device can be used to pair the controller at a time.

I think this is less of an issue for Linux users (since it's a case of changing pairing mode), but an issue for Windows users, as Windows won't be able to use the controller.

I guess, in order to get the "normal" pairing mode, I'd have to report this upstream to GLFW / use their existing issue?

kivutar commented 2 years ago

Thanks for testing.

Either this, either you wait until I implement this: https://github.com/libretro/ludo/issues/452

Is your controller listed here? https://github.com/go-gl/glfw/blob/62640a716d485dcbf341a7c187227a4a99fb1eba/v3.3/glfw/glfw/src/mappings.h

shavs commented 2 years ago

That's OK!

I'd love for it to be included with a default mapping - is there a way that I can generate one of those strings?

kivutar commented 2 years ago

I think so. The original project is here https://github.com/gabomdq/SDL_GameControllerDB And their README suggests to use a tool called SDL2 ControllerMap

shavs commented 2 years ago

(as you can see) I tried making a pull request for the given IDs, but I think they match that of an XBox One / 360 controller, so I don't know whether that means that the hardcoded IDs are wrong for the controller, or that the GLFW hardcoded IDs are just wrong...

Basically, from what I think that issue shows, it should mean that the 8BitDo Lite is treated the same as an XBox One / 360 controller

kivutar commented 2 years ago

OK it doesn't look easy. I'm going to buy some more 8bitdo controllers and take care of this if it can't be resolved this way.