Optional Link (L2)
A USB DualSense exposes a 4-channel audio device: channels 0 and 1 drive its speaker, channels 2 and 3 its left
and right voice coils, the actuators that make DualSense haptics feel detailed. @gamepadly/sdk/link streams
audio to that device so haptic presets play on the voice coils ('4ch_vcm') and samples can use the controller
speaker.
import { createGamepadly } from '@gamepadly/sdk';import { LINK_RELEASES_URL, connectDualSenseViaBrowser, connectDualSenseViaCompanion, createLinkAudio,} from '@gamepadly/sdk/link';
const audio = createLinkAudio();const hub = createGamepadly({ audio, teardownAudioOnExit: true });There are two ways to reach the device. Both must start from a click.
Through the browser
Section titled “Through the browser”import { connectDualSenseViaBrowser } from '@gamepadly/sdk/link';
browserButton.onclick = async () => { const res = await connectDualSenseViaBrowser(audio); if (res.ok) hub.syncCapabilities();};Chrome and Edge can route audio to a specific device with setSinkId(). This needs no install, but Windows must
be set to a Quadraphonic speaker configuration for the DualSense, and the browser asks once for permission to
read audio device names.
Through Gamepadly Link
Section titled “Through Gamepadly Link”Gamepadly Link is an open-source (MIT) Windows tray app that streams 4-channel audio over a local connection. On sites other than gamepadly.com it asks the user to approve the site in the tray first.
import { LINK_RELEASES_URL, connectDualSenseViaCompanion } from '@gamepadly/sdk/link';
linkButton.onclick = async () => { const res = await connectDualSenseViaCompanion(audio, { minProtocolVersion: 1.1 }); if (!res.ok) { // 'link_not_running' | 'link_outdated' | 'user_denied' | 'consent_timeout' | 'consent_busy' // | 'origin_not_allowed' | 'dualsense_audio_not_found' | 'failed' showError(res.error, res.retryAfterSec, LINK_RELEASES_URL); return; } hub.syncCapabilities();};Never connect to Link on page load: the browser’s local network access rules require a user gesture, and players who do not run Link should never see an error for it.
Your own companion
Section titled “Your own companion”The protocol/v1.1 specification is open.
Fork Link or build your own companion, and point the SDK at it with
createLinkAudio({ httpBase, wsBase }). If your Content Security Policy blocks blob: worklets, host the audio
worklet yourself and pass workletUrl.