Files
ansible/roles/pi_musicmouse/files/config-musicdolphin.yml
Martin Bauer 804cb1bfaf Give musicdolphin real sound through the HifiBerry amp
It was set up display-only, with alsa_device "simulate", so the UI showed a
working player that made no noise - but the Pi has a HifiBerry amp and
pi_alsasetup already put the softvol_effects slot on it. Point the backend at
it, the same way musicmouse does: a softvol control feeding dmix, so the card
stays shared with squeezelite and shairport instead of being locked.

Carry musicmouse's volume clamp over with it. Below roughly 23 the softvol
attenuation leaves nothing audible, and the ceiling keeps a UI slider from
putting the amp to full. Those numbers are tuned to musicmouse's speakers and
this is a different room, so they are a starting point.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-19 21:53:50 +02:00

95 lines
4.2 KiB
YAML

---
# musicdolphin: screen-driven instance. No physical mouse is attached, so serial stays
# "simulate" and the web front-end (shown locally in the pi_kiosk Firefox window, and
# reachable on the LAN for a tablet) is how the player is driven. `figures` still needs
# at least one entry (the schema requires it) even though nothing will ever scan a tag
# here.
#
# Audio goes out the HifiBerry amp, the same way musicmouse does it: pi_alsasetup's
# `softvol_effects` slot is a softvol control feeding dmix, so the backend shares the
# card with squeezelite and shairport rather than locking it.
#
# Unknown keys are rejected rather than ignored, so a typo fails at startup with the
# path to the offending line. Every key is documented in the app repo's
# python-backend/config.yml.example.
general:
library:
# The four shelves underneath are fixed names, not settings: Figuren/, Musik/,
# Hoerbuecher/ (with real umlauts) and Kinderpodcasts/.
root: /media/musicmouse
# Relative, so it resolves against *this file's* directory -
# /media/musicmouse/.musicmouse-cache. Seeded by the app repo's
# scripts/sync-library.sh; safe to delete, at the cost of recomputing analysis.
cache: .musicmouse-cache
# analysis_workers: 2
# ^ pointless until this role installs the backend's `analysis` extra
# (librosa + numpy, a heavy build on a Pi). Without it build_analyzer() falls
# back to NullAnalyzer and the reactive background stays static.
# Both required rather than optional on purpose: running blind or silent has to be
# asked for, so a config that lost a line fails loudly instead of booting into
# something that looks like it is working. Startup says so every boot.
serial_port: "simulate"
alsa_device: "softvol_effects"
web:
host: "0.0.0.0"
port: 8080
# Absolute on purpose. The repo's example uses ../web/dist because its config sits
# in python-backend/; from /media/musicmouse that would resolve to /media/web/dist
# and silently serve nothing.
static_dir: /opt/musicmouse/web/dist
# The typing game. Both paths are relative, so both land in /media/musicmouse/.
# curriculum_file must exist at startup and is installed by this role;
# progress_file is created and written by the app itself.
tippen:
curriculum_file: tippen-curriculum.yml
progress_file: tippen-progress.json
# Home Assistant "Mein Zimmer" page. Left out until the Wohnzimmer-oben entity ids
# are picked - the dev config's entities are Arbeitszimmer, the wrong room for this
# Pi. An empty ha: block is invalid; the section needs at least one device or scene,
# so uncomment it only once it is filled in:
#
# ha:
# url: "https://ha.bauer.tech"
# token: "<long-lived access token>"
# devices:
# - entity_id: cover.wohnzimmer_oben_rollo
# name: "Rollo"
# - entity_id: light.wohnzimmer_oben_...
# name: "Licht"
# scenes:
# - entity_id: scene.wohnzimmer_oben_...
# name: "Lesen"
# No mqtt: section. The Home Assistant integration exposes the *mouse's* lights,
# buttons, touch areas and tag scanner, none of which exist on a simulate-only
# instance - it would publish a device of dead entities.
#
# No lirc: section either, and consequently no top-level `remote:` mapping. This host
# uses mediapi_ir_control: irserver, a custom serial daemon on /dev/ttyUSB0; the
# backend's LircConfig speaks lircd's TCP protocol (pi_lirc, port 2222) and cannot
# talk to it.
# Backlight of the prev/next buttons while a figure is playing, 0..1. Inert here
# (no mouse), kept so the file reads the same as the other hosts'.
button_leds_brightness: 0.5
# Volume, 0..100, clamped the way musicmouse clamps it: below ~23 the softvol
# attenuation leaves nothing audible, and the ceiling is there so no UI slider can
# put the amp to full. These two numbers are tuned to musicmouse's speakers, so
# expect to want different ones for this room.
min_volume: 23
max_volume: 70
initial_volume: 40
volume_increment: 5
figures:
# Placeholder - serial_port is "simulate" so no reader ever reports a tag id, but the
# schema requires at least one figure to be configured.
placeholder:
id: "0000000001"
colors: ["#ffffff", "#ffffff", "#000000", "#ffffff"]