| shairport-sync(1) | General Commands Manual | shairport-sync(1) |
shairport-sync - AirPlay and AirPlay 2 Audio Player
shairport-sync [-djvw] [-a service-name | --name=service-name] [-B command | --onstart=command] [-c configurationfile | --configfile=configurationfile] [-d | --daemon] [-E command | --onstop=command] [-g | --get-cover-art] [-j | --justDaemoniseNoPIDFile] [--logOutputLevel] [--log-to-syslog] [-L latency | --latency=latency] [-m backend | --mdns=backend] [-M | --metadata-enable] [-o backend | --output=backend] [-p port | --port=port] [--password=secret] [-r threshold | --resync=threshold] [--statistics] [-S mode | --stuffing=mode] [-t timeout | --timeout=timeout] [--tolerance=frames] [-v | --verbose] [-w | --wait-cmd] [-- audio_backend_options]
shairport-sync -X | --displayConfig
shairport-sync -h
shairport-sync -k
shairport-sync -V
Shairport Sync plays AirPlay audio. It can be built to stream either from "classic" AirPlay (aka "AirPlay 1") or from AirPlay 2 devices.
AirPlay 2 support is limited, and AirPlay 2 from iTunes for Windows is not supported. For AirPlay 2 operation, a companion program called nqptp must be installed.
Please see https://github.com/mikebrady/shairport-sync for details.
The name of the Shairport Sync executable is shairport-sync.
You should use the configuration file for setting up Shairport Sync because -- apart from a few special-purpose commands -- it has a much richer set of options than are available on the command line. 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. The last item 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";
};
alsa = {
output_device = "hw:0";
mixer_control_name = "PCM";
};
Users generally only need to set (1) the service name and (2) the output device. If the name setting is omitted, the service name is derived from the system's hostname. By default, the ALSA backend will be chosen if included in the build. If the (alsa) output device has a mixer that can be used for volume control, then (3) 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.
The sample configuration file includes extensive documentation of the settings. and is also available at https://github.com/mikebrady/shairport-sync/blob/master/scripts/shairport-sync.conf. Please refer to it for the most up-to-date information on configuration file settings.
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.
See the EXAMPLES section for sample usages.
Program Options are used by shairport-sync itself.
The following substitutions are allowed: %h for the computer's hostname, %H for the computer's hostname with the first letter capitalised (ASCII only), %v for the shairport-sync version number, e.g. "3.0.1" and %V for the shairport-sync version string, e.g. "3.0.1-OpenSSL-Avahi-ALSA-soxr-metadata-sysconfdir:/etc".
The default is "%H", which is replaced by the hostname with the first letter capitalised.
If you want shairport-sync to wait until the command has completed before starting to play, select the -w option as well.
If you want shairport-sync to wait until the command has completed before continuing, select the -w option as well.
See also --displayConfig.
Please note that this feature is deprecated and will be removed in a future version of shairport-sync.
When shairport-sync plays an audio stream, it starts a play session and will return a busy signal to any other sources that attempt to use it. If the audio stream disappears for longer than timeout seconds, the play session will be terminated. If you specify a timeout time of 0, shairport-sync will never signal that it is busy and will not prevent other sources from "barging in" on an existing play session. The default value is 120 seconds.
If this is the only option on the command line, shairport-sync will terminate after displaying the information.
Audio Backend Options are command-line options that are passed to the chosen audio backend. They are always preceded by the -- symbol to introduce them and to separate them from any preceding program options. In this way, option letters can be used as program options and reused as audio backend options without ambiguity.
Audio backends are listed with their corresponding Audio Backend Options in the help text provided by the help (-h or --help) option.
Here is a slightly contrived example:
shairport-sync -a "Joe's Stereo" -o alsa -- -d hw:1,0 -m hw:1 -c PCM
The program will be visible as "Joe's Stereo" ( -a "Joe's Stereo" ). The program option -o alsa specifies that the alsa backend be used, thus that audio should be output into the ALSA audio subsystem. The audio backend options following the -- separator are passed to the alsa backend and specify that the audio will be output on subdevice 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: Firstly, if the alsa backend has been included in the build, it will be the default, so it doesn't need to be specified and the -o alsa option could be omitted. Secondly, subdevice 0 is the default for a soundcard, so the output device could simply be written -d hw:1. Thirdly, when a mixer name is given ( -c "PCM" ), the default is that the mixer is on the output device, so the -m hw:1 is unnecessary here. Using these defaults and simplifications gives the following command:
shairport-sync -a "Joe's Stereo" -- -d hw:1 -c PCM
Mike Brady (https://github.com/mikebrady) developed Shairport Sync from Shairport by James Wah (https://github.com/abrasive).
This man page was written using xml2man(1) by Oliver Kurth.
| User | Manuals |