Skip to content

M0Rf30/rmpd

Repository files navigation

rmpd

CI Security License

rmpd is a modern, high-performance, memory-safe music server written in pure Rust. It aims for 100% compatibility with the Music Player Daemon (MPD) protocol while providing first-class extensibility through a plugin architecture.

Features

  • 🎡 MPD Protocol Compatible - Works with existing MPD clients (ncmpcpp, mpc, Cantata)
  • πŸ¦€ Pure Rust - Memory-safe, fast, and reliable
  • πŸ”Œ Extensible - Plugin system for decoders, outputs, and inputs
  • 🎧 High-Quality Audio - DSD support, ReplayGain, gapless playback, crossfade
  • 🎼 Format Support - FLAC, MP3, Ogg Vorbis, WAV, AAC, DSD (DoP and native)
  • 🏠 Multi-Room Ready - Snapcast integration for synchronized playback
  • πŸ“± Multi-Protocol - MPD and OpenSubsonic support (planned)
  • ⚑ Efficient - Runs on everything from Raspberry Pi to high-end servers

Architecture

rmpd/
β”œβ”€β”€ rmpd/               # Main binary
β”œβ”€β”€ rmpd-core/          # Core types and traits
β”œβ”€β”€ rmpd-protocol/      # MPD protocol implementation
β”œβ”€β”€ rmpd-player/        # Audio playback engine
β”œβ”€β”€ rmpd-library/       # Music library/database
β”œβ”€β”€ rmpd-plugin/        # Plugin system
└── rmpd-stream/        # Streaming support

Quick Start

Prerequisites

System dependencies:

# Ubuntu/Debian
sudo apt-get install libasound2-dev pkg-config

# macOS
brew install pkg-config

Build

cargo build --release

Run

./target/release/rmpd --bind 127.0.0.1 --port 6600 --music-dir ~/Music

Test with mpc

# Check status
mpc status

# Update library
mpc update

# Add and play music
mpc add /
mpc play

Configuration

Create ~/.config/rmpd/rmpd.toml:

[general]
music_directory = "~/Music"
playlist_directory = "~/.config/rmpd/playlists"
db_file = "~/.config/rmpd/database.db"
log_level = "info"

[network]
bind_address = "127.0.0.1"
port = 6600

[audio]
default_output = "alsa"
gapless = true
replay_gain = "auto"
buffer_time = 500

[[output]]
name = "ALSA Output"
type = "alsa"
enabled = true
device = "default"

[[output]]
name = "Snapcast Output"
type = "snapcast"
enabled = false
fifo_path = "/tmp/snapfifo"

See rmpd.toml for a complete configuration example.

Audio Format Support

Supported Formats

  • Lossless: FLAC, WAV, ALAC, APE, WavPack, TrueAudio
  • Lossy: MP3, Ogg Vorbis, Opus, AAC, MP4
  • High-Resolution: DSD (DSF, DFF) with DoP and native playback
  • Streaming: HTTP streams, Icecast, internet radio

DSD Support

rmpd includes comprehensive DSD support:

  • DSD64, DSD128, DSD256 and higher sample rates
  • DoP (DSD over PCM) for wider DAC compatibility
  • Native DSD playback for compatible hardware
  • Automatic format detection and conversion

Development

Running Tests

cargo test --workspace --all-features

Linting

# Format code
cargo fmt

# Run clippy
cargo clippy --workspace --all-targets --all-features

CI/CD

This project uses GitHub Actions for CI/CD with:

  • Multi-platform testing (Ubuntu, macOS)
  • Multi-architecture builds (x86_64, ARM64)
  • Strict linting with Clippy
  • Security audits with cargo-audit and cargo-deny
  • Code coverage reporting
  • Automated dependency updates via Renovate

See CI.md for detailed CI/CD documentation.

Current Status

Implemented βœ…

  • Core Infrastructure

    • MPD protocol server (TCP/Unix sockets)
    • Event bus system
    • Configuration management
    • Logging with tracing
  • Audio Playback

    • Multi-format decoding (FLAC, MP3, Vorbis, WAV, AAC, DSD)
    • High-rate DSD support (DSD128, DSD256+)
    • Multiple output types (ALSA, PulseAudio, PipeWire)
    • Gapless playback
    • ReplayGain support
  • Library Management

    • Filesystem scanning
    • SQLite database
    • Metadata extraction with lofty
    • Full-text search with tantivy
    • Album art support
  • MPD Protocol

    • Core playback commands (play, pause, stop, seek)
    • Queue management (add, delete, move, shuffle)
    • Database queries (find, search, list)
    • Status and statistics
    • Playlist management
    • Output control

In Progress 🚧

  • Advanced playback features (crossfade, MixRamp)
  • Plugin system
  • Snapcast integration
  • Complete MPD protocol coverage
  • OpenSubsonic support

Compatibility

Tested MPD Clients

  • βœ… mpc - Command-line client
  • βœ… ncmpcpp - TUI client
  • βœ… Cantata - Qt GUI client
  • βœ… rmpc - Modern TUI client
  • 🚧 MPDroid - Android client (testing in progress)
  • 🚧 MPDluxe - iOS client (testing in progress)

Multi-Room Audio

  • 🚧 Snapcast - Synchronous multi-room playback (integration in progress)

Performance

rmpd is designed for efficiency:

  • Startup time: < 500ms with 100k song library
  • Memory usage: < 20MB idle, < 150MB with 100k songs loaded
  • CPU usage: < 5% during FLAC playback
  • MSRV: Rust 1.75.0+

Project Goals

  1. 100% MPD Compatibility - Drop-in replacement for MPD
  2. Modern Architecture - Clean, modular, testable code
  3. Extensibility - Plugin system for community contributions
  4. Performance - Efficient resource usage
  5. Multi-Protocol - MPD, OpenSubsonic support

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes with tests
  4. Run cargo fmt and cargo clippy
  5. Submit a pull request

See CI.md for development guidelines and CI/CD information.

License

Licensed under either of:

at your option.

Acknowledgments

Links

About

Modern, high-performance MPD (Music Player Daemon) server written in pure Rust with DSD support, multi-room audio, and extensible plugin architecture

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages