diff --git a/common/JackNetDriver.cpp b/common/JackNetDriver.cpp index 8c8d1bf4..38fe48e7 100644 --- a/common/JackNetDriver.cpp +++ b/common/JackNetDriver.cpp @@ -575,7 +575,7 @@ namespace Jack } for (int audio_port_index = 0; audio_port_index < fPlaybackChannels; audio_port_index++) { #ifdef OPTIMIZED_PROTOCOL - // Port is connected on other side.. + // Port is connected on other side... if ((long)fNetAudioPlaybackBuffer->GetBuffer(audio_port_index) == -1) { fNetAudioPlaybackBuffer->SetBuffer(audio_port_index, GetOutputBuffer(audio_port_index, true)); } else { diff --git a/common/JackNetManager.cpp b/common/JackNetManager.cpp index c3cb85eb..7601acdd 100644 --- a/common/JackNetManager.cpp +++ b/common/JackNetManager.cpp @@ -432,6 +432,7 @@ namespace Jack #ifdef OPTIMIZED_PROTOCOL if ((long)fNetAudioCaptureBuffer->GetBuffer(audio_port_index) == -1) { + // Port is connected on other side... fNetAudioCaptureBuffer->SetBuffer(audio_port_index, static_cast(jack_port_get_buffer_nulled(fAudioCapturePorts[audio_port_index], fParams.fPeriodSize))); diff --git a/common/JackNetTool.h b/common/JackNetTool.h index cfceee13..238b075a 100644 --- a/common/JackNetTool.h +++ b/common/JackNetTool.h @@ -614,6 +614,7 @@ namespace Jack } for (uint port_index = 0; port_index < port_num; port_index++) { + // Use -1 when port is actually connected on other side fPortBuffer[*active_port_address] = (sample_t*)-1; active_port_address++; } diff --git a/tests/iodelay.cpp b/tests/iodelay.cpp index 4ef90fb0..924c818b 100644 --- a/tests/iodelay.cpp +++ b/tests/iodelay.cpp @@ -235,14 +235,18 @@ int main (int ac, char *av []) if (mtdm.resolve () < 0) printf ("Signal below threshold...\n"); else { + jack_nframes_t systemic_latency; if (mtdm.err () > 0.3) { mtdm.invert (); mtdm.resolve (); } - printf ("%10.3lf frames %10.3lf ms", mtdm.del (), mtdm.del () * t); - if (mtdm.err () > 0.2) printf (" ??"); - if (mtdm.inv ()) printf (" Inv"); + systemic_latency = (jack_nframes_t) floor (mtdm->_del - (capture_latency.max + playback_latency.max)); + + printf ("%10.3lf frames %10.3lf ms total roundtrip latency\n\textra loopback latency: %u frames\n\tuse %u for the backend arguments -I and -O", mtdm->_del, mtdm->_del * t, + systemic_latency, systemic_latency/2); + if (mtdm->_err > 0.2) printf (" ??"); + if (mtdm->_inv) printf (" Inv"); printf ("\n"); } }