Skip to content

Commit

Permalink
Make resend error backoff work better and set it to 0.5 seconds. Quie…
Browse files Browse the repository at this point in the history
…ten some routine debug messages.
  • Loading branch information
mikebrady committed Apr 23, 2018
1 parent d80ca71 commit 4124168
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dacp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) ||
Expand Down
2 changes: 1 addition & 1 deletion player.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down
11 changes: 7 additions & 4 deletions rtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) ||
Expand All @@ -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) {
Expand Down

0 comments on commit 4124168

Please sign in to comment.