Send audio from mobile phone (Android/iOS) to Raspberry

Platform used: Raspberry Pi 3 B+
Bluetooth module: built-in
First, update firmware to make sure you have latest version:

sudo rpi-update

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:

sudo raspi-config

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:

pulseaudio -k

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.

Entradas relacionadas

2 comentarios en «Send audio from mobile phone (Android/iOS) to Raspberry»

  1. Do you know if this still works in 2023?

    Also, do I need to do more if I want to use a microphone on my Pi to use for voice commands or for talking on the phone?

    1. Hi, I haven’t tried since then so I couldn’t say with certainty. Let me know if you finally check it out and find that it still works on latest OS versions! 😉

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

Este sitio usa Akismet para reducir el spam. Aprende cómo se procesan los datos de tus comentarios.