diff --git a/README.md b/README.md index 9a65b3ec..37992583 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Shairport Sync does not support AirPlay video or photo streaming. # Quick Start * A building guide is available [here](BUILD.md). -* A Docker image is available on the [Docker Hub](https://hub.docker.com/r/mikebrady/shairport-sync). +* A Docker image is available on the [Docker Hub](https://hub.docker.com/r/mikebrady/shairport-sync). Also see [docker/README.md](docker/README.md). * Next Steps and Advanced Topics are [here](ADVANCED%20TOPICS/README.md). * Runtime settings are documented [here](scripts/shairport-sync.conf). * Build configuration options are detailed in [CONFIGURATION FLAGS.md](CONFIGURATION%20FLAGS.md). diff --git a/docker/Dockerfile b/docker/Dockerfile index dbb8d44a..be3cba82 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -103,6 +103,7 @@ COPY --from=builder /shairport-sync/build/install/etc/dbus-1/system.d/shairport- COPY --from=builder /shairport-sync/build/install/etc/dbus-1/system.d/shairport-sync-mpris.conf /etc/dbus-1/system.d/ COPY ./docker/etc/s6-overlay/s6-rc.d /etc/s6-overlay/s6-rc.d +COPY ./docker/etc/pulse /etc/pulse RUN chmod +x /etc/s6-overlay/s6-rc.d/01-startup/script.sh # Create non-root user for running the container -- running as the user 'shairport-sync' also allows diff --git a/docker/README.md b/docker/README.md index 560dc89b..02a57cd3 100644 --- a/docker/README.md +++ b/docker/README.md @@ -40,10 +40,22 @@ $ docker run -d --restart unless-stopped --net host --device /dev/snd \ ``` This will send audio to alsa hardware device `hw:0` and make use of the that device's mixer control called `PCM`. The service will be visible as `DenSystem` on the network. +The image is built with PulseAudio backend support. To use it, refer to [`docker-compose.yaml`](docker-compose.yaml) for required environment variables and mounts. You might need to adjust authentication on your PulseAudio server ([PA documentation](https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Modules/#module-native-protocol-unixtcp)) and set default backend to `pa` via either command line option `-o` or `general.output_backend` field in config file. + ## Configuration File To get access to the full range of configuration options, pass the configuration file to `/etc/shairport-sync.conf` in the container using the `-v` option or docker compose. +## Environment variables + +Set `IPV4ONLY` to any value to force NQPTP to use IPv4 (might be useful on hosts not running IPv6): + +``` +$ docker run --env IPV4ONLY=yes -d --restart unless-stopped --net host --device /dev/snd \ + mikebrady/shairport-sync:latest \ + -v --statistics -a DenSystem -d hw:0 -c PCM +``` + ## Building ### Build Example (for arm7 devices) diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index 88831298..c6cb8330 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -5,10 +5,15 @@ services: image: mikebrady/shairport-sync:latest network_mode: host restart: unless-stopped + # environment: + # PULSE_SERVER: unix:/tmp/pulseaudio.socket # Path for PulseAudio socket + # PULSE_COOKIE: /tmp/pulseaudio.cookie # Path for PulseAudio cookie + # IPV4ONLY: "yes" # Force IPv4 in nqptp devices: - - "/dev/snd" + - "/dev/snd" # ALSA device # volumes: # - ./volumes/shairport-sync/shairport-sync.conf:/etc/shairport-sync.conf # Customised Shairport Sync configuration file. + # - /run/user/1000/pulse/native:/tmp/pulseaudio.socket # PulseAudio socket when using that backend logging: options: max-size: "200k"