Commit graph

19396 commits

Author SHA1 Message Date
Paul Davis
33b7c38e42 control protocols: add API to control selection by RID 2022-06-05 15:03:48 -06:00
Robin Gareus
c713841f39
Re-implement RTTaskList using Graph Threads
There is no longer an extra set of rt-threads, but existing
process-graph threads are reused.

There are two main benefits to this approach: graph-threads
have a SessioEvent pool and ProcessThread buffers. They are
also joined to work-groups (on macOS), or  JACK created threads
(cgroups).
2022-06-04 17:22:50 +02:00
Robin Gareus
7219791d22
Use a GraphNode base-class for processing
The process-graph trigger_queue only needs to call
::prep() and ::run() without knowing any further details.

This is in preparation for using the graph-threads for rt-tasks
2022-06-04 15:22:05 +02:00
Robin Gareus
c1a1d12354
Disambiguate GraphNode::run and IOPlug::run 2022-06-04 15:19:18 +02:00
Robin Gareus
637971a7df
Fix Beat duration calculation
bbt_duration_at() calls bbtwalk_to_quarters() which already
subtracts the origin's position. Previously `pos` was subtracted twice.
2022-06-04 04:33:48 +02:00
Robin Gareus
ac5fb9d1f9
Revert "Debug noseq's audition issue - silent plugin processing"
This reverts commit b3497b3f8f.
2022-06-04 01:40:38 +02:00
Robin Gareus
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
Robin Gareus
3e1e0d94c5
Add Process Graph API for Route::silence() processing 2022-06-03 22:50:13 +02:00
Robin Gareus
57a1dbb375
Update route API for silent processing 2022-06-03 22:50:13 +02:00
Robin Gareus
191fdfda72
Leave a note for RT-Tasklists (need macOS workgroups) 2022-06-03 22:50:13 +02:00
Robin Gareus
99e785541a
Coreaudio/M1: prefer device IOThread Workgroup 2022-06-03 22:50:13 +02:00
Paul Davis
88a035b000 temporal: changes in API to better support BBT markers 2022-06-03 13:19:56 -06:00
Paul Davis
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
Paul Davis
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
Paul Davis
1b904285be temporal: improve utility of TempoMap::dump() output 2022-06-03 10:53:01 -06:00
Robin Gareus
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
Robin Gareus
fa8f75c145
Fix yet another oversight when coding blindly in 6a513a11f 2022-06-03 07:29:23 +02:00
Robin Gareus
5417ddd792
Fix typo in 6a513a11f 2022-06-03 07:24:42 +02:00
Robin Gareus
58979af4f2
Coreaudio: update workgroup query 2022-06-03 06:42:42 +02:00
Robin Gareus
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
Robin Gareus
87ee609339
Amend previous commit, fix debug print format 2022-06-03 05:32:19 +02:00
Robin Gareus
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
Robin Gareus
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
Robin Gareus
88e9fc3e22
Remove unneccesary include (now handled by libpbd) 2022-06-03 04:52:38 +02:00
Robin Gareus
c2cff575b7
Add debug info to track down M1 time-constraint issue 2022-06-03 03:52:43 +02:00
Robin Gareus
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
Robin Gareus
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
Ben Loftis
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
Paul Davis
2d24bcdf4a temporal: add operator== and operator!= for ratio_t 2022-05-31 12:36:54 -06:00
Paul Davis
192b2fd839 temporal: fixes for TempoMap::move_meter() 2022-05-30 21:14:57 -06:00
Robin Gareus
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
Robin Gareus
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
Robin Gareus
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
Paul Davis
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
Paul Davis
ef07fb601a libcanvas: FramedCanvas::covers() method is ill-conceived. Use PolyItem::covers() 2022-05-29 14:19:02 -06:00
Paul Davis
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
Robin Gareus
51b507b831
Skip any postprocessing when exporting for analysis only 2022-05-28 18:20:22 +02:00
Paul Davis
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
Paul Davis
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
Paul Davis
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
Paul Davis
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
Paul Davis
c8feef51ab convert use of operator* for tim::line types with ::scale(ratio_t) 2022-05-27 12:47:44 -06:00
Paul Davis
48f4f9bf9c temporal: remove some arithmetic operators and rewrite others to use muldiv() 2022-05-27 12:47:44 -06:00
Paul Davis
12e5042ece libpbd: add muldiv() to compute v * (n/d) without overflow 2022-05-27 12:47:44 -06:00
Paul Davis
5175260af4 temporal: remove dangerous muldiv methods and use explicit method name not cast 2022-05-27 12:47:44 -06:00
Robin Gareus
927562678b
Do not emit MixerScene signal with locked mutex (fixes ndeadlck) 2022-05-26 16:18:00 +02:00
Paul Davis
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
Paul Davis
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