From: Mike Brady Date: Fri, 28 Dec 2018 10:35:13 +0000 (+0000) Subject: Add some diagnostics around the state of the DAC during delays. X-Git-Tag: 3.3RC0~71 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=919c5fe8b8e4da46bd5641c653376280b3756884;p=thirdparty%2Fshairport-sync.git Add some diagnostics around the state of the DAC during delays. --- diff --git a/audio_alsa.c b/audio_alsa.c index 764a4381..33669018 100644 --- a/audio_alsa.c +++ b/audio_alsa.c @@ -1493,8 +1493,13 @@ void *alsa_buffer_monitor_thread_code(void *arg) { ((present_time > most_recent_write_time) && ((present_time - most_recent_write_time) > (sleep_time_in_fp)))) { reply = delay(&buffer_size); - if (reply != 0) - buffer_size = 0; + if (reply != 0) { + buffer_size = 0; + char errorstring[1024]; + strerror_r(-reply, (char *)errorstring, sizeof(errorstring)); + debug(1, "alsa: alsa_buffer_monitor_thread_code delay error %d: \"%s\".", + reply, (char *)errorstring); + } if (buffer_size < frames_of_silence) { if ((hardware_mixer == 0) && (config.ignore_volume_control == 0) && (config.airplay_volume != 0.0)) diff --git a/player.c b/player.c index 816ff40a..1ce5494a 100644 --- a/player.c +++ b/player.c @@ -1017,8 +1017,8 @@ static abuf_t *buffer_get_frame(rtsp_conn_info *conn) { // this might happen if a big clock adjustment was made at just the wrong // time. - debug(1, "Run a bit past the exact start time by %" PRId64 " frames.", - -exact_frame_gap); + debug(1, "Run a bit past the exact start time by %" PRId64 " frames with a DAC delay of %ld frames.", + -exact_frame_gap, dac_delay); if (config.output->flush) config.output->flush(); ab_resync(conn);