Sign inSign up

wgraj/pipewire

By wgraj

•Updated 5 days ago

Run a PipeWire server in Docker.

Image
Internet of things
0

2.1K

wgraj/pipewire repository overview

⁠PipeWire Server in Docker

Run a PipeWire server in Docker, that can either be fully isolated or communicate directly with the host's ALSA, with an optional PulseAudio interface.

See wojciech-graj/bluez-speaker-docker⁠ for an example of using this to create a bluetooth speaker.

⁠Why?

The entire point of containerization is to require as little as possible from the host, so when deploying containers that use PulseAudio or PipeWire for audio playback on a headless system, there's no good reason to require the audio server to be installed on the host. By running it in a container, we reduce the setup needed when migrating to a new system.

⁠Example compose.yaml

  pipewire:
    image: wgraj/pipewire:latest
    container_name: pipewire
    environment:
      - PUID=1000
      - PGID=1000
    cap_add:
      - SYS_NICE
      - IPC_LOCK
    ulimits:
      rtprio: 95
      memlock: -1
    volumes:
      - ./pipewire-runtime:/pipewire # PipeWire/PulseAudio sockets
      - /run/udev:/run/udev:ro # If using ALSA
    devices:
      - /dev/snd:/dev/snd # If using ALSA

You can then test that it works by running the following on the host:

PULSE_SERVER="unix:$(pwd)/pipewire-runtime/pulse/native" paplay /usr/share/sounds/alsa/Front_Center.wav

⁠Configuration

VariableValueDefaultExplanation
PUIDNumeric1000Unix UID for the container user.
PGIDNumeric1000Unix GID for the container user.
USE_HOST_DBUS0/10Use the host's dbus. Requires mounting the /run/user/<UID>/bus:/pipewire/bus volume.
ENABLE_PULSE0/11Run pipewire-pulse to provide a PulseAudio interface alongside PipeWire.
BLUETOOTH_A2DP0/10Configure PipeWire to be a speaker instead of a headset over Bluetooth.

Tag summary

Content type

Image

Digest

sha256:4b13e5569…

Size

64.9 MB

Last updated

5 days ago

docker pull wgraj/pipewire