MIDI IO debugging
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 13 Jul 2011 15:49:53 +0000 (15:49 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 13 Jul 2011 15:49:53 +0000 (15:49 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@9861 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/midi_diskstream.cc

index 45b7e8f4de4af429cf2216fe2b2ac471af0874d3..663704a675f0c04c53579983b312b9f72a79b225 100644 (file)
@@ -864,6 +864,8 @@ MidiDiskstream::do_flush (RunContext /*context*/, bool force_flush)
        int32_t ret = 0;
        framecnt_t total;
 
+       cerr << name() << " flushing to disk\n";
+
        _write_data_count = 0;
 
        total = _session.transport_frame() - _last_flush_frame;
@@ -874,6 +876,11 @@ MidiDiskstream::do_flush (RunContext /*context*/, bool force_flush)
 
        if (total == 0 || _capture_buf->read_space() == 0
                        || (!force_flush && (total < disk_io_chunk_frames && was_recording))) {
+               cerr << "\tFlush shortcut because total = " << total
+                    << " capture read space = " << _capture_buf->read_space()
+                    << " force flush = " << force_flush 
+                    << " was recording = " << was_recording
+                    << endl;
                goto out;
        }
 
@@ -905,6 +912,10 @@ MidiDiskstream::do_flush (RunContext /*context*/, bool force_flush)
                } else {
                        _last_flush_frame = _session.transport_frame();
                }
+       } else {
+               cerr << "\tdidn't write to disk because recenabled = " << record_enabled()
+                    << " last flush @ " << _last_flush_frame << " disk io " << disk_io_chunk_frames << " TF @ " << _session.transport_frame()
+                    << " force = " << force_flush << endl;
        }
 
 out: