Skip to content

Releases

padspeaker 0.1.0

Choose a tag to compare

@eknowledger eknowledger released this 24 Oct 06:07

Play your computer's sound on the speaker built into a Bluetooth gamepad. The pad shows up as an audio output, picked like any other.

▶ Watch it work (13 s, with sound)

Over USB a DualShock 4 is a sound card. Over Bluetooth it is not, so Linux offers no output for its speaker, even though the pad accepts sound on its Bluetooth link. padspeaker sends it there.

What you get

  • One audio output per connected pad, named Controller speaker (Wireless Controller xxxx). It appears in the normal audio menu and disappears when the pad disconnects.
  • Combined outputs: your TV (or any main output) plus one pad, or plus every pad, or all pads together. The menu text uses the output's own name.
  • Volume and mute follow the output, the pad's light colour is kept while streaming and restored afterwards, and the default output is moved back if the pad vanishes while selected.
  • Safe by construction: it writes only two kinds of HID message to a pad, never touches buttons, sticks or motion, and removes everything it creates. SECURITY.md lists exactly what it writes.
  • Zero runtime dependencies beyond the Python standard library, libsbc and the pactl and parec tools.
  • A Batocera installer with dry run, checksums, atomic swap and rollback, which also migrates an install made under the earlier working name (ds4-bt-speaker).

Install

On Batocera, from a checkout, on your computer:

git clone https://github.com/eknowledger/padspeaker && cd padspeaker
deploy/install.sh --dry-run     # look first; nothing is changed
deploy/install.sh --enable      # install, enable at boot, start

Then pick Start > System Settings > Audio Output > Controller speaker. Other Linux systems: see docs/LINUX.md.

Verified, and not

  • Verified on hardware: two DualShock 4 compatible clones (054C:09CC) over Bluetooth, on Batocera v41 with PipeWire and kernel 6.11, including a reboot test with the service starting by itself.
  • Covered by tests only: other distributions, PulseAudio without PipeWire, the systemd and udev examples.
  • Not verified: genuine Sony pads and the USB dongle. DualSense is not supported (different protocol).
  • Alpha. COMPATIBILITY.md says how to report your pad, whether it works or not.

Known limitations

  • Latency is roughly 100 to 150 ms (an estimate, not yet measured), and in combined outputs the main output is ahead of the pad. tv_delay_ms is planned and does nothing yet.
  • Without hcitool a pad can drop after about 14 seconds of streaming (why).
  • Bluetooth and 2.4 GHz Wi-Fi sharing a radio can make the sound stutter.

Documentation

README · Architecture · Protocol · Batocera · Changelog · Roadmap

Not affiliated with Sony. "DualShock", "DualSense" and "PlayStation" are trademarks of their owners and are used only to say which hardware this works with.