SDL/src/joystick/hidapi
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
..
steam Added missing file from previous commit 2020-01-29 20:09:59 -08:00
SDL_hidapi_gamecube.c Fixed long delay on main thread caused by blocking rumble writes in HIDAPI drivers 2020-02-04 15:26:56 -08:00
SDL_hidapi_ps4.c Fixed long delay on main thread caused by blocking rumble writes in HIDAPI drivers 2020-02-04 15:26:56 -08:00
SDL_hidapi_rumble.c Update for bug 4923 - Calling SDL_GameControllerRumble() often takes 8 ms 2020-02-07 11:02:34 -08:00
SDL_hidapi_rumble.h Update for bug 4923 - Calling SDL_GameControllerRumble() often takes 8 ms 2020-02-07 11:02:34 -08:00
SDL_hidapi_steam.c 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
SDL_hidapi_switch.c Fixed trying to handle the HORI Wireless Switch Pad when connected via USB 2020-02-27 13:53:32 -08:00
SDL_hidapi_xbox360.c Fixed bug 4996 - Mac: XBoxOne Bluetooth rumble isn't working 2020-03-01 14:52:49 -08:00
SDL_hidapi_xbox360w.c Fixed support for third party Xbox 360 wireless controller dongle 2020-02-19 08:26:00 -08:00
SDL_hidapi_xboxone.c Xbox One controller rumble doesn't need synchronization if you use a packet counter of 0 2020-02-27 09:33:32 -08:00
SDL_hidapijoystick.c mac: Fix gamepad detection 2020-03-01 13:01:53 -08:00
SDL_hidapijoystick_c.h Fixed long delay on main thread caused by blocking rumble writes in HIDAPI drivers 2020-02-04 15:26:56 -08:00