DualSense haptics and controller speaker sound bluethooth #969
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!969
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/969/head"
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?
@Pyxellator on GitHub · 2026-10-02 09:59 UTC · original
main→main· +1394 −134 · 11 files · 10 commits · merged 2026-10-02 10:55 UTCSummary
DualSense haptics and controller speaker audio previously relied on the USB audio endpoint. This PR sends both over Bluetooth using DualSense HID audio reports, so games such as Astro’s Playroom can use these effects wirelessly.
Bluetooth audio reports are prepared on a worker thread to keep encoding and HID writes off the emulation audio path. The audio queue is bounded to prevent delay from building up after a Bluetooth stall. Normal rumble resumes when haptic playback ends.
The PR also adds Opus for Bluetooth speaker encoding and includes macOS test allocation fixes needed for CI.
Testing
AI use
Implementation and automated tests were developed with Codex at my direction. I tested the controller behavior described above.
@coderabbitai[bot] on GitHub · 2026-10-02 10:03 UTC · original · edited 2026-10-02 10:35 UTC
Navigate logical layers of code changes, visualize relationships, and explore their blast radius.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
2d978f48-8641-4567-b72e-e440a1bcc4d4📥 Commits
Reviewing files that changed from the base of the PR and between
78762bb48bandf147c69354.📒 Files selected for processing (2)
src/libs/audio.cpptests/AudioOutTimingTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.
📝 Walkthrough
Walkthrough
The change adds Bluetooth HID audio and haptics for wireless DualSense controllers, using Opus for speaker audio. Haptics and general audio routing distinguish Bluetooth from wired controllers, and audio buffering and pacing are updated. Audio output APIs reject zero sample frequency. Tests cover Bluetooth reports, routing, failures, concurrency, and buffering. Memory and page-manager tests now search multiple fixed guest addresses.
Suggested reviewers:
mhakkuh,nmzik,cosmoPriority: ➖ Normal
Change: Feature
Merge Risk: 🔵 Low · up to
f147cZero-frequency output requests now fail cleanly. The USB timing test may still pass through fallback pacing if USB-specific pacing regresses, so a focused boundary case would improve confidence; no current runtime failure is established.
Security Architecture Review
Security architecture risk: 🔵 Low · up to
f147cWireless output is constrained by controller identity checks, bounded transport queues, and stale-report protection. No introduced security vulnerability was established, but device-identity lifetime and cleanup during stalled or failed writes remain incompletely verified.
Retained concerns
No architecture-level concerns identified.
Security review details
Security Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment
@coderabbitai helpto get the list of available commands.@ -0,0 +406,4 @@break;}queued = std::max(0, SDL_GetAudioStreamQueued(stream->audio));}@coderabbitai[bot] on GitHub · 2026-10-02 10:03 UTC · original · edited 2026-10-02 10:17 UTC
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Haptic overflow discards almost the whole queue, not the oldest report slot.
The
discardedbuffer holds2 * OPUS_FRAMES * 2floats, which is 7680 bytes.SDL_GetAudioStreamDatameasures this request in the output format.So on a haptic stream, the first read drains everything SDL can produce. Only the resampler lookahead survives. After a Bluetooth write stall, haptics therefore lose up to 80 ms of buffered waveform. This is the gap the comment says the code avoids.
TestBluetoothOverflowKeepsRecentAudiotests only the speaker stream, so it does not catch this.Fix: size each discard read to one report slot for the stream type. A haptic slot is 128 floats (64 stereo frames).
🐛 Proposed fix
📝 Committable suggestion
✅ Addressed in commits
44ba657to78762bb@coderabbitai[bot] on GitHub · 2026-10-02 10:03 UTC · original · reviewed
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
fe537d28-f8a7-4508-92e8-4fc33621b015📥 Commits
Reviewing files that changed from the base of the PR and between
39e23ac92eand0ad4080dea.📒 Files selected for processing (9)
CMakeLists.txtsrc/libs/audio.cppsrc/libs/dualSenseBluetooth.cppsrc/libs/dualSenseBluetooth.hsrc/libs/dualSenseHaptics.cppsrc/libs/dualSenseHaptics.htests/MemoryTrackerTests.cpptests/PadHapticsTests.cpptests/PageManagerTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
@ -0,0 +406,4 @@break;}queued = std::max(0, SDL_GetAudioStreamQueued(stream->audio));}@Pyxellator on GitHub · 2026-10-02 10:07 UTC · original
ok, i´m fixing it
@coderabbitai[bot] on GitHub · 2026-10-02 10:23 UTC · original · reviewed
🧹 Nitpick comments (1)
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
ed504435-3111-406b-a7be-9504aae31d9c📥 Commits
Reviewing files that changed from the base of the PR and between
0ad4080deaand78762bb48b.📒 Files selected for processing (6)
CMakeLists.txtsrc/libs/audio.cppsrc/libs/dualSenseBluetooth.cpptests/AudioOutTimingTests.cpptests/MemoryTrackerTests.cpptests/PadHapticsTests.cpp🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.
@Nmzik on GitHub · 2026-10-02 10:54 UTC · original
Unified USB and Bluetooth paths. Thanks
@Rool-IO on GitHub · 2026-10-02 13:24 UTC · original
Small regression resulting from those changes is SpeakerFX are quieter.
Worth considering to offer a couple sliders in Kyty's settings interface to mimic console's options of lowering or upping respective Speaker and Haptics volumes.
@Pyxellator on GitHub · 2026-10-02 13:29 UTC · original
I think @Cosmo has already done something similar
@Pyxellator on GitHub · 2026-10-02 13:29 UTC · original
Still, i think i will build a solution with sliders inside the settings of Kyty
@Rool-IO on GitHub · 2026-10-02 13:49 UTC · original
Other issue with this is if you have the DualSense connected over BT, then plug it in over USB (both BT and USB are still active in this scenario), then neither Haptics nor SpeakerFX are sent to the controller and Mic input doesn't work either despite being selected in Kyty's settings.
Unplugging (falling back to BT only) restores functionalities.
@Pyxellator on GitHub · 2026-10-02 13:55 UTC · original
True, im gonna fix that later