projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix error introduced in MTC transport master
[ardour.git]
/
libs
/
ardour
/
butler.cc
diff --git
a/libs/ardour/butler.cc
b/libs/ardour/butler.cc
index 697b5f8544f30c6a170bf74eb3c0b28061929b65..ea68f9480646cb86bc3011bd2ce803e4cd7ac90e 100644
(file)
--- a/
libs/ardour/butler.cc
+++ b/
libs/ardour/butler.cc
@@
-80,7
+80,7
@@
Butler::config_changed (std::string p)
_session.adjust_playback_buffering ();
if (Config->get_buffering_preset() == Custom) {
/* size is in Samples, not bytes */
_session.adjust_playback_buffering ();
if (Config->get_buffering_preset() == Custom) {
/* size is in Samples, not bytes */
- audio_dstream_playback_buffer_size = (uint32_t) floor (Config->get_audio_playback_buffer_seconds() * _session.
fram
e_rate());
+ audio_dstream_playback_buffer_size = (uint32_t) floor (Config->get_audio_playback_buffer_seconds() * _session.
sampl
e_rate());
_session.adjust_playback_buffering ();
} else {
#ifndef NDEBUG
_session.adjust_playback_buffering ();
} else {
#ifndef NDEBUG
@@
-89,7
+89,7
@@
Butler::config_changed (std::string p)
}
} else if (p == "capture-buffer-seconds") {
if (Config->get_buffering_preset() == Custom) {
}
} else if (p == "capture-buffer-seconds") {
if (Config->get_buffering_preset() == Custom) {
- audio_dstream_capture_buffer_size = (uint32_t) floor (Config->get_audio_capture_buffer_seconds() * _session.
fram
e_rate());
+ audio_dstream_capture_buffer_size = (uint32_t) floor (Config->get_audio_capture_buffer_seconds() * _session.
sampl
e_rate());
_session.adjust_capture_buffering ();
} else {
#ifndef NDEBUG
_session.adjust_capture_buffering ();
} else {
#ifndef NDEBUG
@@
-98,12
+98,12
@@
Butler::config_changed (std::string p)
}
} else if (p == "buffering-preset") {
DiskIOProcessor::set_buffering_parameters (Config->get_buffering_preset());
}
} else if (p == "buffering-preset") {
DiskIOProcessor::set_buffering_parameters (Config->get_buffering_preset());
- audio_dstream_capture_buffer_size = (uint32_t) floor (Config->get_audio_capture_buffer_seconds() * _session.
fram
e_rate());
- audio_dstream_playback_buffer_size = (uint32_t) floor (Config->get_audio_playback_buffer_seconds() * _session.
fram
e_rate());
+ audio_dstream_capture_buffer_size = (uint32_t) floor (Config->get_audio_capture_buffer_seconds() * _session.
sampl
e_rate());
+ audio_dstream_playback_buffer_size = (uint32_t) floor (Config->get_audio_playback_buffer_seconds() * _session.
sampl
e_rate());
_session.adjust_capture_buffering ();
_session.adjust_playback_buffering ();
} else if (p == "midi-readahead") {
_session.adjust_capture_buffering ();
_session.adjust_playback_buffering ();
} else if (p == "midi-readahead") {
- DiskReader::set_midi_readahead_
frames ((framecnt_t) (Config->get_midi_readahead() * _session.fram
e_rate()));
+ DiskReader::set_midi_readahead_
samples ((samplecnt_t) (Config->get_midi_readahead() * _session.sampl
e_rate()));
}
}
}
}
@@
-114,7
+114,7
@@
Butler::start_thread()
DiskIOProcessor::set_buffering_parameters (Config->get_buffering_preset());
/* size is in Samples, not bytes */
DiskIOProcessor::set_buffering_parameters (Config->get_buffering_preset());
/* size is in Samples, not bytes */
- const float rate = (float)_session.
fram
e_rate();
+ const float rate = (float)_session.
sampl
e_rate();
audio_dstream_capture_buffer_size = (uint32_t) floor (Config->get_audio_capture_buffer_seconds() * rate);
audio_dstream_playback_buffer_size = (uint32_t) floor (Config->get_audio_playback_buffer_seconds() * rate);
audio_dstream_capture_buffer_size = (uint32_t) floor (Config->get_audio_capture_buffer_seconds() * rate);
audio_dstream_playback_buffer_size = (uint32_t) floor (Config->get_audio_playback_buffer_seconds() * rate);
@@
-124,7
+124,7
@@
Butler::start_thread()
*/
midi_dstream_buffer_size = (uint32_t) floor (Config->get_midi_track_buffer_seconds() * rate);
*/
midi_dstream_buffer_size = (uint32_t) floor (Config->get_midi_track_buffer_seconds() * rate);
- DiskReader::set_midi_readahead_
frames ((fram
ecnt_t) (Config->get_midi_readahead() * rate));
+ DiskReader::set_midi_readahead_
samples ((sampl
ecnt_t) (Config->get_midi_readahead() * rate));
should_run = false;
should_run = false;
@@
-215,8
+215,8
@@
Butler::thread_work ()
DEBUG_TRACE (DEBUG::Butler, string_compose ("\ttransport work complete @ %1, twr = %2\n", g_get_monotonic_time(), transport_work_requested()));
}
DEBUG_TRACE (DEBUG::Butler, string_compose ("\ttransport work complete @ %1, twr = %2\n", g_get_monotonic_time(), transport_work_requested()));
}
-
fram
eoffset_t audition_seek;
- if (should_run && _session.is_auditioning() && (audition_seek = _session.the_auditioner()->seek_
fram
e()) >= 0) {
+
sampl
eoffset_t audition_seek;
+ if (should_run && _session.is_auditioning() && (audition_seek = _session.the_auditioner()->seek_
sampl
e()) >= 0) {
boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (_session.the_auditioner());
DEBUG_TRACE (DEBUG::Butler, "seek the auditioner\n");
tr->seek(audition_seek);
boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (_session.the_auditioner());
DEBUG_TRACE (DEBUG::Butler, "seek the auditioner\n");
tr->seek(audition_seek);
@@
-229,6
+229,8
@@
Butler::thread_work ()
RouteList rl_with_auditioner = *rl;
rl_with_auditioner.push_back (_session.the_auditioner());
RouteList rl_with_auditioner = *rl;
rl_with_auditioner.push_back (_session.the_auditioner());
+ DEBUG_TRACE (DEBUG::Butler, string_compose ("butler starts refill loop, twr = %1\n", transport_work_requested()));
+
for (i = rl_with_auditioner.begin(); !transport_work_requested() && should_run && i != rl_with_auditioner.end(); ++i) {
boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*i);
for (i = rl_with_auditioner.begin(); !transport_work_requested() && should_run && i != rl_with_auditioner.end(); ++i) {
boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*i);
@@
-241,13
+243,13
@@
Butler::thread_work ()
if (io && !io->active()) {
/* don't read inactive tracks */
if (io && !io->active()) {
/* don't read inactive tracks */
- DEBUG_TRACE (DEBUG::Butler, string_compose ("butler skips inactive track %1\n", tr->name()));
+
//
DEBUG_TRACE (DEBUG::Butler, string_compose ("butler skips inactive track %1\n", tr->name()));
continue;
}
continue;
}
- DEBUG_TRACE (DEBUG::Butler, string_compose ("butler refills %1, playback load = %2\n", tr->name(), tr->playback_buffer_load()));
+
//
DEBUG_TRACE (DEBUG::Butler, string_compose ("butler refills %1, playback load = %2\n", tr->name(), tr->playback_buffer_load()));
switch (tr->do_refill ()) {
case 0:
switch (tr->do_refill ()) {
case 0:
- DEBUG_TRACE (DEBUG::Butler, string_compose ("\ttrack refill done %1\n", tr->name()));
+
//
DEBUG_TRACE (DEBUG::Butler, string_compose ("\ttrack refill done %1\n", tr->name()));
break;
case 1:
break;
case 1:
@@
-273,7
+275,7
@@
Butler::thread_work ()
goto restart;
}
goto restart;
}
- disk_work_outstanding = flush_tracks_to_disk_normal (rl, err);
+ disk_work_outstanding =
disk_work_outstanding ||
flush_tracks_to_disk_normal (rl, err);
if (err && _session.actively_recording()) {
/* stop the transport and try to catch as much possible
if (err && _session.actively_recording()) {
/* stop the transport and try to catch as much possible
@@
-332,15
+334,15
@@
Butler::flush_tracks_to_disk_normal (boost::shared_ptr<RouteList> rl, uint32_t&
int ret;
int ret;
- DEBUG_TRACE (DEBUG::Butler, string_compose ("butler flushes track %1 capture load %2\n", tr->name(), tr->capture_buffer_load()));
+
//
DEBUG_TRACE (DEBUG::Butler, string_compose ("butler flushes track %1 capture load %2\n", tr->name(), tr->capture_buffer_load()));
ret = tr->do_flush (ButlerContext, false);
switch (ret) {
case 0:
ret = tr->do_flush (ButlerContext, false);
switch (ret) {
case 0:
- DEBUG_TRACE (DEBUG::Butler, string_compose ("\tflush complete for %1\n", tr->name()));
+
//
DEBUG_TRACE (DEBUG::Butler, string_compose ("\tflush complete for %1\n", tr->name()));
break;
case 1:
break;
case 1:
- DEBUG_TRACE (DEBUG::Butler, string_compose ("\tflush not finished for %1\n", tr->name()));
+
//
DEBUG_TRACE (DEBUG::Butler, string_compose ("\tflush not finished for %1\n", tr->name()));
disk_work_outstanding = true;
break;
disk_work_outstanding = true;
break;
@@
-409,6
+411,7
@@
Butler::flush_tracks_to_disk_after_locate (boost::shared_ptr<RouteList> rl, uint
void
Butler::schedule_transport_work ()
{
void
Butler::schedule_transport_work ()
{
+ DEBUG_TRACE (DEBUG::Butler, "requesting more transport work\n");
g_atomic_int_inc (&should_do_transport_work);
summon ();
}
g_atomic_int_inc (&should_do_transport_work);
summon ();
}