summaryrefslogtreecommitdiff
path: root/libs/ardour/disk_writer.cc
AgeCommit message (Collapse)Author
2020-01-18Fix MIDI capture alignmentRobin Gareus
This fixes Audio/MIDI alignment when recording normally. Loop and/or Punch-in recording is still not aligned properly (both audio and MIDI). _accumulated_capture_offset is initialized once, accumulated offsets (rec_nframes) are kept, even when ::check_record_status() is called multiple times.
2020-01-18Zero capture-offset regardless of data-typeRobin Gareus
_accumulated_capture_offset is only used for MIDI, however this is helpful when debugging. Previously audio kept accumulating the offset indefinitely.
2020-01-09Fix MIDI loop recording - Revert "Fix MIDI disk-writer flush"Robin Gareus
This reverts commit 254f22e372ff1155e76bea2c9a6f9c6c85a94868.
2020-01-09Towards fixing MIDI capture alignmentRobin Gareus
When there is no overlap (Evoral::OverlapNone) of local transport position and the record-range, MIDI data does not need to be offset. This matches audio recording: Only write to the capture ringbuffer when there is an overlap. (There is still some unknown, unresolved discrepancy remaining to be tracked down)
2020-01-09Fix CaptureAlignment debug messsageRobin Gareus
2020-01-07Fix MIDI disk-writer flushRobin Gareus
to_write must not exceed `total = _samples_pending_write`. If the write succeeds (events spanning `to_write` samples are written) to_write is atomically subtracted from `_samples_pending_write`.
2019-12-11variable renaming in Butler for various buffer sizesPaul Davis
2019-11-18fix typo/thinko in logic to decide if MIDI buffers in DiskWriter require the ↵Paul Davis
butler (to write to disk)
2019-11-02refactor SessionEvent and DiskIO so that we pass around ↵Paul Davis
boost::shared_ptr<Track> rather than Route (this the raw pointers used inside SessionEvent)
2019-09-26Don't try to process MIDI input in a DiskWriter if it has no _midi_bufPaul Davis
... which implies it has no MIDI input port(s) either. This fixes behaviour caused by BufferSet::get...() returning a valid MidiBuffer because it was based on using the _available count within the BufferSet, even though the _count value indicated there was no buffer available (to match the I/O configuration of the Route).
2019-09-05Reset write-source only when necessaryRobin Gareus
When I/O port-counts do not change, plugin re-order happens in sync in the process-thread. ::configure_io() is only called to ensure that the current configuration is valid. In case that the ChanCount does not change, the method must be realtime-safe and not block. DiskWriter::reset_write_sources() is not realtime-safe and implicitly causes a session-save: Write-sources are destroyed and re-created. This includes a call to write_source->drop_references(), which triggers ARDOUR::Session::remove_source(), which saves the session. Furthermore adding/removing plugins will likewise call ::configure_io(). Previously any processor change on a track lead to saving the session!
2019-08-12NO-OP: mark private variables, remove cruftRobin Gareus
2019-08-12Initialize some more uninitialized variablesRobin Gareus
2019-08-03Update libardour GPL boilerplate and (C) from git logRobin Gareus
2019-08-01(Source List) Clean up the natural_position implementation (libardour part).Ben Loftis
2019-08-01(Source List) Source property signals (libardour part)Ben Loftis
2019-08-01(Source List) Take-ID: new (working) implementation.Ben Loftis
2018-12-23Fix cases where there's no MIDI buffer (e.g. audio audition)Robin Gareus
2018-11-29Disk I/O: only allocate midi-buffer if neededRobin Gareus
This fixes a memory-leak (_midi_buf was allocated in DiskIOProc but only delete in DiskReader). Also skip midi-refill early on
2018-07-09Separate ChannelInfo for disk reader and writerRobin Gareus
This allows to use different types for write and read buffers, in preparation for a dedicated reader-buffer.
2017-10-31Move Loop Location to ProcessorsRobin Gareus
The processors will becomes responsible to know about loop-positions and map latency-compensated start_sample, end_sample into the loop-range as needed.
2017-10-04Clean up State API:Robin Gareus
* Processor implement get_state(), classes derived from Processor implement protected ::state() -- as documented in processor.h * likewise for Route, Track: make ::state() a protected interface * removal of "full_state", use explicit "template_save" * use RAII/Unwind to skip saving automation-state
2017-10-02remove cruftPaul Davis
2017-10-01Fix MIDI rec-region displayRobin Gareus
gui_feed_buffer is used for DiskWriter -> GUI notifications. It was wrongly migrated from MidiDiskstream to DiskReader in 7fb6807
2017-10-01Fix recording MIDIRobin Gareus
- Fix API call to add region(midi_region) -- set count to "1" - Forward DataRecorded() signal - remove botched merge/rebase" a4a87f56 accidentally brought back code from old-destructive API which was removed in af103cf3 and 08c13007 There is no per track NonLayered record mode anymore, it's session global. - set can_record correctly to not accidentally clear last capture sources for cont'd recording (toggle track's rec-arm)
2017-09-30Disk-writer: don't record immediate/oob eventsRobin Gareus
2017-09-30Align punch in/out recording with latency-compensationRobin Gareus
2017-09-29Remove unused punch+preroll APIRobin Gareus
This API was not used, also superseded by record w/preroll.
2017-09-29Ongoing work on latency compensationRobin Gareus
The general goal is to align transport-sample to be the audible frame and use that as "anchor" for all processing. transport_sample cannot become negative (00:00:00:00 is the first audible frame). Internally transport pre-rolls (read-ahead) before the transport starts to move. This allows inputs and disk to prefill the pipeline. When starting to roll, the session counts down a global "remaning preroll" counter, which is the worst-latency from in-to-out. Each route in turn will start processing at its own output-latency. Route::process_output_buffers() - which does the actual processing incl disk i/o - begins by offsetting the "current sample" by the route's process-latency and decrements the offset for each latent processor. At the end of the function the output will be aligned and match transport-sample - downstream-playback-latency (if any). PS. This commit is a first step only: transport looping & vari-speed have not yet been implemented/updated.
2017-09-29NO-OP: WhitespaceRobin Gareus
2017-09-29Remove code related to capture-offset.Robin Gareus
2017-09-24convert codebase to use Temporal for various time typesPaul Davis
2017-09-22NO-OP: whitespaceRobin Gareus
2017-09-22AlignmentChoise is a Track PropertyRobin Gareus
The DiskWriter uses AlignStyle which is set dynamically by the Track and may depend on I/O connections.
2017-09-21fix clang compilation (include header ordering)Robin Gareus
"i18n.h" needs to be included last, after types have been defined or clang bails out: "call to function 'operator<<' is not visible in the template definition"
2017-09-18globally change all use of "frame" to refer to audio into "sample".Paul Davis
Generated by tools/f2s. Some hand-editing will be required in a few places to fix up comments related to timecode and video in order to keep the legible
2017-09-18move _file_frame from DiskIOProcessor into DiskReader (only place where it ↵Paul Davis
is needed); split into by-type array to deal with different rate of audio & MIDI i/o
2017-09-18DiskWriter needs to drop source refs in its destructor.Paul Davis
SerializedRCUManager can't do this by itself
2017-09-18change visible name of disk i/o processorsPaul Davis
2017-09-18comment out debug trace outputPaul Davis
2017-09-18set + store signal chain latency for all processors; DiskWriter sets its ↵Paul Davis
capture_offset appropriately
2017-09-18the return of MIDI recording, plus refactor to move post-capture playlist ↵Paul Davis
manipulations into Track
2017-09-18more DEBUG::Destruction messagesPaul Davis
2017-09-18fix uninitialized variables causing DiskWriters to think they were in some ↵Paul Davis
incorrect state(s)
2017-09-18get sdio branch working with MIDI tracksPaul Davis
2017-09-18cue monitoring for audio (libardour aspects)Paul Davis
2017-09-18fix various naming issues with Disk{Reader,Writer}Paul Davis
2017-09-18alignment choice now owned by Track, as a proxy for DiskWriterPaul Davis
DiskWriter is a processor and as such has no Input object. This means that the "Automatic" setting must be handled by the Track, which does have an Input object to check for port connections to physical or non-physical sources
2017-09-18NO-OP: whitespace inside #if 0Paul Davis
2017-09-18fix iterator initializationPaul Davis