* increase memory pool (bindings alone require 1.5 MB), and all session
scripts have a shared memory pool.
* use TLSF (like Lua DSP processors) - this fixes an issue with atomics
(notably int62_t, temporal) on macOS and ARM, which need to be
aligned.
Since 44610c787 RCU keeps references until another write happens.
even before then, some shared_ptr references may have been kept.
When using a process graph, a route's activision-set can
hold references to other graph-nodes (routes). This lead
to Routes not being deleted until a second graph-reorder
flushed the RCU.
Every route calls Session::ensure_buffers when configuring
processors. Previously that unconditionally invoked the
BufferManager, even if no change was required.
This also fixes a potential issue when bouncing tracks.
::write_one_track() increases the buffersize to 8k, but only for
the ChanCount required to bounce. This was never properly reset.
Furthermore this is in preparation for RegionFX which may
need to increase the ChanCount of Threadbuffers.
Commit cd5369c added some cleanup code to `libs/ardour/session.cc`,
which drags in the type info symbol of VST3PluginInfo. When built
with `--no-vst3`, the resulting binary dies at startup:
```
ld-elf.so.1: /usr/local/lib/ardour8/libardour.so.3: Undefined symbol
"_ZTIN6ARDOUR14VST3PluginInfoE"
```
Make that code compile conditional on VST3_SUPPORT.
Occurs on FreeBSD 14.0-RELEASE, clang 16.0.6, amd64.
This is perhaps a better solution than b8551eed7e
and 8d0a655608 and 7942897d93. It is certainly less
fragile.
It is more consistent with other plugin standards,
where modules are closed with the last instance in a session.
Then again keeping the VST3 factory around is beneficial
when switching snapshots.
Discuss, and let's watch for issues when re-loading a
previously unloaded VST3 module.
when Session emits RouteAdded, each handler (editor, mixer, trigger pages etc) will
execute their callbacks in order. But Editor::add_routes() selects the routes too,
which triggers a PresentationInfo::Change signal. This is received by e.g. the Mixer
before it has even found out about the newly added stripables. This in turn
leads to severe confusion regarding the state of the selection in the mixer,
and potentially elsewhere.
So, just add a PresentationInfo::ChangeSuspender for the scope of the RouteAdde
signal emission
Playlist::split can result in removal of a region
(adding two others instead). In this case the state
of the removed region (if modified) is not saved.
Ardour uses some global variables and singletons. These global variables
can be initialized with a value prior to program execution (especially
if they are const), but some of the static variables are modified, and
it is crucial that they always are reset when switching to another
session. To keep things simple and explicit and consistent, we thus
introduce Temporal::reset() to reset TempoMap (and later on also the
superclock rate). This is somewhat similar to Temporal::init(), which
usually only is invoked once (on program start) to initialize singletons
(such as the TempoMap).
9964f20c added TempoMap initialization to Session::create() ... but only
when not using a template. This create method is mainly preparing the
filesystem for a new session, and TempoMap initialization doesn't seem
like a perfect fit for it. It also seemed odd that it only initialized
TempoMap for clean new sessions, while existing sessions and templates
initialized it elsewhere.
Instead, invoke the TempoMap initialization early in the Session
creation process. This might introduce an extra and unnecessary TempoMap
initialization when loading an existing session or using a template, but
that will be cheap and do no harm, while providing a guarantee that we
always use the same default value.
cut/copy section does copy the tempo-map, so copying
a 4 Bar MIDI section will be 4 Bars after the paste.
This does not work the other way around:
With a tempo-map, 4 bars may correspond to 10 seconds
at the source position. While 4 bars at the target
position may correspond to a different audio-time
duration. This can lead to gaps or overlaps.
This fixes several callsites that were passing samplepos_t to get a TempoMetric,
some of them somewhat significant (e.g. VST plugins that want tempo information).
Bad API design on my part, apologies.
This commit combines libs/ and gtk2_ardour because the new private status
of the ::metric_at() call would be a blocking point for git bisect
* Use an atomic reference count since the freeze-thread
can call use_playlist.
* Remove explicit argument to construct unused playlist
because playlists are unused by default. This also
lead to use-count becoming negative (or rather UINT32_MAX)
This fixes a random crash with stop-and-forget capture.
When aborting capture, the disk-writer can emit
midi_write_source->drop_references ()
in the butler thread, which leads to a direct call to
Session::remove_source.
This can happen before or after Region::source_deleted
is called which is initiated from the same signal.
Furthermore it was possible that Region::source deleted
was called concurrently from the UI thread via SourceRemoved
for whole file regions, which lead to memory corruption.
Record, move recorded region(s), delete the recorded source, undo.
Undo would undo the region-move, of a region that no longer
exists and has no source.
* Do not emit signal with source-lock mutex held
* explicitly drop references when called directly; notably from
EditorSources::remove_selected_sources