Platform used: Raspberry Pi 3 B+
Bluetooth module: built-in
First, update firmware to make sure you have latest version:
Now, install all the needed pulse-audio packages:
sudo apt install pulseaudio-*.
Configure the bluetooth in the Raspberry:
pi@raspberrypi:~ $ bluetoothctl [NEW] Controller XX:XX:XX:XX:XX:XX raspberrypi [default] [bluetooth]# power on Changing power on succeeded [bluetooth]# agent NoInputNoOutput Agent registered [bluetooth]# default-agent Default agent request successful [bluetooth]# discoverable on Changing discoverable on succeeded [CHG] Controller B8:27:EB:DB:58:46 Discoverable: yes [bluetooth]# pairable on Changing pairable on succeeded
In your mobile phone, search for the raspberry bluetooth signal and pair to it:
[Noname]# connect XX:XX:XX:XX:XX:XX Attempting to connect to XX:XX:XX:XX:XX:XX [CHG] Device XX:XX:XX:XX:XX:XX ServicesResolved: yes Connection successful [Noname]# trust XX:XX:XX:XX:XX:XX Changing XX:XX:XX:XX:XX:XX trust succeeded [CHG] Controller XX:XX:XX:XX:XX:XX Discoverable: no [Noname]# exit
Now, you can try to play some audio in your mobile and it should be reproduced in the the Raspberry.
In my case, audio was driven out to the HDMI. In case you want to switch it through the Jack 3.5 mm output you can run:
Then, select Advanced Options > Audio > Force 3.5 mm (‘headphone’) jack
With this all set, you can stream any audio such as the built-in music player, Spotify or YouTube to the Raspberry and from it to the connected speakers or HDMI display.
Finally, as the device has been stored as a trusted device, every time the Raspberry is booted, you won’t need to repeat this process. It will be so easy as connecting your mobile phone to the available raspberry bluetooth signal.
If sound sounds distorted, try restarting pulseaudio with:
Handling with several devices
If you pair several devices, only first connected device will be able to stream audio. If I connect my computer to the raspberry and then I try to connect my mobile phone (both previously paired and trusted), phone connection will fail. First, I’ll need to disconenct my computer and only then I’ll be able to successfully connect to the raspberry with my mobile phone.