From: Mike Brady Date: Wed, 24 Jan 2018 11:12:29 +0000 (+0000) Subject: Add ability to diable resend request. Use a new "diagnostics" group in the configurat... X-Git-Tag: 3.2d29~97 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6aa6fd27d997ae6aa1eae8aeadc4cfec3dc8831;p=thirdparty%2Fshairport-sync.git Add ability to diable resend request. Use a new "diagnostics" group in the configuration file and move log_verbosity and statistics to it. --- diff --git a/common.h b/common.h index eac46bb6..86ea7dc1 100644 --- a/common.h +++ b/common.h @@ -179,6 +179,7 @@ typedef struct { #ifdef HAVE_METADATA_HUB char *cover_art_cache_dir; #endif + int disable_resend_requests; //set this to stop resend request being made for missing packets } shairport_cfg; diff --git a/player.c b/player.c index 5fb9351e..459a90f6 100644 --- a/player.c +++ b/player.c @@ -1159,9 +1159,11 @@ static abuf_t *buffer_get_frame(rtsp_conn_info *conn) { seq_t next = seq_sum(conn->ab_read, i); abuf = conn->audio_buffer + BUFIDX(next); if (!abuf->ready) { - rtp_request_resend(next, 1, conn); - // debug(1,"Resend %u.",next); - conn->resend_requests++; + if (config.disable_resend_requests==0) { + rtp_request_resend(next, 1, conn); + // debug(1,"Resend %u.",next); + conn->resend_requests++; + } } } } diff --git a/scripts/shairport-sync.conf b/scripts/shairport-sync.conf index 7cafd841..896ed1f9 100644 --- a/scripts/shairport-sync.conf +++ b/scripts/shairport-sync.conf @@ -19,11 +19,8 @@ general = // port = 5000; // Listen for service requests on this port // udp_port_base = 6001; // start allocating UDP ports from this port number when needed // udp_port_range = 100; // look for free ports in this number of places, starting at the UDP port base. Allow at least 10, though only three are needed in a steady state. -// statistics = "no"; // set to "yes" to print statistics in the log // drift_tolerance_in_seconds = 0.002; // allow a timing error of this number of seconds of drift away from exact synchronisation before attempting to correct it // resync_threshold_in_seconds = 0.050; // a synchronisation error greater than this number of seconds will cause resynchronisation; 0 disables it -// log_verbosity = 0; // "0" means no debug verbosity, "3" is most verbose. - // ignore_volume_control = "no"; // set this to "yes" if you want the volume to be at 100% no matter what the source's volume control is set to. // volume_range_db = 60 ; // use this advanced setting to set the range, in dB, you want between the maximum volume and the minimum volume. Range is 30 to 150 dB. Leave it commented out to use mixer's native range. // volume_max_db = 0.0 ; // use this advanced setting, which must have a decimal point in it, to set the maximum volume, in dB, you wish to use. @@ -144,3 +141,10 @@ metadata = // socket_msglength = 65000; // the maximum packet size for any UDP metadata. This will be clipped to be between 500 or 65000. The default is 500. }; +// Diagnostic settings. These are for diagnostic and debugging only. Normally you sould leave them commented out +diagnostics = +{ +// disable_resend_requests = "no"; // set this to yes to stop Shairport Sync from requesting the retransmission of missing packets. Default is "no". +// statistics = "no"; // set to "yes" to print statistics in the log +// log_verbosity = 0; // "0" means no debug verbosity, "3" is most verbose. +}; diff --git a/shairport.c b/shairport.c index 5de5f940..99df5cc1 100644 --- a/shairport.c +++ b/shairport.c @@ -508,6 +508,7 @@ int parse_options(int argc, char **argv) { /* Get the statistics setting. */ if (config_lookup_string(config.cfg, "general.statistics", &str)) { + warn("The \"general\" \"statistics\" setting is deprecated. Please use the \"diagnostics\" \"statistics\" setting instead."); if (strcasecmp(str, "no") == 0) config.statistics_requested = 0; else if (strcasecmp(str, "yes") == 0) @@ -540,6 +541,7 @@ int parse_options(int argc, char **argv) { /* Get the verbosity setting. */ if (config_lookup_int(config.cfg, "general.log_verbosity", &value)) { + warn("The \"general\" \"log_verbosity\" setting is deprecated. Please use the \"diagnostics\" \"log_verbosity\" setting instead."); if ((value >= 0) && (value <= 3)) debuglev = value; else @@ -548,6 +550,40 @@ int parse_options(int argc, char **argv) { value); } + /* Get the verbosity setting. */ + if (config_lookup_int(config.cfg, "diagnostics.log_verbosity", &value)) { + if ((value >= 0) && (value <= 3)) + debuglev = value; + else + die("Invalid diagnostics log_verbosity setting option choice \"%d\". It should be between 0 and 3, " + "inclusive.", + value); + } + + /* Get the statistics setting. */ + if (config_lookup_string(config.cfg, "diagnostics.statistics", &str)) { + if (strcasecmp(str, "no") == 0) + config.statistics_requested = 0; + else if (strcasecmp(str, "yes") == 0) + config.statistics_requested = 1; + else + die("Invalid diagnostics statistics option choice \"%s\". It should be \"yes\" or \"no\""); + } + + + /* Get the disable_resend_requests setting. */ + if (config_lookup_string(config.cfg, "diagnostics.disable_resend_requests", &str)) { + config.disable_resend_requests = 0; // this is for legacy -- only set by -t 0 + if (strcasecmp(str, "no") == 0) + config.disable_resend_requests = 0; + else if (strcasecmp(str, "yes") == 0) + config.disable_resend_requests = 1; + else + die("Invalid diagnostic disable_resend_requests option choice \"%s\". It should be " + "\"yes\" " + "or \"no\""); + } + /* Get the ignore_volume_control setting. */ if (config_lookup_string(config.cfg, "general.ignore_volume_control", &str)) { if (strcasecmp(str, "no") == 0) @@ -1397,6 +1433,7 @@ int main(int argc, char **argv) { #endif debug(1, "loudness is %d.", config.loudness); debug(1, "loudness reference level is %f", config.loudness_reference_volume_db); + debug(1, "disable resend requests is %d -- non-zero means \"yes\"", config.disable_resend_requests); uint8_t ap_md5[16];