Add a new exit handler to enable Shairport Sync to exit cleanly — that is, on exit, to clean up everything, e.g. open files, ports, sockets, devices, threads, it has been using.
If cleanup isn’t finished after one second, exit will occur unconditionally. Use the new exit handler for normal exit, for SIGINT and SIGTERM handling, for abnormal exit after fatal errors, and for handling quit requests from the D-Bus and MPRIS interfaces. When an unfixable error occurs without an installed unfixable error handler, unlock the mutex protecting Shairport Sync’s alsa backend to permit a clean exit. Fix a very low-level mutex-locking error that interfered with debugging. Simplify much mutex lock handling. Remove lots of old and unused code, variables and definitions. Update audio_sndio.c to remove some harmless compiler warnings. Undo adding two seconds for messages to be output before _Exit() on die() to allow messages to be output... Undo making die() exit unconditionally.
This commit is contained in:
@@ -21,7 +21,7 @@ general =
|
||||
// The default is "auto", which means that the AirPlay 2 service will be provided if NQPTP is present and "classic" AirPlay will be provided otherwise, with "(Classic)" appended to the service name (see above).
|
||||
// service_type = "auto"; // This can be "auto", "airplay2" or "classic".
|
||||
// The interpolation setting below controls how Shairport Sync adds or removes frames of audio to keep in sync.
|
||||
// "auto" (default) measures the processor's floating point speed and chooses "soxr" if available and it is fast enough. Otherwise, "vernier" is selected.
|
||||
// "auto" (default) measures the processor's floating point speed and chooses "soxr" if available and if the processor is fast enough. Otherwise, "vernier" is selected.
|
||||
// "vernier" recodes a packet of frames to a new packet containing more or fewer frames. This is recommended for low powered devices.
|
||||
// "soxr" uses the SoX library to recode a packet of frames to a new packet containing more or fewer frames. This needs a processor with fast floating point capability.
|
||||
// "basic" causes the simple removal or insertion of frames in a packet of frames. Not recommended.
|
||||
@@ -106,13 +106,18 @@ sessioncontrol =
|
||||
// run_this_before_play_begins = "/full/path/to/application and args"; // make sure the application has executable permission. If it's a script, include the shebang (#!/bin/...) on the first line
|
||||
// run_this_after_play_ends = "/full/path/to/application and args"; // make sure the application has executable permission. If it's a script, include the shebang (#!/bin/...) on the first line
|
||||
|
||||
// run_this_if_an_unfixable_error_is_detected = "/full/path/to/application and args"; // if a problem occurs that can't be cleared by Shairport Sync itself, hook a program on here to deal with it.
|
||||
// run_this_if_an_unfixable_error_is_detected = "/full/path/to/application and args"; // if a problem occurs that can't be cleared by Shairport Sync itself, hook a handler program on here to deal with it.
|
||||
// An error code-string is passed as the last argument.
|
||||
// Shairport Sync will always wait for this handler to complete.
|
||||
// Shairport Sync will not exit automatically after executing this handler. To exit, the handler must do it itself, perhaps via a script with "/usr/bin/kill $PPID" as its last line.
|
||||
// Many of these "unfixable" problems are caused by malfunctioning output devices, and sometimes it is necessary to restart the whole device to clear the problem.
|
||||
// You could hook on a program to do this automatically, but beware -- the device may then power off and restart without warning!
|
||||
// wait_for_completion = "no"; // set to "yes" to get Shairport Sync to wait until the "run_this..." applications have terminated before continuing
|
||||
|
||||
// allow_session_interruption = "no"; // set to "yes" to allow another device to interrupt Shairport Sync while it's playing from an existing audio source
|
||||
// wait_for_completion = "no"; // set to "yes" to get Shairport Sync to wait until the "run_this..." applications have terminated before continuing,
|
||||
// except the "run_this_if_an_unfixable_error_is_detected" handler, which will always wait for completion, irrespective of this setting.
|
||||
|
||||
// allow_session_interruption = "no"; // (Classic AirPlay only) Set to "yes" to allow another device to interrupt Shairport Sync while it's playing from an existing audio source
|
||||
|
||||
// session_timeout = 60; // wait for this number of seconds after a source disappears before terminating the session and becoming available again.
|
||||
};
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ StartLimitIntervalSec=300
|
||||
StartLimitBurst=5
|
||||
|
||||
[Service]
|
||||
ExecStart=@prefix@/bin/shairport-sync --log-to-syslog
|
||||
ExecStart=@prefix@/bin/shairport-sync
|
||||
User=shairport-sync
|
||||
Group=shairport-sync
|
||||
LimitRTPRIO=5
|
||||
|
||||
Reference in New Issue
Block a user