voja's blog

if you hate fun and actual web design, you came to the right place

Using Bluetooth speakers on Linux

Using bluetooth speakers or anything bluetooth related is an infamously difficult task, so I wrote this short guide, primarily for myself.

I say "speakers" but really it should go for other bluetooth devices as well (like headphones, etc.)

1. Enable Bluetooth device (if not already)

sudo rfkill unblock bluetooth

2. Install Bluez

sudo apt install pulseaudio-module-bluetooth bluez bluez-firmware bluez-tools pavucontrol

3. Find and edit the bluetooth.service file

You can find this by running

sudo systemctl status bluetooth

and look at the first two lines for a service file

bluetooth.service - Bluetooth service
  Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)

open it, find the ExecStart line and add --noplugin=sap to the end.

ExecStart=/usr/lib/bluetooth/bluetoothd --noplugin=sap

After that reload the daemon and restart the service.

sudo systemctl daemon-reload
sudo systemctl restart bluetooth

4. Connect to the speaker with bluetoothctl

power on
scan on (find the MAC address of the speaker)
pair <MAC_ADDRESS>
trust <MAC_ADDRESS>
connect <MAC_ADDRESS>

(if "connect" doesn't work, try resetting pulseaudio)

pulseaudio -k
pulseaudio --start

You should now see the speaker as an output device in pavucontrol.

uploaded: Mon, 18 Jul 2022
tags: