Balena Sound Bluetooth and Spotify connect

Hi all,

I’ve just configured my RPi3 B+ to cast from various devices to my amplifier.
I am using bluetooth-audio to play music from the Google Home
and using Spotify Connect to play music from any other device.

When I play music from Google Home it is not possible to switch to Spotify Connect.
I get the following error messages.

26.01.20 12:35:38 (+0100) spotify ERROR:librespot_playback::audio_backend::alsa: Alsa error PCM open ALSA function ‘snd_pcm_open’ failed with error ‘EBUSY: Device or resource busy’
26.01.20 12:35:38 (+0100) spotify ERROR:librespot_playback::player: Could not start audio: Alsa error: PCM open failed

I can reconnect via Spotify Connect when I stop the bluetooth-audio service.

Is there a way that I can switch between services without enabling/disabling?

I don’t have an answer directly, but it would seem that you can’t have 2 input sources mixing into 1 output source; the bluetooth audio feed it taking an exclusive lock on the ALSA device, and Spotify Connect cannot get a shared lock.

Hey,

We will take a look into it, but our recommendation at this time is to just use a single service at any one time. It seems you’ve run into one of the reasons why :smile:

I created a GH issue here, and linked it to our support tickets - you should get an update whenever this changes progress. (https://github.com/balenalabs/balena-sound/issues/87)

@kertu i don´t know why, but it seems like the audio output is alredy used over bluetooth. Did you try disconnecting all connected devices? Maybe is your phone or your google home still connected, while you try to switch to spotify connect.

Hey @richbayliss, thank you. I’ll keep an eye on the ticket. Eagerly waiting on the result. :slight_smile:

@AlexProgrammerDE I stopped the playback but didn’t disconnect Bluetooth. That was actually my intention in the first place: not to disconnect and connect each time when I want to change inputs.

Hi @kertu, I’d like to let you know that the following issue https://github.com/balenalabs/balena-sound/issues/87 is now closed.
As of v3.0, balenaSound now supports simultaneous audio streams and does audio routing in a much more robust way. It should be possible to switch seamlessly between Bluetooth/Spotify and even have both playing at the same time.
Could you give it a try and let us know how it works for you?

Best,
Georgia