bluez-alsa: a2dp-source profile connect failed: Protocol not available
I have two pi’s, and I’m trying to send audio from one to the other. I want to sort it out all via console so I can automate things. Let’s call the one I’m trying to get the sound from SourcePi
and the one I’m trying to send output to SpeakerPi
.
I start by setting up SpeakerPi
, after some wrangling it all works (including adding profile=a2dp-sink
in the service file). I can connect my Android device via bluetooth to SpeakerPi
and the sound comes out as expected. Great!
I go to set up SourcePi
but I’m having problems. I’ve been to so many web pages (like this and this - I deactivated onboard audio entirely as it suggested) to try and find the answer to my problem, but no success.
I’ve change my /lib/systemd/system/bluealsa.service
file to read this on SourcePi
:
ExecStart=/usr/bin/bluealsa --profile=a2dp-source
So it should have the a2dp-source available.
However when I connect the two devices via bluetoothctl
, I run sudo systemctl status bluetooth.service
and see the following lines, the last of which is in bold and red…
Jan 02 15:46:30 SourcePi bluetoothd[759]: Bluetooth management interface 1.14 initialized
Jan 02 15:46:30 SourcePi bluetoothd[759]: Endpoint registered: sender=:1.23 path=/org/bluez/hci0/A2DP/SBC/Source/1
Jan 02 15:46:30 SourcePi bluetoothd[759]: Endpoint registered: sender=:1.23 path=/org/bluez/hci0/A2DP/SBC/Source/2
Jan 02 15:46:30 SourcePi bluetoothd[759]: Endpoint registered: sender=:1.23 path=/org/bluez/hci0/A2DP/SBC/Source/3
Jan 02 15:56:31 SourcePi bluetoothd[759]: a2dp-source profile connect failed for 00:E0:4C:6E:AC:03: Protocol not available
I can use aplay
to successfully send sound from SourcePi
to SpeakerPi
, by running this:
aplay -D bluealsa:DEV=AB:CD:EF:01:02:03,PROFILE=a2dp sound/test.mp3
The sound comes out of SpeakerPi
as I would want. However what I want is all audio from SourcePi
to be sent to SpeakerPi
. I think the reason why that’s not working is the Protocol not available
message above.
I’ve tried all sorts of restarting the services, minor tweaks, rebooting but to no avail.
The only potential fixes I’ve found refer to enabling pulseaudio but my impression from all the reading I’ve done is that alsa is the better way to do things & it’s best to leave pulseaudio out…?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 28 (7 by maintainers)
@reedstonefood - There are possibly thousands of different combinations of setups of audio sub-systems with linux, so it is impossible to recommend any one “best” solution from a simple exchange of comments on a forum. So instead, let me imagine a requirement which hopefully has some similarities to yours.
There is a RPi with attached screen and keyboard on which is run a desktop (eg the latest Raspios image) and a number of different applications each requiring audio output. There is a USB DAC connecting to an amplifier and speakers, and also a need to send audio over bluetooth. This machine is called SourcePi.
There is a second RPi which is headless, and has an I2C HAT digital amplifier connected to a pair of wired speakers. This machine is to be used to play audio from bluetooth sources, and has a minimal OS installed (eg the latest Raspios Lite). It is called SpeakerPi.
The requirement for multiple sound applications and multiple sound outputs on SourcePi makes pulseaudio the simplest option for audio management. It is also a good option, in spite of the many negative posts by people who basically complain about anything and everything. The lastest Raspios full image is already configured with desktop, Chromium browser, and pulseaudio with bluetooth - ready to go (I think, not having actually tried it myself 😃).
SpeakerPi has the Raspios Lite image. This has the bluetooth subsystem configured, but with no audio component. So bluealsa and bluealsa-aplay are installed (either from the repository or self-built from sources; if using self-build, the guide on the bluez-alsa project wiki has been followed).
SpeakerPi has its attached sound card configured as
default
using/etc/asound.conf
, and has bluealsa started as:and bluealsa-aplay started as:
SourcePi and SpeakerPi are paired using bluetoothctl in the usual way. SpeakerPi is set to trust SourcePi so that it automatically accepts connect requests from SourcePi.
On SourcePi, using the desktop audio control panel, SpeakerPi is selected as the default audio sink. Chromium browser is started and a YouTube video plays sound through SpeakerPi with no further configuration required.
The end 😃