sdl2_frt/src/joystick
Sam Lantinga 6590d078d7 Fixed bug 4996 - Mac: XBoxOne Bluetooth rumble isn't working
rofferom

I have an annoying issue on MacOS about XBoxOne Bluetooth rumble (Vendor: 0x045e, Product: 0x02fd).

When 360controller is installed, rumble is working correctly. However, Bluetooth rumble isn't working at all, with or without 360controller installed (although it is working with Chrome + https://html5gamepad.com).

I looked at the code, and it seems that XBox controllers are managed in MacOS in this file: SDL_hidapi_xbox360.c. The XBoxOne file is disabled for MacOS in SDL_hidjoystick_c.h.

The function HIDAPI_DriverXbox360_Rumble() is called correctly, and hid_write() returns no error.

I have tried a stupid test. I took the rumble packet from 360controller: ec4e88eb2d/XBOBTFF/FFDriver.cpp (L620). With the patch I have attached, I manage to have rumble working on Bluetooth (with some stupid vibration level, but it proves it can if the packet is changed).

But it breaks the USB rumble with 360controller. A comment in the function makes an explicit reference to 360controller, I think that's why I have broken this specific usecase.

I don't know what is the correct way to fix this, but it seems that the current implementation has a missing case for Bluetooth support.


Note that I also tested master this morning, and I have another issue:
    if (!device->ffservice) {
        return SDL_Unsupported();
    }

test fails in DARWIN_JoystickRumble(). This test has been done quickly, I'm not totaly confident about its accuracy.
2020-03-01 14:52:49 -08:00
..
android Moved rumble expiration to the main joystick handling level, and prevent sending the driver layer duplicate rumble requests. 2020-02-04 12:48:53 -08:00
bsd Moved rumble expiration to the main joystick handling level, and prevent sending the driver layer duplicate rumble requests. 2020-02-04 12:48:53 -08:00
darwin macOS: fix crash if and when joystick-init-on-add fails 2020-02-05 13:16:17 -05:00
dummy Moved rumble expiration to the main joystick handling level, and prevent sending the driver layer duplicate rumble requests. 2020-02-04 12:48:53 -08:00
emscripten Moved rumble expiration to the main joystick handling level, and prevent sending the driver layer duplicate rumble requests. 2020-02-04 12:48:53 -08:00
haiku Moved rumble expiration to the main joystick handling level, and prevent sending the driver layer duplicate rumble requests. 2020-02-04 12:48:53 -08:00
hidapi Fixed bug 4996 - Mac: XBoxOne Bluetooth rumble isn't working 2020-03-01 14:52:49 -08:00
iphoneos Moved rumble expiration to the main joystick handling level, and prevent sending the driver layer duplicate rumble requests. 2020-02-04 12:48:53 -08:00
linux Moved rumble expiration to the main joystick handling level, and prevent sending the driver layer duplicate rumble requests. 2020-02-04 12:48:53 -08:00
psp Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
steam Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
windows Moved rumble expiration to the main joystick handling level, and prevent sending the driver layer duplicate rumble requests. 2020-02-04 12:48:53 -08:00
controller_type.h Fixed support for third party Xbox 360 wireless controller dongle 2020-02-19 08:26:00 -08:00
SDL_gamecontroller.c Added Android SDK conditionals to game controller mappings 2020-02-17 14:15:47 -08:00
SDL_gamecontrollerdb.h Added Android SDK conditionals to game controller mappings 2020-02-17 14:15:47 -08:00
SDL_joystick_c.h Added support for detecting previously unknown Xbox 360 and Xbox One controllers using the HIDAPI driver with libusb and Android 2020-01-18 11:21:14 -08:00
SDL_joystick.c Fixed support for third party Xbox 360 wireless controller dongle 2020-02-19 08:26:00 -08:00
SDL_sysjoystick.h Moved rumble expiration to the main joystick handling level, and prevent sending the driver layer duplicate rumble requests. 2020-02-04 12:48:53 -08:00
sort_controllers.py Added Android SDK conditionals to game controller mappings 2020-02-17 14:15:47 -08:00
usb_ids.h Added support for the paddles on the Xbox One Elite Series 1 controller 2020-01-22 11:28:35 -08:00