How to add a snapcast volume ui to balenaSound?

First, a huge shout-out for a really great product (and for a very cunning strategy to expose people to BalenaCloud!!!) I have has some very limited experience in running and maintaining a fleet of 12 raspberry Pis, with common software but different configurations, and I see the amazing benefit of using balenaCloud. It is an amazing product and I love the simplicity+power of the dashboard. (I must admit I am really a little out of my depth regarding docker containers, but willing to learn. )

I successfully installed balenaSound on 4 Pi4s and the snapcast server works really well. The one improvement I would like to explore is the ability to configure the snapcast server to sync over some devices and not over others. I found these two ( and project which installs a small webserver on each Pi and which allows configuration of the snapcast server through the JSON::RPC API.

The second project has references to a containerized version here

Is it possible to add a container to the current balenaSound setup? Can you please point me to a tutorial on how to do this? Are there specific issues I may need to take into account that come to mind?

Thanks and advance for your thoughts and help.

Hi there, welcome to our forums and thanks for the kind words about both balenaCloud and balenaSound, I’m glad you are liking them!

Adding a local UI to balenaSound to allow extra “live” configuration is something we’ve wanted to do for a while now. I’ve been personally working the past few weeks in the new major release of balenaSound (v3.0) which won’t include this just yet but it will have the foundations needed to do so. I’d say v3.1 or v3.2 will definitely have a UI that will enable you to do what you want, this will probably come towards the end of the year.

In the meantime, I can help you explore the alternatives you’ve linked. I think I have tried both in the past with mixed results. I definitely don’t recommend you try the snapcast-volume-ui one since it’s very outdated, I don’t think I got it to work with modern versions of snapcast. snapweb on the other hand should work fine provided you set it up correctly. I’ll give you a few pointers to start with, then if you are stuck let me know!

Let’s asume you’ll deploy the snapweb UI.

  • The project is just a web page (HTML/JS/CSS files), so you’ll need to create a docker container to act as a webserver. There are many tutorials online about how to achieve this, I liked this one that uses nginx: Just bare in mind that the tutorial is not for Rasbperry Pi’s so it asumes an x86 architecture, the base image the dockerfile is based on won’t work on RPi’s, you’ll need to use the ARM variants, for example FROM arm32v7/nginx for RPi 4 instead of FROM nginx:alpine. This tutorial will show you how to write a Dockerfile and how to edit a docker-compose.yml file to create a container based on that Dockerfile. Both are needed.
  • Next, I noticed the snapweb webpage tries to connect to the snapcast server based on the window.location property (see this line of code). This is no good for us because our snapcast server is in a separate docker container. You’ll need to edit that to be let snapcontrol = new SnapControl('multiroom-server', 1780);, that should be enough for the webpage to find the snapcast server based on the container name instead.
  • Lastly, snapweb connects to a special port on the snapcast server, 1780. The snapcast server container (multiroom-server) does not allow traffic by default to that port, so you need to fix that. This can easily be done by adding - 1780: 1780 to the ports section of said container in the docker-compose.yml file. It should read:
    build: ./core/multiroom/server
    restart: on-failure
      - 1704:1704
      - 1780:1780
      - snapcast:/var/cache/snapcast

I think those changes should be enough, though I might be missing something. In any case, if you try it let me know and I’m sure we can figure it out!