Connect an Orange pi Zero 3 to a bluetooth speaker on Ubuntu 24.4

First install the necessary software “not” as root:

sudo apt install bluez bluez-cups bluez-obexd
sudo apt install libspa-0.2-bluetooth
sudo apt install pipewire-pulse
sudo apt install wireplumber
sudo apt install pulseaudio-utils

systemctl –user daemon-reload
systemctl –user –now enable pipewire-pulse
systemctl –user start pipewire-pulse

Check the available devices:

wpctl status
or
pactl list sinks

Add the speaker:
bluetoothctl

scan on

trust <device MAC>
pair <device MAC>
connect <device MAC>

On OS level:
pactl list short sinks
pactl set-default-sink <SINK_ID>
or
wpctl status
wpctl set-default <SINK_ID>

Test:
aplay test.wav
or
paplay test.wav
or
speaker-test -t sine -f 1000 -c 2