24 #ifndef PLATFORM_WINDOWS
30 #include "ardour/debug.h"
48 , audio_dstream_capture_buffer_size(0)
49 , audio_dstream_playback_buffer_size(0)
50 , midi_dstream_buffer_size(0)
68 if (p ==
"playback-buffer-seconds") {
72 }
else if (p ==
"capture-buffer-seconds") {
75 }
else if (p ==
"midi-readahead") {
100 error <<
_(
"Session: could not create butler thread") <<
endmsg;
116 pthread_join (
thread, &status);
125 return ((
Butler *) arg)->thread_work ();
133 bool disk_work_outstanding =
false;
134 RouteList::iterator i;
139 if(!disk_work_outstanding) {
173 disk_work_outstanding =
false;
186 tr->seek(audition_seek);
205 if (io && !io->active()) {
211 switch (tr->do_refill ()) {
218 disk_work_outstanding =
true;
223 std::cerr <<
string_compose(
_(
"Butler read ahead failure on dstream %1"), (*i)->name()) << std::endl;
229 if (i != rl_with_auditioner.begin() && i != rl_with_auditioner.end()) {
231 disk_work_outstanding =
true;
251 gint64 before, after;
255 before = g_get_monotonic_time ();
257 after = g_get_monotonic_time ();
265 disk_work_outstanding =
true;
271 std::cerr <<
string_compose(
_(
"Butler write-behind failure on dstream %1"), (*i)->name()) << std::endl;
286 if (i != rl->begin() && i != rl->end()) {
289 disk_work_outstanding =
true;
297 if (!disk_work_outstanding) {
389 for (
int i = 0; i < 2; ++i) {
390 for (guint j = 0; j < vec.len[i]; ++j) {
392 delete vec.
buf[i][j];
412 std::cerr <<
"Butler drops pool trash\n";
static void * _thread_work(void *arg)
void butler_transport_work()
ARDOUR::Session & _session
void config_changed(std::string)
#define DEBUG_THREAD_SELF
bool actively_recording() const
shared_ptr< T > dynamic_pointer_cast(shared_ptr< U > const &r)
static void create_per_thread_pool(const std::string &n, uint32_t nitems)
int receive(char &msg, bool wait=false)
bool is_auditioning() const
LIBPBD_API Transmitter error
void get_read_vector(rw_vector *)
void refresh_disk_space()
std::ostream & endmsg(std::ostream &ostr)
framecnt_t frame_rate() const
void increment_read_idx(guint cnt)
boost::shared_ptr< Auditioner > the_auditioner()
LIBARDOUR_API uint64_t Butler
void request_stop(bool abort=false, bool clear_state=false)
LIBARDOUR_API RCConfiguration * Config
void schedule_transport_work()
void adjust_capture_buffering()
framecnt_t audio_dstream_capture_buffer_size
RingBuffer< CrossThreadPool * > pool_trash
static void set_readahead_frames(framecnt_t frames_ahead)
boost::shared_ptr< RouteList > get_routes() const
#define DEBUG_TRACE(bits, str)
LIBPBD_API void pthread_set_name(const char *name)
PBD::Signal1< void, std::string > ParameterChanged
Glib::Threads::Cond paused
uint32_t midi_dstream_buffer_size
void set_trash(RingBuffer< CrossThreadPool * > *t)
Glib::Threads::Mutex request_lock
bool transport_work_requested() const
CrossThreadChannel _xthread
void wait_until_finished()
void queue_request(Request::Type r)
static PerThreadPool * pool
std::list< boost::shared_ptr< Route > > RouteList
LIBPBD_API int pthread_create_and_store(std::string name, pthread_t *thread, void *(*start_routine)(void *), void *arg)
gint should_do_transport_work
std::string string_compose(const std::string &fmt, const T1 &o1)
void adjust_playback_buffering()
framecnt_t audio_dstream_playback_buffer_size