Description
On macOS, the Logitech F310 controller (reporting as “Logitech Dual Action”) is not enumerated by VICE when using the default SDL configuration.
If VICE is launched with the environment variable SDL_JOYSTICK_MFI=0, the controller is detected and functions correctly.
Environment
VICE version: 3.10 (SDL2 build)
Bundled SDL version: 2.32.10
Platform: macOS (Apple Silicon)
Controller: Logitech F310 (D-mode, appears as “Logitech Dual Action”)
Steps to Reproduce
- Connect Logitech F310 (switched to D)
- Launch VICE normally:
x64sc -verbose -debug
- Observe the output
SDLJoystick: No joysticks found.
Workaround
- Launch VICE with MFi joystick support disabled:
SDL_JOYSTICK_MFI=0 x64sc -verbose -debug
- Observe the output
SDLJoystick: Got 1 potential devices.
SDLJoystick: SDL_JoystickNameForIndex(0) = "Logitech Dual Action"
Controller input works correctly when C64 port 2 is configured as a real joystick:
-joydev2 4
Control Tests
- PS4 controller detected correctly without workaround
- THEC64 Competition Pro USB joystick detected correctly without workaround
- SDL testjoystick utility detects the F310 correctly
Have you tried other SDL based apps? I don't think we can do much about it (in the SDL port anyway)
I tried it with the SDL testjoystick utility. Is there another (relatively simple) SDL based app you would like me to try it with?
No idea really (even less which are ported to macOS, those i had in mind only have windows binaries apparently)
Did you build the testjoystick program yourself? And which SDL version does it use? Seems odd that it works with that, but not in VICE
Yes. I built SDL’s testjoystick utility myself from source using SDL release-2.30.9. The resulting binary is statically linked and reports: SDL-release-2.30.9-0-gc98c4fb. VICE, by contrast, is dynamically linked against SDL 2.32.10
To make sure it wasn't an issue with SDL 2.32.10 I copied the VICE app, and replaced the linked 2.32.10 SDL lib with the 2.30.9 one. When I ran VICE is till reported No joysticks found, unless disabled MFi joystick support
BTW, what happens if you switch the pad to xinput? (Isn't that the preferred way anyway?)
X-Input is preferred by is less likely to work on linux and macs (or so all the documentation tells me). I tried it just in case , but no luck.
Does it work in the GTK build?
That env var looks like it disables SDL use of the modern macOS game controller APIs. I think we need to make this into an SDL+macos only setting. It's good that you have a workaround.