├── .gitignore ├── BUILD.txt ├── Dockerfile ├── HISTORY.txt ├── LICENSE ├── README.md ├── airconnect-logo.png ├── assets └── images │ ├── airconnect-logo-festive-smaller.png │ ├── airconnect-logo-festive.png │ ├── airconnect-logo-smaller.png │ └── airconnect-logo.png ├── cache └── libssl1.0.0_1.0.1t-1+deb8u10_armhf.deb ├── run_aircast.sh ├── setconfig.sh ├── setconfig_aircast.sh ├── setoptions.sh └── setoptions_aircast.sh /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | ._.DS_Store 3 | ._* 4 | .idea/ 5 | -------------------------------------------------------------------------------- /BUILD.txt: -------------------------------------------------------------------------------- 1 | Image Build Instructions 2 | ======================== 3 | 4 | Automated Docker Hub builds have been retired as of June 2021, so builds must be 5 | performed locally and manually pushed. 6 | 7 | 1. Ensure that Docker Desktop is running, on an ARM host 8 | 2. From the root of the repo, invoke: 9 | docker build . --tag psychlist/docker-airconnect-arm 10 | 3. Scan the image for vulnerabilities: docker scout cves psychlist/docker-airconnect-arm 11 | 4. Push to Docker Hub 12 | docker push psychlist/docker-airconnect-arm 13 | 5. Update the Docker Hub README if necessary 14 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # Dockerfile that will build an ARM image on an x86 build host 2 | # Remove the 'cross-buld' commands to build on a native ARM host 3 | 4 | # Balena base image required for cross-build capabilities 5 | FROM balenalib/raspberry-pi-alpine:3.11 6 | 7 | ### Run commands within QEMU ARM cross-build emulation, if required ########### 8 | # RUN [ "cross-build-start" ] 9 | 10 | # RUN install_packages wget 11 | RUN apk update && apk -U upgrade && apk add --no-cache wget unzip 12 | 13 | ARG VERSION=1.8.3 14 | 15 | RUN wget https://github.com/philippe44/AirConnect/releases/download/${VERSION}/AirConnect-${VERSION}.zip && \ 16 | unzip AirConnect-${VERSION}.zip airupnp-linux-armv6-static aircast-linux-armv6-static && \ 17 | rm AirConnect-${VERSION}.zip && \ 18 | chmod +x airupnp-linux-armv6-static && \ 19 | chmod +x aircast-linux-armv6-static 20 | 21 | # setconfig.sh and setoptions.sh dynamically create the config.xml and options.txt files, 22 | # using environment variables (if present) to override defaults. 23 | ADD ./setconfig.sh setconfig.sh 24 | ADD ./setoptions.sh setoptions.sh 25 | ADD ./run_aircast.sh run_aircast.sh 26 | ADD ./setconfig_aircast.sh setconfig_aircast.sh 27 | ADD ./setoptions_aircast.sh setoptions_aircast.sh 28 | RUN chmod +x setconfig.sh setoptions.sh run_aircast.sh setconfig_aircast.sh \ 29 | setoptions_aircast.sh 30 | 31 | # Run container as non-root 32 | RUN addgroup -S appgroup && adduser -S appuser -G appgroup 33 | 34 | # RUN [ "cross-build-end" ] 35 | ### End QEMU ARM emulation #################################################### 36 | 37 | USER appuser 38 | 39 | # 'run_aircast.sh` will run aircast-arm daemonised if 40 | # INCLUDE_AIRCAST is set. 41 | 42 | CMD ./run_aircast.sh ; \ 43 | ./setconfig.sh > ~/config.xml ; \ 44 | ./setoptions.sh > ~/options.txt ; \ 45 | ./airupnp-linux-armv6-static -Z -x ~/config.xml $(cat ~/options.txt) 46 | -------------------------------------------------------------------------------- /HISTORY.txt: -------------------------------------------------------------------------------- 1 | - 2024-05-08: Update to AirConnect v1.8.3 2 | - 2023-11-28: Update to AirConnect v1.5.0 3 | - 2023-11-21: Update to AirConnect v1.4.0 4 | - 2023-11-19: Update to AirConnect v1.3.4 5 | - 2023-11-12: Update to AirConnect v1.3.1 & revert to Alpine Linux 3.11 6 | - 2023-11-02: Update to AirConnect v1.3.0 & Alpine Linux 3.18 7 | - 2023-09-15: Update to AirConnect v1.2.0 and use ARMv6 static binaries 8 | - 2023-09-15: Revert to AirConnect 3 to restore ARMv6 support 9 | - 2023-05-08: Update to AirConnect v1.1.5 10 | - 2023-03-31: Update to AirConnect v1.0.16 11 | Switch default encoding from FLAC to WAV to circumvent Sonos 15.2 changes 12 | Update Alpine Linux packages 13 | - 2022-01-12: Update to AirConnect v0.2.51.2 14 | - 2021-10-17: Run the container as a non-root user 15 | - 2021-10-05: Add ability to select host network interface using 'BIND_IP' 16 | - 2021-10-04: Switch to Alpine base image (reduces image size) 17 | Add support for Raspberry Pi Zero W 18 | Add support for Raspberry Pi Model B 19 | - 2021-10-01: Update to AirConnect v0.2.51.1 20 | - 2021-07-01: Update to AirConnect v0.2.50.5 21 | - 2021-03-12: Update to AirConnect v0.2.50.1 22 | Remove custom binary in favour of using '--noflush' option 23 | - 2021-01-15: Update to AirConnect v0.2.43.1 24 | - 2021-01-13: Update to AirConnect v0.2.43.0 25 | - 2020-12-16: Update to AirConnect v0.2.42.1 26 | - 2020-12-13: Update to AirConnect v0.2.41.2 27 | - 2020-12-10: Update to AirConnect v0.2.41.0 28 | - 2020-12-07: Add 'ARTWORK' environment variable 29 | - 2020-10-27: Update to AirConnect v0.2.28.3 30 | - 2020-10-26: Supply options to aircast using environment variables 31 | - 2020-10-24: Update to airupnp v0.2.28.1 32 | - 2020-10-23: Update to airupnp v0.2.28.0 33 | Add support for setting MAX_PLAYERS (default=32) 34 | - 2020-07-13: Simple experimental support for aircast inclusion 35 | - 2020-06-06: Reduce default logging levels 36 | - 2020-06-04: Add SUPPRESS_FLUSH option and customised binary 37 | - 2020-05-28: Update to airupnp v0.2.26.1 38 | - 2020-05-27: Update to airupnp v0.2.26.0 39 | - 2020-05-05: Update to airupnp v0.2.25.0 40 | - 2020-04-19: Add device model S15 to included players 41 | - 2020-04-17: Update to airupnp v0.2.24.7 42 | - 2020-04-07: Update to airupnp v0.2.24.6 43 | - 2020-03-16: Update to airupnp v0.2.24.5 44 | - 2020-03-07: Update to airupnp v0.2.24.4 45 | - 2020-02-24: Update to airupnp v0.2.24.2 46 | - 2020-02-11: Update to airupnp v0.2.24.1 47 | - 2020-01-06: Update to airupnp v0.2.24.0 48 | - 2020-01-04: Update to airupnp v0.2.23.0 (mDNS change) 49 | - 2019-11-11: Update to AirConnect v0.2.22.1 50 | Use -o option so that _only_ specific Sonos devices are included 51 | Specify base image as Raspbian:Stretch 52 | - 2019-10-05: Update to AirConnect v0.2.21.3 53 | - 2019-09-30: Update to AirConnect v0.2.21.2 54 | - 2019-09-18: Update to AirConnect v0.2.20.0 55 | - 2019-08-31: Update to AirConnect v0.2.13.1 56 | - 2019-08-21: Update to AirConnect v0.2.12.0 57 | - 2019-07-05: Add ability to change config using environment variables 58 | - 2019-06-03: Update to v0.2.10.2 (No known functional changes for airupnp) 59 | - 2019-05-25: Update to v0.2.10.1 (No known functional changes) 60 | - 2019-05-09: Update to v0.2.10 (No relevant functional changes) 61 | - 2019-04-21: Restore input buffer to 1000ms 62 | - 2019-04-21: Update to v0.2.9.0 (Note: no functional changes to airupnp; aircast only) 63 | Halve the buffering delays 64 | - 2019-03-17: Update to v0.2.8.0 (Note: reports as v0.2.7.0) 65 | - 2019-03-03: Update to v0.2.6.0. Add exclusion for all Sonos Airplay 2 speakers 66 | - 2019-02-04: Update to v0.2.4.0. Add exclusion for some Sonos Airplay 2 speakers 67 | - 2019-01-23: Force image update for AirConnect v0.2.3.1 68 | - 2019-01-14: Force image update for AirConnect v0.2.2.6 69 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Add AirPlay to Sonos with AirConnect and Docker on a Raspberry Pi 2 | 3 | ## Quickstart 4 | 5 | ### Installing Docker 6 | 7 | **If you already have a working Docker installation on your Raspberry Pi, you can ignore this step.** 8 | 9 | The commands to install Docker using its install script are shown below. In the final command below, replace ``, with your Raspberry Pi user name (perhaps `pi`). 10 | 11 | ``` 12 | curl -fsSL https://get.docker.com -o get-docker.sh 13 | sudo sh get-docker.sh 14 | sudo usermod -aG docker 15 | ``` 16 | 17 | Now **start a new terminal** for the final command to take effect. It's possible you will also have to reboot your device to start the Docker service correctly. 18 | 19 | ### Starting 20 | 21 | Start the container using the following command line: 22 | 23 | ``` 24 | docker run -d \ 25 | --net=host \ 26 | --name=airconnect \ 27 | --restart=unless-stopped \ 28 | -e SUPPRESS_FLUSH=TRUE \ 29 | -e INCLUDE_AIRCAST=TRUE \ 30 | psychlist/docker-airconnect-arm 31 | ``` 32 | 33 | ### Updating 34 | 35 | Update the container using the following commands: 36 | 37 | ``` 38 | docker pull psychlist/docker-airconnect-arm && \ 39 | docker rm --force airconnect && \ 40 | docker run -d \ 41 | --net=host \ 42 | --name=airconnect \ 43 | --restart=unless-stopped \ 44 | -e SUPPRESS_FLUSH=TRUE \ 45 | -e INCLUDE_AIRCAST=TRUE \ 46 | psychlist/docker-airconnect-arm 47 | ``` 48 | 49 | ## Introduction 50 | 51 | This project provides a Docker container version of the excellent AirConnect [1] utility, suitable for running on a Raspberry Pi, and optimised for use with Sonos speakers. It provides a network bridge allowing Apple devices to send AirPlay audio to speakers and other devices that don't natively support AirPlay. The container image is based on Alpline Linux and its total size is about 90MB. 52 | 53 | The docker-airconnect-arm container hosts the AirConnect `airupnp-arm` service which enables AirPlay for all Sonos speakers and devices. The service is configured by default only to include Sonos players that don't have native AirPlay 2 capability, preventing any duplicate AirPlay targets from being created. 54 | 55 | AirConnect works with Sonos **S1** and **S2** software versions, and also works with 'split' S1/S2 Sonos systems. 56 | 57 | The Docker container also configures a graphic for display by Sonos controller apps: 58 | 59 | ![AirConnect Logo](https://github.com/pwt/docker-airconnect-arm/blob/master/assets/images/airconnect-logo-smaller.png) 60 | 61 | ### AirCast support 62 | 63 | Although this Docker image is primarily targeted and optimised for Sonos environments, it's possible to include in addition the `aircast-arm` service, providing AirPlay capabilities for ChromeCast devices. To enable AirCast in your container, set the environment variable `INCLUDE_AIRCAST=TRUE` when starting the container. See the usage example below. 64 | 65 | ## Platforms 66 | 67 | The image has been tested on the following Raspberry Pi models: 68 | 69 | * Raspberry Pi Model B Rev 2 (000f) 70 | * Raspberry Pi Zero W Rev 1.1 (90000c1) 71 | * Raspberry Pi Zero 2 Rev 1.0 (902120) 72 | * Raspberry Pi 3 Model B Rev 1.2 (a02082) 73 | * Raspberry Pi 3 Model B Plus Rev 1.3 (a020d3) 74 | * Raspberry Pi 4 Model B Rev 1.1 (a03111) 75 | 76 | **Note that an [issue](https://github.com/pwt/docker-airconnect-arm/issues/15) with very high CPU usage has been reported when running on a Raspberry Pi 5. This is under investigation.** 77 | 78 | It may work on other ARM-based devices that support Docker. 79 | 80 | The docker image name is `psychlist/docker-airconnect-arm` on Docker Hub [3]. 81 | 82 | Feedback and suggestions are welcome: feel free to use the issue at [4] for this purpose. 83 | 84 | ## Requirements 85 | 86 | A working Docker environment running on a suitable Raspberry Pi connected to the same network as the target speakers. Internet access is required to pull the Docker image. 87 | 88 | ## Usage 89 | 90 | The container is **started** as follows: 91 | 92 | ``` 93 | docker run -d \ 94 | --net=host \ 95 | --name=airconnect \ 96 | --restart=unless-stopped \ 97 | -e SUPPRESS_FLUSH=TRUE \ 98 | psychlist/docker-airconnect-arm 99 | ``` 100 | 101 | To include AirCast support, set the `INCLUDE_AIRCAST` environment variable to `TRUE` in each `docker run` command line, as shown below: 102 | 103 | ``` 104 | docker run -d \ 105 | --net=host \ 106 | --name=airconnect \ 107 | --restart=unless-stopped \ 108 | -e SUPPRESS_FLUSH=TRUE \ 109 | -e INCLUDE_AIRCAST=TRUE \ 110 | psychlist/docker-airconnect-arm 111 | ``` 112 | 113 | If you subsequently want to **update to a newer version** of the image: (1) pull the new image, (2) remove the container, then (3) start a new instance of the container. This will stop any currently-running AirPlay streams: 114 | 115 | ``` 116 | docker pull psychlist/docker-airconnect-arm 117 | docker rm --force airconnect 118 | docker run -d \ 119 | --net=host \ 120 | --name=airconnect \ 121 | --restart=unless-stopped \ 122 | -e SUPPRESS_FLUSH=TRUE \ 123 | psychlist/docker-airconnect-arm 124 | ``` 125 | 126 | ### Docker 'platform' warnings 127 | 128 | If, on starting the container, there is a warning message along the lines of `WARNING: The requested image's platform (linux/arm/v7) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested`, then you can specify the `platform` on the `docker run` command line to suppress the warning: 129 | 130 | ``` 131 | docker run -d \ 132 | --platform=linux/arm/v7 \ 133 | --net=host \ 134 | --name=airconnect \ 135 | --restart=unless-stopped \ 136 | -e SUPPRESS_FLUSH=TRUE \ 137 | -e INCLUDE_AIRCAST=TRUE \ 138 | psychlist/docker-airconnect-arm 139 | ``` 140 | 141 | ## Changing the configuration 142 | 143 | The container is started with a default configuration that should work very well for most Sonos installations. However, configuration settings can be overridden by passing in optional environment variables to the container when it's started. 144 | 145 | ### Using the SUPPRESS_FLUSH option to improve Apple Music and iTunes responsiveness 146 | 147 | If the `SUPPRESS_FLUSH` environment variable is set to `TRUE` on the Docker command line (as it is in the examples on this page), the airupnp service is run with the `--noflush` option, which greatly improves AirConnect's responsiveness (changing tracks, changing position within a track) when streaming from Apple apps. 148 | 149 | *This option works well with Sonos speakers, but may not work well with other types of speaker.* 150 | 151 | If you prefer not to use this option just omit the `-e SUPPRESS_FLUSH=TRUE` statements from the Docker command lines. 152 | 153 | ### Selecting the network interface 154 | 155 | If your Raspberry Pi has multiple network interfaces, e.g., you're using both the wired and wireless interfaces, it's possible to specify which interface AirConnect binds to using the `BIND_IP` environment variable. 156 | 157 | For example, add the following to the `docker run` command line options: `-e BIND_IP=192.168.0.50`, where the IP address specified is the one assigned to your chosen interface. 158 | 159 | ### Changing which speakers are included 160 | 161 | The container is configured to include only Sonos devices that do not natively support AirPlay2. Specifically, the following Sonos devices are included: Play:1, Play:3, Play:5 (first generation), PlayBar, ZP80, Connect (ZP90), ZP100 and Connect:Amp (ZP120). All other Sonos and non-Sonos UPnP devices discovered on the network will be ignored. 162 | 163 | To override this behaviour, you can use the `INC_MODELNUMBERS`, `EXC_MODELNUMBERS` and `EXC_MODELNAMES` environment variables. 164 | 165 | - Set `INC_MODELNUMBERS` to `NONE` in order to inhibit specific inclusion of device model numbers. Alternatively, set it to the specific list of device model numbers you want to include. 166 | 167 | - When `INC_MODELNUMBERS` is set to `NONE`, use the `EXC_MODELNUMBERS` and `EXC_MODELNAMES` environment variables to provide lists of device model numbers and names that you'd like to exclude. 168 | 169 | Required environment variables and their values are supplied using the `-e` option as part of the `docker run` command line. As an example, to include only Playbars and Play:1 speakers, use: 170 | 171 | ``` 172 | docker run -d \ 173 | --net=host \ 174 | --name=airconnect \ 175 | --restart=unless-stopped \ 176 | -e SUPPRESS_FLUSH=TRUE \ 177 | -e INC_MODELNUMBERS=S9,S1,S12 \ 178 | psychlist/docker-airconnect-arm 179 | ``` 180 | 181 | Or, to include all UPnP devices except second generation Play:5s, use: 182 | 183 | ``` 184 | docker run -d \ 185 | --net=host \ 186 | --name=airconnect \ 187 | --restart=unless-stopped \ 188 | -e SUPPRESS_FLUSH=TRUE \ 189 | -e INC_MODELNUMBERS=NONE \ 190 | -e EXC_MODELNUMBERS=S6 \ 191 | psychlist/docker-airconnect-arm 192 | ``` 193 | 194 | Note that the `-e INC_MODELNUMBERS=NONE` is required in order for the other options to be effective. 195 | 196 | ### Changing the artwork displayed by the Sonos controller apps 197 | 198 | Use the `ARTWORK` environment variable to point to an image URL of your choice, instead of the default artwork supplied. The image must be available to the speakers and controllers over HTTP/S. For example: 199 | 200 | ``` 201 | docker run -d \ 202 | --net=host \ 203 | --name=airconnect \ 204 | --restart=unless-stopped \ 205 | -e ARTWORK=https://raw.githubusercontent.com/pwt/docker-airconnect-arm/master/airconnect-logo.png \ 206 | -e SUPPRESS_FLUSH=TRUE \ 207 | psychlist/docker-airconnect-arm 208 | ``` 209 | 210 | ### Other configuration settings 211 | 212 | The other available configuration parameters are: 213 | 214 | `CODEC, METADATA, LATENCY, DRIFT, MAX_PLAYERS, MAIN_LOG, UPNP_LOG, UTIL_LOG, RAOP_LOG` 215 | 216 | So, for example, to change the codec to MP3 @ 256kb/s and to change the latency to 500ms/500ms, use the following command line: 217 | 218 | ``` 219 | docker run -d \ 220 | --net=host \ 221 | --name=airconnect \ 222 | --restart=unless-stopped \ 223 | -e SUPPRESS_FLUSH=TRUE \ 224 | -e CODEC='mp3:320' \ 225 | -e LATENCY='500:500:f' \ 226 | psychlist/docker-airconnect-arm 227 | ``` 228 | 229 | Take a look at the AirConnect documentation [1] (in the Config File Parameters section) for more information on the available configuration values. 230 | 231 | ## Building your own Docker images 232 | 233 | If you wish to build the Docker image for ARM on an x86 host, the Dockerfile allows use of the *crossbuild* capabilities provided by the Balena [2] base image for Alpine Linux. Uncomment the two `cross-build` statements to enable this. 234 | 235 | ## Links 236 | 237 | [1] https://github.com/philippe44/AirConnect \ 238 | [2] https://hub.docker.com/u/balenalib/ \ 239 | [3] https://hub.docker.com/r/psychlist/docker-airconnect-arm \ 240 | [4] [https://github.com/pwt/docker-airconnect-arm/issues/5](https://github.com/pwt/docker-airconnect-arm/issues/5) 241 | -------------------------------------------------------------------------------- /airconnect-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pwt/docker-airconnect-arm/1262ab0f2633bea732cf94b76cf41cbce4c36905/airconnect-logo.png -------------------------------------------------------------------------------- /assets/images/airconnect-logo-festive-smaller.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pwt/docker-airconnect-arm/1262ab0f2633bea732cf94b76cf41cbce4c36905/assets/images/airconnect-logo-festive-smaller.png -------------------------------------------------------------------------------- /assets/images/airconnect-logo-festive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pwt/docker-airconnect-arm/1262ab0f2633bea732cf94b76cf41cbce4c36905/assets/images/airconnect-logo-festive.png -------------------------------------------------------------------------------- /assets/images/airconnect-logo-smaller.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pwt/docker-airconnect-arm/1262ab0f2633bea732cf94b76cf41cbce4c36905/assets/images/airconnect-logo-smaller.png -------------------------------------------------------------------------------- /assets/images/airconnect-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pwt/docker-airconnect-arm/1262ab0f2633bea732cf94b76cf41cbce4c36905/assets/images/airconnect-logo.png -------------------------------------------------------------------------------- /cache/libssl1.0.0_1.0.1t-1+deb8u10_armhf.deb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pwt/docker-airconnect-arm/1262ab0f2633bea732cf94b76cf41cbce4c36905/cache/libssl1.0.0_1.0.1t-1+deb8u10_armhf.deb -------------------------------------------------------------------------------- /run_aircast.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Runs aircast-arm if the environment variable is set 4 | 5 | if [[ $INCLUDE_AIRCAST = "TRUE" ]] 6 | then 7 | ./setoptions_aircast.sh > ~/options_aircast.txt 8 | ./setconfig_aircast.sh > ~/config_aircast.xml 9 | ./aircast-linux-armv6-static -z -x ~/config_aircast.xml $(cat ~/options_aircast.txt) 10 | fi 11 | -------------------------------------------------------------------------------- /setconfig.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Dynamically generates the config.xml file 4 | 5 | # Various settings below will be obtained from the environment if the variables are set, 6 | # otherwise the defaults will be used. 7 | 8 | echo "" 9 | echo "" 10 | echo " " 11 | echo " 1" 12 | echo " 100" 13 | echo " ${CODEC:-wav}" 14 | echo " ${METADATA:-1}" 15 | echo " ${ARTWORK:-https://raw.githubusercontent.com/pwt/docker-airconnect-arm/master/airconnect-logo.png}" 16 | echo " ${LATENCY:-1000:1000:f}" 17 | echo " ${DRIFT:-1}" 18 | echo " ${MAX_PLAYERS:-32}" 19 | if [ "$SUPPRESS_FLUSH" ] 20 | then 21 | echo " 0" 22 | else 23 | echo " 1" 24 | fi 25 | echo " " 26 | echo " ${MAIN_LOG:-info}" 27 | echo " ${UPNP_LOG:-warn}" 28 | echo " ${UTIL_LOG:-warn}" 29 | echo " ${RAOP_LOG:-warn}" 30 | echo " 2" 31 | echo "" 32 | -------------------------------------------------------------------------------- /setconfig_aircast.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Dynamically generates the config_aircast.xml file 4 | 5 | # Various settings below will be obtained from the environment if the variables are set, 6 | # otherwise the defaults will be used. 7 | 8 | echo "" 9 | echo "" 10 | echo " " 11 | echo " 1" 12 | echo " 100" 13 | echo " ${CODEC:-flc}" 14 | echo " ${METADATA:-1}" 15 | echo " https://raw.githubusercontent.com/pwt/docker-airconnect-arm/master/airconnect-logo.png" 16 | echo " ${LATENCY:-1000:1000:f}" 17 | echo " ${DRIFT:-1}" 18 | echo " ${MAX_PLAYERS:-32}" 19 | if [ "$SUPPRESS_FLUSH" ] 20 | then 21 | echo " 0" 22 | else 23 | echo " 1" 24 | fi 25 | echo " " 26 | echo " ${MAIN_LOG:-info}" 27 | echo " ${UTIL_LOG:-warn}" 28 | echo " ${RAOP_LOG:-warn}" 29 | echo " 2" 30 | echo "" 31 | -------------------------------------------------------------------------------- /setoptions.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Set the command line options for airupnp using env. variables 4 | # Redirect the output of this script to the required options file. 5 | 6 | # --- 7 | 8 | 9 | # Which local port (IP address) to bind to 10 | if [ "$BIND_IP" ] 11 | then 12 | echo -n "-b ${BIND_IP} " 13 | fi 14 | 15 | # Strict list of model numbers to include. Exact matches. Case sensitive. 16 | # **Overrides** the '-m' and '-n' options completely. 17 | # 18 | # Player model numbers 19 | # Play:1 : S1, S12 20 | # Play:3 : S3 21 | # Play:5 gen 1: S5 22 | # PlayBar: S9 23 | # ZonePlayers: ZP80, ZP90, and S15 (Connect), ZP100, ZP120 (Connect:Amp) 24 | # (Sub: Sub -- not included as a target; cannot be standalone) 25 | 26 | if [ "$INC_MODELNUMBERS" != "NONE" ] 27 | then 28 | echo -n "-o ${INC_MODELNUMBERS:-S1,S3,S5,S9,S12,ZP80,ZP90,S15,ZP100,ZP120} " 29 | fi 30 | 31 | # Model names to exclude. Supports partial matches. 32 | if [ "$EXC_MODELNAMES" ] 33 | then 34 | echo -n "-m ${EXC_MODELNAMES:-} " 35 | fi 36 | 37 | # Model numbers to exclude. Supports partial matches. 38 | if [ "$EXC_MODELNUMBERS" ] 39 | then 40 | echo -n "-n ${EXC_MODELNUMBERS:-} " 41 | fi 42 | -------------------------------------------------------------------------------- /setoptions_aircast.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Set the command line options for aircast using env. variables 4 | 5 | # Redirect the output of this script to the required options file. 6 | 7 | # --- 8 | 9 | # Which local port (IP address) to bind to 10 | if [ "$BIND_IP" ] 11 | then 12 | echo -n "-b ${BIND_IP:-} " 13 | fi 14 | --------------------------------------------------------------------------------