Streaming music wirelessly from a smartphone, tablet, or secondary laptop to your desktop PC or Linux home server turns your workstation into a high-quality Bluetooth speaker. In Bluetooth terminology, your smartphone acts as the A2DP Source, while your Linux PC acts as the A2DP Sink (Audio Receiver).
While desktop Linux distributions typically default to acting as an A2DP Source (sending audio to wireless headphones), enabling A2DP Sink mode requires configuring BlueZ Bluetooth daemons and PulseAudio or PipeWire audio servers. In this article, we cover how to enable A2DP Sink support across both legacy Ubuntu releases (using PulseAudio) and modern Ubuntu distributions (using PipeWire).
A2DP Architecture: Source vs. Sink
A2DP Source (Audio Transmitter): The device sending compressed audio stream data over Bluetooth (e.g. Android phone, iPhone, tablet).
A2DP Sink (Audio Receiver): The target device decoding the incoming Bluetooth audio stream and routing it to physical hardware speakers or DACs (e.g. Linux desktop PC, Raspberry Pi, Bluetooth speaker).
Audio Codecs: Subband Coding (SBC) is mandated by the A2DP specification. High-definition codecs like AAC, LDAC, and aptX HD require additional library support (
pulseaudio-module-bluetoothorpipewire-audio-client-libraries).
Method 1: Configuring PulseAudio for A2DP Sink (Ubuntu 16.04 / 18.04 / 20.04 LTS)
On systems using PulseAudio, install the Bluetooth audio modules and enable the Bluetooth policy handlers:
# 1. Install PulseAudio Bluetooth modules and BlueZ utilities
sudo apt update
sudo apt install pulseaudio-module-bluetooth bluez bluetooth pavucontrol
# 2. Edit PulseAudio default configuration file
sudo nano /etc/pulse/default.pa
# Ensure the following module lines are present and uncommented:
# load-module module-bluetooth-policy
# load-module module-bluetooth-discover
# 3. Restart BlueZ service and PulseAudio daemon
sudo systemctl restart bluetooth
pulseaudio -k
pulseaudio --startMethod 2: Modern PipeWire Setup (Ubuntu 22.04 LTS & 24.04 LTS)
Modern Ubuntu releases use PipeWire by default. PipeWire handles A2DP Sink roles automatically out of the box without requiring manual module edits:
# 1. Verify WirePlumber and PipeWire Bluetooth modules are running
systemctl --user status pipewire wireplumber
# 2. If Bluetooth audio is missing, install the PipeWire SPA Bluetooth plugin
sudo apt install libspa-0.2-bluetooth
systemctl --user restart pipewire wireplumberStep-by-Step Bluetooth Pairing via bluetoothctl
Once your audio server is configured, use the bluetoothctl interactive CLI tool to pair your mobile phone and establish the A2DP connection:
# Launch interactive bluetoothctl prompt
bluetoothctl
# Inside bluetoothctl shell:
power on
agent on
default-agent
discoverable on
pairable on
scan on
# Identify your smartphone's MAC address (e.g. AA:BB:CC:DD:EE:FF)
# Pair and trust your smartphone:
pair AA:BB:CC:DD:EE:FF
trust AA:BB:CC:DD:EE:FF
connect AA:BB:CC:DD:EE:FFTroubleshooting Common A2DP Sink Issues
Connected but No Audio Output: Open
pavucontrol, go to the Configuration tab, locate your phone device, and ensure the profile is set to High Fidelity Playback (A2DP Sink) rather than HSP/HFP (Handsfree).Audio Stuttering or Dropouts: Increase the PulseAudio buffer size in
/etc/pulse/daemon.conf(default-fragments = 5,default-fragment-size-msec = 25) or move Wi-Fi traffic away from the 2.4 GHz band to eliminate radio interference.Connection Immediately Drops After Pairing: Check BlueZ logs using
sudo journalctl -u bluetooth -e. EnsureEnable=Source,Sink,Media,Socketis set under[General]in/etc/bluetooth/main.conf.
Comments and corrections