Docker and Pulse audio #1620
Replies: 3 comments
-
Thanks for the information. TBH, I'd prefer to keep PulseAudio out of the Docker image, but the modified Docker compose script would certainly be interesting. A quick guide to that would be useful! |
Beta Was this translation helpful? Give feedback.
-
Not sure if this would interest anyone but I've created a Docker image which uses Seems to be working on desktop Ubuntu. I haven't extensively tested the sync impacts. |
Beta Was this translation helpful? Give feedback.
-
I'm documenting another setup that uses the latest $ diff /etc/pulse/default.pa ~/.config/pulse/default.pa 78c78
< load-module module-native-protocol-unix
---
> load-module module-native-protocol-unix auth-anonymous=1
services:
shairport-sync:
image: mikebrady/shairport-sync:latest
network_mode: host
restart: unless-stopped
# For debugging, enter a shell with docker compose run --rm --entrypoint /bin/ash shairport-sync
# restart: "no"
# user: shairport-sync
environment:
PULSE_SERVER: unix:/tmp/pulseaudio.socket # Path for PulseAudio socket
PULSE_COOKIE: /tmp/pulseaudio.cookie # Path for PulseAudio cookie
#devices:
# - "/dev/snd" # ALSA device
volumes:
- ./shairport-sync.conf:/etc/shairport-sync.conf # Customised Shairport Sync configuration file.
- ./.state/coverart:/tmp/shairport-sync/.cache/coverart
- /run/user/1000/pulse/native:/tmp/pulseaudio.socket # PulseAudio socket when using that backend
- /home/ubuntu/.config/pulse/cookie:/tmp/pulseaudio.cookie And with the following custom configuration: # diff <(curl -sSL https://github.com/mikebrady/shairport-sync/raw/master/scripts/shairport-sync.conf) shairport-sync.conf 9c9
< // name = "%H"; // This means "Hostname" -- see below. This is the name the service will advertise to iTunes.
---
> name = "soundsystem"; // The container receives an auto-generated hostname. We choose to set our instance configuration here instead.
19c19
< // output_backend = "alsa"; // Run "shairport-sync -h" to get a list of all output_backends, e.g. "alsa", "pipe", "stdout". The default is the first one.
---
> output_backend = "pa";
21c21
< // interface = "name"; // Use this advanced setting to specify the interface on which Shairport Sync should provide its service. Leave it commented out to get the default, which is to select the interface(s) automatically.
---
> interface = "eth0:0";
174c174
< // application_name = "Shairport Sync"; //Set this to the name that should appear in the Sounds "Applications" tab when Shairport Sync is active.
---
> application_name = "soundsystem"; References: |
Beta Was this translation helpful? Give feedback.
-
I notice there is some talks about docker image and pulseaudio I have look how is this implemented in balena-sound script they install just
alsa-plugin-pulse
and whit small changes to the S6-overlay scripts I was able to use the docker image and pulseaudio here is my working docker-compose exampleI make
pulseaudio
andshairport-sync
service files where thepulseaudio
service is checking ifPULSE_SERVER
env variable is passed and install thealsa-plugin-pulse
if not it will continue and start like normal and other services dependent on pulse shairport-sync dependent on all other service so it start lastFrom the host server the pulseaudio socket and pulseaudio cookie need to be mount inside the container cookie is needed for root user from inside container to login to the pulseaudio server
there is also
EXTRA_ARGS
env variable that is pass to theshairport-sync
for extra option if need to be used for setting the NAME config file...If there is interest in this i can make PR for changes in the
s6-overley
scriptsBeta Was this translation helpful? Give feedback.
All reactions