Commit Graph

342 Commits

Author SHA1 Message Date
Ben Loftis 2829f4385f triggerbox: publish some trigger functions to ::session (for the convenience of control surfaces)
Grid controllers will largely want to access clips in the order they appear on the Cue page

It is up to the device (and/or its ControlProtocol) to handle banking
2022-10-01 09:13:14 -05:00
Ben Loftis 75ae0fd4b1 disambiguate trigger functions: cue_bang -> trigger_cue_row 2022-10-01 09:13:14 -05:00
Paul Davis 6bef80ae60 triggerbox: use regular transport request mechanism to get transport started
if a slot becomes active, and the transport is not rolling, it still
asks the transport to roll. however, (1) there's only 1 request across
all triggerboxen (2) the request will not be handled till the next
process cycle (3) the triggerbox returns after the request i.e. it
waits until the transport is rolling
2022-06-10 11:59:12 -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 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 5c85695362
Add Input Port meters for I/O Pre-Plugin outputs 2022-05-17 02:26:28 +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 3f1420880b
Implement IOPlug processing using the Process Graph 2022-05-09 17:39:05 +02:00
Robin Gareus 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
Paul Davis 22b50c1716 ensure that Session handles tempo map changes synchronously in the main RT process thread 2022-03-14 14:03:07 -06:00
Paul Davis 00d8b08300 triggerbox: track empty slot status and ignore stop-at-session-end when appropriate 2022-03-14 14:03:07 -06:00
Ben Loftis b506a243a2 move cue-behavior from rc_configuration to per-session config 2022-02-19 11:48:56 -06:00
Robin Gareus 2328df23e5
Collect and postpone send delayline updates
In order to detect if route delaylines need to be updated,
aux-send delaylines need to be updated first. This was previously
done directly in the latency-callback, which may be concurrent
with processing.

Now only the information (pending_delay) is set, and the actual
change happens later at the end of process().
2022-02-07 04:31:42 +01:00
Robin Gareus c870c22c87
Process Audition: process events before run
Calls DR::set_pending_overwrite() sets DR::run_must_resolve
before the first run.

Previously this variable was set after the first ::run,
which resulted in notes at the beginning of audition to be
cut short.
2022-02-05 19:16:00 +01:00
Robin Gareus 031a05b07a
Return early if processing is blocked
There is no need to setup thread-local variable
if they are never used.
2022-02-01 21:40:11 +01:00
Paul Davis 15f0e4dbbf triggerbox: fix cue playback and recording
Somewhat alarmed that gcc (at least) allows if (cue_recording ...) to be
used just like if (_cue_recording) even though the former is a class method
and the latter is a class member.
2022-01-27 11:36:04 -07:00
Paul Davis b023b97538 triggerbox: flush newly recorded cue markers back to RT context 2022-01-21 10:55:55 -07:00
Paul Davis 8d1684e1f7 triggerbox: store cue bangs in process thread when discovered 2022-01-21 10:55:54 -07:00
Paul Davis 8bf494e5a8 change nature of CueBehavior enum to be bitwise
This allows us to OR-in the ImplicitlyIgnoreCues bits, and still toggle
FollowCues on and off to indicate user-requested behavior
2022-01-06 11:59:58 -07:00
Paul Davis 44d52133ae triggerbox: ignore cue-marker cues if told to do so 2022-01-06 11:23:02 -07:00
Paul Davis a187b5e1fb triggerbox: reimplement timeline cues without session events 2022-01-06 00:23:27 -07:00
Paul Davis fd2f2f46cc triggerbox: implement cue-triggering session event handling (sync with location markers)
Still requires handling tempo changes
2022-01-05 13:27:47 -07:00
Paul Davis 93b30976e5 cue events: some basic handling framework for syncing cue markers with session events that implement them
This doesn't actually do anything yet
2022-01-05 13:27:47 -07:00
Paul Davis ff89d998b2 triggerbox: steps toward sane trigger stopping API and design 2021-12-22 17:27:26 -07:00
Paul Davis 91a28b78c4 modify and extend both Session and TriggerBox API to allow better transport control
This allows a stop transport request to first stop all active triggers and then stop the transport
2021-11-10 15:55:58 -07:00
Paul Davis 241948635b new session event type for triggering scene changes 2021-11-03 22:58:17 -06:00
Paul Davis 07a98734f3 triggerbox: tentatively add static calls to check for scene triggers inside Session process() 2021-11-01 12:11:57 -06:00
Robin Gareus 5eee8bf1a3
Allow to change process graph while auditioning
This fixes an issue with adding/removing tracks while auditioning.

Session::remove_routes() calls Graph::clear_other_chain(),
which will block until the graph chains have been swapped.
2021-09-15 04:03:18 +02:00
Paul Davis c64db47b37 use new libtemporal sample rate mechanism (libs edition) 2021-08-13 12:51:31 -06:00
Paul Davis ae01dafcce use Temporal::set_thread_sample_rate() rather than explicit assignment 2021-08-13 12:51:30 -06:00
Paul Davis c9055547f3 set thread-local variable infrastructure for process thread & process graph 2021-08-13 12:51:29 -06:00
Paul Davis 68850892b8 NO-OP: make logical statement precedence more visually obvious 2021-07-26 17:27:43 -06:00
Paul Davis e01f898f3b libardour: adjust names for default speed APIs and make ::set_default_play_speed() private 2021-07-18 19:48:13 -06:00
Paul Davis 3bdf009e11 libardour: provide infrastructure for requesting default play speed 2021-07-18 19:40:21 -06:00
Ben Loftis b99925fc6b
Default_Play_Speed: change some speeds from assuming "1.0" to "default_speed" (lib part) 2021-07-03 19:06:03 +02:00
Ben Loftis c72359b431
Default_Play_Speed: when transport is stopped, we want to run the engine at the varispeed setting.
* PRO: you can audition synths at the varispeed tuning; you can use x42 guitar tuner when stopped
* CON: this is NOT like a tape machine ... a tape machine has no 'speed' when stopped

ToDo:  if we find that this is contentious, we could make a config var for it
2021-07-03 19:06:03 +02:00
Ben Loftis 3114ef4de2
Default_Play_Speed: prep work (libardour)
* remove unused variables in session.h
* move default play speed (varispeed(sic)) into fsm
* request_transport_speed should -never- set the default_play_speed
2021-07-03 19:06:02 +02:00
Robin Gareus 90a0f0af89
CUE monitor during record w/preroll 2021-07-02 19:52:59 +02:00
Robin Gareus 83b9ab1bee
Temporarily revert ongoing varispeed development
This reverts bf88f3fe64
until 35813db0f4

in order to move development into a branch, until after the
upcoming 6.8 release
2021-06-26 18:58:24 +02:00
Ben Loftis ea3abe9f24 Default_Play_Speed: change some speeds from assuming "1.0" to "default_speed" (lib part) 2021-06-25 11:51:34 -05:00
Ben Loftis 9217b25fe3 Default_Play_Speed: when transport is stopped, we want to run the engine at the varispeed setting.
* PRO: you can audition synths at the varispeed tuning; you can use x42 guitar tuner when stopped
* CON: this is NOT like a tape machine ... a tape machine has no 'speed' when stopped

ToDo:  if we find that this is contentious, we could make a config var for it
2021-06-25 11:51:34 -05:00
Ben Loftis 006055a2ff Default_Play_Speed: prep work (libardour)
* remove unused variables in session.h
* move default play speed (varispeed(sic)) into fsm
* request_transport_speed should -never- set the default_play_speed
2021-06-25 11:51:34 -05:00
Paul Davis 1777cf8f69 add some initial timing points for dsp stats 2021-06-11 18:55:24 -06:00
Robin Gareus 8803b55f45
Remove invalid assertion
There are some valid cases to call no-roll with non-zero
transport speed. e.g. export pre_roll/fail_roll when
exporting multiple timespans.
2021-05-08 23:46:10 +02:00
Paul Davis 4b87c3a6b1 complete removal of Session::_transport_speed, _default_transport_speed and takeover of transport state mgmt by TransportFSM
The TransportFSM is now responsible for deciding what to do at all transport state transitions. The Session (via the TransportAPI) merely
provides mechanism (locate, start, stop, set_speed). Default and most recent speed requests are managed by the TransportFSM too
2021-05-03 17:40:41 -06:00
Paul Davis c7c5379fac remove "flush" argument from Session and TransportFSM locate APIs (it does nothing) 2021-05-03 17:40:41 -06:00
Paul Davis 5f2d043ca4 update macro and call site for sending a TransportFSM::SetSpeed event 2021-04-19 16:14:09 -06:00
Paul Davis 5a159abe1f new SessionEvents for start/stop transport 2021-04-19 16:14:08 -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 d5a105e777
Keep track of capture duration 2021-02-22 01:00:01 +01:00