diff options
author | Robin Gareus <robin@gareus.org> | 2020-04-08 06:26:47 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-04-08 15:59:30 +0200 |
commit | cfd95340b18cc90ea9d0c53ddcd3f21407010de3 (patch) | |
tree | 613684ebd2bf47251155e58fa81916c3b2345750 /libs/ardour/session_export.cc | |
parent | 911c82ff094420ec2e30e3768361f82b00c14388 (diff) |
Fix exporting multiple range (MacOS)
The actual issue was introduced in 61e7f3176bfd8e:
Session::non_realtime_stop() no longer unsets PostTransportStop
(other changes from that commit are not relevant).
The real issue however is a race-condition.
So far this only seems to happen on MacOS, Coreaudio.
It seems that non_realtime_stop() is called in the butler-thread
after exporting has started, even though the butler has been
paused in wait_until_finished().
Perhaps Coreaudio thread switches causes TransportFSM to
reinitialize and scheduling the butler?
The use of `usleep()` makes this rather a workaround.
However it's sufficient for the coreaudio rt thread to run
at least once.
Diffstat (limited to 'libs/ardour/session_export.cc')
-rw-r--r-- | libs/ardour/session_export.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libs/ardour/session_export.cc b/libs/ardour/session_export.cc index 4e1dda441e..4f9670d5e2 100644 --- a/libs/ardour/session_export.cc +++ b/libs/ardour/session_export.cc @@ -23,6 +23,7 @@ #include "pbd/error.h" #include <glibmm/threads.h> +#include <glibmm/timer.h> #include <midi++/mmc.h> @@ -136,6 +137,8 @@ Session::start_audio_export (samplepos_t position, bool realtime, bool region_ex it here. */ + Glib::usleep (engine().usecs_per_cycle ()); + _butler->schedule_transport_work (); _butler->wait_until_finished (); /* get everyone to the right position */ |