AirConnect: Use AirPlay to stream to UPnP/Sonos & Chromecast devices

Docker AirConnect: Use AirPlay to stream to UPnP/Sonos & Chromecast devices

Do you want to use AirPlay to stream from iTunes, iOS, or Audio Station and find that your player doesn't support it (or between them Apple and the player's manufacturer broke it when adding AirPlay v2)? The AirConnect approach adds an AirPlay v1 bridge between UPnP and Chromecast players.

Why do I need this? Audio Station can already connect to UPnP (DLNA) and Chromecast directly.

This is a good question (well done me :) ) and the short answer is you don't, but it would be nice to recover AirPlay capabilities that have been broken. The downside is that it can't fix the current problems of Audio Station streaming to tvOS 13 and 13.2 (Apple TV HD and 4K) but does fix my Denon amps which stopped working when AirPlay 2 was added in 2018. The HEOS Amp doesn't even have AirPlay 1 so this is a good addition for it.​
One thing that Audio Station added to AirPlay v1 was the ability to stream to multiple devices at once. This always had some audible lag between players and isn't fixed with AirConnect. Adjustments are possible per player but my limited testing suggests it'll be fiddly to get it working.​

So why am I still reading this?

You may be using iTumes or an iOS device and want to play music or podcasts to you non-AirPlay speaker.​

So what we're going to do is use the Synology NAS to run a network service aimed to help your other devices, rather than the limited mileage it adds for Audio Station.

AirConnect (philippe44/AirConnect) is open-source and available as pre-compiled binaries for many platforms. There is extensive help on its GitHub webpage and links to a Synology package and a maintained Docker container.


Before we begin

We're going to setup AirConnect using DSM's Docker package that is available on DS 'plus' models. So first you need to install Docker from Package Center, if it's not already running. I selected the Docker container (Docker Hub) because it isolates the software from the rest of DSM. You can try the Synology package if your NAS doesn't run Docker.

Follow the instructions for a Simple deployment or the Advanced. The advanced deployment will let you set your choice of names for the AirPlay devices, artwork, and other settings.


Deployment method 1: Simple

The container can be run using its default settings without any access to a shared NAS folder. Any UPnP and Chromecast players will have an AirPlay instance created and named the same as the player but with a '+' suffix, e.g.: 'HEOS Amp' the DLNA/UPnP player will get a 'HEOS Amp+' AirPlay v1 service.

Add the AirConnect container to Docker

Within Docker's Registry tab, search for 'airconnect' and from the results download the official container which is called '1activegeek/airconnect'.

From Docker's Image tab, select the '1activegeek/airconnect' image and click Launch. Next configure the new container instance (if not mentioned then leave a setting as-is):
  • Container Name: give it a useful name, e.g. 'AirConnect'.
  • Click Advanced Settings and Enable auto-restart, then...
  • Network tab, enable 'Use the same network as Docker Host'.
  • Click Apply to save the Advanced Settings
  • Click Next to progress to the summary view
  • Click Apply to create the new container
The new AirConnect container should now be running and has preset latency and buffering values that work with Sonos and HEOS players.

Open Audio Staiton and click the output device icon (bottom right corner) to see the new AirPlay devices.


Deployment method 2: Advanced

The same Docker container is used from the Simple method but this time we will add support for editing the configuration.

Groundwork

We want to store all configuration data and logs on NAS storage, not within the container. This will make updating a container much easier when that time comes. For now we will just create the folders in DSM, later we will assign them to the containers.

I have a DSM shared folder called 'system' that I used for non-user related activities and I'm going to used that here (you can select your own shared folder and follow the instructions).
  1. Using File Station navigate to the 'system' shared folder.
  2. Add a new folder to hold all Docker containers information: mine is called 'docker'.
  3. Within 'docker' create folder 'airconnect'.
That's the DSM setup complete, now proceed to add the AirConnect container.

Add the AirConnect container to Docker

Within Docker's Registry tab, search for 'airconnect' and from the results download the official container which is called '1activegeek/airconnect'.

From Docker's Image tab, select the '1activegeek/airconnect' image and click Launch. Next configure the new container instance (if not mentioned then leave a setting as-is):
  • Container Name: give it a useful name, e.g. 'AirConnect'.
  • Click Advanced Settings and Enable auto-restart, then...
  • Volume tab, add folder:
FolderMount path
system > docker > airconnect/config/airconnect
  • Network tab, enable 'Use the same network as Docker Host'.
  • Environment tab, add these variable (enter the values as single lines, the table wraps them over multiple lines):
AIRUPNP_VAR-x /config/airconnect/airupnp.xml -I -f /config/airconnect/airupnp.log -p /config/airconnect/airupnp.pid -l 1000:2000 -d all=info
AIRCAST_VAR-x /config/airconnect/aircast.xml -I -f /config/airconnect/aircast.log -p /config/airconnect/aircast.pid -l 1000:2000 -d all=info
  • Click Apply to save the Advanced Settings
  • Click Next to progress to the summary view
  • Click Apply to create the new container
The new AirConnect container should now be running. But let's just go through those settings in more detail:

-x /path_to.xml
This is the place to look for the configuration file. If no file exists then command line inputs and defaults will be used. Once this file exists you can edit it in File Station, or other editor.

-I
[uppercase 'i'] Write out the current configuration to file and update with new players. It will use the path from '-x' and so will create the initial configuration file.

-f /path_to.log
(optional) Generate logs to this file.

-p /path_to.pid
(optional) Record the current daemon's PID here.

-l 1000:2000
The Sonos/HEOS latency command has to be (re)included if these Enironment variables are used.


-d all=info
(optional) Set the debug reporting for all log levels to be 'info'.

Modifying the AirConnect container

Once the initial run has created the configuration XML file you can sto the container and the edit the setting inside it. Once you have made your changes you can restart the container. Some useful settings:

<codec>flc</codec>
<codec>mp3:320</codec>
The format streamed to the player. FLAC (flc) was defaulted for my setup, but if the player supports it then MP3 streams will support sending metadata using <metadata>1</metadata>

<artwork>URL to image file</artwork>
If your player supports displaying artwork you can set it here (my Denon AVR does). Tested with PNG and JPEG served from Web Station HTTPS.

<name>HEOS Amp+</name>
<name>HEOS Amp (AirConnect)</name>
Change to your own preferred device name.
Related resources
AirConnect's web page and full instructions are here.

AirConnect docker container web page and full instructions are here.

Icon used for tutorial is adapted from here.



Back
Top