]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Add ability to diable resend request. Use a new "diagnostics" group in the configurat...
authorMike Brady <mikebrady@eircom.net>
Wed, 24 Jan 2018 11:12:29 +0000 (11:12 +0000)
committerMike Brady <mikebrady@eircom.net>
Wed, 24 Jan 2018 11:12:29 +0000 (11:12 +0000)
common.h
player.c
scripts/shairport-sync.conf
shairport.c

index eac46bb620a7f9c23e4a0c060065831358585758..86ea7dc17bc0ae74fa66c6b64727b319c71c740f 100644 (file)
--- 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;
 
index 5fb9351e61bd872de6b01aa935c7c6413e5b58cb..459a90f6a7015b0b22e448bbf58fcfbb1d8a10d5 100644 (file)
--- 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++;
+        }
       }
     }
   }
index 7cafd84126db58ee929060a280eb9176856ebbe6..896ed1f90f4fbf89f8bcdb48a3e8e571ff022168 100644 (file)
@@ -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.
+};
index 5de5f9402450f60e608936cb4befaf7b074e9042..99df5cc184f3c4135e219ee2961aaf43cf71bbe1 100644 (file)
@@ -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];