Confusion about SDL3 Rumble APIs: SDL_OpenHapticFromJoystick vs SDL_RumbleGamepad

Hello, I am developing in C# using SDL3 (via the wrapper ppy.SDL3-CS).
My controller supports vibration and is connected successfully.

I tried two different ways to start rumble:

  1. Using SDL_Joystick + SDL_OpenHapticFromJoystick + SDL_InitHapticRumble + SDL_PlayHapticRumble
    → But this always fails, SDL_OpenHapticFromJoystick returns NULL.
    When I check the error with SDL_GetError, it says: “Haptic: Joystick isn’t a haptic device.”

  2. Using SDL_RumbleGamepad (or SDL_RumbleJoystick) directly on the opened SDL_Gamepad
    → This works correctly, the controller vibrates as expected.

So my questions are:

  • Is SDL_OpenHapticFromJoystick not supposed to work with modern gamepads?

  • Is SDL_IsJoystickHaptic only for advanced/custom haptic effects, while SDL_RumbleGamepad is the standard way for simple rumble?

  • The documentation says: “This function requires you to process SDL events or call SDL_UpdateJoysticks() to update rumble state.”
    → Why is SDL_UpdateJoysticks() necessary for rumble? My script already has an event loop, but I am not sure if I am using it correctly.

Any clarification on the correct and recommended way to handle rumble in SDL3 would be greatly appreciated!

Thank you!

Yes — that behavior is expected.

Modern controllers usually don’t expose haptics via SDL_OpenHapticFromJoystick(), so it fails. The correct method is to use SDL_RumbleGamepad() (or SDL_RumbleJoystick()), which handles standard rumble on most gamepads.

SDL_UpdateJoysticks() or regular event polling is needed so SDL can send rumble updates to the device.

In short: use the Rumble APIs, not the Haptic ones, unless you need advanced effects.

2 Likes

Thanks a lot! That clears everything up. I’ll stick with SDL_RumbleGamepad from now on — really appreciate the explanation!