Commit Graph

985 Commits

Author SHA1 Message Date
Robin Gareus
e48fe0fd42 Remove more cruft (unused rf-scale) 2019-02-21 00:24:56 +01:00
Ben Loftis
688bd28458 Session-range behavior (libardour part) 2019-02-12 11:35:48 -06:00
Robin Gareus
81857a947c Consolidate ambiguous engine API calls
available(), connected(), running() were ill-defined and
used interchangeably.
2018-11-28 15:24:47 +01:00
Robin Gareus
5531a440c9 Fix stuck connection block when template load fails.
Session::new_route_from_template() unconditionally calls
IO::disable_connecting(), and needs to be reverted likewise
(no RAII here).
2018-11-26 21:45:06 +01:00
Robin Gareus
dce81aecc5 Prevent deadlock when removing routes w/o engine 2018-11-26 03:31:02 +01:00
Robin Gareus
ae2a6175cc Don't allow to add/remove monitor-section w/o engine
Adding/removing the Monitor section changes port-connections,
a port-engine is needed to establish connections.

Ideally we'd allow this and queue for connection changes. This
will however require deep changes.

Also toggling the monitor-section on/off/on w/o engine can later
result in failure to register ports. Due to lack of engine-signals
not all shared_ptr<> port references are dropped.
2018-11-26 03:15:14 +01:00
Len Ovens
9b2612f686 Make foldback bus match foldback sends namewise
to avoid confusion with listener sends or monitor bus
2018-11-12 22:30:32 -08:00
Len Ovens
80fd215a5c get_stripables and get_routelist are now presentationinfo aware 2018-11-07 17:00:16 -08:00
Len Ovens
be5a89aa22 Add ListenBus to stripable types 2018-10-30 12:15:28 -07:00
Robin Gareus
5599cdb911 Fix race-condition/deadlock, plugin-copy while rolling
lili93's session (#ardour) triggered this w/jackd 512fpp:
Drag/Drop copy a latent plugin from one track to another while rolling.
The GUI-thread as well as the auto-connect thread concurrently call
jack_recompute_total_latencies(). The auto-connect thread holds
a process lock while doing so. The GUI does not use any mutexes.
This randomly deadlocks in libjack.

backtrace: https://pastebin.com/6m3KGhWS
2018-10-25 02:00:08 +02:00
Damien Zammit
3fd7f9478f PT import: Minor changes to session 2018-10-12 19:09:40 +11:00
Paul Davis
970c8939d4 some rather simple code to allow MIDI Clock to set the tempo of the session.
This is only allowed if the session has only 1 tempo marker
2018-10-08 12:59:51 -04:00
Robin Gareus
16dc3a1613 Properly disable looping when deleting loop-range 2018-10-05 21:50:55 +02:00
Robin Gareus
32b7343927 NO-OP: whitespace 2018-10-05 21:50:55 +02:00
Paul Davis
e6915e01de new transport slave/master implementation, libs/ edition 2018-09-18 19:06:04 -04:00
Robin Gareus
cf39ebc966 Add method to conveniently retrieve a sorted routelist 2018-08-02 21:36:34 +02:00
Robin Gareus
2953b575f2 Remove unused AutoLoopDeclick, PendingLoopDeclick
The flags were set, but not used. They also won't be needed anymore.
2018-07-09 17:30:38 +02:00
Robin Gareus
249640267c Remove global declick API
De-click will be per disk-reader, latency compensated and buffer-size
independent. Cue-monitoring should not be affected by de-click.
2018-07-09 17:30:38 +02:00
Paul Davis
cd0f5e06a9 when creating a route from a template, use correct call to setup XML state so that name/ports are unique 2018-06-28 19:14:37 -04:00
Robin Gareus
2fa6314fb4 Lua: Lock bindings into memory for rt-scripts
Empirically this decreases gc-spike duration (worst-case) by a factor of
two and speeds up the average gc-run by a factor of over 4 (depending
on the amount of memory used by the plugin).
2018-03-19 02:43:03 +01:00
Robin Gareus
77d16999b5 Tweak Lua GC 2017-11-29 12:06:42 +01:00
Robin Gareus
d26ad5573c Optimize Delaylines: block-process (not one sample at a time)
This also tweaks fade behavior when the latency changes to prefer a
x-fade when possible.

This new variant does not support concurrent re-allocation and
execution. Hence the auto-connect thread needs to take a lock before
updating latencies (actually there's no need for an explicit update with
built-in backends, so this case remains to be updated further)
2017-11-04 07:14:12 +01:00
Robin Gareus
471644c59d Parallel execution of cycle-start/end 2017-10-30 16:31:38 +01:00
Robin Gareus
927788a0b0 Move vari-speed into backend (resample ports)
Previously Ardour used a /local/ per track vari-speed mechanism.
Now that the disk-reader is a latency-compensated processor, the speed
of each disk-reader would need to be maintained locally, offset by each
disk-reader's output latency. Furthermore each disk-reader may
produce a different number of samples, depending on its global alignment.

This commit introduces port-data resampling directly at the engine-level:
Up/down-sample all input ports at the beginning, and down/up-sample output
port-data using the inverse ratio at the end of the session's process
cycle.
The session itself is unaware of the speed-change, and only needs to
handle transport speeds {-1, 0, +1}.

This also allows for aligned cue-monitoring and vari-speed recording,
and also pitch-shifts synthesized MIDI along.
2017-10-29 20:04:00 +01:00
Robin Gareus
72fb8a5342 Align punch in/out recording with latency-compensation 2017-09-30 02:45:13 +02:00
Robin Gareus
915b308a88 amend ccedb2d44 2017-09-29 21:15:51 +02:00
Robin Gareus
ccedb2d44e Remove unused punch+preroll API
This API was not used, also superseded by record w/preroll.
2017-09-29 21:02:22 +02:00
Robin Gareus
2b20f30d81 Aux-Send Latency compensation, part 2 & code-consolidation 2017-09-29 05:03:48 +02:00
Robin Gareus
24ec0b974d Properly aligned export (Stem + Session)
Delay ports being exported by their playback latency.
2017-09-29 05:03:48 +02:00
Robin Gareus
8139becb18 Ongoing work on latency compensation
The general goal is to align transport-sample to be the audible frame
and use that as "anchor" for all processing.

transport_sample cannot become negative (00:00:00:00 is the first audible
frame).

Internally transport pre-rolls (read-ahead) before the transport starts
to move. This allows inputs and disk to prefill the pipeline.

When starting to roll, the session counts down a global "remaning preroll"
counter, which is the worst-latency from in-to-out.
Each route in turn will start processing at its own output-latency.

Route::process_output_buffers() - which does the actual processing
incl disk i/o - begins by offsetting the "current sample" by the
route's process-latency and decrements the offset for each latent
processor.  At the end of the function the output will be aligned
and match  transport-sample - downstream-playback-latency (if any).

PS. This commit is a first step only: transport looping & vari-speed have
not yet been implemented/updated.
2017-09-29 05:03:48 +02:00
Robin Gareus
d98f87d542 No more disk-reader roll-delay
It was not working in sdio/6.0-pre anyway and with upcoming changes to
latency compensation the concept of per disk[stream/reader] will go away.
2017-09-29 05:03:48 +02:00
Robin Gareus
25f45022db Fix order of [initial] latency-computation
Session::post_playback_latency() sets the actual route latency,
so that playback latency notifications need to come after capture-
latency (backends follow the same rule: capture first).


NB. Session::initialize_latencies() was already using the correct order
2017-09-23 00:34:01 +02:00
Robin Gareus
c681e9d4d7 NO-OP: whitespace 2017-09-23 00:34:01 +02:00
Robin Gareus
87f5cd30d1 Fix crash when unloading a partially loaded session. 2017-09-21 17:35:52 +02:00
Robin Gareus
10b76ae631 Various updates and fixes for Latency Compensation
* centralize signal_latency_at_***_position to processors
* update initial-delay/roll-delay when processor order changes
* consolidate signal-latency calculation: use the same method
  for processor-changes and session's post_playback_latency.
* include relative output-delay in roll-delay
* fix capture processor position & optimize stem-export latency

(roll-delay fixes pending Route:roll() update)
2017-09-19 02:11:22 +02:00
Paul Davis
30b087ab3d globally change all use of "frame" to refer to audio into "sample".
Generated by tools/f2s. Some hand-editing will be required in a few places to fix up comments related to timecode
and video in order to keep the legible
2017-09-18 12:39:17 -04:00
Paul Davis
f8de3e0c6e reinstate "restart seek" behaviour but use a new Session::_seek_counter member variable for this 2017-09-18 11:40:53 -04:00
Paul Davis
b61146365f delete slave during Session::destroy 2017-09-18 11:40:53 -04:00
Paul Davis
1f53c861b8 remove Track::hidden(); replace with Stripable::is_private_route() 2017-09-18 11:40:53 -04:00
Paul Davis
646d6bec7e when DiskReader checks to see if a locate is in progress, it must be atomic with respect to all DiskReaders 2017-09-18 11:40:53 -04:00
Paul Davis
cb0d9f5607 remove InputConfigurationChange from session events, since it is a no-op in this development branch 2017-09-18 11:40:53 -04:00
Paul Davis
c6bd033523 update disk writer input latency at transport stop 2017-09-18 11:40:53 -04:00
Paul Davis
1b058a6ab9 force auditioner to emit GoingAway at the right time, so that its disk reader/writer objects drop their reference 2017-09-18 11:40:53 -04:00
Paul Davis
462711b23a nothing to do anymore at the Track level when input config changes 2017-09-18 11:40:53 -04:00
Paul Davis
361cab503b random changes required to get an audio track created and transport functional 2017-09-18 11:40:53 -04:00
Paul Davis
11baba0275 remove Session::track_by_diskstream_id() 2017-09-18 11:40:52 -04:00
Paul Davis
a4a87f56e9 mega-commit to save state of first "it compilesand links" state for separated disk i/o changes.
THIS WILL NOT RUN. THIS REQUIRES MANY CHANGES
2017-09-18 11:40:52 -04:00
Robin Gareus
6654c53760 Fix bumping .mid file name (snapshots & playlist copy)
When forking regions, copying playlists or saving snapshots we do not
have a reference to the track and cannot use the track's name as basis
for the new filename like Editor::fork_region() does.
A cloned midi region's name is based on the original region name.

This prevents endless addition "name-1-1-1-1-1-1-1-1.mid", adding
to the region's basename.
2017-09-07 06:05:26 +02:00
Robin Gareus
fb745cc5a8 Lua may call C++ functions with throw. Catch them 2017-08-19 01:06:44 +02:00
Robin Gareus
5f0279ab06 Catch some exceptions during session loading. 2017-08-17 19:28:14 +02:00