libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
9.77k stars 1.77k forks source link

[macOS] Nintendo Switch Pro Controller is non-functional over USB #16136

Open DJtheMan2101 opened 5 months ago

DJtheMan2101 commented 5 months ago

First and foremost consider this:

Description

When an official Nintendo Switch Pro Controller is connected via USB, none of its inputs function in RetroArch at all.

Expected behavior

The controller should work so it can navigate RetroArch's menus and control the cores. The controller does work over USB in other programs (ES-DE, Dolphin, and PCSX2). The controller does work in RetroArch via Bluetooth and the "mfi" controller driver, but macOS Sonoma has a bug that causes it to have significant input lag over Bluetooth, so USB is preferable.

Actual behavior

When the controller is connected via USB, its autoconfig profile is loaded (assuming the "hid" controller driver is set), but nothing else happens. Whether the profile is present or not, none of the inputs will do anything in RetroArch's menu or cores. In previous nightly builds, the controller would sometimes instead send random inputs on every frame, but I cannot recreate this behavior reliably.

The controller also does not work via USB with the "mfi" controller driver, but I assume that is expected (the profile is not loaded in that case). I do not have any other controllers to test, so I do not know if the issue is specific to the Nintendo Switch Pro Controller or if this is a problem with the "hid" controller driver and/or the macOS version of RetroArch in general.

Steps to reproduce the bug

  1. Open RetroArch on a Mac with the controller driver set to "hid".
  2. Connect a Nintendo Switch Pro Controller to your Mac via USB.
  3. See that the autoconfig is loaded, but the controller does nothing.

Bisect Results

In stable 1.9.0 (the earliest available stable build), the controller's (non-)behavior seems to be the same as in the latest nightly. I usually use the controller via Bluetooth myself, so I have no idea if it ever worked via USB on macOS.

Version/Commit

You can find this information under Information/System Information

Environment information

bitznbrewz commented 5 months ago

Downloaded latest stable for MacOS metal(1.16). Nintendo Switch N64 controller via bluetooth and USB is detected, but no inputs are captured.

RetroArch: 1.16.0 (stable) OS: macOS Sonoma 14.2.1

erfg12 commented 4 months ago

Version: RetroArch 1.17.0 (stable Metal) OS: Sonoma 14.3.1 (Apple Silicon - Arm) Controller Driver: mfi Status: Still not working. Plugged in by USB or Bluetooth

If anyone sees this and is wondering how they could get it working (worked for me in N64 core):

  1. In the Drivers section, change controller to hid. Restart RA.
  2. Open Input > RetroPad Binds > Port 1 Controls. Set Analog to Digital Type to None. Now re-bind all the buttons.
  3. Also in Input change the Analog Sensitivity to 1.4+.
  4. Load a core, or start up a rom. Open the Quick Menu > Controls >Port 1 Controls. Check all buttons are mapped correctly (Ex: A button might be bound to B button)
sarahckohl commented 2 months ago

Hello, I was able to solve the issue of the controller not registering while plugged in via usb-c by manually toggling off game mode. Game mode sometimes interferes with background processes that ironically are needed to play games.

Furthermore there is a setting in RetroArch which automatically toggles Game Mode on, you will want to turn it off: Settings > Input > Auto Enable 'Game Mode'.

I also found @erfg12 's suggestion regarding changing Analog to Digital type to None helpful. I had previously set it to left stick thinking this was necessary to have analog support on the Pro Controller. It's not. Instead, go to the Quick Menu while running Swanstation, go to Port 1 and change the device type from Digital Controller to Analog (DualShock).

DJtheMan2101 commented 2 months ago

I don't think any of these comments are related to the issue I'm having.

The controller works fine via Bluetooth (mfi driver), though I prefer using it via USB (hid driver) to avoid input lag. When connected via USB, the "Pro Controller" controller profile is loaded, but all of the inputs are completely ignored in the cores and the menu, even when attempting to remap in Settings > Input.

I did find a workaround: by launching RetroArch from Steam (which does support the Pro Controller via both Bluetooth and USB), you can use Steam Input to create a virtual Xbox 360 controller that does work via USB (hid driver).

@bitznbrewz - I don't have any NSO controllers, so I can't verify if any of them also have this issue.

@erfg12 and @sarahckohl - The issue occurs whether or not macOS's Game Mode is enabled. "Game Focus Mode" in Settings > Input is unrelated to that; that setting disables hotkeys and captures the mouse so you can directly pass keyboard and mouse inputs to certain cores, for systems like DOS and Amiga. It's not relevant for controllers.

"Analog to Digital Type" maps one of your RetroPad's analog sticks so it mimics the D-Pad, allowing it to be used in cores that normally have no analog input (e.g., most 8-bit and 16-bit systems). It doesn't affect the buttons, and it's useless if the analog inputs were non-functional to begin with, as mine were.

warmenhoven commented 2 months ago

@DJtheMan2101 I see what you're talking about. I've added it to my list.

DJtheMan2101 commented 1 month ago

@warmenhoven - Thanks for looking at this. Sometimes, instead of doing nothing, the controller spams many different inputs at once, though I cannot figure how to consistently trigger this behavior consistently. Whenever this occurs, the keyboard inputs also stop working.

warmenhoven commented 1 month ago

FWIW I can't get it to work in Dolphin either. Steam works brilliantly though. Haven't tried PCSX2 yet.

jamescastells commented 1 month ago

I can confirm this is happening with version 1.18.0 on macOS Sonoma. This is indirectly related to a bug I reported.