0

I use a Raspberry Pi 4 as a bluetooth receiver for audio. I set it up with this script and it works well if the connection is initiated through my phone: Click on the name of the raspberry bluetooth, it connects and I can play audio.

When I initiate the connection through bluetoothctl connect xx:xx:xx:xx:xx:xx, the connection is established as well and playing audio on my phone does not end up on the phone speaker, but the raspberry also does not play the audio. I tried to initiate the connection through dbus using d-feet, but the result is exactly the same.

It appears that the audio is received, but not forwarded to the AUX output. With pactl list I can see that indeed there are significant differences for the both cases (new sink input, new card, some state changes). So there must be some callback that is executed in the one connection mode and not in the other one. Seeing that pulseaudio might be a problem, i purged it, as suggested here, but that didn't change the behavior.

I tried to start bluealsa-aplay manually, but got the following when the connection was initiated by the raspberry:

bluealsa-aplay: D: aplay.c:690: Creating PCM worker B0:4A:6A:37:AA:BB
bluealsa-aplay: D: aplay.c:1018: Starting main loop
bluealsa-aplay: E: aplay.c:448: Couldn't open PCM: Device or resource busy
bluealsa-aplay: D: aplay.c:422: Exiting PCM worker B0:4A:6A:37:AA:BB

Any idea how I could solve the problem?

The final goal is to have an auto-connect if my phone is near the Raspberry.

1 Answer 1

0

I just encountered a similar problem. I was not using the script you linked. However, I was attempting to use bluealsa on a Raspberry Pi 3B+ with Bookworm.

I eventually found that my issue was caused by an instance of bluealsa-aplay running as a service. I don't really know what the purpose of this is; it is installed and enabled along with the main bluealsa servie. As it's always running, it opens the PCM device, meaning it is always busy.

The solution is to stop the unwanted service:

sudo systemctl stop bluealsa-aplay.service
sudo systemctl disable bluealsa-aplay.service

The main bluealsa service will still run as normal.

I'm not sure whether this is also the cause of your issue, but thougbt it was worth posting for you to try.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.