shairport-sync [-djvuw] [-a name] [-A latency] [-B command] [-c configurationfile] [-E command] [--get-cover-art] [--logOutputLevel] [-L latency] [-m backend] [--meta-dir=directory] [-o backend] [--password=secret] [-r threshold] [--statistics] [-S mode] [-t timeout] [--tolerance=frames] [-- audio_backend_options] shairport-sync -k shairport-sync -h shairport-sync -V

Shairport Sync plays audio streamed from iTunes or from an AirPlay device to an ALSA-compatible audio output device (available on Linux and FreeBSD), to a "sndio" output device (available on OpenBSD, FreeBSD and Linux), to a PulseAudio output stream or to Jack Audio.

Shairport Sync offers full audio synchronisation. Full audio synchronisation means that audio is played on the output device at exactly the time specified by the audio source. This means that if many devices are playing the same stream at the same time, all the outputs will stay in synchrony with one another. This allows multiple devices to play the same source without getting out of step with one another, enabling, for example, simultaneous multi-room operation.

Shairport Sync can stream synchronised audio to a unix pipe or to standard output, or to audio systems that do not provide timing information. This could perhaps be described as partial audio synchronisation, where synchronised audio is provided by Shairport Sync, but what happens to it in the subsequent processing chain, before it reaches the listener's ear, is outside the control of shairport-sync.

Shairport Sync can be compiled to stream metadata, including cover art, to a pipe or socket.

Shairport Sync can be compiled to offer a standard MPRIS interface, a "native" D-Bus interface and an MQTT client interface. Through these interfaces, it can provide metadata, including cover art, and can offer remote control of the audio source.

Settings can be made using the configuration file (recommended for all new installations) or by using command-line options.

The name of the Shairport Sync executable is shairport-sync. Both names are used in these man pages.

You should use the configuration file for setting up Shairport Sync. This file is usually shairport-sync.conf and is generally located in the System Configuration Directory, which is normally the /etc directory in Linux or the /usr/local/etc directory in BSD unixes. You may need to have root privileges to modify it.

(Note: Shairport Sync may have been compiled to use a different configuration directory. You can determine which by performing the command $ shairport-sync -V. One of the items in the output string is the value of the sysconfdir, i.e. the System Configuration Directory.)

Within the configuration file, settings are organised into groups, for example, there is a "general" group of standard settings, and there is an "alsa" group with settings that pertain to the ALSA back end. Here is an example of a typical configuration file:

general = {

name = "Mike's Boombox";

password = "secret";

output_backend = "alsa";

};

alsa = {

output_device = "hw:0";

mixer_control_name = "PCM";

};

Most settings have sensible default values, so -- as in the example above -- users generally only need to set (1) the service name, (2) a password (if desired) and (3) the output device. If the output device has a mixer that can be used for volume control, then (4) the mixer name should be specified. It is important to do this if the mixer exists. Otherwise, the maximum output from the output device will be whatever setting the mixer happens to have, which will be a matter of chance and which could be very low or even silent.

A sample configuration file with all possible settings, but with all of them commented out, is installed at shairport-sync.conf.sample, within the System Configuration Directory -- /etc in Linux, /usr/local/etc in BSD unixes.

To retain backwards compatibility with previous versions of shairport-sync you can use still use command line options, but any new features, etc. will be available only via configuration file settings.

The configuration file is processed using the libconfig library -- see .

These are the settings available within the general group:

These settings are for the ALSA back end, used to communicate with audio output devices in the ALSA system. (By the way, you can use tools such as alsamixer or aplay to discover what devices are available.) Use these settings to select the output device and the mixer control to be used to control the output volume. You can additionally set the desired size of the output buffer and you can adjust overall latency. Here are the alsa group settings:

These settings are for the SNDIO back end, used to communicate with audio output devices in the SNDIO system.

These settings are for the new PulseAudio backend.

These settings are for the PIPE backend, used to route audio to a named unix pipe. The audio is in raw CD audio format: PCM 16 bit little endian, 44,100 samples per second, interleaved stereo.

There are no settings for the STDOUT backend.

There are no configuration file settings for the AO backend.

shairport-sync can process metadata provided by the source, such as Track Number, Album Name, cover art, etc. and can provide additional metadata such as volume level, pause/resume, etc. It sends the metadata to a pipe, by default /tmp/shairport-sync-metadata. To process metadata, shairport-sync must have been compiled with metadata support included. You can check that this is so by running the command $ shairport-sync -V; the identification string will contain the word metadata.

Please note that different sources provide different levels of metadata. Some provide a lot; some provide almost none.

The metadata group of settings allow you to enable metadata handling and to control certain aspects of it:

This section is about the command-line options available in shairport-sync.

Note: if you are setting up shairport-sync for the first time or are updating an existing installation, you are encouraged to use the configuration file settings described above. Most of the command-line options described below simply replicate the configuration settings and are retained to provide backward compatibility with older installations of shairport-sync.

Many command-line options take sensible default values, so you can normally ignore most of them. See the EXAMPLES section for typical usages.

There are two kinds of command-line options for shairport-sync: regular program options and audio backend options. Program options are always listed first, followed by any audio backend options, preceded by a -- symbol.

These command-line options are used by shairport-sync itself.

These command-line options are passed to the chosen audio backend. The audio backend options are preceded by a -- symbol to introduce them and to separate them from any program options. In this way, option letters can be used as program options and also as audio backend options without ambiguity.

In the ALSA backend, audio is sent to an output device which you can specify using the -d option. The output level (the "volume") is controlled using a level control associated with a mixer. By default, the mixer is implemented in shairport-sync itself in software. To use a hardware level control on a mixer on the sound card, specify the name of the mixer control with the -c option. If the mixer is not associated with the output device, then you need to specify where the mixer is to be found with the -m option.

Here is a slightly contrived example:

shairport-sync -d -a "Joe's Stereo" -S soxr -- -d hw:1,0 -m hw:1 -c PCM

The program will run in daemon mode ( -d ), will be visible as "Joe's Stereo" ( -a "Joe's Stereo" ) and will use the SoX Resampler Library-based stuffing ( -S soxr ). The audio backend options following the -- separator specify that the audio will be output on output 0 of soundcard 1 ( -d hw:1,0 ) and will take advantage of the same sound card's mixer ( -m hw:1 ) using the level control named "PCM" ( -c "PCM" ).

The example above is slightly contrived in order to show the use of the -m option. Typically, output 0 is the default output of a card, so the output device could be written -d hw:1 and then the mixer option would be unnecessary, giving the following, simpler, command:

shairport-sync -d -a "Joe's Stereo" -S soxr -- -d hw:1 -c PCM

Mike Brady developed shairport-sync from the original Shairport by James Laird.

shairport-sync can be found at

Shairport can be found at

This man page was written using by Oliver Kurth.