Commit Graph

251 Commits

Author SHA1 Message Date
David Robillard
bdacfb8724 Fix invalid use of Doxygen "@param" command
This is never for inline references to parameters, only for starting parameter
documentation blocks.  The "@p" command is for this, although unfortunately
Doxygen doesn't actually do anything with it and it's just an alias for code
text.
2022-10-30 20:44:28 -04:00
Robin Gareus
9327027d98 Revert "Ensure disk buffer refills happen in the right thread"
This reverts commit 96ebac646d.

There are some valid cases where refill is called from the GUI
thread. e.g adding tracks, or adding channels to an existing track.
2022-08-11 22:45:13 +02:00
Robin Gareus
96ebac646d Ensure disk buffer refills happen in the right thread 2022-08-11 19:14:51 +02:00
Robin Gareus
63c068227f Improve DR refill error messages to aid debugging 2022-08-11 19:14:51 +02:00
Robin Gareus
2de84c97d0 Fix Temporal::Range::squish reduced to samples
Loop Location start="a1665678660" end="b145920"
Loop-end (at 122BPM) is a2109859636
at 48kHz this is sample 1794098.32

Now play the loop and play sample 1794098 = a2109859248
Range::squish start: a1665678660 end: a2109859636 squish: a2109859248

squish() does nothing, since there are still 388 superclock-ticks
until the end of the loop.

However, DiskReader::get_midi_playback convertes the value back
to samples(), this leads to effective_start == loop_end;
resulting in an endless loop.

Thanks to MikeLupe to provide a session to reproduce this issue.
2022-07-15 19:54:21 +02:00
Paul Davis
873f78de78 NOOP: rearrange code DiskReader::get_midi_playback() to follow the "early exit for conditional" style guide 2022-06-25 13:36:55 -06:00
Paul Davis
0d9656ef82 use new macros to cleanup #ifndef NDEBUG as much as possible (libs edition) 2022-06-22 13:31:08 -06:00
Paul Davis
1e09e0f6fa fix may-be-used-unset warnin 2022-06-22 13:31:07 -06:00
Paul Davis
ed645761d0 fix optimized unused variable warning 2022-06-22 13:31:07 -06:00
Robin Gareus
9c9a7bbf97 Remove debug message 2022-05-13 21:02:37 +02:00
luz paz
1e640563d6 Fix source comment typos in libs/ardour
Found via `codespell`
2022-05-11 00:14:28 +02:00
Robin Gareus
834ca29cde Silence DR after freewheel export 2022-05-10 16:01:39 +02:00
Paul Davis
7bf89ce109 Constification: make Stateful::get_state() const, with all other required const-ness added (libs) 2022-04-06 21:56:59 -06:00
Robin Gareus
e603b2e12d Remove debug messages (1/2) 2022-03-16 17:08:14 +01:00
Paul Davis
83c7ac4f38 libardour: use Processor::check_active() in all Processors instead of per-processor code
There are a few exceptions where the semantics make this too complex to be worth forcing check_active()
2021-11-29 21:50:29 -07:00
Paul Davis
7c10cf1d54 Automatable now requires (and owns) a time domain to be used by automation data 2021-08-13 12:51:32 -06:00
Paul Davis
fbdf06a794 cleanup after timecnt_t API changed (libs edition) 2021-08-13 12:51:31 -06:00
Paul Davis
eae9d276fe libardour: conversion to use timeline types (mega-commit) 2021-08-13 12:51:29 -06:00
Paul Davis
0cec44ca4b diskreader: avoid double conditional, use else{} instead 2021-04-21 22:51:06 -06:00
Paul Davis
5ebe78ad2d diskreader: fix decrement of start before zero (#8647) 2021-04-21 22:50:26 -06:00
Robin Gareus
cc7b8b1bc5 gcc-11 compat, volatile atomic variables (1/2)
"While 'atomic' has a volatile qualifier, this is a historical
artifact and the pointer passed to it should not be volatile."

Furthermore "It is very important that all accesses to a
particular integer or pointer be performed using only this API"
(from https://developer.gnome.org/glib/2.68/glib-Atomic-Operations.html)

Hence initialization of atomic variables is changed to also use
this API, instead of directly initializing the value.

This also fixes a few cases where atomic variables were
accessed directly.

see also libs/pbd/pbd/g_atomic_compat.h
2021-03-22 15:30:07 +01:00
Robin Gareus
8089998eaa Consistent DiskIO Processor naming
Use a name-prefix when creating the processor just like later
DiskReader::set_name() DiskWriter::set_name() do.
2021-02-19 14:03:32 +01:00
Robin Gareus
acae86781b Fix race condition when deleting tracks
In rare cases it can happen that the GUI thread results in
a call to DropReferences(), while the backend (RCU) still has a
reference to the track and processes the track.

However the call to DropReferences, DiskIO processor will
have cleared the pointer to _track, leading to segfaults when
the processor runs.

Since the DIO processor is owned by the track, one cannot directly
pass a shared_ptr<Track>. That would keep the Track around forever.

However the DIO processor cannot exist without a track passing
a reference is acceptable.
2021-02-14 21:43:36 +01:00
Robin Gareus
751db481a6 Use linear fades for loop-range cross-fades
The cross-over point of an exponential fade occurs further towards
start of the fade. This increases consistency of cross-fades moving
the cross-over point to the center of the fade.

Also looped material is likely correlated in which a linear fade
is more appropriate.
2020-09-25 17:09:25 +02:00
Robin Gareus
c08298e6d8 Fix loop cross-fade glitch #8420
This fixes an off-by one when assigning `fade_length` and
also solves an edge-case with different fade length for
fade-in/fade-out.
2020-09-25 17:09:25 +02:00
Robin Gareus
ecf4a62082 Fix off-by-one in declick fade allocation #8418
This case is only relevant for large sample-rates for
the fade-in curve. see also 6f755c3c02
2020-09-22 16:44:50 +02:00
Robin Gareus
7a9d4b1f64 Tweak default declick fade length #8341 2020-09-04 01:50:58 +02:00
Robin Gareus
fcd347fe0c Fix --no-nls, i18n include order in libs -- #8361
Ardour's "pbd/i18n.h" needs to be included last,
after any include that may indirectly pull in getext or libintl.

For that reason "pbd/i18n.h" must not be used in header files either.
2020-08-19 17:39:32 +02:00
Paul Davis
d812c77362 DiskReader: initialize pre-loop-buffer at the right times 2020-05-15 17:28:18 -06:00
Paul Davis
169e7033b6 DiskReader: improve comment 2020-05-13 23:54:24 -06:00
Paul Davis
d776415d54 DiskReader: always reset file_sample[AUDIO] after an overwrite
In theory we only need to do this if the use of a loop for a given overwrite differs
from the previous refill or overwrite. However, keeping track of this is hard, and
this way effectively enforces the notion that if we do the arithmetic correct,
for cases where there's no change in the use of a loop location, this ends up
being a no-op (i.e. we are resetting it back to its current value)
2020-05-13 23:54:02 -06:00
Paul Davis
7660ea29d2 avoid off-by-one error when overwriting w/loop 2020-05-13 18:52:29 -06:00
Paul Davis
ac915d7d55 NO-OP: remove commented line 2020-05-12 11:34:38 -06:00
Paul Davis
5b7c20453f DiskReader::overwrite_existing_audio() now only overwrites data that would be read
There's no need to fill the whole buffer, because we do not consider the whole buffer readable.
This uses the recently-added PlaybackBuffer::overwritable_at() API to compute the correct
amount of data to overwrite
2020-05-12 11:34:38 -06:00
Paul Davis
af46adc110 NO-OP: expand comments for DiskReader::audio_read() parameters 2020-05-12 11:34:38 -06:00
Paul Davis
f5064fa1ca after an overwrite with the loop location set, reset the next sample to be read 2020-05-12 11:34:38 -06:00
Paul Davis
c2e774e99d trivial reorder of variable assigment 2020-05-12 11:34:37 -06:00
Paul Davis
27e45e9336 Don't bother even checking let alone doing internal seeks for zero distances 2020-05-12 11:34:37 -06:00
Paul Davis
98a3a96d40 use more standard mechanism for "squishing" start of audio read into loop range 2020-05-12 11:34:37 -06:00
Paul Davis
7138e76d2d new mechanism to refill pre-loop buffer when loop changes (used for xfading loop ends) 2020-05-12 11:34:37 -06:00
Paul Davis
5a7b7b3bfb remove Route::reload_loop() and derivatives
Replacement to follow in subsequent commit
2020-05-12 11:34:37 -06:00
Paul Davis
95d9f60035 fix comment typo 2020-05-07 17:40:20 -06:00
Robin Gareus
9604e64c35 Fix initial disk-reader fade-in
Since 4508d5bab this only happened after a fade-out.

Currently there is no fade when transport is stopped and monitor
mode changes MonitoringDisk <-> MonitoringInput.
DiskReader::DeclickAmp is only used for data from disk.
Fading live-input data passing through will likely need another
Amp.
2020-05-07 16:12:52 +02:00
Robin Gareus
4508d5bab1 Set de-click reason monitor vs. start/stop.
Previously use-monitor-fades was unused in A6, and transition
between monitoring states used the use-transport-fades preference.
2020-05-04 21:51:53 +02:00
Robin Gareus
a6f95b21fc Fix alignment and de-click when monitoring changes while playing
Previously it was possible that
 * declick_out = true,
 * target_gain == 0, cur_gain != 0 (fade out active)
 * speed != 0, disk_samples_to_consume > 0.

So the disk-reader advanced the playback_sample, but since
declick_out is active, the read from the ringbuffer was not committed.
2020-05-04 21:48:47 +02:00
Paul Davis
70da4ad893 fix 52b9066511 (incorrect logic). Restores audio playback from disk 2020-04-30 10:36:01 -06:00
Paul Davis
6eb48e40a0 do not set declick_amp's gain for declick out during export of MIDI-only tracks
When export is done, nothing a MIDI-only track will reduce the gain ("goto midi" inside
DiskReader::run() and the "declick-in-progress" state will be permanent
2020-04-29 15:36:07 -06:00
Robin Gareus
26bb781ecd Fix disk-reader alignment when creating tracks while playing 2020-04-14 16:39:30 +02:00
Robin Gareus
ea2bda6668 Fix playback alignment when adding/removing channels
The disk-reader assumes that all playback ringbuffers are in sync
and have the same fill_level.
2020-04-14 03:57:26 +02:00
Paul Davis
9e3efced72 remove debug output 2020-04-10 16:39:29 -06:00