AirPlay Password

Hello everyone! I’m trying to use BalenaSound to be an AirPlay receiver for a small school PA speaker system. The plan is to use it to allow administrators to connect to the speakers to play music in the mornings. I have BalenaSound working great and have disabled all other services, but I need to password protect Airplay. Currently we have an Apple AirPort with a password, but it is failing and needs replacement. I tried editing /etc/shairport-sync.conf and uncommenting the password line, but it seems to revert back after a restart or reboot. Is there a way to enable the password protect feature of Shairport?

Hey Dwayne, we are still looking at this internally and we’ll get back to you once we have more info. Thanks for reaching out and using balenaSound :slight_smile:

Hey Dwayne,

Looks like a very interesting use case :slight_smile:

Can you please provide some clarifications so I can better understand what is going on and try and help ?

  • How are you deploying the application? Are you using the Deploy with balena button or are you using the balenaCli to push the application?
  • I have BalenaSound working great and have disabled all other services

Can you please confirm which services you disabled and how?

  • I tried editing /etc/shairport-sync.conf and uncommenting the password line, but it seems to revert back after a restart or reboot

Are you editing the file directly on the device?

It seems that currently balenaSound does not provide a way to set a password for connecting via airport. I have created an issue here

If you want to try this right away, you can clone the balenaSound project and modify the line here and adding the --password option too.

PRs are always welcomed and adding this feature into the project and configurable via an environment variable would be great imo.

Hope this helps!

Hey Rahul,

I successfully added the password option to my BalenaSound application. Thank you so much for the pointers, it really helped steer me in the right direction. I installed it in the school yesterday and will get feedback from the administrators in a week or two. This would be a wonderful addition to the BalenaSound application for future users.

To clarify your questions above:

  • I initially deployed the Balena-Sound application using the Deploy with Balena button.
  • I disabled the unneeded services of bluetooth/spotify/upnp with the environment variables described in the documentation. I did this because we are not planning on using them and leaving them on just invites kids to try and connect to it.
  • I edited the shairport-sync.conf file from the terminal in BalenaCloud. I selected the target as “Airplay” and navigated to the file. Reading further into how BalenaCloud operates, I believe that this would only affect the current session and not the application that is loaded on restart.

For the next person, here’s how I enabled the AirPlay password.

  1. I downloaded the Balena-Sound project from GitHub and edited the start.sh line as instructed in the GitHub Issue.
  2. In the Balena Application, I created a device variable called AIRPLAY_PASSWORD. I set the variable value to the password I wanted to use.
    3.I installed BalenaCLI and pushed the newly updated files to the Balena Application.
  3. Once Balena finished building the program, it sent it to the Pi. When it restarted, it now had AirPlay password protection enabled.

I couldn’t get this to work. Can you elaborate on these instructions? How do I edit the start.sh line? I created the AIRPLAY_PASSWORD device variable and it still isn’t working.

Hello @hazelabs, you’ll need to download the project from GitHub (you can grab the zip file here: https://github.com/balenalabs/balena-sound/archive/master.zip) and unzip/save the files to a folder. You’ll find start.sh in the plugins/airplay folder which you can edit as instructed in the issue (https://github.com/balenalabs/balena-sound/issues/370) Install the balena CLI to push this updated code to your device. You can find a tutorial on that here: https://www.balena.io/docs/learn/getting-started/raspberrypi3/nodejs/#add-release

Thanks for this! I’m just getting back around to it. I’ll give this a try!

Sounds good @Hazelabs!