From: Mike Brady Date: Tue, 2 Apr 2019 11:28:01 +0000 (+0100) Subject: Some messages made a bit more useful X-Git-Tag: 3.3rc4~31^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=539dea7d3d298e9e2e2c4317827f726009735962;p=thirdparty%2Fshairport-sync.git Some messages made a bit more useful --- diff --git a/audio_alsa.c b/audio_alsa.c index 8bb54584..4c6e3b50 100644 --- a/audio_alsa.c +++ b/audio_alsa.c @@ -65,6 +65,7 @@ static void parameters(audio_parameters *info); int mute(int do_mute); // returns true if it actually is allowed to use the mute static double set_volume; static int output_method_signalled = 0; // for reporting whether it's using mmap or not +int delay_type_notified = -1; // for controlling the reporting of whether the output device can do precison delays (alsa->pulsaudio devices can't) audio_output audio_alsa = { .name = "alsa", @@ -1173,19 +1174,22 @@ int delay_and_status(snd_pcm_state_t *state, snd_pcm_sframes_t *delay, enum yndk *using_update_timestamps = YNDK_YES; } -/* + if (update_timestamp_ns == 0) + debug(1,"update timestamp is zero!"); + +// user information if (update_timestamp_ns == 0) { - if (delay_type_notifier != 1) { - inform("Note: this output device does not provide timed delay updates via snd_pcm_status_get_*_htstamp(). Is it a virtual rather than a real device? Disable_standby is not available."); - delay_type_notifier = 1; + if (delay_type_notified != 1) { + inform("Note: the alsa output device \"%s\" is not capable of precision delay timing. Could it be a virtual device?", snd_pcm_name(alsa_handle)); + delay_type_notified = 1; } } else { - if (delay_type_notifier != 0) { - debug(1,"ALSA: using snd_pcm_status_get_delay() to calculate delay"); - delay_type_notifier = 0; +// diagnostic + if (delay_type_notified != 0) { + debug(1,"alsa: delay_and_status using snd_pcm_status_get_delay() to calculate delay"); + delay_type_notified = 0; } } -*/ if (update_timestamp_ns == 0) { ret = snd_pcm_delay (alsa_handle,delay); @@ -1404,6 +1408,7 @@ int do_open() { // set accordingly // do_mute(0); // complete unmute } + alsa_backend_state = abm_connected; // only do this if it really opened it. } } else { @@ -1638,7 +1643,7 @@ int precision_delay_available() { debug(2,"alsa: precision delay timing available."); } else { precision_delay_available_status = YNDK_NO; - inform("Note: the alsa output device \"%s\" is not capable of precision delay timing. Could it be a virtual device?", snd_pcm_name(alsa_handle)); + debug(2,"alsa: precision delay timing not available."); if (config.disable_standby_mode != disable_standby_off) inform("Note: disable_standby_mode has been turned off because the output device is not capable of precision delay timing."); } diff --git a/player.c b/player.c index 63316684..791df3a4 100644 --- a/player.c +++ b/player.c @@ -968,7 +968,7 @@ static abuf_t *buffer_get_frame(rtsp_conn_info *conn) { // to compensate for delays due to paging, etc. // The suggestion is that it should be at least 100 ms less than the lead-in time. - int64_t max_dac_delay = config.output_rate / 10; // so the lead-in time must be greater + int64_t max_dac_delay = config.output_rate / 5; // so the lead-in time must be greater // than this, say 0.2 sec, to allow for // dynamic adjustment int64_t filler_size = max_dac_delay;