cemu-project / Cemu

Cemu - Wii U emulator
https://cemu.info
Mozilla Public License 2.0
7.43k stars 609 forks source link

[Linux] Motion controls on official Switch Pro Controller are not available through SDL #753

Closed lisa-wolfgang closed 8 months ago

lisa-wolfgang commented 1 year ago

When setting the emulated controller to "Wii U GamePad" and adding an official Nintendo Switch Pro Controller through the SDLController API, all controller features that Cemu supports are functional except for the "Use motion" option, which is disabled and greyed out in the UI. Removing and re-adding the controller within Cemu and re-pairing the controller in the Bluetooth settings of the OS did not fix the issue.

Cemu versions tested: 2.0-14, 2.0-25, 2.0-32 Operating system: Ubuntu 22.10 (kernel has drivers required for reading Switch Pro motion)

Squall-Leonhart commented 1 year ago

2.0-25 is not the latest build, and 2.0.30+ have updated the SDL version used, please test a later version.

lisa-wolfgang commented 1 year ago

Sorry, it wasn't very clear in my original message that the commit I tested on was 2.0-32. I've updated it to make that more clear.

Squall-Leonhart commented 1 year ago

Found a potential cause https://github.com/libsdl-org/SDL/issues/6478

pkyee commented 1 year ago

Having a similar issue with the 8bitdo Ultimate Bluetooth set in Switch mode. Detected as Switch Pro Controller in Steam and Cemu latest version under SDL API, but motion option is greyed out.

Squall-Leonhart commented 1 year ago

From https://github.com/libsdl-org/SDL/issues/7577#issuecomment-1577598443

This is caused by SDL not being able to open the raw devices anymore. It's likely that the user installed udev rules to block the raw devices to prevent Steam from opening them.

prurigro commented 1 year ago

Switch pro motion controls seem to be working for me on the latest build without any additional software, but I had to switch to Wii U GamePad emulation rather than a Wii U Pro Controller.

KWottrich commented 1 year ago

Support for linking multiple evdev inputs by their unique IDs just got merged into SDL 2 in https://github.com/libsdl-org/SDL/pull/8336. Whenever that makes it into a release, please update the version of SDL in Cemu and see if that helps with this issue!

lisa-wolfgang commented 8 months ago

Just tested today and this issue seems to be resolved as of Cemu 2.0-74 (probably earlier.) However, it won't work on systems without a specific udev rule for hidraw access: #1097 Also, SDL assigns the axis incorrectly (or at least doesn't follow Cemu's axis convention for motion), but that's outside the scope of this issue. (related: https://github.com/cemu-project/Cemu/issues/822)