From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Mon, 10 May 2021 15:03:02 +0000 (+0100) Subject: Quieten some more debug messages. Fix a misleading clock status return. X-Git-Tag: 4.0-dev~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a563d5e847699ba3fc5dd3ed3d4e454366b35fb6;p=thirdparty%2Fshairport-sync.git Quieten some more debug messages. Fix a misleading clock status return. --- diff --git a/player.c b/player.c index 69172e3f..db46cd12 100644 --- a/player.c +++ b/player.c @@ -1279,7 +1279,7 @@ static abuf_t *buffer_get_frame(rtsp_conn_info *conn) { if (do_wait == 0) if ((conn->ab_synced != 0) && (conn->ab_read == conn->ab_write)) { // the buffer is empty! if (notified_buffer_empty == 0) { - debug(1, "Buffers exhausted."); + debug(3, "Buffers exhausted."); notified_buffer_empty = 1; // reset_input_flow_metrics(conn); // don't do a full flush parameters reset conn->initial_reference_time = 0; diff --git a/ptp-utilities.c b/ptp-utilities.c index 8dd412dc..73b778fa 100644 --- a/ptp-utilities.c +++ b/ptp-utilities.c @@ -82,7 +82,11 @@ int ptp_get_clock_info(uint64_t *actual_clock_id, uint64_t *raw_offset) { response = clock_no_master; } } else { - response = clock_version_mismatch; + // the version can not be zero. If zero is returned here, it means that the shared memory is not yet initialised, so not availalbe + if (nqptp_data.version == 0) + response = clock_service_unavailable; + else + response = clock_version_mismatch; } } else { response = clock_data_unavailable; diff --git a/rtp.c b/rtp.c index 1cc3b084..520e0c06 100644 --- a/rtp.c +++ b/rtp.c @@ -290,8 +290,8 @@ void *rtp_control_receiver(void *arg) { obfp += 2; }; *obfp = 0; - - + + // get raw timestamp information // I think that a good way to understand these timestamps is that // (1) the rtlt below is the timestamp of the frame that should be playing at the @@ -302,19 +302,19 @@ void *rtp_control_receiver(void *arg) { // Thus, (3) the latency can be calculated by subtracting the second from the // first. // There must be more to it -- there something missing. - + // In addition, it seems that if the value of the short represented by the second // pair of bytes in the packet is 7 // then an extra time lag is expected to be added, presumably by // the AirPort Express. - + // Best guess is that this delay is 11,025 frames. - + uint32_t rtlt = nctohl(&packet[4]); // raw timestamp less latency uint32_t rt = nctohl(&packet[16]); // raw timestamp - + uint32_t fl = nctohs(&packet[2]); // - + debug(1,"Sync Packet of %d bytes received: \"%s\", flags: %d, timestamps %u and %u, giving a latency of %d frames.",plen,obf,fl,rt,rtlt,rt-rtlt); //debug(1,"Monotonic timestamps are: %" PRId64 " and %" PRId64 " @@ -1413,12 +1413,9 @@ void *rtp_event_receiver(void *arg) { finished = 1; } } while (finished == 0); - debug(1, "Connection %d: AP2 Event Receiver RTP thread \"normal\" exit.", - conn->connection_number); pthread_cleanup_pop(1); // close the socket - pthread_cleanup_pop(1); // do the cleanup - debug(1, "Connection %d: AP2 Event Receiver RTP thread exit.", conn->connection_number); + debug(2, "Connection %d: AP2 Event Receiver RTP thread \"normal\" exit.", conn->connection_number); pthread_exit(NULL); } diff --git a/rtsp.c b/rtsp.c index 3f216eea..9ea48512 100644 --- a/rtsp.c +++ b/rtsp.c @@ -379,7 +379,7 @@ int get_play_lock(rtsp_conn_info *conn) { #else } else if (config.allow_session_interruption == 1) { #endif - debug(1, "Connection %d: Asking Connection %d to stop playing.", conn->connection_number, + debug(2, "Connection %d: Asking Connection %d to stop playing.", conn->connection_number, playing_conn->connection_number); playing_conn->stop = 1; interrupting_current_session = 1; @@ -406,7 +406,7 @@ int get_play_lock(rtsp_conn_info *conn) { } if ((have_the_player == 1) && (interrupting_current_session == 1)) { - debug(1, "Connection %d: got player lock", conn->connection_number); + debug(2, "Connection %d: Got player lock", conn->connection_number); response = 1; } else { debug(1, "Connection %d: failed to get player lock", conn->connection_number); @@ -1398,7 +1398,7 @@ void handle_setrateanchori(rtsp_conn_info *conn, rtsp_message *req, rtsp_message debug(2, "Connection %d: Stop playing.", conn->connection_number); conn->ap2_play_enabled = 0; // not sure this is needed yet - reset_anchor_info(conn); // needed if the player resumes + // reset_anchor_info(conn); // needed if the player resumes } pthread_cleanup_pop(1); // unlock the conn->flush_mutex