Commit graph

241 commits

Author SHA1 Message Date
Robin Gareus
8c4819e588
AU: request offline processing 2024-08-17 16:47:21 +02:00
Robin Gareus
f858316503
Plugins: Ignore offset for scratch/silent buffers
This allows to process buffers at an offset, as long
as the number of processed samples is less or equal to the
current buffersize.
2024-04-23 21:51:19 +02:00
Robin Gareus
828d45c6fa
Disambiguate In/Out etc for translations (2/2) #9512 2023-10-28 14:46:04 +02:00
Robin Gareus
8558b1f99e
AudioUnit: apply offset to MIDI events 2023-06-30 17:12:16 +02:00
Paul Davis
a486fba3e9 std::atomic - 2nd batch of changes to convert from glib to std::atomic 2023-03-24 14:19:15 -06:00
Paul Davis
4ba4cd69ff switch from glib atomic to std::atomic (libs edition) 2023-03-24 14:19:15 -06:00
Paul Davis
b35518e212 switch from boost::{shared,weak}_ptr to std::{shared,weak}_ptr
This is mostly a simple lexical search+replace but the absence of operator< for
std::weak_ptr<T> leads to some complications, particularly with Evoral::Sequence
and ExportPortChannel.
2023-03-24 14:19:15 -06:00
Robin Gareus
cfb31e3257 AU: update to new tempo-map API (amend 259499fc) 2023-02-17 01:19:10 +01:00
Robin Gareus
617ec6f54f
Include bus number in IOPortDescription 2023-01-17 22:02:10 +01:00
Ben Loftis
3e19363c4c fix typo in prior 10d125: sort presets 2022-12-19 10:04:29 -06:00
Robin Gareus
10d12599dd
Sort plugin presets by default 2022-12-19 16:41:41 +01:00
luz paz
1e640563d6
Fix source comment typos in libs/ardour
Found via `codespell`
2022-05-11 00:14:28 +02:00
Paul Davis
8c23d6955d new timeline types for AudioUnits and CoreAudioSource 2021-08-13 12:51:35 -06:00
Paul Davis
3ca2be321d use cleaned up Temporal ::quarters*_at* API (libs edition) 2021-08-13 12:51:31 -06:00
Paul Davis
f4490f54c5 change Timecode::BBT_Time to use Temporal namespace, plus a couple of other minor changes to enable compilation
This still uses the tempo map object in libs/ardour, not the new one in libs/temporal, and isn't likely to be functional
(though it could be)
2021-08-13 12:51:28 -06:00
Robin Gareus
088ccd24f0
AU: use AudioUnit scanner app, overhaul AU support 2021-07-03 19:07:26 +02:00
Robin Gareus
d4212da693
AU: standalone scanner tool 2021-07-03 19:07:26 +02:00
Robin Gareus
37acb07752 Fix previous commit 2021-05-28 22:51:12 +02:00
Robin Gareus
0f25086446
Misc fixes pertaining to plugin-scanning 2021-05-28 22:03:10 +02: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
f01ece1bd7 AU: Fix variable I/O instruments
Refactoring in 7ec10f7771 assumed that
audio inputs are always present.
2021-02-03 15:33:07 +01:00
Robin Gareus
767d5f93ba
Fix segfault when plugin insantiation fails
*PluginInfo::load() eventually calls `plugin->set_info()`
which depends on a valid PluginPtr. The method needs to return
early if `plugin` is unset or null.
2020-11-21 22:28:48 +01:00
Robin Gareus
7ec10f7771
Update variable-i/o channel assignment, separate sidechains
We need to be able to distinguish
 * 2 ins: mono + sidechain
 * 2 ins: stereo input
2020-10-12 03:26:33 +02:00
Robin Gareus
323fe16d4d
Improve AU debug facilities (1/2)
Use a common prefix "AudioUnit" but allow to only debug setup/config
changes without regular process-callback debug clutter.
2020-10-09 02:29:19 +02:00
Robin Gareus
10b05df189
Rename plugin pin I/O API (NO-OP)
This allows to distinguish Processor::configure_io from the
Plugin API with the same name. Despite the identical name,
both functions serve different purposes.
Likewise the ::can_support_io_configuration() API is renamed.
The signature of that function call has already diverged.

The Plugin-API has to handle optional busses (e.g. side-chain)
and replication. The PluginInsert processor provides context.

This change is in preparation for AudioUnit and VST3 busses.
Currently a stereo-input (1 bus) cannot be distinguished from
mono + sidechain (2 busses).
2020-10-09 02:19:43 +02:00
Robin Gareus
1a50b6b8ea
Update Plugin API to allow timestamped parameter changes
This is in preparation for VST3 automation.
2020-09-14 23:37:21 +02:00
Robin Gareus
1b55648131
Do not report timestamps smaller than zero to plugins
This can happen during pre-roll when buffers are filled
to start audible playback at zero.

While the position argument is signed for all plugin-standards,
it seems that some do not support negative timestamps before
00:00:00:00. (e.g. https://github.com/falkTX/Carla/issues/1236)

Furthermore TempoMap::bbt_at_sample() returns 0 for all negative
timestamps, but it was possible tthat tempo-map transmission,
as well as beat-position returned negative values.
2020-09-06 16:00:20 +02:00
Robin Gareus
c54b36c3ff AU: only set render callbacks for connected busses
This fixes an issue with Renoise Redux. The plugin reports the following:

Reported Channel Capabilities (explicit):
      [2, 2]  [1, 2]  [0, 2]

When it is added to an Arodur MIDI track, the 0 in, 2 output variant is
chosen, since Ardour MIDI tracks don't have audio by default.

However the render callback was set uncondionally for all busses. This
lead to issues with this specific plugin.
2020-08-06 20:30:44 +02:00
Robin Gareus
6d83e47860
Fix Plugin-preset saving when preset exists
Previously the GUI explicitly called remove_preset() before
saving a plugin-preset. This functionality is now moved
into the backend.

This fixes a case when a user tries to save/replace factory presets
and works around https://github.com/lv2/lilv/issues/37
2020-06-24 23:59:09 +02:00
Robin Gareus
ea8d1d09d4
Fix MacOS builds (API change in 705ac7bfc5) 2020-04-24 07:06:40 +02:00
Robin Gareus
32a97d242e
Fix typos in AU channel-count calc 2019-10-15 15:24:50 +02:00
Robin Gareus
bcd1391bf7
API to count max multi-channel plugin outputs 2019-10-15 14:48:32 +02:00
Paul Davis
f470d3e856 remove all use of NO_PLUGIN_STATE #ifdef
We determined several years that we should never ever do this,
and changed the basis for the free/demo copy because of that.
2019-10-02 18:04:40 -06:00
Robin Gareus
8a313daa13
Who needs semicolons? 2019-09-11 03:00:26 +02:00
Robin Gareus
9f668ceed2
AU: fix optional buffers
The spec [1] says:
 "If the mData pointers are null, the audio unit can
  provide pointers to its own buffers. In this case,
  the audio unit must keep those buffers valid for
  the duration of the calling thread’s I/O cycle."

A plugin *can* do this, but it does not need to. An extra
NULL test is required.

furthermore [2] specifies

 "mDataByteSize -  The number of bytes in the buffer pointed
  at by the mData field."

In case the host does not provide any buffers, this is obviously zero.


[1] https://developer.apple.com/documentation/audiotoolbox/1438430-audiounitrender?language=objc
[2] https://developer.apple.com/documentation/coreaudiotypes/audiobuffer?language=objc
2019-09-11 02:56:08 +02:00
Robin Gareus
8dc0c84ba4
AU: don't consider in-place if there are no inputs 2019-09-11 02:56:04 +02:00
Robin Gareus
a22f918d9d
Update libardour GPL boilerplate and (C) from git log 2019-08-03 15:53:16 +02:00
Julien "_FrnchFrgg_" RIVAUD
a4474e95a4 Make the configuration penalty subtler about inputs
Instead of uniformly demote configurations with a non-matching audio
input count (using a penalty offset of 1000), also grade the
impreciseness of the configuration so that those with the nearest input
count are preferred. As for outputs, give a slightly higher handicap to
configuration with too many inputs with regard to the actual audio
inputs that can be fed to the plugin.

POLICY CHANGE: when only imprecise configurations are found the actually
selected one can be different (better) than before this commit.
2019-05-12 22:32:10 +02:00
Julien "_FrnchFrgg_" RIVAUD
fe4d0f67e4 Remove ad-hoc handling of possible_in == 0
Just make the code responsible for possible_in > 0 also handle
possible_in == 0 since it nearly does the same thing.

The only difference is that the possible_in == 0 case, by using
FOUNDCFG(), acted as if possible_in was audio_in. The consolidated code
uses FOUNDCFG_IMPRECISE which will add some penalty to the
configurations where desired_in == possible_in != audio_in.

There is thus a small POLICY CHANGE, but the selected configuration will
stay the same unless a better matching configuration is available.
2019-05-12 22:32:10 +02:00
Julien "_FrnchFrgg_" RIVAUD
3bff40b5b3 Enable overriding the configuration penalty
This relieves exact matches of the need to duplicate the bookeeping done
by FOUNDCFG()
2019-05-12 22:32:10 +02:00
Julien "_FrnchFrgg_" RIVAUD
7a6daab642 Merge input-imprecise pass into the main pass
Still no policy change, since when a configuration is chosen that would
have belonged to the second pass, then its penalty will be increased by
1000 and it will be selected only as last recourse.
2019-05-12 22:32:10 +02:00
Julien "_FrnchFrgg_" RIVAUD
b5218fa38b Introduce a macro for imprecise configurations
It enables only setting the imprecise audio channel count if the
configuration is indeed selected.
2019-05-12 22:32:10 +02:00
Julien "_FrnchFrgg_" RIVAUD
0e0c55c6b5 Merge some cases to avoid duplicated logic
Merge the cases in == -1 and in == -2 since those are both wildcards,
almost symmetric in the AU spec, and handled completely symmetrically by
the code here considering it accepts invalid or unspecified demands.

Also merge the cases in > 0 and in < -2 since they are handled exactly
the same as far as outputs are concerned.

No policy change
2019-05-12 22:32:10 +02:00
Julien "_FrnchFrgg_" RIVAUD
baef462cf4 Replace the exact_match logic by a negative penalty
Instead of doing an initial loop for detection of exact matches, then
letting the following loop set \audio_out yet ignore its value, merge
the two loops but give exact matches a negative penalty so that the
\audio_out value they set won't change afterwards.

No policy change.
2019-05-12 22:32:10 +02:00
Julien "_FrnchFrgg_" RIVAUD
4d0e122976 Remove never-matching assert
Since previous line just asserted that possible_in > 0, it is
necessarily non-null and the test is always true.
2019-05-12 22:32:10 +02:00
Julien "_FrnchFrgg_" RIVAUD
e9f02e28d3 Prefer int32_t to int for channel counts
To match the actual type used by ChanCount. Keep the int type in the
structure passed in by the Audio Unit, because we have no control over
it.
2019-05-12 22:32:10 +02:00
Robin Gareus
2f91bdfa53
NO-OP: <tab> after <space> fixes in libs 2019-04-13 19:19:29 +02:00
Robin Gareus
484e0d0fb2
Remove generic parameter-printer
This has been superseded by value_as_string() along with meta-data
from parameter-descriptor, which is supported by all standards, except VST.
2019-03-11 02:10:50 +01:00
Robin Gareus
2ee2b8481c
Copy state when replicating an AU plugin
This is only used for plugin-analysis, AU plugins are otherwise not
replicated, and variable-i/o is used instead
2019-02-28 04:48:48 +01:00
Robin Gareus
2ec28f3ce7
Clean up Latency API (Processor vs Plugin)
Plugins are only a source of Latency (Plugin delay).
The API to query, signal and override Latency is managed
by PluginInsert.
2019-02-17 01:51:49 +01:00