Skip to content

Commit

Permalink
Merge pull request #621 from fabienheureux/feature/bring-airplay-2-su…
Browse files Browse the repository at this point in the history
…pport

Add Airplay 2 support - Upgrade shairport version
  • Loading branch information
maggie44 committed Jan 25, 2023
2 parents f2d1808 + 6f77936 commit 2158f38
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
9 changes: 5 additions & 4 deletions plugins/airplay/Dockerfile.template
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
FROM mikebrady/shairport-sync:3.3.8 as shairport
FROM mikebrady/shairport-sync:4.1.1 as shairport
WORKDIR /usr/src

ENV DBUS_SYSTEM_BUS_ADDRESS=unix:path=/host/run/dbus/system_bus_socket

# DL4006: https://github.com/hadolint/hadolint/wiki/DL4006
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
SHELL ["/bin/sh", "-eo", "pipefail", "-c"]

# shairport-sync docker image doesn't include pulseaudio support so we use ALSA bridge
ENV PULSE_SERVER=tcp:localhost:4317
RUN apk add --no-cache curl~=7 && \
RUN apk add --no-cache supervisor curl~=7 && \
curl -skL https://raw.githubusercontent.com/balena-labs-projects/audio/master/scripts/alsa-bridge/alpine-setup.sh | sh \
&& apk del curl

COPY start.sh /usr/src/
COPY supervisor.conf /usr/src/supervisor.conf

# shairport-sync image entrypoint starts dbus and avahi daemons that we don't need
ENTRYPOINT []
CMD [ "/bin/ash", "/usr/src/start.sh" ]
CMD ["supervisord","-c","/usr/src/supervisor.conf"]
6 changes: 3 additions & 3 deletions plugins/airplay/start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/ash
#!/usr/bin/env sh

if [[ -n "$SOUND_DISABLE_AIRPLAY" ]]; then
echo "Airplay is disabled, exiting..."
Expand All @@ -13,9 +13,9 @@ echo "Starting AirPlay plugin..."
echo "Device name: $SOUND_DEVICE_NAME"

# Start AirPlay
echo "Starting Shairport Sync"
exec shairport-sync \
--use-stderr \
--name "$SOUND_DEVICE_NAME" \
--output alsa \
-- -d pulse \
| echo "Shairport-sync started. Device is discoverable as $SOUND_DEVICE_NAME"
| echo "Shairport-sync started. Device is discoverable as $SOUND_DEVICE_NAME"
20 changes: 20 additions & 0 deletions plugins/airplay/supervisor.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[supervisord]
nodaemon=true
root=true

[program:shairport-sync]
command=/bin/sh /usr/src/start.sh
autorestart=true
stderr_logfile=/dev/stdout
stderr_logfile_maxbytes = 0
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes = 0

[program:nqptp]
command=nqptp
autostart=true
autorestart=true
stderr_logfile=/dev/stdout
stderr_logfile_maxbytes = 0
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes = 0

0 comments on commit 2158f38

Please sign in to comment.