Airplay and Bluetooth Containers not deployed on Boot. Need an Assist, please.

Hi all. I’m hoping for an assist from anyone in the know…

I deployed two balenaSound instances (using ‘One Click’) on 2Gig Raspberry Pi 4 SBCs. One configured to output audio thru a Allo Boss v1.2, the other outputting audio to a USB DAC. Sync’ed multi-room audio with input from AirPlay and Bluetooth is working fantastically. Kudos to all involved with the project.

I planned to install this at a friend’s house, for AirPlay music playback, as balenaSound is basically turn-key & hands-off. The show-stopper however is on every cold boot and reboot, Containers for AirPlay and Bluetooth aren’t deployed and started. I have to start the services manually using the portal (side-note: if I manually start them in the portal then refresh service they are started back up, but that makes sense as the containers have already been deployed). The balena-supervison log shows they aren’t even getting deployed.

Hoping that someone can give me some assistance in the form of terminal commands I can use to enable that? Attached below within the hidden summary is the output of balena ps and the balena-supervisor log after a reboot, which you’ll see isn’t including the AirPlay and Bluetooth services:

Summary
Connecting to 677fc1a93a0bbc450ad15528a7f5aa6c...
Spawning shell...

=============================================================
    Welcome to balenaOS
=============================================================

root@balena:~# balena logs balena_supervisor | grep airplay
(node:1) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
root@balena:~# 


root@balena:~# balena ps 
CONTAINER ID   IMAGE                                                            COMMAND                  CREATED        STATUS                             PORTS                                                                                                      NAMES
cd81e4b96740   7597ce6a0d22                                                     "/bin/bash /usr/src/…"   27 hours ago   Up 37 seconds                      1704-1705/tcp, 1780/tcp                                                                                    multiroom-client_7728391_2817927_0a21bbcf6623214f9ccbde1c31d224fa
b05ffd55e3d0   a32affe2642d                                                     "/bin/bash /usr/src/…"   2 days ago     Up 36 seconds                      0.0.0.0:4317->4317/tcp, :::4317->4317/tcp                                                                  audio_7728388_2817927_0a21bbcf6623214f9ccbde1c31d224fa
422133ffd749   9d6c08ae39cb                                                     "/usr/bin/entry.sh n…"   2 days ago     Up 39 seconds                                                                                                                                 sound-supervisor_7728389_2817927_0a21bbcf6623214f9ccbde1c31d224fa
1b9fb480a052   f83f727f2862                                                     "/bin/bash /usr/src/…"   2 days ago     Up 21 seconds                      0.0.0.0:1704-1705->1704-1705/tcp, :::1704-1705->1704-1705/tcp, 0.0.0.0:1780->1780/tcp, :::1780->1780/tcp   multiroom-server_7728390_2817927_0a21bbcf6623214f9ccbde1c31d224fa
54487df7bc16   1ac4600f63e6                                                     "/usr/bin/entry.sh /…"   2 days ago     Up 39 seconds                                                                                                                                 spotify_7728394_2817927_0a21bbcf6623214f9ccbde1c31d224fa
239d03400430   registry2.balena-cloud.com/v2/833093e7c145dbce3fd2b58bd51c4ae9   "/usr/src/app/entry.…"   4 weeks ago    Up 26 seconds (health: starting)                                                                                                              balena_supervisor
root@balena:~# 


root@balena:~# balena logs balena_supervisor
INFO: Found device /dev/mmcblk0p1 on current boot device mmcblk0, using as mount for '(resin|balena)-boot'.
INFO: Found device /dev/mmcblk0p5 on current boot device mmcblk0, using as mount for '(resin|balena)-state'.
INFO: Found device /dev/mmcblk0p6 on current boot device mmcblk0, using as mount for '(resin|balena)-data'.
[info]    Supervisor v15.0.2 starting up...
[info]    Setting host to discoverable
[debug]   Starting systemd unit: avahi-daemon.service
[debug]   Starting systemd unit: avahi-daemon.socket
[debug]   Starting logging infrastructure
[info]    Starting firewall
[warn]    Invalid firewall mode: . Reverting to state: off
[info]    Applying firewall mode: off
[success] Firewall mode applied
[debug]   Starting api binder
[debug]   Performing database cleanup for container log timestamps
[info]    Previous engine snapshot was not stored. Skipping cleanup.
[debug]   Handling of local mode switch is completed
[debug]   Spawning journalctl -a -S 2024-01-11 00:11:00 -o json CONTAINER_ID_FULL=cd81e4b96740ba12ea063227b69611f6d1052cca67da8259b5163fd937b8d19b
(node:1) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
[info]    API Binder bound to: https://api.balena-cloud.com/v6/
[event]   Event: Supervisor start {}
[info]    Starting API server
[info]    Supervisor API successfully started on port 48484
[debug]   Spawning journalctl -a -S 2024-01-08 21:40:24 -o json CONTAINER_ID_FULL=b05ffd55e3d0f7e8cbcb3c92c0146d7bc2100fbff97bdf47b87cbf5610df1813
[debug]   Ensuring device is provisioned
[debug]   Spawning journalctl -a -S 2024-01-09 21:22:19 -o json CONTAINER_ID_FULL=422133ffd749b99e7394864f19f68abc9552d2588496f3d1eb13bb2ce5dd08ef
[debug]   Spawning journalctl -a -S 2024-01-09 21:22:30 -o json CONTAINER_ID_FULL=1b9fb480a052923ff1b7cd87ac6843f1764974cb37e7ab16759ce1eca145d641
[debug]   Spawning journalctl -a -S 2024-01-08 21:40:09 -o json CONTAINER_ID_FULL=54487df7bc16abeda1183e7bbbe31d5806dab4d7444e642db26f13d2d422d96b
[debug]   Connectivity check enabled: true
[debug]   Starting periodic check for IP addresses
[info]    Reporting initial state, supervisor version and API info
[debug]   Skipping preloading
[info]    Applying target state
[debug]   VPN status path exists.
[info]    Waiting for connectivity...
[info]    VPN connection is active.
[debug]   Starting current state report
[debug]   Starting target state poll
[debug]   Spawning journalctl -a --follow -o json _SYSTEMD_UNIT=balena.service
[debug]   Finished applying target state
[success] Device state apply success
[info]    Reported current state to the cloud
[info]    Applying target state
[debug]   Finished applying target state
[success] Device state apply success
[info]    Internet Connectivity: OK
root@balena:~# 

As said above, this is a show-stopper for me using this as if someone unplugs one of the RPi 4s, or the house loses power, my friend doesn’t have the technical chops to get AirPlay and Bluetooth started manually after the sbcs boot up. Thank you very much for any assistance provided. Ask me for anything, program output, logs, whatever and I’ll get it for you. Thanx again.

p.s. After starting the AirPlay and Bluetooth services manually the balena ps output is:

Summary
root@balena:~# balena ps
CONTAINER ID   IMAGE                                                            COMMAND                  CREATED        STATUS                PORTS                                                                                                      NAMES
cd81e4b96740   7597ce6a0d22                                                     "/bin/bash /usr/src/…"   27 hours ago   Up 27 hours           1704-1705/tcp, 1780/tcp                                                                                    multiroom-client_7728391_2817927_0a21bbcf6623214f9ccbde1c31d224fa
2859609990e2   36291d42b99b                                                     "supervisord -c /usr…"   2 days ago     Up 2 days                                                                                                                        airplay_7728393_2817927_0a21bbcf6623214f9ccbde1c31d224fa
b05ffd55e3d0   a32affe2642d                                                     "/bin/bash /usr/src/…"   2 days ago     Up 2 days             0.0.0.0:4317->4317/tcp, :::4317->4317/tcp                                                                  audio_7728388_2817927_0a21bbcf6623214f9ccbde1c31d224fa
422133ffd749   9d6c08ae39cb                                                     "/usr/bin/entry.sh n…"   2 days ago     Up 2 days                                                                                                                        sound-supervisor_7728389_2817927_0a21bbcf6623214f9ccbde1c31d224fa
db2d9f7d5446   5259ec6eda96                                                     "/bin/bash /usr/src/…"   2 days ago     Up 2 days                                                                                                                        bluetooth_7728392_2817927_0a21bbcf6623214f9ccbde1c31d224fa
1b9fb480a052   f83f727f2862                                                     "/bin/bash /usr/src/…"   2 days ago     Up 2 days             0.0.0.0:1704-1705->1704-1705/tcp, :::1704-1705->1704-1705/tcp, 0.0.0.0:1780->1780/tcp, :::1780->1780/tcp   multiroom-server_7728390_2817927_0a21bbcf6623214f9ccbde1c31d224fa
54487df7bc16   1ac4600f63e6                                                     "/usr/bin/entry.sh /…"   2 days ago     Up 2 days                                                                                                                        spotify_7728394_2817927_0a21bbcf6623214f9ccbde1c31d224fa
239d03400430   registry2.balena-cloud.com/v2/833093e7c145dbce3fd2b58bd51c4ae9   "/usr/src/app/entry.…"   4 weeks ago    Up 5 days (healthy)                                                                                                              balena_supervisor
root@balena:~# 

Is “restart: always” enabled for each container in your docker compose files?

1 Like

In the deployment yaml of the “one click” installation, the option is ‘on-failure’, I believe. It seemed like that was good so i didnt change it, but I’ll try this. I have since refactored to use the legacy/manual balena-cli based deployment. I’ll alter that property and re-push the project to my fleet. Thanks for the suggestion!

This indeed did the trick. Much Thanx!

Can I ask what may be a stupid question? How does someone make that change if they used the “Deploy with balena” button on the ‘01-getting-started.md’ page, as I originally had (did so as that was my first contact with the balena ecosystem et al)? If that property change is not possible I’d like to suggest that the default of the ‘restart’ property be changed from ‘on-failure’ to ‘always’. (p.s. I don’t know if you’re affiliated with balena; just speaking in general) At least I learned a lot about how everything ‘fit’ together in my futile attempt to try to address this issue. :wink: HeHe. Thanx again.