13
0
Commit Graph

19390 Commits

Author SHA1 Message Date
543bb85157
Use process-graph for silencing routes during audition
Route::silence() runs plugins. With a heavy session
that relies on multi-core processing, sending silence
to processors will have to be done in parallel.
Otherwise it can result in large DSP load and xruns.

This may allow to revert b3497b3f8f, which was
a prior attempt to resolve this, before understanding
the actual cause.
2022-06-03 22:50:13 +02:00
3e1e0d94c5
Add Process Graph API for Route::silence() processing 2022-06-03 22:50:13 +02:00
57a1dbb375
Update route API for silent processing 2022-06-03 22:50:13 +02:00
191fdfda72
Leave a note for RT-Tasklists (need macOS workgroups) 2022-06-03 22:50:13 +02:00
99e785541a
Coreaudio/M1: prefer device IOThread Workgroup 2022-06-03 22:50:13 +02:00
88a035b000 temporal: changes in API to better support BBT markers 2022-06-03 13:19:56 -06:00
531db75a27 temporal: when dragging tempo/meter, move in points list as well
We spliced the point back into the tempo and meter lists correctly, but failed
to do the same thing for the same object's position in the points list.
2022-06-03 10:53:01 -06:00
7dadb1407b temporal: when copying points between TempoMaps do not double-count MusicTimePoints
They were counted as tempos, and meters, and bartimes individually, which
generated new tempo and meter points in the map, which is incorrect.
2022-06-03 10:53:01 -06:00
1b904285be temporal: improve utility of TempoMap::dump() output 2022-06-03 10:53:01 -06:00
b3497b3f8f
Debug noseq's audition issue - silent plugin processing
When auditioning, ardour's process_audition calls Route::silence
for all routes. PluginInsert::silence simply fed all [ports of all
[replicated] plugins with silence, regardless of port-mapping.
This can cause some VST2/3 plugins to change state, and enable ports
(e.g. stereo VST2 plugins on mono tracks), causing glitches.

This commit is mainly intended to investigate how significant
this glitch is when starting to audition.
2022-06-03 17:17:07 +02:00
fa8f75c145
Fix yet another oversight when coding blindly in 6a513a11f 2022-06-03 07:29:23 +02:00
5417ddd792
Fix typo in 6a513a11f 2022-06-03 07:24:42 +02:00
58979af4f2
Coreaudio: update workgroup query 2022-06-03 06:42:42 +02:00
6a513a11fa
Coreaudio: set real-time constraint before joining the workgroup
The worker thread needs to have a real-time constraint set,
before it cab be joined to the workgroup.
2022-06-03 06:42:38 +02:00
87ee609339
Amend previous commit, fix debug print format 2022-06-03 05:32:19 +02:00
fd5d290217
Fix mach thread time constraints on M1
or any system where timebase is not 1 tick per ns.
2022-06-03 05:27:42 +02:00
74ee7ee091
Add parallel realtime threads to CoreAudio workgroup
This API is only available since BigSur (11.0), see also
https://developer.apple.com/documentation/audiotoolbox/workgroup_management/adding_parallel_real-time_threads_to_audio_workgroups?language=objc
2022-06-03 04:56:28 +02:00
88e9fc3e22
Remove unneccesary include (now handled by libpbd) 2022-06-03 04:52:38 +02:00
c2cff575b7
Add debug info to track down M1 time-constraint issue 2022-06-03 03:52:43 +02:00
972389e1bd
Tweak PluginInsert::silence (used during audition, etc)
Actually run plugins (use _pending_active), and feed silence
to the plugin. Also update timing stats accordingly.
2022-06-03 01:30:02 +02:00
ef4bbae02e
Fix logic in nth_mixer_scene (amend 00bd313e6e)
_mixer_scenes[nth] may not exist, size check condition needs
to happen first. Writer lock is only required when changing the
vector.
2022-06-01 16:26:51 +02:00
00bd313e6e Mixer Scenes: fix code thinkos for sparsely-populated vector of scenes
* don't create a new MixerScene if one already exists
* only resize the vector when necessary
* adding a new scene at position N should not shrink the vector size
2022-06-01 08:53:50 -05:00
2d24bcdf4a temporal: add operator== and operator!= for ratio_t 2022-05-31 12:36:54 -06:00
192b2fd839 temporal: fixes for TempoMap::move_meter() 2022-05-30 21:14:57 -06:00
60db5a827f
Use SYS_futex instead of __NR_futex
Use the C library definition for portability; also test
for support instead of unconditionally enabling it.
2022-05-30 21:56:49 +02:00
ce7d8ed8a1
Fix consolidating to FLAC file(s)
FLAC file needs to be re-opened read-only. FLAC files do not have a
read/write mode.
2022-05-30 20:46:23 +02:00
5658e18815
Fix occasional crash at end of clip playback
Previously it was possible to cause a 64bit signed to 32bit
unsigned overflow. `from_stretcher` is pframes_t aka. uint32_t.
With int64_t arguments a std::min() expression producing negative
result will result in large 32bit values:

(pframes_t) std::min<int64_t>(1024, 176400 - 187392) = 4294956304

This produced a segfault when used as n_samples to copy in
buf.accumulate_from()
2022-05-29 23:35:51 +02:00
710cca9ccf change logic for memory management when adding tempo,meter,bartime points
Because a bartime point IS-A tempo point and IS-A meter point, we cannot just delete the tempo
point passed into core_add_tempo() if the new point replaces an existing one. Ditto for meter.

So, leave that logic up to the caller
2022-05-29 15:01:54 -06:00
ef07fb601a libcanvas: FramedCanvas::covers() method is ill-conceived. Use PolyItem::covers() 2022-05-29 14:19:02 -06:00
cca3e6e061 temporal: fix bug introduced in 48f4f9bf9c
timecnt_t and timepos_t constructors with the initial argument as an int64_t
are assumed to be using samples. We need to use the explicit factory methods
instead.
2022-05-28 12:59:35 -06:00
dancesWithBugs
e505407b76
fix boundary check 2022-05-28 19:14:57 +02:00
51b507b831
Skip any postprocessing when exporting for analysis only 2022-05-28 18:20:22 +02:00
c1f92861c6 triggerbox: fix responses to "Play Cues" button being clicked
Session handles the case when the button is used to enable cue triggering, by
forcing a locate to the current transport position.

TriggerBox now connects to the correct configuration object to notice when cue
triggering is disabled, and sets _cancel_locate_armed appropriately.
2022-05-27 23:05:34 -06:00
cc2e6b3cf8 libardour: change API of Session::request_locate() to include "force" argument
No behavior should be changed by this modification; the argument has a default value of false, which
matches previous semantics, and every instance where the argument is specified, it is given as false.
2022-05-27 18:49:11 -06:00
03649dc32a temporal: fix bug in TempoMap::get_grid() when next point (eg. BBT) is not on grid 2022-05-27 18:46:06 -06:00
39248d682d add ::time_domain() methods to Playlist and Region
These are heuristics based on data type for now. That may evolve over time,
but it's a reasonable place to begin
2022-05-27 15:56:13 -06:00
c8feef51ab convert use of operator* for tim::line types with ::scale(ratio_t) 2022-05-27 12:47:44 -06:00
48f4f9bf9c temporal: remove some arithmetic operators and rewrite others to use muldiv() 2022-05-27 12:47:44 -06:00
12e5042ece libpbd: add muldiv() to compute v * (n/d) without overflow 2022-05-27 12:47:44 -06:00
5175260af4 temporal: remove dangerous muldiv methods and use explicit method name not cast 2022-05-27 12:47:44 -06:00
927562678b
Do not emit MixerScene signal with locked mutex (fixes ndeadlck) 2022-05-26 16:18:00 +02:00
30c073f669 temporal: fix double negative causing semantic confusing and crashing 2022-05-25 21:53:27 -06:00
John Emmas
ee7e043855 class 'ARDOUR::Session::ProcessorChangeBlocker' gets used outside of libardour now (so needs to be exportable) 2022-05-25 12:26:09 +01:00
60e5b84d78 temporal: alternative solution to overflow in timeline operator*()
This uses boost::multiprecision::int512_t when multiplying and dividing by the numerator
and denominator of a ratio_t. 128 bits would be sufficient but for some reason, the boost
docs show the 512 bit variant being very slightly faster.

This is a better solution than using a double, which although it will prevent overflow
has fairly limited resolution.
2022-05-24 21:46:10 -06:00
540a15efa0 temporal: remove debug output 2022-05-24 18:08:31 -06:00
a7ee848f70 temporal: improve accuracy of a comment/XXX item 2022-05-24 17:21:18 -06:00
Mads Kiilerich
c1c95f538f evoral: fix ControlList::_x_scale to avoid ratio overflow when adjusting fade length
Region fades would sometimes get in a mode with weird behaviour. They
would be drawn in 2d with crossing lines, mainly moving back and forth
horizontally - not as a function of time. It would sound as it looked.
The fade would sometimes jump around when resizing. It could be worked
around by resetting the fade shape. It turned out the problem could be
reproduced by making minute long fades.

This change fixes or works around the problem.

Back story:

timepos_t (in temporal/timeline.h) uses 62 bit for integer value and the
max value is thus 4611686018427387904 ~ 5e18. timepos_t counts
superclocks, where superclock_ticks_per_second is 56448000 ~ 6e7. It can
thus store up to 8e10 seconds - thousands of years.

ratio_t (in temporal/types.h) can represent fractions as 64 bit (signed)
numerator and denominator. timepos_t avoids floating point operations,
but has operator* with ratio_t. To avoid crazy loss of precision it will
multiply the superclock count with the numerator before dividing with
the denominator.

Audio region fade in and out uses a number of increasing timepos_t
values (in a ControlList) up to the length of fade. When dragging to
resize, these values are (in_x_scale) multiplied with the ratio_t of the
new and old fade length. The problem is that the 62 bits will overflow
if using fades more than sqrt(5e18) ~ 2e9 superclock ticks ~ 38 seconds.
It will overflow into the "beat" flag and (at 58 seconds) into the sign
bit. The timepos_t values in the fade will thus jump and can be negative
or change to count beats.

To work around that problem, this changeset just use floating point
values for scaling the timepos_t values. All scaled values are stored as
integer anyway, so it should not make any actual difference for this use
case. There might however be other uses of ControlList where it matters.

As an implementation detail of this "workaround" of using double, it
could perhaps also be nice to implement timepos_t operator* (or
operator*=) for double. But I'm not sure we want floating point support
in timepos_t.

An alternative (and better) solution would be to convince the fraction
multiplication to use 128 bits. It is essential to avoid overflow -
mainly in static analysis, alternatively as runtime checks or asserts.
2022-05-24 17:15:37 -06:00
Mads Kiilerich
2f5f917df2 libs/temporal: clarify superclocks-per-second usage comment 2022-05-24 17:15:37 -06:00
Mads Kiilerich
aadd24a4e5 libs/temporal/temporal/types.h: fix confusing indentation 2022-05-24 17:15:37 -06:00
25dc926f24 temporal: improve handling of MusicTimePoints and related matters 2022-05-24 17:10:25 -06:00
d48ee3df0e temporal: improve debug output when ::superclock_at() returns < 0 2022-05-24 17:10:25 -06:00
8ee7dc35f4 temporal: improve operator<< for MusicTimePoint 2022-05-24 17:10:25 -06:00
735835dff3 temporal: improve output of TempoMap::dump() 2022-05-24 17:10:25 -06:00
c48430f502 temporal: refactor methods to add tempo/meter points 2022-05-24 17:10:25 -06:00
ef1f814837 temporal: remove commented constructor 2022-05-24 17:10:25 -06:00
e3501a05f8 temporal: remove the concept of a time domain for the tempo map
TempoPoint and MeterPoint always have their position set in musical time; MusicTimePoint (BBT)
always has a position in audio time. It's that simple
2022-05-24 17:10:25 -06:00
7f5a576f66 temporal: fix continuing tempo section's tempo after end-stretch 2022-05-24 17:10:25 -06:00
e7e467264f temporal: add TempoMap::set_continuing() and make it and set_ramped return bool 2022-05-24 17:10:25 -06:00
f2a596669e temporal: set speed *and* tempo when setting tempo 2022-05-24 17:10:25 -06:00
e863a7dbc9
Allow to configure vari-speed resampler quality
This also allows to disable the resampler, effectively disabling
varispeed support, for the benefit of adding no additional latency.
By default 2 * 16 samples latency are added, due to port-resampler,
this is not desirable if Ardour is used as mixer only.
2022-05-24 20:41:59 +02:00
bb4a45ebaf
zita-resampler: pass-through data if not configured
This is in preparation to allow fixed-speed processing without
resampler latency
2022-05-24 20:41:59 +02:00
f02e8d34e3
Make resampler reset idempotent 2022-05-24 20:41:56 +02:00
83b5be1add
Add static signal to indicate MixerScene changes 2022-05-24 20:08:05 +02:00
4d5ac90248
Only emit RouteProcessorChange if disk-i/o point actually changes 2022-05-24 02:26:56 +02:00
baa30262b8
Be more specific about RouteProcessorChange signals
Session::route_processors_changed accumulates signals emitted
in realtime and processing is delegated to a dedicated rt-safe
thread. Previously this resulted in any changed to be converted
to a `GeneralChange`, which unconditionally triggered a route-reorder.

Record-arming a track causes a MeterPointChange (meters change to "in"),
and this caused routes to be resorted and a latency-update.

While the former is reasonable (Ardour prefers to process
rec-armed routes first), the latter certainly is not.
2022-05-24 02:26:56 +02:00
20d7313e13 temporal: change "clamped" terminology to "continuing" (since that's what the GUI calls it) 2022-05-23 08:07:08 -06:00
1179b022da temporal: fix error in TempoMap::previous_tempo() 2022-05-21 18:58:41 -06:00
8de52a74bb temporal: better fix for tempo ramp setting during ::reset_starting_at() 2022-05-21 17:28:38 -06:00
5c8b7519c1 remove debug-only direct-to-output debug info that duplicates a DEBUG_TRACE msg 2022-05-21 16:38:36 -06:00
c4844b00e3 temporal: when calling TempoMap::reset_starting_at(), fix ramps
Even if we start at time T, if the tempo point before T is ramped, we need to
adjust it's omega value based on the beat time of the following tempo point. If
we don't do this, then using that tempo to compute ::superclock_at() for
subsequent points will be incorrect.

Note: there may be an ordering issue here with Tempo/Meter points. We might
need to pass over all tempo points first, then process meters etc. Something
like that.
2022-05-21 16:35:00 -06:00
029ef88059 temporal: wrap some calls to TempoMap::dump() in appropriate DEBUG stuff 2022-05-21 16:35:00 -06:00
a0810ed608
LV2: pass patch-set messages to replicated plugin instances
This also fixes impulse analysis plugin display
2022-05-22 00:16:22 +02:00
58372f5b78
Fix macOS builds, size_t serialization
See also e1905e779b
2022-05-21 21:09:21 +02:00
e1905e779b
Fix macOS builds, size_t serialization
libs/ardour/session_state.cc:1500:13: note: in instantiation of
 function template specialization 'XMLNode::set_property<unsigned long>'
 requested here
libs/pbd/pbd/string_convert.h:151:11: error:
  type 'unsigned long' cannot be used prior to '::' because it
  has no members
2022-05-21 07:44:39 +02:00
ba675fa0e9
Remove old, now unused freesound path config 2022-05-20 22:03:14 +02:00
5476a20fc4 temporal: fix conditional when deciding which log expression to use inside ::superclock_at() 2022-05-20 11:20:39 -06:00
2129552777
MixerScene: correctly restore controls with VCA master
The master needs to be restored first, otherwise setting
the master value with be propagated. Furthermore the
actual value is saved at the time of VCA assignment.
Restoring the vaule needs to scale by the master-reduced value.
2022-05-20 19:10:16 +02:00
7d6e429001
Add API to query control-masters
This allows to traverse VCA masters upstream, and potentially
build a graph.
2022-05-20 19:10:13 +02:00
9dd4931247 temporal: revert changes that created two different omegas; fix computation of ::superclock_at() for decelerando
changes in tempo can be negative (decelerando/slowing down), and thus so can _omega. We cannot call log() or its
cousins on negative values, so in this scenario use an alternate expression for "t from b" in the tempo.pdf paper
2022-05-20 09:06:25 -06:00
c4307667fb freesound: add a DebugBit
Add a new DebugBit value for Freesound
2022-05-20 14:33:57 +01:00
e1f5fb0206 libpbd: change GlibEventLoopCallback to use C API not C++
We discovered in the past that the C++ API for GSource/Glib::Source has some fatal and unfixable flaws. Copy similar
code and just use the C API for GSource instead
2022-05-19 22:24:43 -06:00
04aaf23851
Add Lua bindings for MixerScene 2022-05-19 23:32:01 +02:00
48fdfbab53
Implement Session support for Mixer Scenes 2022-05-19 23:31:54 +02:00
bdc5711c31
Implement mixer-scene class 2022-05-19 20:08:24 +02:00
a811583380
Add API to query registered controllers 2022-05-19 20:08:08 +02:00
276172b8b1
Fix PhaseControl set_value()
Previously this resulted in excessive "000...000" state string.
2022-05-19 20:08:00 +02:00
5c85695362
Add Input Port meters for I/O Pre-Plugin outputs 2022-05-17 02:26:28 +02:00
cdf3b5209e
Generalize input-meters 2022-05-17 02:26:28 +02:00
4c1506e50e add copyright notices 2022-05-16 15:41:56 -06:00
9758e6280f use new event loop callback to ensure that all surface/control protocol threads have tempo map ptr set 2022-05-16 15:24:52 -06:00
968533cc23 (re)add mechanism for a callback in any glib event loop executed before the loop "executes"
This is based on code from earlier commits that were later reversed, but we need some mechanism
to ensure that threads have a thread local tempo map ptr set. The big difference is that this
time we do not implement this for all instances of an AbstractUI - implementation is left to
each thread/event loop
2022-05-16 15:24:52 -06:00
2079a150dd probable fix for Mackie vpot press/release misbehavior in sends (and plugin) subview
The accessed control needs to reflect the current subview banking
2022-05-16 15:24:52 -06:00
e528c4df92
Fix export-processor position, include triggerbox output 2022-05-16 14:32:47 +02:00
cd332a2af0 when pasting a Range of automation, first add guard points,
so the automation data before and after this range is retained
2022-05-16 07:16:25 -05:00
3a174ff914 add support for 'positive' guard points in ControlList 2022-05-16 07:16:25 -05:00
c98561e95c when cutting or clearing an automation range, always add boundary points
* these guard points are necessary to retain the automation that existed
 before and after the selected range is removed
2022-05-16 07:16:24 -05:00
44e273d713
Overhaul export channel state save/load
This allows to properly save/restore Route and Port
channel config states.
2022-05-16 04:54:17 +02:00
f6e67875f4
Implement MIDI ExportGraph processing 2022-05-16 04:54:17 +02:00
aa09a445e3
Bootstrap MIDI export writer
This leans on the AudioGrapher API for IdentityVertex.
2022-05-16 04:54:17 +02:00
719dda7701
Implement MIDI ExportChannel
Since MIDI Export is limited to Stem-Export, only a port-reader
and ExportProcessor have to be implemented.
2022-05-16 04:54:17 +02:00
4c4ab9cf51
Prepare PortExportChannel API for MIDI export 2022-05-16 04:54:17 +02:00
7c2cb31b63 temporal: use boost::intrusive ::iterator_to to improve efficiency of ::next/previous_tempo() 2022-05-15 17:49:09 -06:00
a522a98118
Add API to query fixed delay line's delay time 2022-05-15 19:32:46 +02:00
ae0aa50b6f
Fix MIDI delay-line (amend 25098ed)
Events in the delay-buffer must be shifted back every cycle.
Also in case of fixed-delay-lines events may not be in sequence
since events are only sorted at backend port-level.
2022-05-15 19:20:32 +02:00
d55d3a7360
Save/load export timespan realtime setting 2022-05-15 02:20:19 +02:00
4577f86aa0
NO-OP: clang-format 2022-05-15 02:19:46 +02:00
86597d7e1c
NO-OP: re-indent, and cleanup 2022-05-14 23:32:26 +02:00
0cfbc64e54 triggerbox: given no other info, assume a clip is 1,2,4,8 or 16 bars at 4/4
this solves the oft-recurring problem where we assign
 a beat-count of '3' or '7' because minipm  mis-detected the tempo,
 and that situation is vanishingly rare.  it's better to assume 4 or 8

the user always has the option to change the number of beats (and
 therefore the detected tempo) manually, for those clips that are
 in a different time signature.  but minibpm cannot be expected
 to help us there.

NOTE: this is a fallback to make things 'just work' lacking any other context.

* if the tempo is detected in the filename, we use that instead
* clips that were recorded to the timeline use that bpm+timesig
* in the future we can use file-metadata (acidized wave?) instead
* this is audio-only: midi files can have an embedded timesignature

but... given no other information, experience says the vast majority
of downloaded/purchased clips will be 1,2 or 4 bars at 4/4.
2022-05-14 14:16:21 -05:00
be5c64f737 temporal: NOOP - add blank line 2022-05-13 19:05:13 -06:00
1ccda17504 temporal: add a new version of tempo twist based on pre-nutempo code 2022-05-13 19:05:13 -06:00
60159acd33 temporal: slightly change const positioning in definition of ::stretch_tempo() 2022-05-13 19:05:13 -06:00
b0ff612572 temporal: add DEBUG_TRACE message 2022-05-13 19:05:13 -06:00
4defa3ae8f temporal: fix logic bug in TempoMap::reset_starting_at() 2022-05-13 19:05:13 -06:00
c9b7f012e4 temporal: helpful comment for future readers 2022-05-13 19:05:13 -06:00
f0f8f15cce temporal: missing change from 072a7b17a22f 2022-05-13 19:05:13 -06:00
51980b15cd temporal: split _omega into two values, for each time domain
omega can be computed from Beat or superclock duration. This gives rise to
different units for omega, and we must use the correct value in a given
context.

This commit also changes the way that the audio time omega is computed during
TempoMap::reset_starting_at()
2022-05-13 19:05:13 -06:00
f679cd6eab temporal: remove Rampable, change name of method to set end note types per minute
Rampable only existed to provide exclusive access to ::set_end() for the
TempoMap. More idiomatic C++ but now that _type has also gone away, so has
::set_ramped() and it really was not worth keeping it around.
2022-05-13 19:05:13 -06:00
8770df611c temporal: remove TempoMap::_type concept
Ramped/Constant is really a function of start/end note_types_per_minute. Having
a separate member is really just caching it and leads to errors or risk thereof.
2022-05-13 19:05:13 -06:00
43b3ec005f temporal: use new debug bit for debug output in reset_starting_at() 2022-05-13 19:05:13 -06:00
5d22e522d1 temporal: add new debug bit for debug tracing just TempoMap::reset_starting_at() 2022-05-13 19:05:13 -06:00
45de3694cc temporal: add reimplemented version of 6.x's TempoMap::gui_stretch_tempo() 2022-05-13 19:05:13 -06:00
db9cc04230 temporal: remove debug output from TempoMap::reset_starting_at() 2022-05-13 19:05:13 -06:00
itmuckel
9178ca635a
Remove unused imports and modernize stateful.cc 2022-05-13 23:07:49 +02:00
9c9a7bbf97
Remove debug message 2022-05-13 21:02:37 +02:00
3b13dc9b54
Remove unused method declaration 2022-05-13 19:38:12 +02:00
f8aecc460c
Use new hard-stop API to stop transport before export 2022-05-13 19:38:11 +02:00
25098edfc1
Fix MIDI delaylines
MidiBuffer::read_from() clears the buffer, so events were not
accumulated into the delay-buffer.

This also includes a small optimization and comments for the
variable delayline.
2022-05-13 19:38:07 +02:00
a899136cae Fix egregious playlist copy+paste thinko
* when you copy a Range into a playlist, the playlist's 'timeline' should
 begin at the start of the selected Range.  Regions should retain the
 offset they had from the Range's start.
2022-05-13 12:05:04 -05:00
1fdfa53b9f region::absolute_time_to_region_beats() needs to incorporate start offset
* this fixes the Draw tool when adding notes;  if you tried to draw in
 a region with a trimmed front, the note would not get added in the correct
 location
2022-05-12 12:15:53 -05:00
luz paz
78f1205806 Fix typos in source foward(s)->forwards(s)
Fix source typos
2022-05-12 10:15:15 -04:00
luz paz
b3c0143df7 Fix typos in source functionmax_configurable_outputs
Fixes source typo
2022-05-12 09:18:32 -04:00
40fa6e2023
Improve PBD::Semaphore performance
Skip syscall if no threads are waiting and decouple atomic
value from futex address so that FUTEX_WAIT does not fail.
2022-05-12 05:27:27 +02:00
f849f3ce2c
Use futex semaphores on Linux only 2022-05-12 00:56:33 +02:00
13cac5c139
Grow Graph and RTTask MPMC queues as required
This fixes an issue if with sessions where a process-graph can
have more than 1024 routes to be processed concurrently.
2022-05-12 00:44:39 +02:00
5ca76789c5
Allow to query capacity of MPMC queue
This is in preparation to grow the queue as needed.
2022-05-12 00:40:31 +02:00
c87a5cdcfd
Remove mutex from RTTaskList, use MPMC queue 2022-05-11 23:55:41 +02:00
34678c094a
Implement Futex semaphore 2022-05-11 23:55:41 +02:00
luz paz
36ae8e7022
Fixed typo that may also be a bugfix 2022-05-11 00:14:28 +02:00
luz paz
1e640563d6
Fix source comment typos in libs/ardour
Found via `codespell`
2022-05-11 00:14:28 +02:00
a251ba3b76 pt_import: since we aren't using undo here, need to delete the diff_command manually 2022-05-10 15:47:56 -05:00
f50d5507c3 midi_model: rename some midi diff functions, to (try to) avoid confusion
syntax for beginning and ending a diff command is:
 "new_diff_command"  ->  "apply_diff_command"

syntax for applying a diff_command is:
 "_as_commit" :  Begins and Commits a standalone undo Command
 "_as_subcommand" :  adds to undo but does not Begin or Commit a Command
 "_only" : (new) applies the note_diff but does not have any effect on undo
2022-05-10 15:47:20 -05:00
c44d692390 Create a trap for overlapping or nested undo commands 2022-05-10 13:14:08 -05:00
a57f4fbce6 temporal: after changing a tempo point, reset the map starting at that point 2022-05-10 09:46:08 -06:00
be90b4e0ca US2400 - fix crash when no strip is selected
first selected could be null, so check that first.
This is untested since I don't have a surface.
2022-05-10 09:17:33 -05:00
834ca29cde
Silence DR after freewheel export 2022-05-10 16:01:39 +02:00
445e8c468e
Add TSFM API to immediately stop the transport
This is useful after a freewheel export, where a realtime-stop
is called, but the actual Locate/MustStop event is only processed
later. Once the session switches back to normal processing after
export the transport is still rolling, TSFM schedules a de-click
locate. This may play some remaining audio.

This new API allows to hard stop the transport, without going
via any session-events and process_with_events. It is intended to
be called from the freewheel process-callback in the last export
cycle.
2022-05-10 16:01:39 +02:00
2fc43c59c4
Fix audible hiccup at end of realtime export 2022-05-10 16:01:39 +02:00
1809b6ae9a
Reset port resampler after freewheeling
This clears out any data potently left there by export processing.
Previously this could cause an audible click.
2022-05-10 16:01:39 +02:00
a97e910b70
Debug efficiency of latency and graph order callbacks 2022-05-09 17:39:05 +02:00
3f1420880b
Implement IOPlug processing using the Process Graph 2022-05-09 17:39:05 +02:00
af6f8abdc7
Prepare IOPlug processing as GraphNode 2022-05-09 17:39:05 +02:00
c45a6b80c7
Session support to add/remove save/load IOPlugs 2022-05-09 17:39:05 +02:00
74f71c6683
Session-wide plugin support (IOPlug)
The idea is to run a plugin outside the process graph, and provide
its I/O as port (much like an external JACK app).

The intended use-case is NDI (provide additional I/O), but it could
also be useful for other cases.
2022-05-09 17:39:05 +02:00
8a90d4a414
Fix another possible memory leak in BPM detection code 2022-05-09 17:34:59 +02:00
f0a8b8cd6d
Fix an unlikely memory leak in zita-resampler 2022-05-07 04:19:16 +02:00
221975a982
Fix memory-leak in BPM detection 2022-05-07 04:19:12 +02:00
46117303da
Fix some potentially uninitialized variables 2022-05-07 04:19:09 +02:00
f5b280a850
Generalize graph processing
This allows to pass any GraphChain to the Graph to process.
It removes the need to use a mutex to swap two dedicated
chains (setup-chain <> active-chain, pending-chain).

Also various special cases pertaining to graph interaction
while auditioning and route-deletion can be removed.

This also unconditionally creates a graph-thread for GraphChains
to be processed, even if the main callback uses a special-cased
sorted RouteList if there is only one process thread.
2022-05-06 17:43:01 +02:00
5fa7d481c1
Optimize Route::direct_feeds_according_to_reality
Consolidate duplicate function calls, cache result in local variable.
2022-05-06 14:02:35 +02:00
44bb8caa65
Use new Route fed-by API (2/2) 2022-05-06 14:02:35 +02:00
9ad154f265
Untangle Graph from Route
The process-graph should only be concerned with GraphNodes,
which may or may not be Routes.

This also removes intrinsic connection information from
the graph-node. Connection information is to be kept separate
from the nodes.

When the graph is re-calculated in the background, old information
has to be retained until the new graph becomes active.

Previously *new* information was already stored in the nodes
while the graph is sorted, even though the new graph was not
active.
2022-05-06 14:02:34 +02:00
3862d13e21
Prepare for GraphNode::feeds () and fed-by API update (2/2) 2022-05-06 14:02:34 +02:00
078e652859
Implement rt-safe deletion - delegate to butler 2022-05-06 14:02:32 +02:00
226dadbd19
Further reduce DSP load of debug builds
In all years of using these assert()s never triggered. Besides
there are valid_port() tests in other strategic locations that
are not periodically hit in realtime context.
2022-05-06 02:04:55 +02:00
ed21ea8fc6
Speed up valid-port changes O(n) -> O(log(n))
This significantly reduces DSP load of sessions with many ports
when using debug builds.
2022-05-06 02:04:49 +02:00
37c0fceeac
Prefer comparison operators as part of the class 2022-05-06 02:04:43 +02:00
ce95c9fb09
Fix std::set< BackendPortPtr> lookup by key
The set uses a custom sort-by-name comparator.
Previously it was possible to have an inconsistent set iterator.
std::set::find() did not find a given port while std::find() did.

This fixes using std::set::find() on the PortIndex set.
2022-05-06 02:04:33 +02:00
668cb1ca3b
Set names of RT tasks threads 2022-05-05 00:54:47 +02:00
6c2c3a49c4
Update comment about required buffers 2022-05-05 00:54:47 +02:00
John Emmas
2554302281 Export a variable which can't be accessed via a 'get()' function
Temporal::most_recent_engine_sample_rate is used in performance-critical code so shouldn't be accessed via a 'get()' function. But (via the TEMPORAL_SAMPLE_RATE #define) it does get accessed outside of libtemporal and therefore needs to get exported.
2022-05-04 16:09:34 +01:00
28231d6365
NO-OP: cleanup public API, re-indent source 2022-05-04 05:58:06 +02:00
96c138c985
ALSA: prevent excessive slave-device latency updates on underrun 2022-05-04 05:57:52 +02:00
John Emmas
2245e362b9 TempoMap::twist_tempi() gets used outside of libtemporal so needs to get exported 2022-05-03 11:31:43 +01:00
Caleb Potter
b689d2881e M: US2400: allows user to bank over sends while in TrackView.
Sends only appear on the last 8 vpots, which means sends to matrices 9-12
are unreachable without banking.
2022-05-02 22:41:40 -06:00
Caleb Potter
20fff72370 US2400: Use Bank- and Bank+ to page over sends on pots 2022-05-02 22:41:40 -06:00
Caleb Potter
0d05cd231b US2400: maps track parameters and sends to vpots
Pots 0-4 now display the 5 parameters from the Mackie track subview when a
track is selected and pots 8-23 will display up to the first 16 sends.
2022-05-02 22:41:40 -06:00
b5487415ec editing: a partiaally implemented version of TempoTwistDrag, to be completed. 2022-05-02 16:47:23 -06:00
86e7a1b259 temporal: no reason for Point::set() to be virtual 2022-05-02 16:45:33 -06:00
55755d5453 temporal: fix TempoMap::reset_starting_at()
We were using a given tempo or meter point as part of the metric used when
recomputing its position. In fact, the metric should be only use the
tempo/meter immediately preceding the given point.
2022-05-02 16:44:15 -06:00
00b9e3f86a temporal: change return type of TempoMap::next_tempo()
It is more useful to get the actual TempoPoint than just the Tempo
that we discover.

Aside: it would be awesome to understand how to use boost::intrusive to get the
next tempo point directly from the tempo hook.
2022-05-02 11:40:23 -06:00
2b8b9a3a2f const for const-sake 2022-05-01 18:01:35 -06:00
d218dcb21b evoral: when adding points to a ControlList, coerce the time domain of the new point to the list time domain
This may not be the ideal solution, but for now it appears to be the best approach to preventing
points with different time domains with the same list
2022-05-01 17:50:51 -06:00
f7e917c123
Potential fix for M1 x-thread events
On M1, the cross-thread channel sets G_IO_PRI in addition to G_IO_IN
this breaks various assumptions in receivers, which test for ~G_IO_IN
as error condition.
2022-05-02 00:02:33 +02:00
8b97abee19 change location of TempoMap::fetch() call in graph main thread to match semantic equivalent in process threads 2022-04-30 19:16:31 -06:00
f3bf91b9b1 fix another use of a reader lock by a source (comments explain more) 2022-04-30 17:25:53 -06:00
b74fb262fa use a very very slightly more convenient and possibly more correct method for LV2 bpm port 2022-04-28 14:33:39 -06:00
51ebb143de on windows, allow ARDOUR_DATA_PATH envvar to be used in the data search path 2022-04-28 14:33:39 -06:00
7cd16d9473
Apply new Item method name to various other usage sites 2022-04-27 13:16:18 +02:00
c9b8a91edb apply new Item method name to various other usage sites 2022-04-26 22:04:08 -06:00
f913373351 canvas: change Item::bb_clean() to better named Item::set_bbox_clean() 2022-04-26 22:04:08 -06:00
c75ceb31ab canvas: when an item has its bbox marked dirty, this should propagate to all parents 2022-04-26 22:04:08 -06:00
d54d63da3a canvas: remove code long disabled via an "if (0" 2022-04-26 22:04:08 -06:00
3d860b9665 libpbd: do not use DEBUG transmitter from inside AbstractUI<T> request methods
This will lead to recursion, since delivering the debug msg goes through a request method.

Discovered by running with -D all
2022-04-26 22:04:08 -06:00
6917a1e836 triggerbox: initialize the follow_length control from the source data length 2022-04-26 09:42:00 -05:00
98bfede1fc
Restore connections when using templates
This also fixes an issue when duplicating tracks. Saved
connections were ignored and tracks were auto-connected.
2022-04-26 15:36:51 +02:00
6f5d3d8dd9 another change from ReaderLock to WriterLock in audio source peak reading
The rationale is as for f06d04c174
2022-04-25 20:33:21 -06:00
f06d04c174 audiosource: lock held during peak reading must be a write lock
We modify elements of the source object, not to mention the peakfiles on disk. This
was a regression introduced when switching from Lock to RWLock, caused by a failure
to recognize this as a case where a write lock was required.

The presence of scoped_array<> as a member of AudioSource (peak_cache) is suspicious
nevertheless, and we should establish that it serves a useful purpose.
2022-04-25 19:03:11 -06:00
be927f7a58
Revert "Debug async MIDI port (M1 builds)"
This reverts commit f8a0de5928.
2022-04-25 15:40:11 +02:00
f8a0de5928
Debug async MIDI port (M1 builds) 2022-04-23 23:12:16 +02:00
9ce91e2952
NO-OP: clang-format 2022-04-23 23:12:13 +02:00
c1d6c0690e
Fix poll() edge case on macOS, clean up logic
Return from poll_for_request() when CrossThreadChannel is
closed/destroyed. -- see also f4166fb61d

This also cleans up poll API usage, and check for nonnegative
return value is added.
2022-04-23 23:12:10 +02:00
95693f9364
Fix endless recursion when creating cyclic connection graphs
This is mainly relevant for Mixbus, which allows cyclic-connections
to record Master-out on a Track (which unconditionally has Mixbus send
and feeds master).

In Ardour it may also cause issues when creating loopback connections,
however latency is not usually updated with invalid graphs (old
process graph remains in use).

Otherwise it fixes a crash connecting Track 1 -> Track 2 -> Track 1.

This also optimizes Route::output_effectively_connected by caching
any prior lookup. This helps e.g. Track 1 -> Track 2 -> Master.
The connection "Track 2 -> Master" now only need to be looked up once.

See also 7958031287 and a556e96ed0
2022-04-23 15:37:57 +02:00
ae32daa148 allow ARDOUR::Filter to be used with MIDI regions/sources 2022-04-20 17:11:29 -06:00
aee3cf1534 handle an action named "Escape" specially when blocking activation during drags 2022-04-18 12:22:30 -06:00
c0b1f0e63c fix buglet in RAII mgmt of Bindings::_drags_active 2022-04-18 12:21:57 -06:00
729f930974 bindings: add a mechanism to prevent binding activation during drag 2022-04-18 11:38:21 -06:00
Caleb Potter
8b82de7ac1 Prevents user from infinitely banking right in mackie plugin subview
Changes handle_cursor_right_press() in PluginSubviewState to pure virtual
function so that PluginSelect and PluginEdit can each have their own
version.
2022-04-18 11:14:53 -06:00
Caleb Potter
f3bd740913 Formatting. Adds spaces before parentheses 2022-04-18 11:07:45 -06:00
Caleb Potter
8e375f5acd Moves left brackets to be on the same line as conditionals 2022-04-18 11:07:45 -06:00
Caleb Potter
bc6461dc76 Prevents user from infinitely banking right in mackie sends subview 2022-04-18 11:07:45 -06:00
Caleb Potter
17a7dbe06d adds ability to bank over in mackie sends subview
The cursor_left and cursor_right mackie control buttons will now move the
sends subview left and right like it does in the plugin subview. Previously,
if you had more than 8 sends (which is almost always the case for Mixbus),
then sends 9+ were unreachable on an 8 channel controller.
2022-04-18 11:07:45 -06:00
217f51e6fb
Break out common plugin-insert state methods
This is in preparation for IO-Plug, and should also come
in handy later for per region plugins.
2022-04-14 20:08:22 +02:00
74a673ce17
Create a virtual base class for PluginInsert
This in in preparation for IO-Plug GUI support.
2022-04-14 16:35:03 +02:00
f9d80c32d6
Allow to destroy Widgets when removing them from a container
This is useful when the container uses manage()d Widgets,
which are otherwise not destroyed.
2022-04-14 16:35:02 +02:00
defc902571
Allow to use Destructible as virtual base class
This is in preparation for a pure-virtual base class for
PluginInsert to expose `DropReferences` in the virtual base.

```
class PlugInsertBase : virtual public PBD::Destructible
class PluginInsert : public Processor, public PlugInsertBase
class Processor : public SessionObject
class SessionObject : public PBD::StatefulDestructible
```
2022-04-14 16:35:02 +02:00
db1a6720c2
Fix Region Export (clip library bounce)
Region::read_at fails if the region is not in a playlist.
It also applies fades and and region transparency which are
not relevant here.
2022-04-14 16:34:39 +02:00
844479568b
fix building OSC surface (amend 9b89dd7967) 2022-04-14 04:49:23 +02:00
99ed076e7e
Potential fix for region export on windows 2022-04-14 00:31:33 +02:00
7f12c664d2
Consistent checks for peakfile file descriptors
This fixes a crash on windows, close(-1) or closing an
already closed FD will abort the application
(Save-As can trigger the issue in done_with_peakfile_writes).

Note that g_open() returns -1 if an error occurred. However
other negative number may still be a valid FD.
2022-04-13 18:04:35 +02:00
91e1083cb1 fix typo 2022-04-09 18:35:16 -06:00
bdc8264fda given 217519b1b4, revert 5bbfac23 and cleanup DEBUG_TRACE output 2022-04-09 18:33:24 -06:00
Mads Kiilerich
217519b1b4 Put ostream operator<< for PresentationInfo in std namespace
Fix compilation error seen with gcc 12.0.1 on Fedora 36:

In file included from ../libs/ardour/ardour/variant.h:30,
                 from ../libs/ardour/ardour/parameter_descriptor.h:25,
                 from ../libs/ardour/ardour/automation_control.h:39,
                 from ../libs/ardour/ardour/amp.h:30,
                 from ../libs/ardour/session.cc:61:
../libs/pbd/pbd/compose.h: In instantiation of ‘StringPrivate::Composition& StringPrivate::Composition::arg(const T&) [with T = ARDOUR::PresentationInfo]’:
../libs/pbd/pbd/compose.h:277:31:   required from ‘std::string string_compose(const std::string&, const T1&, const T2&, const T3&, const T4&) [with T1 = std::__cxx11::basic_string<char>; T2 = unsigned int; T3 = std::__cxx11::basic_string<char>; T4 = ARDOUR::PresentationInfo; std::string = std::__cxx11::basic_string<char>]’
../libs/ardour/session.cc:3268:4:   required from here
../libs/pbd/pbd/compose.h:122:20: error: no match for ‘operator<<’ (operand types are ‘std::ostringstream’ {aka ‘std::__cxx11::basic_ostringstream<char>’} and ‘const ARDOUR::PresentationInfo’)
  122 |                 os << obj;
      |                 ~~~^~~~~~

This might also fix a similar problem with clang, and
https://github.com/Ardour/ardour/commit/5bbfac23808 can be backed out.
2022-04-09 18:03:21 -06:00
Mads Kiilerich
5b7431f243 wscript: drop unnecessary trailing ";" 2022-04-09 12:16:41 +02:00
Mads Kiilerich
49855e52aa wscript: consistently have at most one empty separator line 2022-04-09 12:16:40 +02:00
Mads Kiilerich
bac32a8c2d wscript: consistently use 4 spaces for indentation 2022-04-09 12:16:40 +02:00
Mads Kiilerich
c3bdcdd3fa wscript: consistently use space indentation instead of tab indentation 2022-04-09 12:16:40 +02:00
Mads Kiilerich
06f8936a73 wscript: remove trailing whitespace 2022-04-09 12:16:37 +02:00
fa204b632f
Fetch tempo-map for main process thread (amend 9e69c0d184) 2022-04-09 02:25:30 +02:00
luz paz
fb55878375
Fix source typos (heirarchy->hierarchy) 2022-04-08 21:38:00 +02:00
Mads Kiilerich
cb4e10683d
gtkmm: use size_request() function instead of deprecated Gtk::Widget::size_request(&) 2022-04-08 21:11:07 +02:00
Mads Kiilerich
1a0f862a0c
gtkmm: use prepend() instead of deprecated Gtk::ComboBoxText::prepend_text() 2022-04-08 21:11:05 +02:00
Mads Kiilerich
09c6e68ae8
gtkmm: use append() instead of deprecated Gtk::ComboBoxText::append_text() 2022-04-08 21:10:56 +02:00
Mads Kiilerich
71ea2cc7b9
gtkmm: use get_sensitive() instead of deprecated Gtk::Widget::sensitive() 2022-04-08 20:20:33 +02:00
Mads Kiilerich
91b08d5f45
gtkmm: use get_realized() instead of deprecated Gtk::Widget::is_realized() 2022-04-08 20:20:32 +02:00
Mads Kiilerich
a86aa31747
gtkmm: use get_visible() instead of deprecated Gtk::Widget::is_visible() 2022-04-08 20:20:10 +02:00
Mads Kiilerich
d52c727ec5
gtkmm: use get_mapped instead of deprecated Gtk::Widget::is_mapped() 2022-04-08 20:20:10 +02:00
JungHee Lee
539ef331d1
Update ko.po
Ardour 6.9 Update.
2022-04-08 20:07:49 +02:00
9c4024ff0c fix creation of TempoCommands for undo/redo history 2022-04-08 11:58:04 -06:00
7fd8544e31 temporal: fix copy-n-paste error in TempoCommand cosntructor 2022-04-08 11:58:04 -06:00
e466736e2d temporal: remove MementoBinder API for tempo map undo/redo 2022-04-08 11:58:04 -06:00
a806ede94d temporal: add TempoCommand, a Command-derived structure for managing undo/redo w.r.t TempoMap 2022-04-08 11:58:04 -06:00
7c3268d12f temporal: TempoMap::use() returns a const ptr to enforce semantics (library version)
This commit leaves two issues outstanding:

1. unclear/ugly semantics for drag operations that reset the GUI thread's tempo map to the writable copy
2. undo/redo for the tempo map

These will be addressed in future commits
2022-04-08 11:58:04 -06:00
luz paz
3d395585c1
Fix various typos
Found via `codespell -q 3 -S *.po,./share/patchfiles,./libs -L ba,buss,busses,doubleclick,hsi,ontop,ro,seh,siz,sord,sur,te,trough,ue`  
Follow-up to 364f2f078
2022-04-08 19:51:02 +02:00
Remi Thebault
a77ac7107f
fix websockets toggle_roll
Also fix BasicUI::toggle_roll who is supposed to do
the same as spacebar but doesn't.
2022-04-08 19:48:23 +02:00
Remi Thebault
93987de09f
websockets provide BBT 2022-04-08 19:39:25 +02:00
Mads Kiilerich
6f04dfc774
wscript: detect if qm-dsp is self-contained or need linking with kiss
When building with --use-external-libs on Fedora, Ardour would fail at
runtime with messages like:
  symbol lookup error: .../vamp/libardourvampplugins.so: undefined symbol: kiss_fftr_alloc
Try to automate handling of this error situation.

Fedora packaging worked around it with a custom patch that we rather
would avoid:
https://src.fedoraproject.org/rpms/ardour6/blob/rawhide/f/ardour6-missing-kissfft.patch .
2022-04-08 18:39:15 +02:00
Mads Kiilerich
9b89dd7967
wscript: drop liblo check in libs/surfaces - it is already mandatory in top level wscript 2022-04-08 18:39:15 +02:00
luz paz
59320b378f
wscript: fix 'testing equality is none' issue
ref: https://lgtm.com/rules/7900090/
2022-04-08 18:27:10 +02:00
Raphael Isemann
3dfcbf17b2
Fix memory leak in ctorNilPtrPlacementProxy 2022-04-08 18:21:55 +02:00
Edgar Aichinger
77fe1c6d32
amend previous commit 2022-04-08 18:17:27 +02:00