From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Tue, 17 May 2022 14:49:01 +0000 (+0100) Subject: Quieten some debug messages. Remove some redundant code. X-Git-Tag: 4.1-rc1~24^2~222 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b4a21f002cfeaa3bce210a7eb8600396d3c67ff;p=thirdparty%2Fshairport-sync.git Quieten some debug messages. Remove some redundant code. --- diff --git a/audio_alsa.c b/audio_alsa.c index e019ea56..ac380682 100644 --- a/audio_alsa.c +++ b/audio_alsa.c @@ -509,7 +509,7 @@ int actual_open_alsa_device(int do_auto_setup) { } if (ret == 0) { config.output_format = trial_format; - debug(1, "alsa: output format chosen is \"%s\".", + debug(2, "alsa: output format chosen is \"%s\".", sps_format_description_string(config.output_format)); } else { die("audio_alsa: Could not automatically set the output format for device \"%s\": %s", @@ -552,7 +552,7 @@ int actual_open_alsa_device(int do_auto_setup) { } if (ret == 0) { config.output_rate = actual_sample_rate; - debug(1, "alsa: output speed chosen is %d.", config.output_rate); + debug(2, "alsa: output speed chosen is %d.", config.output_rate); } else { die("audio_alsa: Could not automatically set the output rate for device \"%s\": %s", alsa_out_dev, snd_strerror(ret)); diff --git a/rtp.c b/rtp.c index 5a5561ed..4052c7e0 100644 --- a/rtp.c +++ b/rtp.c @@ -1276,7 +1276,7 @@ void set_ptp_anchor_info(rtsp_conn_info *conn, uint64_t clock_id, uint32_t rtpti uint64_t networktime) { // debug(1,"clock: %" PRIx64 ", rtptime: %" PRIu32 ".", clock_id, rtptime); if (conn->anchor_clock != clock_id) { - debug(1, "Connection %d: Set Anchor Clock: %" PRIx64 ".", conn->connection_number, clock_id); + debug(2, "Connection %d: Set Anchor Clock: %" PRIx64 ".", conn->connection_number, clock_id); } // debug(1,"set anchor info clock: %" PRIx64", rtptime: %u, networktime: %" PRIx64 ".", clock_id, // rtptime, networktime); @@ -1376,7 +1376,7 @@ int get_ptp_anchor_local_time_info(rtsp_conn_info *conn, uint32_t *anchorRTP, get_absolute_time_in_ns() - conn->last_anchor_time_of_update; if (time_since_last_update > 5000000000) { int64_t duration_of_mastership = time_now - start_of_mastership; - debug(1, + debug(2, "Connection %d: Master clock has changed to %" PRIx64 ". History: %f milliseconds.", conn->connection_number, actual_clock_id, 0.000001 * duration_of_mastership); @@ -1437,7 +1437,7 @@ int get_ptp_anchor_local_time_info(rtsp_conn_info *conn, uint32_t *anchorRTP, if ((clock_status_t)response != conn->clock_status) { switch (response) { case clock_ok: - debug(1, "Connection %d: NQPTP master clock %" PRIx64 ".", conn->connection_number, + debug(2, "Connection %d: NQPTP master clock %" PRIx64 ".", conn->connection_number, actual_clock_id); break; case clock_not_ready: @@ -1449,7 +1449,7 @@ int get_ptp_anchor_local_time_info(rtsp_conn_info *conn, uint32_t *anchorRTP, warn("Can't access the NQPTP clock. Is NQPTP running?"); break; case clock_access_error: - debug(1, "Connection %d: Error accessing the NQPTP clock interface.", + debug(2, "Connection %d: Error accessing the NQPTP clock interface.", conn->connection_number); break; case clock_data_unavailable: @@ -1459,10 +1459,10 @@ int get_ptp_anchor_local_time_info(rtsp_conn_info *conn, uint32_t *anchorRTP, debug(2, "Connection %d: No NQPTP master clock.", conn->connection_number); break; case clock_no_anchor_info: - debug(1, "Connection %d: Awaiting clock anchor information.", conn->connection_number); + debug(2, "Connection %d: Awaiting clock anchor information.", conn->connection_number); break; case clock_version_mismatch: - debug(1, "Connection %d: NQPTP clock interface mismatch.", conn->connection_number); + debug(2, "Connection %d: NQPTP clock interface mismatch.", conn->connection_number); warn("This version of Shairport Sync is not compatible with the installed version of NQPTP. " "Please update."); break; @@ -1710,7 +1710,7 @@ void *rtp_ap2_control_receiver(void *arg) { if ((packet[0] & 0x10) != 0) { debug(2, "First packet is a sentinel packet."); } else { - debug(1, "First packet is a not a sentinel packet!"); + debug(2, "First packet is a not a sentinel packet!"); } } // debug(1,"rtp_ap2_control_receiver coded: %u, %u", packet[0], packet[1]); @@ -1789,20 +1789,10 @@ void *rtp_ap2_control_receiver(void *arg) { conn->latency = notified_latency + 11035 + added_latency; } - /* - debug_mutex_lock(&conn->reference_time_mutex, 1000, 0); - conn->remote_reference_timestamp_time = remote_packet_time_ns; - conn->reference_timestamp = - frame_1 - 11035 - added_latency; // add the latency in to the anchortime - debug_mutex_unlock(&conn->reference_time_mutex, 0); - */ - // this is now only used for calculating when to ask for resends - // debug(1, "conn->latency is %d.", conn->latency); - // debug(1,"frame_1: %" PRIu32 ", added latency: %" PRId32 ".", frame_1, added_latency); set_ptp_anchor_info(conn, clock_id, frame_1 - 11035 - added_latency, remote_packet_time_ns); if (conn->anchor_clock != clock_id) { - debug(1, "Connection %d: Change Anchor Clock: %" PRIx64 ".", conn->connection_number, + debug(2, "Connection %d: Change Anchor Clock: %" PRIx64 ".", conn->connection_number, clock_id); } diff --git a/rtsp.c b/rtsp.c index 48939190..4d775c40 100644 --- a/rtsp.c +++ b/rtsp.c @@ -2655,7 +2655,7 @@ void handle_setup_2(rtsp_conn_info *conn, rtsp_message *req, rtsp_message *resp) plist_get_string_val(timingProtocol, &timingProtocolString); if (timingProtocolString) { if (strcmp(timingProtocolString, "PTP") == 0) { - debug(1, "Connection %d: AP2 PTP connection from %s:%u to self at %s:%u.", + debug(2, "Connection %d: AP2 PTP connection from %s:%u to self at %s:%u.", conn->connection_number, conn->client_ip_string, conn->client_rtsp_port, conn->self_ip_string, conn->self_rtsp_port); conn->airplay_stream_category = ptp_stream; @@ -2681,7 +2681,7 @@ void handle_setup_2(rtsp_conn_info *conn, rtsp_message *req, rtsp_message *resp) uint8_t isRemoteControlOnlyBoolean = 0; plist_get_bool_val(isRemoteControlOnly, &isRemoteControlOnlyBoolean); if (isRemoteControlOnlyBoolean != 0) { - debug(1, "Connection %d: Remote Control connection from %s:%u to self at %s:%u.", + debug(2, "Connection %d: Remote Control connection from %s:%u to self at %s:%u.", conn->connection_number, conn->client_ip_string, conn->client_rtsp_port, conn->self_ip_string, conn->self_rtsp_port); conn->airplay_stream_category = remote_control_stream;