From b76e9ba4be538e2456ef7130baa4e1b435ac4ba5 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Tue, 20 Sep 2016 15:17:28 +0100 Subject: [PATCH 1/3] Add client IP metadata item -- the IP of the client, i.e. the sender of audio, is output when a pley session is about to start, as a 'ssnc' 'clip' string. Also, stop asking for buffer size if sync is disabled. --- audio_alsa.c | 4 ++++ rtsp.c | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/audio_alsa.c b/audio_alsa.c index ad5b0c74..0e9de51c 100644 --- a/audio_alsa.c +++ b/audio_alsa.c @@ -386,6 +386,10 @@ int open_alsa_device(void) { // snd_pcm_uframes_t frames = 441 * 10; snd_pcm_uframes_t buffer_size, actual_buffer_length; snd_pcm_access_t access; + + // ensure no calls are made to the alsa device enquiring about the buffer length if synchronisation is disabled. + if (config.no_sync!=0) + audio_alsa.delay = NULL; ret = snd_pcm_open(&alsa_handle, alsa_out_dev, SND_PCM_STREAM_PLAYBACK, 0); if (ret < 0) diff --git a/rtsp.c b/rtsp.c index d2c71497..feb11c27 100644 --- a/rtsp.c +++ b/rtsp.c @@ -967,6 +967,9 @@ static void handle_set_parameter_parameter(rtsp_conn_info *conn, // string to identify the source's remote control on the network. // 'acre' -- this is the source's Active-Remote token, necessary if you want // to send commands to the source's remote control (if it has one). +// `clip` -- the payload is the IP number of the client, i.e. the sender of audio. +// Can be an IPv4 or an IPv6 number. + // // including a simple base64 encoder to minimise malloc/free activity @@ -1950,6 +1953,10 @@ void rtsp_listen_loop(void) { sa = (struct sockaddr_in*)&conn->remote; inet_ntop(AF_INET, &(sa->sin_addr), remote_ip4, INET_ADDRSTRLEN); unsigned short int rport = ntohs(sa->sin_port); +#ifdef CONFIG_METADATA + send_ssnc_metadata('clip', strdup(ip4), strlen(ip4) , 1); +#endif + debug(1,"New RTSP connection from %s:%u to self at %s:%u.",remote_ip4,rport,ip4,tport); } #ifdef AF_INET6 @@ -1965,7 +1972,9 @@ void rtsp_listen_loop(void) { sa6 = (struct sockaddr_in6*)&conn->remote; // pretend this is loaded with something inet_ntop(AF_INET6, &(sa6->sin6_addr), remote_ip6, INET6_ADDRSTRLEN); u_int16_t rport = ntohs(sa6->sin6_port); - +#ifdef CONFIG_METADATA + send_ssnc_metadata('clip', strdup(ip6), strlen(ip6), 1); +#endif debug(1,"New RTSP connection from [%s]:%u to self at [%s]:%u.",remote_ip6,rport,ip6,tport); } #endif From fd8d5501a573ac01eecb6447550385bbb745168d Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Tue, 20 Sep 2016 15:18:41 +0100 Subject: [PATCH 2/3] Add client IP metadata item -- the IP of the client, i.e. the sender of audio, is output when a pley session is about to start, as a 'ssnc' 'clip' string. Also, stop asking for buffer size if sync is disabled. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 629ce995..32aacb2d 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.50]) -AC_INIT([shairport-sync], [2.8.4.7], [mikebrady@eircom.net]) +AC_INIT([shairport-sync], [2.8.4.8], [mikebrady@eircom.net]) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([shairport.c]) AC_CONFIG_HEADERS([config.h]) From a56d103ee8a443221722f2267e76d60977965aff Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Tue, 20 Sep 2016 15:26:19 +0100 Subject: [PATCH 3/3] Update RELEASENOTES.md --- RELEASENOTES.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 63cd78d8..13e6f2af 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,3 +1,9 @@ +Version 2.8.4.8 – Development Version +---- +**Enhancements** +* Add a new metadata item `clip` (for `CL`ient `IP`). This item is a string comprising the IP number of the "client", and is sent when a play session is starting. The "client" is the sender of the audio stream, e.g. iTunes on a Mac, or the Music player in iOS. +* When synchronisation has been disabled on the ALSA device (you should only do this for testing), Shairport Sync now refrains from asking for buffer length information from the device. + Version 2.8.4.7 – Development Version ---- Pesky Changes You Cannot Ignore