Pi Zero W trouble - can't pair via bluetooth with phone

I’m a new user. Just getting Balena Sound to work. So far only on a Pi 4.
I also have it on a Pi Zero W. They both show up in the Dashboard. There are problems with the Pi Zero W.

I can’t connect using Bluetooth to the Pi Zero W with my OnePlus 8 phone. The phone can connect with Bluetooth to the Pi 4 though.

In the logs in the dashboard for the Pi Zero it looks like there’s also other trouble.
: type 47 is invalid
multiroom-server Waiting for sound supervisor to start at 172.17.0.1:80
multiroom-client Waiting for sound supervisor to start at 172.17.0.1:80
audio Waiting for sound supervisor to start at 172.17.0.1:80
multiroom-server Waiting for sound supervisor to start at 172.17.0.1:80
multiroom-client Waiting for sound supervisor to start at 172.17.0.1:80
audio Waiting for sound supervisor to start at 172.17.0.1:80
multiroom-client Waiting for sound supervisor to start at 172.17.0.1:80
multiroom-server Waiting for sound supervisor to start at 172.17.0.1:80
spotify [2021-08-04T19:08:19Z WARN libmdns::fsm] couldn’t parse packet from 192.168.2.127:5353: type 47 is invalid

And Sound-Supervisor says “Exited” and when I press the start button, nothing happens.

Searching the Internet, some people say there are issues when both WiFi and Bluetooth are running on the Pi Zero. Other people find some other things, but I’ve not been able to figure out what the problem is here.

I don’t yet have a DAC Hat on the Pi, in case that matters. I know - can’t get sound out of it. But I wanted to make sure everything worked before I went that far.

What can I check? I’m a novice at BalenaSound, Docker type stuff, Linux, programming, etc. I’m more of a hardware guy.

I restarted the Bluetooth service on the Pi Zero W (through the cloud dashboard) and got this for output afterwards:
bluetooth Bluetooth agent started!
bluetooth Checking for known bluetooth devices…
bluetooth - Attempting to reconnect to OnePlus 8 (5C:17:CF:0F:B4:71)…
bluetooth - Bluetooth profile not available or not initialized. Retrying (attempt 1/5)…
bluetooth - Bluetooth profile not available or not initialized. Retrying (attempt 2/5)…
bluetooth - Bluetooth profile not available or not initialized. Retrying (attempt 3/5)…
bluetooth - Bluetooth profile not available or not initialized. Retrying (attempt 4/5)…
bluetooth - Bluetooth profile not available or not initialized. Retrying (attempt 5/5)…
bluetooth - Could not connect to OnePlus 8 (5C:17:CF:0F:B4:71)…

And that’s it. No matter how many times I try to reconnect via bluetooth, no more logs show up.

But then a bit later after restarting bluetooth service it says it did connect, but it really didn’t. Audio was still sent out my phone speakers and the phone didn’t indicate it was connected to the Pi.

bluetooth Bluetooth agent started!
bluetooth Checking for known bluetooth devices…
bluetooth - Attempting to reconnect to OnePlus 8 (5C:17:CF:0F:B4:71)…
bluetooth - Bluetooth profile not available or not initialized. Retrying (attempt 1/5)…
bluetooth - Bluetooth profile not available or not initialized. Retrying (attempt 2/5)…
bluetooth - Bluetooth profile not available or not initialized. Retrying (attempt 3/5)…
bluetooth - Bluetooth profile not available or not initialized. Retrying (attempt 4/5)…
bluetooth - Bluetooth profile not available or not initialized. Retrying (attempt 5/5)…
bluetooth - Successfully connected to OnePlus 8 (5C:17:CF:0F:B4:71)…

I restarted again and this time again it said it couldn’t connect to the OnePlus 8.

I tried the shell to the bluetooth thing in the dashboard and it keeps cycling through this:
SSH reconnecting…
Spawning shell…
sh: F: command not found
Error: No such container: /bin/sh
Error: No such container: bash

And the sound-supervisor service still won’t start either.

I tried the DEV code for the Pi Zero W and can connect via Bluetooth from my mobile phone. No trouble.

Hopefully it’ll work when a newer version of the software comes out.
Though I’ll try downloading the Production software again and give it one more try.

I wonder if it was a bad download of the software or a bad image on the SD card that made it not work before. With the newly downloaded software put on the same SD card, I can connect with my phone via bluetooth to the Pi Zero W.
I guess it’s time for the DAC hat now.

I may have spoke too soon.
Again, the phone is not connecting to the Pi Zero W via bluetooth.

Is there a fix for this?

We’re just catching up on threads / posts, thanks for your patience @bmwfan. Ok, a few things.

First and foremost, the Pi Zero is SLOW. I used one a few weeks ago, and it took forever to get the containers downloaded and running, and settled. After about 20 to 30 minutes of load time, it did all work though. Next, some of the containers don’t have terminal access, and you can’t SSH to them. As for the Dev versus Production images, those are used in more traditional IoT use cases, as the Production image has UART, console, and ssh access disabled, hardening them for in the field. Next, the Sound Supervisor container is not needed on a Multiroom configuration, only your Pi4 should run that container. It is exited on the Pi Zero on purpose. Finally, for basic troubleshooting purposes, reboot the Pi Zero, as I’m not sure what containers you’ve started/restarted at this point. Let it sit for about 30 to 45 minutes, then give it a try. :slight_smile:

I’ve noticed it takes a long time to update, etc. And give it a good hour or more after installing BalenaSound.

I again can’t connect via Bluetooth. I shut off the Spotify service and the Sound Supervisor service to see if it might free up some resources on the Pi Zero and get bluetooth working. It didn’t.

I restarted the Bluetooth service and that didn’t help my phone connect to it via bluetooth.

I connected my phone to the Raspberry Pi 4 I have on the same network and music plays through that. I hoped that when I played music when connected to the Pi 4 that it would also play on the Pi Zero W since they’re on the same network. It didn’t. I didn’t get any indication in the logs on the Pi Zero that it was receiving anything from the Pi 4. There are logs on the Pi4: sound-supervisor Playback started, announcing 192.168.2.247 as multi-room master!

But nothing on the Pi Zero logs indicate that it’s receiving anything and there’s no sound from it (I’m using HDMI cable on my TV for audio).

Should I just give up on using a Pi Zero for a network client playback or a standalone playback? Upgrade to a better Pi?

From my Desktop computer’s bluetooth, It says I connect to the Pi Zero W, but then there is no option in the audio to send audio to it. When I connect my desktop computer to the Pi4, I can send and hear music to the Pi 4. It still doesn’t then stream from the Pi 4 over to the PI Zero either.

If there are some logs I need to gather and post here, I will certainly do that.

The Multiroom client isn’t running on the Pi Zero. I can’t get it to run. By the looks of the log/output, it seems to me that it wants the Sound Supervisor to also be running.

I have a USB audio device connected to the Pi Zero (A Behringer UM2 audio interface). No sound coming from it.

 multiroom-client  
 multiroom-client  --- Multiroom ---
 multiroom-client  Starting multiroom service with settings:
 multiroom-client  - Mode: server
 multiroom-client  - Snapcast version: v0.25.0
Started service 'multiroom-client sha256:a9919ddc29d97c23244061628636fd76a9dd64610f6bbf40114ce3d4596da760'
Restarting service 'multiroom-client sha256:a9919ddc29d97c23244061628636fd76a9dd64610f6bbf40114ce3d4596da760'
 multiroom-client  Waiting for sound supervisor to start at 172.17.0.1:80
 multiroom-client  Waiting for sound supervisor to start at 172.17.0.1:80
 multiroom-client  Waiting for sound supervisor to start at 172.17.0.1:80
 multiroom-client  Waiting for sound supervisor to start at 172.17.0.1:80
 multiroom-client  Waiting for sound supervisor to start at 172.17.0.1:80
 multiroom-client  Waiting for sound supervisor to start at 172.17.0.1:80
 multiroom-client  Waiting for sound supervisor to start at 172.17.0.1:80
 multiroom-client  Waiting for sound supervisor to start at 172.17.0.1:80
 multiroom-client  Waiting for sound supervisor to start at 172.17.0.1:80
 multiroom-client  Waiting for sound supervisor to start at 172.17.0.1:80
 multiroom-client  Waiting for sound supervisor to start at 172.17.0.1:80
 multiroom-client  Waiting for sound supervisor to start at 172.17.0.1:80
Starting service 'sound-supervisor sha256:61c6ed20cbe794e01cc622636bf8cbeab378de83f65db08dae4800cface3e855'
 multiroom-client  Waiting for sound supervisor to start at 172.17.0.1:80
 multiroom-client  Waiting for sound supervisor to start at 172.17.0.1:80
 multiroom-client  Waiting for sound supervisor to start at 172.17.0.1:80
 multiroom-client  Waiting for sound supervisor to start at 172.17.0.1:80
Started service 'sound-supervisor sha256:61c6ed20cbe794e01cc622636bf8cbeab378de83f65db08dae4800cface3e855'
Restarting service 'sound-supervisor sha256:61c6ed20cbe794e01cc622636bf8cbeab378de83f65db08dae4800cface3e855'
 multiroom-client  Waiting for sound supervisor to start at 172.17.0.1:80
 multiroom-client  Waiting for sound supervisor to start at 172.17.0.1:80
 multiroom-client  Waiting for sound supervisor to start at 172.17.0.1:80
 sound-supervisor  
 sound-supervisor  > sound-supervisor@1.0.0 start /usr/src
 sound-supervisor  > node build/index.js
 sound-supervisor  
 multiroom-client  Waiting for sound supervisor to start at 172.17.0.1:80
 multiroom-client  Waiting for sound supervisor to start at 172.17.0.1:80
Starting service 'spotify sha256:09c2968a58a1a644569c4ed32aad792e419f074beebba354ec6cbc29e631120f'
 sound-supervisor  Sound supervisor listening on port 80
 sound-supervisor  Connected to PulseAudio at 192.168.2.124:4317
 sound-supervisor  Server protocol version: 33
 sound-supervisor  Client protocol version: 33
 multiroom-client  Waiting for sound supervisor to start at 172.17.0.1:80
 multiroom-client  Starting multi-room client...
 multiroom-client  - balenaSound mode: STANDALONE
 multiroom-client  - Target snapcast server: 192.168.2.124
 multiroom-client  Multi-room client disabled. Exiting...
Started service 'multiroom-client sha256:a9919ddc29d97c23244061628636fd76a9dd64610f6bbf40114ce3d4596da760'
Restarting service 'multiroom-client sha256:a9919ddc29d97c23244061628636fd76a9dd64610f6bbf40114ce3d4596da760'
Killing service 'spotify sha256:09c2968a58a1a644569c4ed32aad792e419f074beebba354ec6cbc29e631120f'
 spotify  [2021-08-07T16:19:47Z WARN  libmdns::fsm] couldn't parse packet from 192.168.2.126:5353: type 47 is invalid
Service exited 'multiroom-client sha256:a9919ddc29d97c23244061628636fd76a9dd64610f6bbf40114ce3d4596da760'
 spotify  [2021-08-07T16:19:57Z WARN  libmdns::fsm] couldn't parse packet from 192.168.2.125:5353: type 47 is invalid
Killed service 'spotify sha256:09c2968a58a1a644569c4ed32aad792e419f074beebba354ec6cbc29e631120f'
Service exited 'spotify sha256:09c2968a58a1a644569c4ed32aad792e419f074beebba354ec6cbc29e631120f'

I’ll ping the maintainer and have him look at it, though it will likely be Monday when he sees it. :slight_smile:

Thanks.

Some more logs…and it almost looked like it was going to start working, but no. Notice near the bottom after it says -sound-supervisor listening on port 80, connected to PulseAudio, starting multi-room client in STANDALONE, then the multiroom-client stops.

Killed service ‘sound-supervisor sha256:61c6ed20cbe794e01cc622636bf8cbeab378de83f65db08dae4800cface3e855’
Service exited ‘sound-supervisor sha256:61c6ed20cbe794e01cc622636bf8cbeab378de83f65db08dae4800cface3e855’
Killed service ‘sound-supervisor sha256:61c6ed20cbe794e01cc622636bf8cbeab378de83f65db08dae4800cface3e855’
Starting service ‘multiroom-client sha256:a9919ddc29d97c23244061628636fd76a9dd64610f6bbf40114ce3d4596da760’
multiroom-client
multiroom-client — Multiroom —
multiroom-client Starting multiroom service with settings:
multiroom-client - Mode: server
multiroom-client - Snapcast version: v0.25.0
Started service ‘multiroom-client sha256:a9919ddc29d97c23244061628636fd76a9dd64610f6bbf40114ce3d4596da760’
Restarting service ‘multiroom-client sha256:a9919ddc29d97c23244061628636fd76a9dd64610f6bbf40114ce3d4596da760’
multiroom-client Waiting for sound supervisor to start at 172.17.0.1:80
multiroom-client Waiting for sound supervisor to start at 172.17.0.1:80
multiroom-client Waiting for sound supervisor to start at 172.17.0.1:80
multiroom-client Waiting for sound supervisor to start at 172.17.0.1:80
multiroom-client Waiting for sound supervisor to start at 172.17.0.1:80
multiroom-client Waiting for sound supervisor to start at 172.17.0.1:80
Starting service ‘sound-supervisor sha256:61c6ed20cbe794e01cc622636bf8cbeab378de83f65db08dae4800cface3e855’
multiroom-client Waiting for sound supervisor to start at 172.17.0.1:80
multiroom-client Waiting for sound supervisor to start at 172.17.0.1:80
multiroom-client Waiting for sound supervisor to start at 172.17.0.1:80
Started service ‘sound-supervisor sha256:61c6ed20cbe794e01cc622636bf8cbeab378de83f65db08dae4800cface3e855’
multiroom-client Waiting for sound supervisor to start at 172.17.0.1:80
multiroom-client Waiting for sound supervisor to start at 172.17.0.1:80
sound-supervisor
sound-supervisor > sound-supervisor@1.0.0 start /usr/src
sound-supervisor > node build/index.js
sound-supervisor
multiroom-client Waiting for sound supervisor to start at 172.17.0.1:80
multiroom-client Waiting for sound supervisor to start at 172.17.0.1:80
multiroom-client Waiting for sound supervisor to start at 172.17.0.1:80
sound-supervisor Sound supervisor listening on port 80
sound-supervisor Connected to PulseAudio at 192.168.2.124:4317
sound-supervisor Server protocol version: 33
sound-supervisor Client protocol version: 33
multiroom-client Starting multi-room client…
multiroom-client - balenaSound mode: STANDALONE
multiroom-client - Target snapcast server: 192.168.2.124
multiroom-client Multi-room client disabled. Exiting…
Service exited ‘multiroom-client sha256:a9919ddc29d97c23244061628636fd76a9dd64610f6bbf40114ce3d4596da760’

On my Pi 4, frequently my phone won’t pair with it either. It gives an error about the PIN not being correct. I don’t believe there’s a pin set for bluetooth, is there?

There seems to be a number of issues with my setup (which can’t be different than anyone else since I use Raspberry Pi Zero W and Pi 4, right?) I’m just using the 1-button install. This has been a pretty frustrating experience.

Is there anything else I can try to get this to work on the Raspberry Pi Zero W? Or do I need to buy a more capable version of Pi?

Hi @bmwfan, regarding the Pi Zero, it should be enough for balenaSound. The Pi Zero is very limited when compared to the Pi 4 obviously, and a lot slower to respond but it does work for this application. The problem you are facing I believe is related to the mode your pi zero is in.

You can read more about modes here: Usage - Home
In a nutshell, the Pi Zero is not powerful enough to run as a multiroom server. It can run as a multiroom client just fine though. However running it as a client when you don’t have a server/master is useless so by default the Pi Zero runs in Standalone mode, which means it’s completely isolated from other devices. You can force your Pi Zero to multiroom client mode by setting the variable SOUND_MODE=MULTI_ROOM_CLIENT. You can also set SOUND_MULTIROOM_MASTER on your Pi Zero to the IP address of your master device (the Pi 4), this is not needed really as the Pi4 will broadcast anyways and the Pi Zero should automatically connect to it once it’s on multiroom client mode, however I’ve seen Pi Zero’s miss the mark. To read more about variables: Customization - Home

Regarding your bluetooth problems, I’ve found that it’s hit or miss with regards to bt implementations. Some phones connect right-away to the Pi’s bluetooth and some have problems. We’ve tracked some leads related to this but the underlying issue seems to be buried deep into bt kernel code and that escapes the scope of this project. I’ve seen the Raspberry Pi foundation recommending to use external bluetooth dongles when facing this type of problems, perhaps you could try that and see if it helps?