$ show daidr/dualsense-tester
A browser-based tool for testing and configuring PlayStation DualSense, DualSense Edge, and DualShock 4 controllers via the WebHID API. It provides real-time visualization of all inputs (joysticks, buttons, triggers, gyroscope, accelerometer, touchpad), output control (lightbar, player LEDs, rumble, adaptive triggers, audio), and diagnostics (battery, telemetry, firmware info). For DualSense Edge, it offers profile editing including button remapping, joystick sensitivity curves, trigger deadzones, and vibration intensity. Built as a single-page application with Vue 3, TypeScript, and Pinia, it uses a custom device-based routing architecture that dynamically loads controller-specific views based on the HID device type. Communication with controllers is handled entirely in the browser through raw HID report parsing and construction, with audio streaming over USB (quadraphonic PCM) and Bluetooth (Opus via WebCodecs). The codebase is heavily modularized with composables for media playback, microphone capture, and state management. While primarily an application, the repository includes significant reverse-engineering work of the HID communication protocols for these controllers, making it a valuable reference for implementing controller support. The code is organized for extensibility, with a clean pattern for adding new controller types.
The LLM identified 3 files worth highlighting for reuse:
Provides a typed event bus using Vue's reactive system. Emitters and listeners communicate without importing a global bus or using provide/inject. The implementation is self-contained, type-safe, and can be extracted to any Vue 3 project.
Implements CRC-32C (Castagnoli) for Bluetooth HID report integrity. This is a clean, dependency-free utility that exactly follows the Sony protocol specification. It can be reused for any project requiring CRC-32C computation, particularly for gaming peripheral or low-level communication protocols.
Implements a RouterManager that matches HID devices to controller-specific router classes. The abstract BaseDeviceRouter defines a clean interface for device panels, matching logic, and device metadata. Adding support for new controllers requires only creating a new file in the router directory, demonstrating an extensible architecture suitable for multi-peripheral applications.