/* Get the desired buffer size setting in seconds. */
if (config_lookup_float(config.cfg, "general.audio_backend_buffer_desired_length_in_seconds",
&dvalue)) {
- if ((dvalue < 0) || (dvalue > 1.5)) {
+ if (dvalue < 0) {
die("Invalid audio_backend_buffer_desired_length_in_seconds value: \"%f\". It "
- "should be between 0 and "
- "1.5, default is %.3f seconds",
+ "should be 0.0 or greater."
+ " The default is %.3f seconds",
dvalue, config.audio_backend_buffer_desired_length);
} else {
config.audio_backend_buffer_desired_length = dvalue;
/* Get the latency offset in seconds. */
if (config_lookup_float(config.cfg, "general.audio_backend_latency_offset_in_seconds",
&dvalue)) {
- if ((dvalue < -1.75) || (dvalue > 1.75)) {
- die("Invalid audio_backend_latency_offset_in_seconds \"%f\". It "
- "should be between -1.75 and +1.75, default is 0 seconds",
- dvalue);
- } else {
config.audio_backend_latency_offset = dvalue;
- }
}
/* Get the desired length of the silent lead-in. */
double audio_backend_latency_offset; // this will be the offset in seconds to compensate for any
// fixed latency there might be in the audio path
double audio_backend_silent_lead_in_time; // the length of the silence that should precede a play.
+ uint32_t minimum_free_buffer_headroom; // when effective latency is calculated, ensure this number of buffers are unallocated
double active_state_timeout; // the amount of time from when play ends to when the system leaves
// into the "active" mode.
uint32_t volume_range_db; // the range, in dB, from max dB to min dB. Zero means use the mixer's
} else {
debug(1, "Unexpected return code %d from dacp_get_speaker_list.", http_response);
}
- } else {
+ } else if (http_response != 400){
debug(3, "Unexpected return code %d from dacp_get_client_volume.", http_response);
}
if (the_actual_volume) {
uint32_t maximum_latency; // set if an a=max-latency: line appears in the ANNOUNCE message; zero
// otherwise
int software_mute_enabled; // if we don't have a real mute that we can use
+ int unachievable_audio_backend_latency_offset_notified; // set when a latency warning is issued
int fd;
int authorized; // set if a password is required and has been supplied
config.resend_control_last_check_time = 0.10; // give up if the packet is still missing this close to when it's needed
config.missing_port_dacp_scan_interval_seconds = 2.0; // check at this interval if no DACP port number is known
+ config.minimum_free_buffer_headroom = 125; // leave approximately one second's worth of buffers free after calculating the effective latency.
+ // e.g. if we have 1024 buffers or 352 frames = 8.17 seconds and we have a nominal latency of 2.0 seconds
+ // then we can add an offset of 5.17 seconds and still leave a second's worth of buffers for unexpected circumstances
+
#ifdef CONFIG_METADATA_HUB
config.cover_art_cache_dir = "/tmp/shairport-sync/.cache/coverart";
config.scan_interval_when_active =