summaryrefslogtreecommitdiff
path: root/libs/ardour/disk_reader.cc
AgeCommit message (Collapse)Author
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
2019-12-18fix crash when looping with a MIDI trackPaul Davis
2019-12-16fix logic error that prevented MIDI playlists from being rendered at load timePaul Davis
An edit was required to force the render
2019-12-14fix behavior of DiskReader when moved after an instrumentPaul Davis
2019-12-13Fix mismatched deleteRobin Gareus
2019-12-12reduce another race condition riskPaul Davis
overwrite_queued == true is equivalent to _pending_overwrite != 0
2019-12-12remove useless lockPaul Davis
rbuf allocation/use is protected by process_lock
2019-12-12fix playback of newly added/modified MIDI dataPaul Davis
2019-12-12expand DEBUG_TRACE() statementPaul Davis
2019-12-11remove MIDI readahead parameterPaul Davis
We just don't do this anymore
2019-12-11variable renaming in Butler for various buffer sizesPaul Davis
2019-12-10should probably resolve MIDI notes when loop bounds changePaul Davis
We don't really need to do this if the bounds have moved "outwards", but at present we don't know if that is the case, so be safe and resolve in case the loop bounds moved "inwards" and we would otherwise get stuck notes caused by the now-missing noteOffs
2019-12-10fix unnecssary disruption of MIDI stream when disabling loopPaul Davis
2019-12-10use PlayistChanged appropriately to fix MIDI outputPaul Davis
We didn't render the MIDI data when a playlist was set, only when modified.
2019-12-10revert to single buffer for disk playback, and 5.x-style overwritePaul Davis
Also address issues with MIDI and also atomicity of _pending_overwrite
2019-12-08fix error when continuing to refill audio playback buffers after a buffer switchPaul Davis
The file_sample[AUDIO] member was not updated to reflect the last-read sample in the switched-to buffer. Also move several methods and members from DiskIO to DiskReader where they belong.
2019-12-08more debug outputPaul Davis
2019-12-07functional double buffering when using DiskReader::overwrite_existing_buffersPaul Davis
2019-12-07a few parameter changes, and flesh out code to switch rbufs in DiskReaderPaul Davis
2019-12-07initial conversion to double buffering inside DiskReaderPaul Davis
Second buffer is not used (or allocated) yet.
2019-11-24fix crash when using Region > LoopPaul Davis
2019-11-23remove debug outputPaul Davis
2019-11-23remove debug message about LOCATE WITHOUT DECLICK. This behavior is normal ↵Paul Davis
and legal when looping
2019-11-23more tweaks to correctly (or more correctly) reload disk reader buffers when ↵Paul Davis
loop fade choice changes
2019-11-22redesign of declicking and fades around loop boundariesPaul Davis
2019-11-21Fix multi-channel de-clickRobin Gareus
_declick_amp gain needs to be reset for each channel before the test (_declick_amp.gain() != target_gain) if de-clicking is needed.
2019-11-19Fix declick offset position for multi-channel tracksRobin Gareus
2019-11-18DiskReader::_declick_offs should only advance once per ::run() callPaul Davis
2019-11-18DiskReader::_declick_amp needs to repeat the same work for each audio ↵Paul Davis
channel handled
2019-11-18small changes to make declick out triggered by just stoppingPaul Davis
2019-11-18add missing NULL checkPaul Davis
2019-11-18use reverse-reading of MIDI data in DiskReaderPaul Davis