Problem
Three related gaps exist in how device names are wired across services:
- Snapclient on both streamer and player has no
--name set — every device shows up as audera in Snapserver, which is broken for multi-device setups.
- PlexAmp
CLIENT_NAME is set dynamically from the system hostname via $(hostname -s) in the systemd unit. The PlexAmp player name will instead be the static value "Audera", set by changing the literal value of CLIENT_NAME in the systemd unit. Per-device Plex naming is out of scope.
- The
_audera._tcp.local. mDNS service and the player FastAPI server are vestigial from the pre-Snapcast architecture. Snapserver already provides the player registry (IP, MAC, name). Removing both simplifies the architecture significantly.
Architecture After This Change
- Snapserver is the player registry. The streamer reaches any player via Snapserver's client list (IP, MAC, display name). No separate player API or mDNS discovery needed.
- System hostname is the permanent machine ID, derived deterministically from the MAC address at provisioning time (e.g.
audera-a1b2c3). It never changes. Snapclient reports this hostname to Snapserver automatically — no --name flag needed.
Client.SetName JSON-RPC is the sole pathway for display name changes. The user renames a device from the streamer UI; this calls Client.SetName and the name persists in Snapserver's config across client reconnects (keyed by MAC address).
identity.json is dropped entirely. The WiFi AP SSID uses the system hostname. The setup wizard drops the name field.
audera.local is static — nginx and avahi are never touched on rename.
- PlexAmp player name is static
"Audera" — set once at provisioning via the settings file. CLIENT_NAME env var is removed from the systemd unit.
What Does Not Change
audera.local nginx domain and avahi hostname — static, never tied to device identity.
- Snapserver source name (
name=PlexAmp in snapserver.conf) — unrelated to device identity.
- CamillaDSP — no name concept, untouched.
What Is Removed
| Artifact |
Reason |
audera/models/identity.py |
No identity object needed; hostname replaces it |
audera/dal/identities.py |
No identity persistence needed |
audera/server/player/app.py |
All info available via Snapserver; endpoints are dead code |
audera/services/mdns.py |
Snapserver replaces mDNS as the player registry |
tests/services/test_mdns.py |
Test file for removed service |
coolname dependency |
Only used in generate_cool_name() in identity model |
zeroconf dependency |
Only used in mdns.py |
fastapi / uvicorn dependencies |
Only used in server/player/app.py (verify not used in streamer) |
Implementation Steps
Step 1 — Set system hostname from MAC address at provisioning
Both setup scripts (os/dietpi/streamer/automation/setup.sh, os/dietpi/player/automation/setup.sh):
After the network interface is up, derive a deterministic hostname from the last 6 hex digits of the MAC address and apply it:
MAC=$(cat /sys/class/net/eth0/address 2>/dev/null || cat /sys/class/net/wlan0/address)
SHORT=$(echo "$MAC" | tr -d ':' | tail -c 7)
NEW_HOSTNAME="audera-${SHORT}"
hostnamectl set-hostname "$NEW_HOSTNAME"
echo "127.0.1.1 $NEW_HOSTNAME" >> /etc/hosts
Step 2 — Remove the player FastAPI server
- Delete
audera/server/player/app.py.
- In
audera/cli/commands.py: remove the player-server branch from run() and remove it from the type_ choices list.
- In
audera/cli/audera.py: remove 'player-server' from the choices list on the type_ argument.
- In
os/dietpi/player/automation/setup.sh: remove the audera run player-server autostart entry from /var/lib/dietpi/dietpi-autostart/custom.sh.
- Remove
fastapi and uvicorn from pyproject.toml.
Step 3 — Remove the mDNS service
- Delete
audera/services/mdns.py.
- Delete
tests/services/test_mdns.py.
- Remove
zeroconf from pyproject.toml.
Step 4 — Remove the Identity model and DAL
- Delete
audera/models/identity.py.
- Delete
audera/dal/identities.py.
- Remove
identity from the imports in audera/models/__init__.py.
- Remove
coolname from pyproject.toml.
- Check
audera/dal/__init__.py and remove any identities import.
Step 5 — Update the AccessPoint service
In audera/services/ap.py, remove the identity parameter entirely. Derive the AP SSID from the system hostname:
import socket
self.hostname = socket.gethostname()
Step 6 — Update the setup wizard
In audera/server/setup.py:
- Remove the
identity parameter from Page.__init__. Remove self.identity, self.name, update_name_callback(), and the IP-update block in connect_callback().
- Construct
AccessPoint without an identity.
- Collapse the wizard to three pages:
welcome → connect → finish. Remove the /discover and /setup routes. Update the progress indicator from five dots to three.
- In
run(), remove all identity generation — replace with just starting the AP and the UI.
- Remove all imports of
audera.dal.identities, audera.models.identity, and coolname.
Step 7 — Wire PlexAmp static name at provisioning
In os/dietpi/streamer/automation/setup.sh:
# Before:
ExecStart=/bin/bash -c 'export CLIENT_NAME=$(hostname -s); exec /usr/bin/node /opt/plexamp/js/index.js'
# After:
ExecStart=/bin/bash -c 'export CLIENT_NAME=Audera; exec /usr/bin/node /opt/plexamp/js/index.js'
Step 8 — Add set_client_name() to SnapserverClient
In audera/services/snapserver.py, add a set_client_name(client_id, name) method using the existing JSON-RPC 2.0 over WebSocket pattern, calling Client.SetName.
Step 9 — Streamer UI: rename flow
In audera/server/streamer/app.py, add an inline rename control per player card and for the streamer's own name. On submit, call await snapserver.set_client_name(client_id, new_name) and refresh the player list. No local identity file is written — Snapserver is the sole persistent store.
Files Changed
| File |
Change |
audera/models/identity.py |
Delete |
audera/dal/identities.py |
Delete |
audera/server/player/app.py |
Delete |
audera/services/mdns.py |
Delete |
tests/services/test_mdns.py |
Delete |
audera/models/__init__.py |
Remove identity import |
audera/dal/__init__.py |
Remove identities import |
audera/cli/commands.py |
Remove player-server branch |
audera/cli/audera.py |
Remove player-server from choices |
audera/services/ap.py |
Remove identity param; use socket.gethostname() |
audera/server/setup.py |
Collapse to three pages; remove identity handling |
audera/services/snapserver.py |
Add set_client_name() |
audera/server/streamer/app.py |
Add rename UI per player + streamer self |
os/dietpi/streamer/automation/setup.sh |
Set hostname from MAC; static CLIENT_NAME=Audera |
os/dietpi/player/automation/setup.sh |
Set hostname from MAC; remove player-server autostart |
pyproject.toml |
Remove coolname, zeroconf, fastapi, uvicorn |
Problem
Three related gaps exist in how device names are wired across services:
--nameset — every device shows up asauderain Snapserver, which is broken for multi-device setups.CLIENT_NAMEis set dynamically from the system hostname via$(hostname -s)in the systemd unit. The PlexAmp player name will instead be the static value"Audera", set by changing the literal value ofCLIENT_NAMEin the systemd unit. Per-device Plex naming is out of scope._audera._tcp.local.mDNS service and the player FastAPI server are vestigial from the pre-Snapcast architecture. Snapserver already provides the player registry (IP, MAC, name). Removing both simplifies the architecture significantly.Architecture After This Change
audera-a1b2c3). It never changes. Snapclient reports this hostname to Snapserver automatically — no--nameflag needed.Client.SetNameJSON-RPC is the sole pathway for display name changes. The user renames a device from the streamer UI; this callsClient.SetNameand the name persists in Snapserver's config across client reconnects (keyed by MAC address).identity.jsonis dropped entirely. The WiFi AP SSID uses the system hostname. The setup wizard drops the name field.audera.localis static — nginx and avahi are never touched on rename."Audera"— set once at provisioning via the settings file.CLIENT_NAMEenv var is removed from the systemd unit.What Does Not Change
audera.localnginx domain and avahi hostname — static, never tied to device identity.name=PlexAmpinsnapserver.conf) — unrelated to device identity.What Is Removed
audera/models/identity.pyaudera/dal/identities.pyaudera/server/player/app.pyaudera/services/mdns.pytests/services/test_mdns.pycoolnamedependencygenerate_cool_name()in identity modelzeroconfdependencymdns.pyfastapi/uvicorndependenciesserver/player/app.py(verify not used in streamer)Implementation Steps
Step 1 — Set system hostname from MAC address at provisioning
Both setup scripts (
os/dietpi/streamer/automation/setup.sh,os/dietpi/player/automation/setup.sh):After the network interface is up, derive a deterministic hostname from the last 6 hex digits of the MAC address and apply it:
Step 2 — Remove the player FastAPI server
audera/server/player/app.py.audera/cli/commands.py: remove theplayer-serverbranch fromrun()and remove it from thetype_choices list.audera/cli/audera.py: remove'player-server'from thechoiceslist on thetype_argument.os/dietpi/player/automation/setup.sh: remove theaudera run player-serverautostart entry from/var/lib/dietpi/dietpi-autostart/custom.sh.fastapianduvicornfrompyproject.toml.Step 3 — Remove the mDNS service
audera/services/mdns.py.tests/services/test_mdns.py.zeroconffrompyproject.toml.Step 4 — Remove the Identity model and DAL
audera/models/identity.py.audera/dal/identities.py.identityfrom the imports inaudera/models/__init__.py.coolnamefrompyproject.toml.audera/dal/__init__.pyand remove anyidentitiesimport.Step 5 — Update the AccessPoint service
In
audera/services/ap.py, remove theidentityparameter entirely. Derive the AP SSID from the system hostname:Step 6 — Update the setup wizard
In
audera/server/setup.py:identityparameter fromPage.__init__. Removeself.identity,self.name,update_name_callback(), and the IP-update block inconnect_callback().AccessPointwithout an identity.welcome → connect → finish. Remove the/discoverand/setuproutes. Update the progress indicator from five dots to three.run(), remove all identity generation — replace with just starting the AP and the UI.audera.dal.identities,audera.models.identity, andcoolname.Step 7 — Wire PlexAmp static name at provisioning
In
os/dietpi/streamer/automation/setup.sh:Step 8 — Add
set_client_name()to SnapserverClientIn
audera/services/snapserver.py, add aset_client_name(client_id, name)method using the existing JSON-RPC 2.0 over WebSocket pattern, callingClient.SetName.Step 9 — Streamer UI: rename flow
In
audera/server/streamer/app.py, add an inline rename control per player card and for the streamer's own name. On submit, callawait snapserver.set_client_name(client_id, new_name)and refresh the player list. No local identity file is written — Snapserver is the sole persistent store.Files Changed
audera/models/identity.pyaudera/dal/identities.pyaudera/server/player/app.pyaudera/services/mdns.pytests/services/test_mdns.pyaudera/models/__init__.pyidentityimportaudera/dal/__init__.pyidentitiesimportaudera/cli/commands.pyplayer-serverbranchaudera/cli/audera.pyplayer-serverfrom choicesaudera/services/ap.pyidentityparam; usesocket.gethostname()audera/server/setup.pyaudera/services/snapserver.pyset_client_name()audera/server/streamer/app.pyos/dietpi/streamer/automation/setup.shCLIENT_NAME=Auderaos/dietpi/player/automation/setup.shpyproject.tomlcoolname,zeroconf,fastapi,uvicorn