Skip to content

ImGui: Add visual vibration intensity indicator to OSD#14230

Open
Vishrut2403 wants to merge 1 commit intoPCSX2:masterfrom
Vishrut2403:feature/vibration-osd
Open

ImGui: Add visual vibration intensity indicator to OSD#14230
Vishrut2403 wants to merge 1 commit intoPCSX2:masterfrom
Vishrut2403:feature/vibration-osd

Conversation

@Vishrut2403
Copy link
Copy Markdown

Description of Changes

Adds a visual on-screen indicator that displays the vibration intensity of each controller's large and small motors during gameplay. A new "Show Vibration" checkbox is added to the OSD settings (disabled by default), and the indicator appears in the top-right corner alongside existing OSD overlays.

Rationale behind Changes

This addresses #14225. The feature helps players who use controllers without rumble motors, have hearing or sensory impairments, or play on handhelds where vibration is disabled to save battery allowing them to "see" haptic feedback they would otherwise miss.

Known limitation: The indicator currently only shows vibration when the underlying hardware successfully processes the rumble signal. Controllers without Linux rumble driver support will not trigger the overlay even when the game sends vibration data. I'm aware of this limitation and plan to address it by intercepting vibration signals earlier in the pipeline (at SetPadVibrationIntensity) before hardware dispatch, so the overlay reflects what the game requested rather than what the hardware received. Feedback on the preferred approach is welcome.

Suggested Testing Steps

Enable "Show Vibration" in Settings -> On-Screen Display
Boot a game that uses controller rumble
Trigger a vibration event (e.g. taking damage, explosions)
Confirm the indicator appears in the top-right corner showing large and small motor intensities as percentages

Note: I was unable to test with real vibration data due to controller driver limitations on my Linux test machine.
To verify the overlay renders correctly without rumble-capable hardware, I temporarily hardcoded a fixed intensity value and confirmed the indicator displays in the correct position with proper styling. This test code was removed before submitting.
Would appreciate a maintainer verifying on a rumble-capable controller.

Did you use AI to help find, test, or implement this issue or feature?

Yes. I used Claude to help navigate the codebase, identify the correct hook points (SetPadVibrationIntensity, DrawIndicatorsOverlay), and implement the feature following PCSX2's coding guidelines.

@Vishrut2403
Copy link
Copy Markdown
Author

Updated the implementation to address the known limitation mentioned in the PR description. Vibration signals are now intercepted at SetPadVibrationIntensity before hardware dispatch, so the overlay correctly displays intensity even on controllers without Linux rumble driver support.
Verified working on a controller without rumble support. The indicator updates dynamically in response to in-game vibration events as the game requests them, which aligns with the goal of the feature.

@kamfretoz
Copy link
Copy Markdown
Contributor

Instead of implementing a separate "DrawVibrationOverlay" OSD, why not just use the existing "DrawInputsOverlay" OSD and just have the vibration as one of the feedbacks icon being shown, just like what DuckStation did?

image

@Vishrut2403
Copy link
Copy Markdown
Author

Instead of implementing a separate "DrawVibrationOverlay" OSD, why not just use the existing "DrawInputsOverlay" OSD and just have the vibration as one of the feedbacks icon being shown, just like what DuckStation did?

image

I wasn't aware of how DuckStation handled it, and I followed the existing PCSX2 pattern of separate overlay functions. The DrawInputsOverlay approach is clearly cleaner. I'll implement it that way.

@Vishrut2403
Copy link
Copy Markdown
Author

Reworked as suggested. Vibration is now shown inline within the existing DrawInputsOverlay rather than as a separate overlay. When "Show Inputs" is enabled, ICON_PF_CONTROLLER_VIBRATION icons appear alongside the controller state whenever a motor is active.
Found ICON_PF_CONTROLLER_VIBRATION in the PromptFont icon set which seemed fitting. Happy to switch to a different icon if there are better ideas.

@Vishrut2403 Vishrut2403 force-pushed the feature/vibration-osd branch 2 times, most recently from 96867ec to 19a5a7e Compare April 3, 2026 03:03
@Vishrut2403 Vishrut2403 force-pushed the feature/vibration-osd branch from 905f43a to 2411ae3 Compare April 8, 2026 16:48
Copy link
Copy Markdown
Contributor

@kamfretoz kamfretoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't seem to work, i use the pad-test homebrew to test the controller vibration. the indicator doens't show up even though the controller itself is physically vibrating.

EDIT: Sorry, didnt meant to approve this.

Image

@bslenul
Copy link
Copy Markdown
Contributor

bslenul commented Apr 11, 2026

For me it's a bit different using padtest (on Windows 11 if it matters): triggering small vibrations (triangle + dpad up) doesn't show anything, strong vibrations (triangle + left stick down) however show 2 icons:

image

@Vishrut2403
Copy link
Copy Markdown
Author

Doesn't seem to work, i use the pad-test homebrew to test the controller vibration. the indicator doens't show up even though the controller itself is physically vibrating.

EDIT: Sorry, didnt meant to approve this.

Image

Both LargeMotor and SmallMotor have bind_index = 0 in PadDualshock2.cpp, so the overlay can't distinguish between them. Motor dispatch uses motors[0]/motors[1] array position rather than bind_index, so changing SmallMotor to bind_index = 1 appears safe, but wanted to confirm before making that change. Is this the right fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants