Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GameCube Adapter support seems broken #11012

Closed
bemug opened this issue Sep 30, 2024 · 11 comments
Closed

GameCube Adapter support seems broken #11012

bemug opened this issue Sep 30, 2024 · 11 comments
Milestone

Comments

@bemug
Copy link

bemug commented Sep 30, 2024

Hi,

I'm on Linux running latest Arch.
I recall having my official Nintendo GameCube adapter working out of the box on SDL2 games. Now it doesn't seem to work anymore
I also recall testing this Godot PR adding SDL support for gamepad and it worked correctly. Now rebuilding with the same commit fails.
I built jstest-sdl to test and indeed it couldn't detect my gamepad either.

I'm new to SDL development and would like someone to double check if it working on its side.

@flibitijibibo
Copy link
Collaborator

Did you have to add a udev rule for the adapter back then? Not sure if Arch packages that somehow but that's usually the main reason it's not detected at first; this is the same rule that's documented for dolphin-emu.

@bemug
Copy link
Author

bemug commented Sep 30, 2024

I remember having the udev rules back then, since my dolphin install is pretty old and it comes in its packages :
https://gitlab.archlinux.org/archlinux/packaging/packages/dolphin-emu/-/blob/main/PKGBUILD?ref_type=heads#L136

On my machine :

$ cat /usr/lib/udev/rules.d/51-usb-device.rules 
#GameCube Controller Adapter
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="0337", TAG+="uaccess"

#Wiimotes or DolphinBar
SUBSYSTEM=="hidraw*", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="0306", TAG+="uaccess"
SUBSYSTEM=="hidraw*", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="0330", TAG+="uaccess"

I also have another file :

$ cat /etc/udev/rules.d/51-gcadapter.rules
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="0337", MODE="0666"

That I should have created a while back when it was not packaged yet, as specified here :
https://fr.dolphin-emu.org/docs/guides/how-use-official-gc-controller-adapter-wii-u/

I tried removing both of them and unfortunately I still have the same issue. But AFAIK these rules are needed for SDL anyway.

@flibitijibibo
Copy link
Collaborator

Did a quick check and can confirm it works locally - if you happen to have FEZ on Steam you can opt into the sdl3 beta branch and see if the controller is detected there.

udev rule on my system at /etc/udev/rules.d/51-gcadapter.rules:

SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="0337", MODE="0666"

@slouken slouken added this to the 3.2.0 milestone Oct 1, 2024
@bemug
Copy link
Author

bemug commented Oct 2, 2024

Thank you for testing.

Interesting, I tried it on FEZ with the sdl3 and it works flawlessly. It does not on the main branch but I'm not sure it is supposed to.
May I ask you to try on an sdl2 game ? Or maybe a tool such as jstest-sdl for simplicity ?

@flibitijibibo
Copy link
Collaborator

It's been a while but I think the beta branch of FEZ is on 2.30.x, which I built with autoconf - if that build doesn't work I should be able to figure things out locally.

@bemug
Copy link
Author

bemug commented Oct 2, 2024

The beta branch is working. Strange.

@flibitijibibo
Copy link
Collaborator

The only thing I can think of is that 2.0 still requires passing --enable-hidapi-libusb to configure, not sure what CMake needs since 3.0 defaults to it being enabled...

@bemug
Copy link
Author

bemug commented Oct 2, 2024

Since it seems to be on my side I'll close the issue.
Thanks a lot for helping me debug this.

I'll reopen if I find anything new.

@bemug bemug closed this as completed Oct 2, 2024
@bemug
Copy link
Author

bemug commented Oct 2, 2024

I figured it out.

If --enable-hidapi-libusb is required, then this update to the Arch package is causing the issue : it removes the SDL_HIDAPI_LIBUSB flag.
It was 2 months ago, so it matches my timeline.

The linked issue states the same issue as me. Case solved.

@bemug
Copy link
Author

bemug commented Oct 2, 2024

Now I'm confused, #9821 should whitelist the gamecube adapter and make it work without needing the flag right ? Or is SDL_HIDAPI_LIBUSB_WHITELIST defaulting to false ?

@slouken
Copy link
Collaborator

slouken commented Oct 2, 2024

--enable-hidapi-libusb is required, the whitelisting changes just make it possible to enable by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants