A high-performance Rust CLI audio player that connects to Music Assistant and plays synchronized audio using the Sendspin protocol.
- π΅ Synchronized Audio Playback - Time-synced playback across multiple players
- π Automatic Server Discovery - Zero-config setup using mDNS service discovery
- ποΈ Volume Control - Software-based volume scaling (0-100)
- β―οΈ Playback Control - Stop, resume, and skip commands
- π Cross-Platform Audio - Uses CPAL for Linux, macOS, and Windows support
- π¦ Lightweight - Minimal dependencies, fast startup time
- π§΅ Multi-threaded - Separate threads for network and audio output
Download the latest release for your platform from the releases page:
- Linux AMD64:
sendspin-rs-cli-linux-amd64 - Linux ARM64:
sendspin-rs-cli-linux-arm64 - macOS Intel:
sendspin-rs-cli-darwin-amd64 - macOS Apple Silicon:
sendspin-rs-cli-darwin-arm64 - Windows:
sendspin-rs-cli-windows-amd64.exe
# Example installation (Linux AMD64)
wget https://github.com/s3than/sendspin-rs-cli/releases/latest/download/sendspin-rs-cli-linux-amd64
chmod +x sendspin-rs-cli-linux-amd64
sudo mv sendspin-rs-cli-linux-amd64 /usr/local/bin/sendspin-rs-cli
# Verify installation
sendspin-rs-cli --versionRequirements:
- Rust 1.92 or later
- ALSA development libraries (Linux only):
libasound2-dev
# Clone the repository
git clone https://github.com/s3than/sendspin-rs-cli.git
cd sendspin-rs-cli
# Build release binary
cargo build --release
# Binary will be at: target/release/sendspin-rs-cli# Auto-discover server via mDNS (recommended)
sendspin-rs-cli
# Specify server manually
sendspin-rs-cli --server 192.168.1.100:8927
# Custom player name and volume
sendspin-rs-cli --name "Living Room" --volume 50Options:
-s, --server <SERVER> Server address (host:port). If not specified, uses mDNS discovery
-n, --name <NAME> Player name [default: "Sendspin-RS Player"]
--client-id <CLIENT_ID> Custom client ID (auto-generated if not specified)
-v, --volume <VOLUME> Initial volume (0-100) [default: 30]
-b, --buffer <BUFFER> Buffer size in milliseconds [default: 20]
-h, --help Print help
--version Print version
Auto-discovery (zero-config):
sendspin-rs-cliSpecify server address:
sendspin-rs-cli --server 192.168.1.100:8927Custom player configuration:
sendspin-rs-cli \
--name "Bedroom Speaker" \
--volume 75 \
--server 192.168.1.100:8927Enable debug logging:
RUST_LOG=debug sendspin-rs-cliβββββββββββββββββββ
β Music Assistantβ
β Server β
ββββββββββ¬βββββββββ
β WebSocket (Sendspin Protocol)
β
ββββββββββΌβββββββββ
β sendspin-rs-cliβ
β β
β βββββββββββββ β
β β Decoder β β
β βββββββ¬ββββββ β
β β β
β βββββββΌββββββ β
β β Queue β β
β βββββββ¬ββββββ β
β β β
β βββββββΌββββββ β
β βTime Sync β β
β βββββββ¬ββββββ β
β β β
β βββββββΌββββββ β
β β CPAL β β
β β Output β β
β βββββββββββββ β
βββββββββββββββββββ
β
βΌ
π Speakers
-
mDNS Discovery: Automatically finds Music Assistant servers on the local network using mDNS (
_sendspin-server._tcp.local.) -
Time Synchronization: Uses NTP-style clock sync to ensure audio plays at the exact right time across multiple players
-
Simple Queue: Audio buffers are decoded and queued with timestamps, then played at the precise moment
-
Protocol Compatibility: Includes a compatibility shim to handle protocol differences between the sendspin-rs library and Music Assistant server
# Run all tests
cargo test
# Run with verbose output
cargo test -- --nocapture
# Run specific test
cargo test test_player_creation
# Generate coverage report
cargo tarpaulin --lib --exclude-files 'target/*'Current test coverage: 49.62% (65/131 lines)
The project uses GitHub Actions to build binaries for multiple platforms:
# Native build (current platform)
cargo build --release
# Cross-compile for ARM64 Linux (requires cross)
cross build --release --target aarch64-unknown-linux-gnu
# Cross-compile for Windows (requires cross)
cross build --release --target x86_64-pc-windows-gnusendspin-rs-cli/
βββ src/
β βββ main.rs # Entry point and protocol handling
β βββ player.rs # Audio playback and queue management
β βββ mdns.rs # mDNS server discovery
β βββ compat.rs # Protocol compatibility shim
β βββ lib.rs # Library exports for testing
βββ tests/
β βββ integration_test.rs # Integration tests
βββ Cross.toml # Cross-compilation configuration
βββ rust-toolchain.toml # Rust toolchain specification
βββ .github/
βββ workflows/
βββ build.yml # CI/CD pipeline
If mDNS discovery fails, manually specify the server address:
sendspin-rs-cli --server <server-ip>:8927Make sure ALSA libraries are installed:
sudo apt-get install libasound2-devEnsure the binary has execute permissions:
chmod +x sendspin-rs-cli- PCM: Uncompressed audio (16-bit, 24-bit)
- Sample rates: 44.1kHz, 48kHz, 96kHz, etc.
- Channels: Mono, Stereo, Multi-channel
The player implements the Sendspin protocol for communicating with Music Assistant:
- Transport: WebSocket over TCP
- Serialization: JSON messages
- Clock Sync: NTP-style time synchronization
- Audio: Chunked streaming with timestamps
Major dependencies:
- sendspin-rs: Core Sendspin protocol implementation
- tokio: Async runtime
- cpal: Cross-platform audio I/O
- tokio-tungstenite: WebSocket client
- mdns-sd: mDNS service discovery
- clap: Command-line argument parsing
Contributions are welcome! Please feel free to submit issues or pull requests.
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/sendspin-rs-cli.git - Create a feature branch:
git checkout -b feature/your-feature - Make your changes and add tests
- Run tests:
cargo test - Run clippy:
cargo clippy -- -D warnings - Run formatter:
cargo fmt - Commit your changes:
git commit -am 'Add new feature' - Push to the branch:
git push origin feature/your-feature - Create a Pull Request
This project is licensed under the Apache License - see the LICENSE file for details.
- Music Assistant - The music management system this player connects to
- sendspin-rs - Core Sendspin protocol library * currently a forked library with various forks from the upstream merged in advanced.
- cpal - Cross-platform audio library
- GitHub Repository: https://github.com/s3than/sendspin-rs-cli
- Music Assistant: https://music-assistant.io/
- Sendspin Protocol: https://github.com/s3than/sendspin-rs