Skip to content

Instantly share code, notes, and snippets.

@rootfs
Forked from joergschiller/a2dp_sink_ubuntu_linux.md
Created September 24, 2023 18:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rootfs/b284654a95df0e4772b3b886a16ce260 to your computer and use it in GitHub Desktop.
Save rootfs/b284654a95df0e4772b3b886a16ce260 to your computer and use it in GitHub Desktop.
A2DP Sink on Ubuntu Linux with bluez (streaming bluetooth stereo audio from smartphone to pc)

Howto Enable and Use A2DP Sink on Ubuntu Linux with Bluez

  1. Add Enable=Source to /etc/bluetooth/audio.conf right after [General].

  2. Find address in form XX:XX:XX:XX:XX:XX of phone with hcitool scan.

  3. Pair and trust smartphone with sudo bluez-simple-agent hci0 XX:XX:XX:XX:XX:XX and sudo bluez-test-device trusted XX:XX:XX:XX:XX:XX yes.

  4. Create loopback in pulseaudio connection bluetooth a2dp source with alsa sink:

pactl load-module module-loopback \
source=bluez_source.XX_XX_XX_XX_XX_XX \
sink=alsa_output.pci-0000_00_1b.0.analog-stereo

You can find your own values for source and sink with pacmd list-sources and pacmd list-sinks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment