Automated installer for Snapcast Client on PiCorePlayer 10.x (TinyCore Linux 15.x).
PiCorePlayer is an easy way to turn a Raspberry Pi into a streaming music player for use with Home Assistant/Music Assistant or other media servers. It includes Squeezelite (LMS) and AirPlay support by default. This installer adds Snapcast, a low-latency multi-room audio solution that allows synchronized playback across multiple devices.
Snapcast is particularly well-suited for Music Assistant users who want to stream to Raspberry Pis, Linux servers, high quality embedded streaming devices or DIY ESP32-based clients.
The script installs the Snapcast client binary, manages TinyCore dependencies, and configures ALSA to allow Squeezelite and Snapclient to play audio simultaneously without device conflicts.
- PiCorePlayer Installed: Follow the official Getting Started Guide to flash and boot your device.
- Password Set: Modern PiCorePlayer versions do not have a default password. You must set a password for the
tcuser during setup or via the web interface. - Network Connected: to download dependencies.
- SSH access works: enable SSH in the pCP web interface (Main Page > Security > SSH tab) and log in.
(enable from the SSH tab of the security settings page)
PiCorePlayer is designed for audiophile bit-perfect playback. To understand what this script does, it helps to know two ALSA (Linux Audio) terms:
hw(Hardware): This gives an application exclusive control over the sound card. If Squeezelite grabs the card viahw, no other app (like Snapclient) can make a sound. pCP defaults to this for maximum purity.dmix(Direct Mixing): This is a software mixer. It allows multiple applications to play audio simultaneously by mixing the streams before sending them to the hardware.
The Solution: This script configures your system to use dmix. This allows your Pi to act as a Squeezelite endpoint AND a Snapcast client at the same time, without "Device Busy" errors.
This script runs entirely as the standard tc user (using sudo only where necessary) and makes the following changes to your system:
- Extensions: Downloads and installs required TinyCore libraries:
avahi,flac,libvorbis,opus,expat2,pcp-libsoxr, andgcc_libs. - Binary: Installs the Snapclient binary (Debian Bookworm build) to
/home/tc/snapclient-bin/. - ALSA Config: Creates
/home/tc/.asoundrcto handle volume attenuation and mixing. - Persistence: updates
/opt/.filetool.lstto ensure the binary and config files survive a reboot. - Startup: Generates a wrapper script
/home/tc/snapclient-bin/startup.shto handle boot-up execution.
- SSH into your PiCorePlayer:
ssh tc@<YOUR_PI_IP>- Download the installer:
wget -O pcp_install_snapcast.sh https://raw.githubusercontent.com/somebox/piCorePlayer-snapcast/main/pcp_install_snapcast.sh- Make it executable and run it:
chmod +x pcp_install_snapcast.sh
./pcp_install_snapcast.shThe script will ask you for:
- Snapserver IP: The address of your Music Assistant or Snapserver instance.
- Audio Device: A list will appear. Select the number corresponding to the device labeled
dmix. - Attenuation: Select a volume level (Recommended: 30%).
- Note: Most DAC HATs lack hardware volume control. Without digital attenuation, mixing two streams will cause severe distortion.
Configure Squeezelite to share the audio device:
- Go to the Squeezelite Settings tab.
- Look for Audio output device settings.
- Click Change and select the device prefixed with
dmix(e.g.,dmix:CARD=sndrpihifiberry...). - Set ALSA Volume Control to
None(or clear the field). - Click Save and Restart Squeezelite.
(Ensure the Output Setting is set to a dmix device)
Note: you can list your available devices with pcp -l from the ssh session, or by browsing to the diagnostics page in the web interface:
To make Snapclient start automatically on boot:
- Go to the Tweaks tab.
- Scroll down to User Commands.
- In the "User Command #1" slot, paste the line provided by the installer script output:
/home/tc/snapclient-bin/startup.sh- Click Save.
(Add the user command to the User Commands slot)
Reboot your device via the web interface, or from the command line with pcp rb. Upon restart, both services should be active.
- Distorted Audio: Re-run the installer and choose a stronger attenuation level (e.g., Option 1 - 30%).
- No Audio / Connection Refused: Check the logs to see if Snapclient is connecting to the correct IP:
tail -f /tmp/snapclient.log- "Device Busy" Error: This means one of the services (Squeezelite or Snapclient) is still trying to use
hw:(exclusive mode). Ensure both are configured to use thedmixdevice. - Shairport doesn't start or is silent: There's a config page where the audio output device is set. Try setting it to a dmix device.
The installer performs these operations:
- Architecture Detection: Identifies the CPU architecture (armhf or arm64) to download the correct Snapcast binary.
- Dependency Resolution: Installs required TinyCore extensions (FLAC, Vorbis, Opus, SoXR, Avahi) from the pCP repository or upstream TinyCore repos.
- Binary Extraction: Downloads the official Debian package from the Snapcast releases and extracts the client binary.
- Audio Configuration: Creates an ALSA configuration file (
~/.asoundrc) that applies digital volume attenuation to prevent clipping when mixing multiple audio streams. - Persistence: Adds the binary and configuration to pCP's backup list so they survive reboots.
- Startup Script: Generates a wrapper script for boot-time execution via pCP's User Commands feature.
This project was developed using the following documentation:
- Snapcast Official Repository
- Music Assistant Stream-to FAQ
- ESP32 Snapclient
- Arduino and ESP32 Snapclient
- PiCorePlayer Official Website
- Getting Started Guide
- Backup & Restore
- DIY Extensions / Boot Scripts
- Editing config.txt
- Extension Repository (15.x aarch64)
This installer was developed from scratch for PiCorePlayer 10.x, with reference to prior work by:
This project is being used to test a complex home audio setup with many open source devices. It might make sense to turn it into an integrated pCP extension in the future. If anyone is interested in helping with this, please let me know.
There's more work to do on volume control and mixing, and Music Assistant has stability issues with Shairport Sync.
Pull requests are welcome. For significant changes, please open an issue first to discuss the proposed changes.
This project is provided as-is for community use.

