summaryrefslogtreecommitdiff
path: root/libs/ardour/disk_reader.cc
AgeCommit message (Collapse)Author
2020-04-14Fix disk-reader alignment when creating tracks while playingRobin Gareus
2020-04-14Fix playback alignment when adding/removing channelsRobin Gareus
The disk-reader assumes that all playback ringbuffers are in sync and have the same fill_level.
2020-04-10remove debug outputPaul Davis
2020-04-10fix mistaken geometrical-math for xfaded loopsPaul Davis
2020-04-10use cout not cerr for some temporary debugging messagesPaul Davis
2020-04-10more debug info for DiskReader::maybe_xfade_loop()Paul Davis
2020-04-08Cont'd work on disk reader channel initializationRobin Gareus
Amend 648beb94. If initial re-fill happens via override buffers, the buffer may still be effectively empty.
2020-04-08Fix false-positive under-run messagesRobin Gareus
Port (or Tracks) can be safely added during playback, however the disk-reader's playback buffer is initially empty. This lead to false-positive Underrun() signals when processing takes place before or concurrently with re-filling the disk-buffer for the new channels. Now new empty buffers are ignored, and produce silence until the initial refill is complete. There is however no per-channel de-click in, yet. This fixes: play some audio track, ctrl+drag a region to the drop-zone, creating a new track while playing.
2020-04-07"fix" some uses of foo<bar<>> by change the closing chars to "> >" (windowsPaul Davis
2020-04-07NO-OP: whitespaceRobin Gareus
2020-04-07Remove unused variableRobin Gareus
2020-04-07NO-OP: whitespaceRobin Gareus
2020-04-01fix boolean logic PART FOUR when trying to avoid complete_refill heuristicPaul Davis
This reworking avoids some confusion caused by the use boost::optional here
2020-03-31fix boolean logic PART THREE when trying to avoid complete_refill heuristicPaul Davis
2020-03-31fix boolean logic PART TWO when trying to avoid complete_refill heuristicPaul Davis
2020-03-31fix boolean logic when trying to avoid complete_refill heuristicPaul Davis
2020-03-31change variable name and debug messages for underrun case (information was ↵Paul Davis
misleading/confusing)
2020-03-31clean up logic for declick out in DiskReaderPaul Davis
This is intended to be a no-op that makes the code easier to read/reason about
2020-03-31if a locate brings us within a heuristic-specified distance of the current ↵Paul Davis
position in a DiskReader, pay attention to loop status If the last read was not looped, but the new one should be, we need to ignore the heuristic. Ditto for vice-versa. This isomorphic with the read-reversed case
2020-03-06Fix MIDI export and post-export transport issuesRobin Gareus
Bug was introduced in 128a45954cf, declick-amp gain was overridden, but declick not cleared. For some reason this did not affect audio-only exports nor all session exports.
2020-03-06Do not de-click during freewheel exportRobin Gareus
2020-02-21fix playback glitch : do not adjust file_sample[Type] after read, it is ↵Paul Davis
canonical We told the DR to read from pos+shift, and it increment file_sample[T] appropriately. We should not adjust it. The only thing that gets adjusted is the sample that will playback (as a result of PlaybackBuffer::increment_read_ptr()
2020-02-21centralize determination of "read-audio-data-in-reverse" and fix seek ↵Paul Davis
"shift" offset There is still a bug related to "shift" that causes a playback discontinuity
2020-02-20add commentPaul Davis
2020-02-20when seeking in disk reader, adjust start of read (if possible) to allow ↵Paul Davis
some reverse internal seek allowance
2020-02-20fix test to decide if we can skip disk buffer refill because we're close ↵Paul Davis
enough (read direction must match)
2020-02-20variable name change (ffa ... 2nd f was "frame" => fsa ... s is "sample")Paul Davis
2020-02-20correctly track is disk read (audio) should be forwards/backwards, and what ↵Paul Davis
was done last time we read from disk
2020-02-20change variable name to be more meaningful/indicativePaul Davis
2020-02-20remove debug outputPaul Davis
2020-02-20Revert "fix behavior of DiskReader when moved after an instrument"Robin Gareus
This reverts commit b2bc934e218a8ed05b6f37edc5585191e60ca288. The commit does causes issues when a user manually removes channels: The disk-reader's ::can_support_io_configuration() at first ignores the user's request, forcing the output channel count to match the DR's current channel config. However, when configuring the DiskReader after that, channels is updated to match the new input-count. Even though the DR itself only plays back using the confgured I/O, all processors after it still use the old channel count. Only a later, second re-configuration step will apply the actual removal to plugins and port. PS. the original commit was mainly intended to fix a crash when adding an instrument plugin *between* disk-writer and disk-reader on a MIDI track.
2020-02-20Fix crash on buffer override of N/A data-typesRobin Gareus
DiskReader::refill_audio and DR::run() do check if a given playlist is available. This is required for upcoming changes to set DR channels to unconditionally match DiskWriter.
2020-02-20Fix declick at transport start for multi-channel tracksRobin Gareus
2020-02-14Fix seamless looping w/split-cyclesRobin Gareus
This fixes the following (loop-lennth > internal_playback_seek length. Due to read-ahead on some cycles the following can happen --- Loop From: 3528000 To: 3880800 (len: 352800) start-sample: 3880971 playback_sample: 3528171 nframes: 96 start-sample: 3880875 playback_sample: 3528075 nframes: 192 --- which resulted in disk_samples_to_consume == 0;
2020-02-12Fix loop-fade and de-click buffersize calculationRobin Gareus
Exponential approach to zero: 1 / exp(t) == exp (-t) we "stretch" it by a time-constant "c": gain(t) = exp (-t * c) To find the time t, at which the exponential approach reaches gain "g": exp (-c * t) = g take the log of both sides: log (exp (-c * t) = log (g) since log (exp (x)) == x : -c t = log (g) divide by -c : t = -log (g) / c set g = 1e-5 and c = _a/sr and we get: t = -log (1e-5) / (_a/sr) The iterative approach using g += c * (target_gain - g); converges faster than the exact exp() calculation. Except with 32-bit float, if target-gain is 1.0f and "c" is small. With 32bit float (1.0 - 1e-5) = .9999900 is represented as sign: +1 | mantissa: 0x7fff58 | exponent: 126 there are only 126 "steps" to 1.0. Rounding of the lowest mantissa bit does matter. We have to assume worst-case, and increase the required loop_fade_length buffersize. vs. approaching 0, where there are over 2^110 steps between zero and 1e-5.
2020-02-12NO-OP: use #define for de-click + fade gain coefficientRobin Gareus
2020-02-12Prevent out-of-bounds array accessRobin Gareus
2020-02-12fix missing MIDI playback by using correct (expanded) logic in ↵Paul Davis
DiskReader::declick_in_progress() If use_transport_fades() is false, then the declick_amp will have its gain always set to the current target (no declick). Therefore only testing if it has reached zero is not enough, we need to check if we are declicking at all.
2020-01-23extend DEBUG_TRACE outputPaul Davis
2020-01-21add a heuristic to avoid refilling playback buffers at transport stopPaul Davis
If we're within 1/6th of the size of the reserved buffer of the target sample, no need to refill
2020-01-21remove debug outputPaul Davis
2020-01-18Session::request_locate() takes a tri-valued second argument for ↵Paul Davis
"roll-after-locate" This allows callers to defer logic about auto-play/current rolling state and more to TransportFSM where it can be cnentralized and is less ambiguous
2020-01-07fix required offset when reading MIDI data near loop end/startPaul Davis
2020-01-07improved/new DEBUG_TRACE outputPaul Davis
2020-01-07imrpove debug msgPaul Davis
2020-01-03add extensive comment for posterityPaul Davis
2020-01-03fix recent bad commitPaul Davis
2020-01-03fix DiskReader::overwrite_existing_audio()Paul Davis
Several math/geometry errors here
2019-12-19fix thinko ... we're checking if a DiskReader handles audioPaul Davis
2019-12-18do not try to process audio in a diskreader with no audio playlistPaul Davis