A guide to connect to a bluetooth speaker on rpi3

This forum is for topics dealing with problems with software specifically in the AArch64 repo.

A guide to connect to a bluetooth speaker on rpi3

Postby GloW » Sun Mar 05, 2017 8:24 pm

Here is a complete guide to connect a Raspberry Pi 3 with Arch Linux ARM to a Bluetooth speaker/headset using pulseaudio and bluez.

First add your user to lp group if not already (see /etc/dbus-1/system.d/bluetooth.conf for reference about this)
$this->bbcode_second_pass_code('', 'usermod -aG lp pi')

Then enable uart, edit /boot/config.txt and append the following :
$this->bbcode_second_pass_code('', 'enable_uart=1')

Create and install hciattach aur package and dependencies :
$this->bbcode_second_pass_code('', '
pacman -S libical
wget https://aur.archlinux.org/cgit/aur.git/snapshot/hciattach-rpi3.tar.gz
tar -xzvf hciattach-rpi3.tar.gz
cd hciattach-rpi3
makepkg
pacman -U hciattach-rpi3-5.38-1-armv7h.pkg.tar.xz
')

Create and install pi-bluetooth package :
$this->bbcode_second_pass_code('', '
wget https://aur.archlinux.org/cgit/aur.git/snapshot/pi-bluetooth.tar.gz
tar -xzvf pi-bluetooth.tar.gz
cd pi-bluetooth
makepkg
pacman -U pi-bluetooth-1-1-armv7h.pkg.tar.xz
')

Enable the bluetooth driver service :
$this->bbcode_second_pass_code('', '
sudo systemctl enable brcm43438.service
')

Install bluetooth and pulseaudio related packages :
$this->bbcode_second_pass_code('', '
pacman -S pulseaudio-alsa pulseaudio-bluetooth bluez bluez-libs bluez-utils bluez-firmware
')

Load bluetooth module :
$this->bbcode_second_pass_code('', '
modprobe btusb
')

Enable bluetooth and pulseaudio services :
$this->bbcode_second_pass_code('', '
sudo systemctl enable bluetooth.service
systemctl --user enable pulseaudio.service
systemctl --user enable pulseaudio.socket
')

Reboot and then you should be able to connect
to "Ready to pair" speaker. bluetoothctl must be run as root :
$this->bbcode_second_pass_code('', '
sudo bluetoothctl
power on
agent on
default-agent
scan on
pair XX:XX:XX:XX:XX:XX
connect XX:XX:XX:XX:XX:XX
')

You can now start Kodi and select ALSA:Pulse Audio Sound Server as audio output. Enjoy !

FYI , there is currently an issue with usage of internal bluetooth and internal wifi at the same time. sound would be crackling and cut off in this case.
GloW
 
Posts: 8
Joined: Sun Sep 04, 2016 8:56 pm

Return to ARMv8

Who is online

Users browsing this forum: No registered users and 6 guests