git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4488 0c269be4-1314-0410-8aa9-9f06e86f4224tags/1.9.8
| @@ -575,7 +575,7 @@ namespace Jack | |||||
| } | } | ||||
| for (int audio_port_index = 0; audio_port_index < fPlaybackChannels; audio_port_index++) { | for (int audio_port_index = 0; audio_port_index < fPlaybackChannels; audio_port_index++) { | ||||
| #ifdef OPTIMIZED_PROTOCOL | #ifdef OPTIMIZED_PROTOCOL | ||||
| // Port is connected on other side.. | |||||
| // Port is connected on other side... | |||||
| if ((long)fNetAudioPlaybackBuffer->GetBuffer(audio_port_index) == -1) { | if ((long)fNetAudioPlaybackBuffer->GetBuffer(audio_port_index) == -1) { | ||||
| fNetAudioPlaybackBuffer->SetBuffer(audio_port_index, GetOutputBuffer(audio_port_index, true)); | fNetAudioPlaybackBuffer->SetBuffer(audio_port_index, GetOutputBuffer(audio_port_index, true)); | ||||
| } else { | } else { | ||||
| @@ -432,6 +432,7 @@ namespace Jack | |||||
| #ifdef OPTIMIZED_PROTOCOL | #ifdef OPTIMIZED_PROTOCOL | ||||
| if ((long)fNetAudioCaptureBuffer->GetBuffer(audio_port_index) == -1) { | if ((long)fNetAudioCaptureBuffer->GetBuffer(audio_port_index) == -1) { | ||||
| // Port is connected on other side... | |||||
| fNetAudioCaptureBuffer->SetBuffer(audio_port_index, | fNetAudioCaptureBuffer->SetBuffer(audio_port_index, | ||||
| static_cast<sample_t*>(jack_port_get_buffer_nulled(fAudioCapturePorts[audio_port_index], | static_cast<sample_t*>(jack_port_get_buffer_nulled(fAudioCapturePorts[audio_port_index], | ||||
| fParams.fPeriodSize))); | fParams.fPeriodSize))); | ||||
| @@ -614,6 +614,7 @@ namespace Jack | |||||
| } | } | ||||
| for (uint port_index = 0; port_index < port_num; port_index++) { | 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; | fPortBuffer[*active_port_address] = (sample_t*)-1; | ||||
| active_port_address++; | active_port_address++; | ||||
| } | } | ||||
| @@ -235,14 +235,18 @@ int main (int ac, char *av []) | |||||
| if (mtdm.resolve () < 0) printf ("Signal below threshold...\n"); | if (mtdm.resolve () < 0) printf ("Signal below threshold...\n"); | ||||
| else | else | ||||
| { | { | ||||
| jack_nframes_t systemic_latency; | |||||
| if (mtdm.err () > 0.3) | if (mtdm.err () > 0.3) | ||||
| { | { | ||||
| mtdm.invert (); | mtdm.invert (); | ||||
| mtdm.resolve (); | 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"); | printf ("\n"); | ||||
| } | } | ||||
| } | } | ||||