Instead of buying a dedicated Bluetooth speaker for your desk, you can easily configure your Linux PC, laptop, or Raspberry Pi to accept incoming wireless audio streams from your Android phone or iPhone.

By instructing Linux to operate as a Bluetooth A2DP Sink (Audio Receiver), your mobile device treats your computer's sound card and external speakers as a high-fidelity wireless audio endpoint. In this tutorial, we demonstrate how to configure BlueZ, PipeWire, and PulseAudio to route smartphone audio directly to your Linux desktop speakers.

Quick Command Sequence

Follow these commands to install required dependencies, enable discovery, and pair your phone:

Terminal Commandsbash
# 1. Install Bluetooth audio utilities
# For Modern PipeWire (Ubuntu 22.04 / 24.04):
sudo apt install bluez libspa-0.2-bluetooth pavucontrol
 
# For PulseAudio (Ubuntu 20.04 and earlier):
sudo apt install bluez pulseaudio-module-bluetooth pavucontrol
 
# 2. Restart Bluetooth service
sudo systemctl restart bluetooth
 
# 3. Launch bluetoothctl to pair and connect phone
bluetoothctl
# bluetoothctl commands:
# power on
# discoverable on
# pair <PHONE_MAC_ADDRESS>
# trust <PHONE_MAC_ADDRESS>
# connect <PHONE_MAC_ADDRESS>

Step 1: Audio Subsystem Configuration (PipeWire vs PulseAudio)

Modern Linux Systems using PipeWire

PipeWire handles Bluetooth A2DP Sink profiles out of the box. Ensure WirePlumber and PipeWire bluetooth plugins are active:

Terminal Commandsbash
# Restart PipeWire and WirePlumber user services
systemctl --user restart pipewire wireplumber
 
# Verify active Bluetooth audio SPA plugin
pw-dump | grep -i bluetooth

Legacy Linux Systems using PulseAudio

If your Linux distribution relies on PulseAudio, enable Bluetooth policy modules in /etc/pulse/default.pa:

Terminal Commandsbash
# Edit PulseAudio default configuration
sudo nano /etc/pulse/default.pa
 
# Ensure these lines exist and are uncommented:
# load-module module-bluetooth-policy
# load-module module-bluetooth-discover
# load-module module-switch-on-connect
 
# Restart PulseAudio daemon
pulseaudio -k && pulseaudio --start

Step 2: Connecting Your Phone and Routing Audio Streams

Once paired and connected via bluetoothctl, open your phone's Bluetooth settings menu and tap your Linux PC name to connect. Open pavucontrol (PulseAudio Volume Control) on Linux to verify stream routing:

  • Input Devices Tab: Your connected mobile phone will appear as an active audio input capture source emitting PCM audio.

  • Playback Tab: Ensure your phone's audio stream is routed to your computer's primary audio output device (e.g. Built-in Audio Analog Stereo or HDMI output).

  • Configuration Tab: Confirm the Bluetooth device profile is set to A2DP Sink rather than low-bitrate HSP/HFP Handsfree mode.

Troubleshooting Common Audio Issues

  • No Sound Playing: Open pavucontrol and check if the phone stream is muted. Ensure the master output volume slider is raised.

  • Audio Latency / Sync Lag: Bluetooth A2DP introduces ~150-200ms audio buffering latency. In PipeWire, adjust quantum buffer size using pw-metadata -n settings 0 clock.force-quantum 512.

  • Phone Keeps Disconnecting: Add Enable=Source,Sink,Media,Socket under the [General] section in /etc/bluetooth/main.conf and run sudo systemctl restart bluetooth.