From 625ee55df0d84e708ce269ee47cc1e36881cd71e Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 16 Oct 2012 20:53:08 +0000 Subject: don't do a pending save if slave is syncing. 13:00 < rgareus> When a slave does initial sync, it sets speed=0, pos=XXX (required by session_process.cc state-machine to init) 13:01 < rgareus> This triggers a locate(roll=false) which in turn triggers a realtime_stop() which in turn triggers a non_realtime_stop(). [..] 13:06 < rgareus> las: the problem I have with non_realtime_stop() is that it does save a pending state IFF get_record_enabled() is true. 13:06 < rgareus> The save can take ages (seconds), which will void the initial sync of the slave. 13:07 < rgareus> The slave enters a live-lock: sync, save, re-sync, save... 13:07 < las> rgareus: understood 13:07 < rgareus> las: I propose to workaround this: only save pending state if there is no slave or the slave is not locked. 13:07 < las> rgareus: another reason why recording + slave == bad idea :( 13:07 < las> rgareus: but yes, that sounds fine to me 13:07 < rgareus> AFICT this is not harmful. It only affects pre-record settings. 13:07 < rgareus> 'did_record' is used to save a full state after each recording. git-svn-id: svn://localhost/ardour2/branches/3.0@13288 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/session_transport.cc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'libs/ardour/session_transport.cc') diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc index 6141716301..ae5a8157c7 100644 --- a/libs/ardour/session_transport.cc +++ b/libs/ardour/session_transport.cc @@ -618,9 +618,19 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished) } if ((ptw & PostTransportLocate) && get_record_enabled()) { - /* capture start has been changed, so save pending state */ - save_state ("", true); - saved = true; + /* This is scheduled by realtime_stop(), which is also done + * when a slave requests /locate/ for an initial sync. + * We can't hold up the slave for long with a save() here, + * without breaking its initial sync cycle. + * + * save state only if there's no slave or if it's not yet locked. + */ + if (!_slave || !_slave->locked()) { + DEBUG_TRACE (DEBUG::Transport, X_("Butler PTW: pending save\n")); + /* capture start has been changed, so save pending state */ + save_state ("", true); + saved = true; + } } /* always try to get rid of this */ -- cgit v1.2.3