Sign inSign up

wgraj/bluez-speaker

By wgraj

•Updated 5 days ago

Containerized BlueZ service for a wireless Bluetooth receiver.

Image
Internet of things
0

2.5K

wgraj/bluez-speaker repository overview

⁠BlueZ Speaker in Docker

A containerized BlueZ service that exposes an audio-configured Bluetooth interface to transform a headless or legacy speaker system into a wireless Bluetooth receiver.

⁠Example compose.yaml

services:
  bluez-speaker:
    image: wgraj/bluez-speaker:latest
    container_name: bluez-speaker
    network_mode: host
    environment:
      - DBUS_SYSTEM_BUS_ADDRESS=unix:path=/var/run/dbus/system_bus_socket
    cap_add:
      - NET_ADMIN
    volumes:
      - /var/run/dbus:/var/run/dbus
      - ./bluetooth-data:/var/lib/bluetooth

  pipewire:
    image: wgraj/pipewire:latest
    container_name: pipewire
    network_mode: host
    environment:
      - PUID=1000
      - PGID=1000
      - BLUETOOTH_A2DP=1
      - DBUS_SYSTEM_BUS_ADDRESS=unix:path=/var/run/dbus/system_bus_socket
    cap_add:
      - SYS_NICE
      - IPC_LOCK
    ulimits:
      rtprio: 95
      memlock: -1
    volumes:
      - /run/udev:/run/udev:ro
      - /var/run/dbus:/var/run/dbus:ro
    devices:
      - /dev/snd:/dev/snd

⁠Usage

You'll most likely need to disable your host bluetooth service

systemctl disable --now bluetooth
systemctl mask --now bluetooth

To enable pairing, make an HTTP request to $PORT/hooks/pair, e.g.

curl http://localhost:2137/hooks/pair

⁠Configuration

VariableValueDefaultExplanation
NAMEStringThe broadcasted name of the Bluetooth device.
TIMEOUTNumeric120The time (in seconds) that discovery and pairing stay active before shutting off.
PORTNumeric2137The HTTP port that the webhook process listens on for pairing events.
MACStringHardware MAC address of the Bluetooth controller if you have multiple adapters.

Tag summary

Content type

Image

Digest

sha256:955bc965f…

Size

53.2 MB

Last updated

5 days ago

docker pull wgraj/bluez-speaker