diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 48fc0ad9f1..2c5a8f3ce0 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -489,6 +489,7 @@ ARDOUR_UI::post_engine () AudioEngine::instance()->Stopped.connect (forever_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::engine_stopped, this), gui_context()); AudioEngine::instance()->SampleRateChanged.connect (forever_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::update_sample_rate, this, _1), gui_context()); + AudioEngine::instance()->BufferSizeChanged.connect (forever_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::update_sample_rate, this, _1), gui_context()); AudioEngine::instance()->Halted.connect_same_thread (halt_connection, boost::bind (&ARDOUR_UI::engine_halted, this, _1, false)); _tooltips.enable(); diff --git a/gtk2_ardour/engine_dialog.cc b/gtk2_ardour/engine_dialog.cc index 2dfcf0088c..394a52b193 100644 --- a/gtk2_ardour/engine_dialog.cc +++ b/gtk2_ardour/engine_dialog.cc @@ -1036,15 +1036,25 @@ EngineControl::show_buffer_duration () uint32_t samples = atoi (bs_text); /* will ignore trailing text */ uint32_t rate = get_rate(); - /* Translators: "msecs" is ALWAYS plural here, so we do not - need singular form as well. - */ /* Developers: note the hard-coding of a double buffered model in the (2 * samples) computation of latency. we always start the audiobackend in this configuration. */ + /* note to jack1 developers: ardour also always starts the engine + * in async mode (no jack2 --sync option) which adds an extra cycle + * of latency with jack2 (and *3 would be correct) + * The value can also be wrong if jackd is started externally.. + * + * At the time of writing the ALSA backend always uses double-buffering *2, + * The Dummy backend *1, and who knows what ASIO really does :) + * + * So just display the period size, that's also what + * ARDOUR_UI::update_sample_rate() does for the status bar. + * (the statusbar calls AudioEngine::instance()->usecs_per_cycle() + * but still, that's the buffer period, not [round-trip] latency) + */ char buf[32]; - snprintf (buf, sizeof (buf), _("(%.1f msecs)"), (2 * samples) / (rate/1000.0)); + snprintf (buf, sizeof (buf), _("(%.1f ms)"), (samples / (rate/1000.0f))); buffer_size_duration_label.set_text (buf); }