The Music Assistant Local Audio add-on is a Sendspin player (sendspin-cli): Music Assistant plays music on it. Next to LVA on the same host, LVA lowers it while you talk, around announcements and while a timer rings, and shows it in its media player in Home Assistant. What LVA does with it is described in behavior.md.
local-audio/ holds a Docker Compose project for the player outside Home Assistant OS: a copy of the docker-compose.yml and .env.example of the add-on, with the output set to the sound server (SENDSPIN_OUTPUT="pulse"). LVA itself runs with the docker-compose.yml in the root of this repository, see installation_part2_application.md.
Copy the directory to where you want to keep it, copy its .env.example to .env, edit that and start it. The two Compose projects are independent, the order does not matter:
cd local-audio && cp .env.example .env && docker compose up -dLook at the logs with docker compose logs -f. Every option is described in the .env.example.
LVA uses two ways to reach the player. Both work only on the same host.
| What | Needed for | Setting |
|---|---|---|
| Sound server (PulseAudio or PipeWire of the host user) | Lowering the stream of the player while ducking (--sendspin-player-duck-mode pulse, the default). The player passes the change on to its Sendspin group, so the other players of the group are ducked too. |
The player has to play through the sound server: SENDSPIN_OUTPUT="pulse" (or pipewire) in the .env of local-audio. Both containers use the sound server of the same user: LOCAL_AUDIO_PULSE_SERVER and LVA_PULSE_SERVER |
Control socket of sendspin-cli, a Unix socket file control.sock |
The state of the player in the media player of LVA, play/pause/stop, volume and mute from Home Assistant, and ducking in every mode (LVA ducks only while the player plays) | Both containers mount the same host directory: LOCAL_AUDIO_CONTROL_DIR in the .env of local-audio and SENDSPIN_CONTROL_DIR in the .env of LVA. Both default to /run/sendspin-cli |
| User | The control socket and the sound server | The socket has mode 0600, so LVA_USER_ID and LOCAL_AUDIO_USER_ID have to be the same user (1000 by default) |
| Switch in LVA | ENABLE_SENDSPIN_BRIDGE in the .env of LVA: 1 (default) on, 0 off |
If you change the directory of the socket, set the same value as LOCAL_AUDIO_CONTROL_DIR and SENDSPIN_CONTROL_DIR, otherwise LVA does not find it. Without a running player LVA works as without Sendspin.
If the player already runs from another Compose file or the stock image:
- Share the directory of the socket. The image creates the socket at
/run/sendspin-cli/control.sock. Mount a host directory there, for example- /run/sendspin-cli:/run/sendspin-cli, and set the same directory asSENDSPIN_CONTROL_DIRin the.envof LVA (the default). Share the directory, not the socket file, so that the player can create the socket again when it restarts. - Run the player as the user of LVA, so that LVA may open the socket (mode
0600). The Compose project in local-audio/ does that. For a quick test only,docker exec <player> chmod 666 /run/sendspin-cli/control.sockopens it until the player restarts, and every local user can then control the player. - Let it play through the sound server (
SENDSPIN_OUTPUT="pulse"), so that LVA can lower its stream. - Check.
docker compose logs linux-voice-assistant 2>&1 | grep -i sendspin(in the directory of the Compose file of LVA) showsSendspin control socket /run/sendspin-cli/control.sock is reachableand, once the sound server is reached,Connected to the sound server, ducking the stream of sendspin-cli there. A critical messageis not reachablemeans that the socket is missing (is the directory mounted into both containers?) or that LVA may not open it (step 2).docker exec <player> sendspin-cli status --control-socket /run/sendspin-cli/control.sockshows what the player reports,pactl list sink-inputson the host shows its stream assendspin-cli.
- The player needs the network of the host (mDNS and the port the server connects back to, 8928 by default,
SENDSPIN_PORT) and announces itself through the Avahi of the host over its D-Bus socket. - On hosts with AppArmor enabled (for example Ubuntu) the default Docker profile blocks that, and the log of the player shows
could not register _sendspin._tcp: dns_sd error -65553. The Compose file oflocal-audiotherefore setssecurity_opt: apparmor=unconfined(this removes the AppArmor protection of that container). - Unless
SENDSPIN_NAMEis set, the player is named after the host in Music Assistant. - Music Assistant has to pair with the player. The
.env.exampleoflocal-audioexplains the options (SENDSPIN_ALLOW_UNPAIREDistruethere for now). - A second player on one host needs its own
SENDSPIN_PORTand its own socket directory, which has to match theSENDSPIN_CONTROL_DIRof the LVA that controls it. - The Compose project is a copy of the one in the add-on repository and is kept in step with it by hand.