]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Make resend error backoff work better and set it to 0.5 seconds. Quieten some routine...
authorMike Brady <mikebrady@eircom.net>
Mon, 23 Apr 2018 12:09:44 +0000 (13:09 +0100)
committerMike Brady <mikebrady@eircom.net>
Mon, 23 Apr 2018 12:09:44 +0000 (13:09 +0100)
dacp.c
player.c
rtp.c

diff --git a/dacp.c b/dacp.c
index c92c6f05d3c084f00d9da784dd6f24637b632e75..53b766163867bdccc4cbca9eee2c44636fa0d8c8 100644 (file)
--- a/dacp.c
+++ b/dacp.c
@@ -430,7 +430,7 @@ void *dacp_monitor_thread_code(__attribute__((unused)) void *na) {
     else
       idle_scan_count = 0;
 
-    debug(2, "Scan Result: %d, Bad Scan Count: %d, Idle Scan Count: %d.", result, bad_result_count,
+    debug(3, "Scan Result: %d, Bad Scan Count: %d, Idle Scan Count: %d.", result, bad_result_count,
           idle_scan_count);
 
     if ((bad_result_count == config.scan_max_bad_response_count) ||
index 704a23dcd351a20fe6307e0236343654c3f5a8e5..d3dcb0db4ff5a10e8c3e505c03f829ddeb5a3fe9 100644 (file)
--- a/player.c
+++ b/player.c
@@ -527,7 +527,7 @@ void player_put_packet(seq_t seqno, uint32_t actual_timestamp, int64_t timestamp
                 check_buf->resend_level = j;
                 if (config.disable_resend_requests == 0) {
                   rtp_request_resend(next, 1, conn);
-                  if (j >= 3)
+                  if (j >= 6)
                     debug(2, "Resend request level #%d for packet %u in range %u to %u.", j, next,
                           conn->ab_read, conn->ab_write);
                   conn->resend_requests++;
diff --git a/rtp.c b/rtp.c
index 446ba53f2017673fe391633eaa55267de464307d..a6cf22292d3447649c5a27e9eb33b3c421706fff 100644 (file)
--- a/rtp.c
+++ b/rtp.c
@@ -969,8 +969,8 @@ void rtp_request_resend(seq_t first, uint32_t count, rtsp_conn_info *conn) {
     }
 #endif
     uint64_t time_of_sending_fp = get_absolute_time_in_fp();
-    uint64_t resend_error_backoff_time = (uint64_t)10 << 32; // ten seconds
-    if ((conn->rtp_time_of_last_resend_request_error_fp) ||
+    uint64_t resend_error_backoff_time = (uint64_t)1 << (32-1); // half a second
+    if ((conn->rtp_time_of_last_resend_request_error_fp==0) ||
         ((time_of_sending_fp - conn->rtp_time_of_last_resend_request_error_fp) >
          resend_error_backoff_time)) {
       if ((config.diagnostic_drop_packet_fraction == 0.0) ||
@@ -979,14 +979,17 @@ void rtp_request_resend(seq_t first, uint32_t count, rtsp_conn_info *conn) {
                    (struct sockaddr *)&conn->rtp_client_control_socket, msgsize) == -1) {
           char em[1024];
           strerror_r(errno, em, sizeof(em));
-          debug(1, "Error %d using send-to to an audio socket: \"%s\". ", errno, em);
+          debug(1, "Error %d using send-to to an audio socket: \"%s\". Backing off for 0.5 seconds.", errno, em);
           conn->rtp_time_of_last_resend_request_error_fp = time_of_sending_fp;
         } else {
           conn->rtp_time_of_last_resend_request_error_fp = 0;
         }
       } else {
-        debug(3, "Dropping resend request packet to simulate a bad network.");
+        debug(3, "Dropping resend request packet to simulate a bad network. Backing off for 0.5 seconds.");
+        conn->rtp_time_of_last_resend_request_error_fp = time_of_sending_fp;
       }
+    } else {
+       debug(3,"Backing off sending resend requests due to a previous send-to error");
     }
   } else {
     // if (!request_sent) {