The design of the Reveille music protocol encompasses 3 pieces of functionality:
Central catalog and dispatch of music requests (gunnyd)
There can be multiple instances of daemons #1 and #3 that are dispatched by a single instance of #2:
┌───────┐ ┌───────────┐
| flakd ├─────────────┤ coxswaind │
└───────┘ └───────────┘
| ╲ ╱ |
| ╲ ╱ |
| ┌────────┐ ┌───────┐
| | gunnyd ├──────┤ flakd |
| └────────┘ └───────┘
| ╲ |
| ╲ |
| ┌───────────┐
└──────────────────┤ coxswaind |
└───────────┘
The flakd daemon scans a given set of directories for music files and submits the metadata to the gunnyd daemon for indexing. It waits for requests for the contents of specific music files from the coxswaind daemon.
The gunnyd daemon is the central hub responsible for cataloging music files from the flakd daemon, dispatching music search requests and pub/sub events from the coxswaind daemon (such as playback begin/pause/end).
The coxswaind daemon is the one most users will interact with the most. It is responsible for submitting search requests to the gunnyd daemon, submitting requests for file data to the flakd daemon and actually playing back music files to the local soundcard. It runs in the background, and the user submits commands to it via the coxswain CLI script.