fix: decouple from DietPi, HDMI stability, real CamillaDSP tests#45
Open
thomaseleff wants to merge 19 commits into
Open
fix: decouple from DietPi, HDMI stability, real CamillaDSP tests#45thomaseleff wants to merge 19 commits into
thomaseleff wants to merge 19 commits into
Conversation
Replace DietPi-only autostart hook and dietpi-set_hardware soundcard call with a proper systemd service unit per role (audera-player as oneshot, audera-streamer as long-running). Write streamer asound.conf unconditionally without reading /boot/dietpi.txt. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Write a global NetworkManager policy (wifi.powersave = 2) in both provision scripts and pass 802-11-wireless.powersave=2 to every nmcli connection add call in netifaces.connect() to prevent the driver from dropping the link during silence. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Set silence_threshold and silence_timeout to null and stop_on_rate_change to false so the ALSA device stays open continuously. Closing the device after 10s of silence causes the HDMI sink to de-clock, resulting in audio dropout. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Append hdmi_force_hotplug, hdmi_drive, and related overlays to /boot/firmware/config.txt to stabilise the HDMI audio output at boot. Add a camilladsp-hdmi-wait.path unit that holds CamillaDSP until /dev/snd/pcmC0D0p exists so it never races the HDMI device. camilladsp.service is no longer directly enabled; the path unit activates it once the device node appears. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Write /etc/profile.d/50-audera-banner.sh on both player and streamer to display the Audera logo and remind operators to use nmcli and /boot/firmware/config.txt instead of dietpi-config for WiFi and audio hardware management. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add tests/docker/camilladsp/ with a Dockerfile (Dummy ALSA backend, port 1234) and a minimal config.yml. Replace the in-process websocket mock fixtures with a session-scoped camilladsp_container fixture that waits for the real binary to accept WebSocket connections. Pure unit tests (percent_to_db, db_to_percent, error path) no longer require a live connection and use a locally constructed client instead. Update tests/AGENTS.md with the Docker build prerequisite. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces the pre-built image approach with DockerImage so the fixture is self-contained. Removes the manual docker build step from CI and the pre-build instruction from tests/AGENTS.md. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces the inline bash-c install command with a proper Dockerfile and entrypoint script under tests/docker/snapserver/, matching the CamillaDSP testcontainer pattern. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Mirror the setup.sh approach: wget to /tmp first, then tar, matching the pattern used in the player and streamer provision scripts. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Release assets use 'amd64' not 'x86_64'. test_error_response_raises needs a live CamillaDSP instance to return an error response — connect to localhost:0 raises a connection error, not RuntimeError. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… responses
Bind CamillaDSP WebSocket to 0.0.0.0 so Docker port forwarding can reach it
(default 127.0.0.1 loopback is unreachable via bridge NAT). Fix _call to detect
{'Invalid': ...} error responses for unknown commands. Fix test_set_config to
send a complete config with the devices section and assert only the changed keys.
Harden _wait_for_websocket against Windows named pipe timeouts on get_logs().
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
vc4-fkms-v3d never creates the vc4-hdmi platform device that snd_soc_hdmi_codec needs, so no HDMI ALSA soundcard ever appeared. Switch to vc4-kms-v3d (confirmed working across Zero 2W, Pi 4, and Pi 5) and add vc4.force_hotplug=3 so HDMI comes up even headless. Extract the config-injection logic into a shared os/dietpi/lib/config.sh, fetched by both setup.sh scripts the same way they already fetch themselves, and make each setting idempotent per-key (replaces an active or commented-out line, appends if absent) instead of relying on a block-comment header. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…rvice directly The path unit was the only thing triggering CamillaDSP at boot since the service itself was never enabled. Restart=always already retries on failure, so enabling the service directly and letting it fail-and-retry until the sound card is ready achieves the same result without a hardcoded /dev/snd/pcmC0D0p path that only matched the DigiAMP+ default. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
setup.sh unconditionally wrote dtoverlay=vc4-kms-v3d on every provision/re-provision run, silently overwriting the dtoverlay DietPi wrote at flash-time for non-HDMI hardware (e.g. rpi-digiampplus). Add an optional --audio-device flag to provision.sh (hdmi, digiamp-plus, dac-plus, hifiberry-dac-plus) that is passed through to setup.sh; when omitted, the existing dtoverlay is left untouched. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Player and streamer setup.sh scripts duplicated root check, ALSA loopback setup, dtoverlay config, CamillaDSP install, uv/audera CLI install, ifupdown purge, NetworkManager setup, WiFi power-save, the ASCII logo, boot banner, and camilladsp.service unit. Move these into lib/config.sh and a new lib/common.sh so future fixes only need to land in one place. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dietpi-set_hardwarecalls with standard systemd service units (audera-player.serviceoneshot,audera-streamer.servicelong-running)/etc/NetworkManager/conf.d/wifi-powersave.confand per-connection vianmcliinnetifaces.pysilence_threshold: null,silence_timeout: null,stop_on_rate_change: falsein both CamillaDSP configs to keep the ALSA device open and prevent HDMI audio dropout/boot/firmware/config.txtand add acamilladsp-hdmi-wait.pathunit that delays CamillaDSP until/dev/snd/pcmC0D0pexists/etc/profile.d/50-audera-banner.shboot banner warning againstdietpi-configusageDockerfileundertests/docker/viaDockerImage— no manual pre-build step required.dtoverlaywrite insetup.shexplicit and opt-in via a new-a, --audio-deviceflag onprovision.sh(hdmi,digiamp-plus,dac-plus,hifiberry-dac-plus). Previouslysetup.shunconditionally wrotedtoverlay=vc4-kms-v3don every re-provision run, silently overwriting thedtoverlayDietPi wrote at flash-time for non-HDMI hardware (e.g.rpi-digiampplus). When the flag is omitted, the existingdtoverlayis left untouched.Test plan
uv run ruff check --fix && uv run ruff format && uv run ty checkpasses cleanuv run pytest tests/dal/ -vpasses (no Docker)uv run pytest tests/clients/ -vpasses (requires Docker)setup.shon a plain Debian Trixie system (no DietPi) completes without errorsbash -nall three modified provisioning scripts;provision.sh --dry-runconfirms--audio-deviceis correctly included/omitted in the remote command--audio-deviceflag and confirmconfig.txt's existingdtoverlay=rpi-digiampplusline is untouched--audio-device digiamp-pluson a spare device and confirmconfig.txtgetsdtoverlay=rpi-digiampplus+dtparam=audio=off, then reboot and confirmaplay -lshows the HAT as card 0🤖 Generated with Claude Code