Updates made in the branch.

This commit is contained in:
Mike Brady
2022-10-05 09:46:41 +01:00
3 changed files with 42 additions and 12 deletions
+10 -4
View File
@@ -1,8 +1,14 @@
## Events
Shairport Sync can run programs just before it starts to play an audio stream and just after it finishes.
You specify them using the `sessioncontrol` group settings `run_this_before_play_begins` and `run_this_after_play_ends`.
This is to facilitate situations where something has to be done before and after playing, e.g. switching on an amplifier beforehand
and switching it off afterwards.
Shairport Sync can run programs when certain "events" occur. The events are:
1. When Shairport Sync become `active` or `inactive`. Shairport Sync is normally in the `inactive` state when no audio is being played. When audio is sent to Shairport Sync, it will transition from `inactive` to `active`. When the audio stops, Shairport Sync will start a timer. If audio restarts before the timer reaches the value of the `active_state_timeout` configuration setting (10 seconds by default), Shairport Sync will stay `active`. However, if no more audio is received before the timer reaches the `active_state_timeout` value, Shairport Sync will transition to `inactive`. The overall effect of this is that Shairport Sync will go `active` when a track is played and will stay active in the interval between tracks, so long as the interval is less than the `active_state_timeout`.
1. Set the `run_this_before_entering_active_state` setting to the full path name to the program to run before Shairport Sync goes `active`.
2. Set the `run_this_after_exiting_active_state` setting to the full path name to the program to run after Shairport Sync goes `inactive`.
3. Set the `active_state_timeout` setting to the maximum amount of time to wait for play to resume before going `inactive`.
3. When audio starts and stops playing.
1. Set the `run_this_before_play_begins` setting to the full path name to the program to run just before Shairport Sync starts playing.
2. Set the `run_this_after_play_ends` setting to the full path name to the program to run after Shairport Sync stops playing.
5. When the volume is adjusted. Shairport Sync can run a program whenever the volume is set or changed. You specify the full path name to the program to run using the `general` group setting `run_this_when_volume_changes`.
Set the `wait_for_completion` value to `"yes"` for Shairport Sync to wait until the respective commands have been completed before continuing.
Note that the full path to the programs must be specified, and script files will not be executed unless they are marked as executable
+21 -1
View File
@@ -1,3 +1,23 @@
Version 4.1-dev-604-gf96fa2f7
====
**Bug Fix**
* If the D-Bus interface was enabled, each change in volume control was calling the volume event hook twice. Fixed.
Version 4.1-dev-601-g98744211
====
**Bug Fix**
* Recent versions of Shairport Sync have a "heartbeat" checker, to try to determine when the client has stopped running without warning -- typically when it has gone to sleep. Unfortunately, it interferes with some non-Apple clients, so it has been disabled in this update.
Version 4.1-dev-599-g2bc62c7d
====
**Enhancements**
* Added some GitHub Actions to test different combinations of builds -- hopefully the result will be fewer bugs. Thanks to [Charles Omer](https://github.com/charlesomer) for the inspiration to try these in the first place.
**Bug Fixes**
* Fixed a bug where the DAC was not closed after the active timeout when the `alsa` `disable_standby_mode` was set to `"auto"`. Thanks to [Tim Curtis](https://github.com/moodeaudio) for an exemplary [bug report](https://github.com/mikebrady/shairport-sync/issues/1546).
* Fixed a couple of bugs (found with GitHub Actions) in the installers on both `systemd` and System V systems.
Version 4.1-dev-551-g30aaabc4
====
**Update**
@@ -8,7 +28,7 @@ Version 4.1-dev-551-g30aaabc4
Version 4.1-dev-548-g7dc077e2
====
* Removed the workaround for the apparent bug in AirPlay 2 Buffered Streams in iOS 16.0. A number of approaches were tried. The most aurally successful is left in the code but is disabled. Basically, it delays the timing of the frames following the 2,122 frame discontinuity by 2,112 frames. This eliminates the timing discontinuity but delays the AirPlay stream by 47.9 ms, and this can be heard in some situations. So it looks as if the bug -- if that's what it is -- can't easily be worked around. It has not been fixed by iOS 16.0.2, unfortunately.
* Removed the workaround for the apparent bug in AirPlay 2 Buffered Streams in iOS 16.0. A number of approaches were tried. The most aurally successful is left in the code but is disabled. Basically, it delays the timing of the frames following the 2,112 frame discontinuity by 2,112 frames. This eliminates the timing discontinuity but delays the AirPlay stream by 47.9 ms, and this can be heard in some situations. So it looks as if the bug -- if that's what it is -- can't easily be worked around. It has not been fixed by iOS 16.0.2, unfortunately.
Version 4.1-dev-543-g24f06b81
====
+11 -7
View File
@@ -1275,7 +1275,9 @@ void clear_ptp_clock() {
ssize_t read_from_rtsp_connection(rtsp_conn_info *conn, void *buf, size_t count) {
// first try to read with a timeout, to see if there is any traffic...
ssize_t response = timed_read_from_rtsp_connection(conn, 10000000000L, buf, count);
// ssize_t response = timed_read_from_rtsp_connection(conn, 20000000000L, buf, count);
// actually don't use a timeout -- OwnTone doesn't supply regular traffic.
ssize_t response = timed_read_from_rtsp_connection(conn, 0, buf, count);
if ((response == -1) && ((errno == EAGAIN) || (errno == EWOULDBLOCK))) {
if (conn->rtsp_link_is_idle == 0) {
debug(1, "Connection %d: RTSP connection is idle.", conn->connection_number);
@@ -3536,14 +3538,16 @@ void handle_set_parameter_parameter(rtsp_conn_info *conn, rtsp_message *req,
debug(2, "Connection %d: request to set AirPlay Volume to: %f.", conn->connection_number,
volume);
// if we are playing, go ahead and change the volume
lock_player();
config.airplay_volume = volume;
if (playing_conn == conn)
player_volume(volume, conn);
unlock_player();
#ifdef CONFIG_DBUS_INTERFACE
if (dbus_service_is_running()) {
shairport_sync_set_volume(shairportSyncSkeleton, config.airplay_volume);
shairport_sync_set_volume(shairportSyncSkeleton, volume);
} else {
#endif
lock_player();
if (playing_conn == conn)
player_volume(volume, conn);
unlock_player();
#ifdef CONFIG_DBUS_INTERFACE
}
#endif
} else if (strncmp(cp, "progress: ", strlen("progress: ")) ==