Skip to content

Add built-in audio support, modify/uninstall scripts and Trixie fix#5

Open
ermanno00 wants to merge 4 commits into
Techposts:mainfrom
ermanno00:main
Open

Add built-in audio support, modify/uninstall scripts and Trixie fix#5
ermanno00 wants to merge 4 commits into
Techposts:mainfrom
ermanno00:main

Conversation

@ermanno00
Copy link
Copy Markdown

@ermanno00 ermanno00 commented May 18, 2026

Summary

This PR extends the installer in three directions while keeping the
existing UX intact:

  1. Built-in audio is now a first-class option. The device picker no
    longer hides bcm2835, Headphones or vc4-hdmi — users can drive
    a speaker from the 3.5mm jack or HDMI without having to dismiss the
    "no DAC found" fallback prompt.
  2. Two new management scripts so users don't have to reinstall from
    scratch to rename the speaker, swap the audio device or remove the
    stack.
  3. A unified menu wrapper that dispatches to install / modify /
    uninstall based on what's currently on the system.

It also fixes a build failure on Raspberry Pi OS / Debian 13 "Trixie",
where plistutil was split out of libplist-dev into its own package.

Changes

install_airplay_v3.sh

  • select_audio_device(): removed the grep -iv 'bcm2835\|Headphones\|vc4-hdmi'
    filter. All cards returned by aplay -l are listed and tagged
    [built-in] or [external/DAC] so the user can clearly tell them
    apart. Single-device auto-select is preserved.
  • Header comment and ASCII banner updated to reflect support for USB
    DAC, audio HAT or built-in audio.
  • Added libplist-utils to the APT dependency list. On Trixie the
    plistutil binary needed by shairport-sync's --with-airplay-2
    configure step lives in this separate package, and the build fails
    with configure: error: plistutil can not be found without it.

New: modify_airplay.sh

Interactive menu to modify an existing installation without rebuilding:

  • Change AirPlay device name
  • Change audio output device (re-uses the same labelled picker)
  • Change ALSA mixer / hardware volume control (or disable it)
  • Change volume limits (volume_max_db, default_airplay_volume)
  • Test audio output via speaker-test
  • View configuration, show service status, restart, edit with nano

Changes are written to /etc/shairport-sync.conf via targeted sed
rules that match both commented and uncommented forms, and the service
is restarted automatically after each change.

New: uninstall_airplay.sh

Clean removal of everything the installer adds:

  • Stops and disables shairport-sync and nqptp
  • Removes binaries from /usr/local/bin
  • Removes /etc/shairport-sync.conf and the sample
  • Removes systemd unit files from /lib/systemd/system/,
    /etc/systemd/system/ and /usr/local/lib/systemd/system/
  • Removes the shairport-sync user and group
  • Removes UFW rules added during install (5353/udp, 319/udp, 320/udp,
    7000/tcp)
  • Backs up the current config under /tmp/airplay_uninstall_backup_<ts>/
    before deleting anything
  • Verifies the removal and reports leftover items, if any

APT build dependencies are intentionally not removed (they may be
in use by other software); the script prints the apt-get command to
remove them manually for users who want a fully clean state.

New: airplay_manager.sh

Thin wrapper that exposes a single menu:

  1. Install AirPlay 2 → calls install_airplay_v3.sh
  2. Modify existing installation → calls modify_airplay.sh
  3. Uninstall → calls uninstall_airplay.sh
  4. Tail live service logs

It auto-detects whether shairport-sync is installed and grays out
modify/uninstall when no installation is present.

README.md

Rewritten to document the new scripts, the built-in audio support, the
Trixie/libplist-utils note, and a troubleshooting section with the
most common failure modes.

Compatibility

  • All scripts refuse to run as root and invoke sudo only where
    needed — same convention as the original installer.
  • No changes to systemd unit content, NQPTP, or the
    shairport-sync --with-airplay-2 build flags.
  • Existing installations done with the old version of
    install_airplay_v3.sh are fully compatible with the new
    modify_airplay.sh / uninstall_airplay.sh.

Test plan

  • bash -n passes on all four scripts.
  • Pi 4 (Trixie) with only built-in audio: install succeeds, card
    appears in picker, audio plays from 3.5mm jack.
  • Pi 4 with USB DAC only: card auto-selected, AirPlay endpoint
    visible on iPhone.
  • Pi 4 with both built-in and USB DAC: both shown in picker, either
    choice works.
  • modify_airplay.sh: rename device → confirm new name appears in
    iPhone AirPlay picker after restart.
  • modify_airplay.sh: switch from DAC to built-in (and back) →
    output_device, mixer_control_name, mixer_device updated
    coherently; service restarts cleanly.
  • uninstall_airplay.sh: full removal on a freshly installed Pi
    leaves no leftover items in the verification step; reinstalling
    afterwards works.
  • airplay_manager.sh: menu reflects the correct state before/after
    install and uninstall.
  • Trixie: install no longer fails at the plistutil check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant