DualSense haptics over Bluetooth (output report 0x32) #2056
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by beecrepaldi-afk on 2026-10-09T06:05:42Z.
Problem
Vibration ports (AudioOut2 type 0x6) reach the controller only through the USB DualSense sound card (#180), and only on Linux. Over Bluetooth there is no sound card, so the haptics are lost; #2032 drops these ports from the main mix in that case. Rumble and adaptive triggers already work over Bluetooth through SDL.
Proposal
Over Bluetooth, the DualSense takes haptics audio in HID output report 0x32. Send the vibration port's two channels there when the controller is connected over Bluetooth and no pad audio device is open.
0x32; byte 1 high nibble a 4-bit sequence number; bytes 2-40x91 0x07 0xFE(audio control packet); bytes 5-9 the controller's internal queue depth in frames (16); byte 10 a counter; bytes 11-120x92 0x40(haptics packet, 64 bytes); bytes 13-76 the samples; last 4 bytes a CRC32 (little-endian) over0xA2followed by bytes 0-137.0x02 | 0x20 | 0x40, valid_flag0 left at 0, since its rumble bits take the actuators out of audio mode). Otherwise the controller keeps what the last host set; we saw actuators at 12.5% of the level sent.SDL_hid_openon the controller andSDL_hid_write.SDL_GameControllerSendEffectonly fills report 0x31, which has no haptics block.Measurements from a working implementation
This already runs in P5M for Mac (PS5 Remote Play,
gui/src/macDualSenseBluetooth.mm), on macOS with IOKit:I wrote that Bluetooth haptics code, and I can contribute it here under GPL-2.0. It uses IOKit, so it would be ported to SDL2 for Linux and Windows. The report layouts are also documented by DS5Dongle, which our code followed for report 0x39 and for the queue depth.
Questions
AudioOut2PadMix, or the pad code that owns the SDL controller?AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T06:10:06Z.
I traced the current ownership in the tree.
AudioOut2Contextclassifies, mixes, and queues the PCM pad ports;PadInputowns the SDL controller and sends the current rumble/adaptive-trigger effects;PadStatecarries only the existing latest-value output state. That suggests keeping controller discovery, HID handle lifetime, report 0x31 configuration, reconnects, and 0x32 writes with the pad/controller output owner, while AudioOut2 hands it a bounded stream of mixed vibration frames.ContextPushholds the audio context mutex while rendering, so HID writes or 10.67 ms pacing should not run inline there. A single owner should also serialize 0x31/0x32 with SDL rumble and trigger reports to avoid output-report races. This is an ownership recommendation from the current architecture; whether to accept the feature and its cross-platform API still needs a maintainer decision and Linux/Windows hardware validation.Imported from boykopovar/AnyPS5. Originally posted by beecrepaldi-afk on 2026-10-09T06:16:31Z.
Thanks, that split matches how it runs in P5M: the audio side only fills a ring buffer, and a separate thread paces the 0x32 writes every 10.67 ms, so nothing blocks the audio path. In P5M, SDL keeps its own handle for 0x31 (rumble, triggers, light bar) while a second handle writes 0x32, and we have not seen conflicts on macOS. Still, a single owner in PadInput is cleaner, and I'd follow that here.
@boykopovar, would you take this feature? If yes, I'll open a PR with that structure, and it will need someone with Linux or Windows and a Bluetooth DualSense to test it on a title.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T21:04:16Z.
Yes, go ahead. A few things for the PR:
Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-21T13:17:47Z.
@beecrepaldi-afk are you still working on this? I have a DualSense I can run over Bluetooth and over USB, on Windows 11 (Radeon 860M), so I can do the Windows hardware testing you asked for above.
Either way works for me:
SDL_hid_*, owned byPadInputas MarcZX10 and oneandonlydean described, with your authorship on the commit.One limitation: I don't have a commercial title that uses the vibration ports (PPSA21564 or similar). I can drive the type 0x6 port with a known signal and feel or measure it on the controller. A title run would have to come from someone who has one.
Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-21T13:27:53Z.
Windows data point, measured with a standalone probe built against this repo's SDL2 (
3rdparty/SDL2, static, HIDAPI on). The probe is outside the tree.Setup: DualSense over Bluetooth, Windows 11 26300. Feature report 0x20 reports firmware 0x010d0002, update version 0x0633, hardware 0x00000917, build Sep 18 2025.
What the probe does:
SDL_GameControllerOpen, thenSDL_hid_open_path(SDL_GameControllerPath(controller), 0). The path is\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002054c_pid&0ce6#..., and its Bluetooth HID service GUID is how the link shows on Windows;interface_numberis -1. It sends one 0x31 configuration report, then 0x32 reports every 10.672 ms. The layout and CRC are exactly as in P5M'sbuild(),fullPower()andsign(). The content is 6 s of a 150 Hz sine at amplitude 100: the first 3 s on channel 0 only, the last 3 s on channel 1 only. Every 100 blocks it also callsSDL_GameControllerSetLEDon SDL's own handle.SDL_GameControllerSetLEDon SDL's handle in betweenSDL_hid_writereturns 547 for a 142-byte 0x32. Windows hidapi pads every write to the device's largest output report (0x39's 547 bytes). The controller still plays them, so the padding is harmless here.So on Windows the plain SDL route the issue proposes works as-is.
Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-21T13:55:15Z.
@beecrepaldi-afk I went ahead with the port in #9154, with your authorship on the commit. It's your report layout, CRC and configuration report from P5M, driven by
PadInputover SDL'sSDL_hid_*, and tested end to end on Windows over Bluetooth. If you'd rather it go differently, or want to take it over, say so there.