13
0
Commit Graph

16182 Commits

Author SHA1 Message Date
b953490bac fix typo/thinko in code that checks for result of waiting for butler transport work 2020-04-10 13:24:55 -06:00
247bd4d3d9
NO-OP: whitespace 2020-04-10 18:32:18 +02:00
ede0fd3ddf
Remove hardcoded 2^15 cairo-boundary, prefer window-area 2020-04-10 18:28:26 +02:00
2177462b73
NO-OP: consistent function and variable naming 2020-04-10 18:06:42 +02:00
bc4de874dc
NO-OP: whitespace 2020-04-10 18:06:42 +02:00
9bbedcb781
Remove unused function
Cairo::curve_to renders cubic Bézier splines, those are not
generally useful in a DAW context.

Canvas::Curve implements centripetal catmull-rom spline drawing
which can be used for fades and automation interpolation.
2020-04-10 18:06:42 +02:00
7bb8ca1e76
Interpolate poly-line with view-point #6481 2020-04-10 18:06:41 +02:00
6cc1e5e75d
NO-OP: whitespace 2020-04-10 18:06:39 +02:00
1e996ca45f add port connect/add/remove callbacks to CoreAudio backend 2020-04-10 10:01:04 -06:00
2a80832243 add port connect/add/remove callbacks to the ALSA backend
This fixes issues with new ports not (always) appearing in port matrices (and presumably
elsewhere too)
2020-04-10 09:53:44 -06:00
b943cec756
ALSA: allow to select different I/O devices
This adds a basic support to use multiple sound-cards, currently
limited to two devices: In/Out with shared settings.

Advanced setups still have to resort to using the ARDOUR_ALSA_EXT
environment variable
2020-04-10 05:01:33 +02:00
e8efd45c05
Fix ALSA slave-device half-duplex mode 2020-04-10 05:01:30 +02:00
78b29c55d3
Hotfix more export woes, prevent possible endless loop
This apparently happens on some Windows systems when exporting
a range starting at 00:00:00:00

I'm still hoping there's a better fix for these race-condition
issues, perhaps by kicking the TFSM...
2020-04-10 03:29:16 +02:00
c33c988adc
Revert "Another attempt at fixing multi-range export"
This reverts commit c5332ddd00.
Apparently this is not needed 4f3a95a1da is sufficient.
2020-04-10 02:24:08 +02:00
62e2ec49ce
ALSA: ignore systemic MIDI latencies during measurement 2020-04-10 01:43:11 +02:00
5f1431aeda fix ArdourFader to use contrasting_text_color() for text, based on relevant bg color 2020-04-09 17:12:40 -06:00
69b4c5108b ALSA backend: fix incorrect pointer cast (fixes #7998) 2020-04-09 15:40:23 -06:00
230ef7596f websockets: shutdown UI event loop is server cannot start 2020-04-09 15:36:02 -06:00
661609f2c0 change default port for websockets surface 2020-04-09 15:26:13 -06:00
18daf2c9b2
C++98 compatibility 2020-04-09 22:43:24 +02:00
cd5eae3556 some potentially helpful but trivial comments 2020-04-09 14:01:47 -06:00
be023ef32d
Tweak websocket surface for use src-tree shared dir
When running from the src-tree, ardev_common.sh sets multiple
data-paths, to allow running ./ardev ./gtk2_ardour/ardev.
Pick the first one that contains a "web_surfaces" subfolder as
docroot.
2020-04-09 21:50:01 +02:00
61692ae1f8
Fix some Wunused-result 2020-04-09 21:26:12 +02:00
Luciano Iam
d694ee97c7
Update waf scripts 2020-04-09 20:56:46 +02:00
Luciano Iam
c946eb3132
Add classes for serving content over HTTP 2020-04-09 20:56:46 +02:00
Luciano Iam
40520a6dc6
Clean up and prepare for HTTP 2020-04-09 20:56:46 +02:00
Luciano Iam
3da0cf2a31
NO-OP update comments for header guard #endifs 2020-04-09 20:56:46 +02:00
c5332ddd00
Another attempt at fixing multi-range export
See also
  * 4f3a95a1da
  * cfd95340b1
  * 61e7f3176b
2020-04-09 20:25:25 +02:00
4f3a95a1da
Cont'd work on fixing export ranges
This picks up where cfd95340b1 left off.

The goal is to ensure that the butler has completed all
PostTransportStop related tasks and won't meddle with transport
after exporting has started.

Previously this could happen, because realtime_stop() queues
PostTransportStop and the butler is sommoned after every
export process cycle.

Since  61e7f3176b the butler keeps calling non_realtime_stop()
every time it is woken up, until TFSM comes around and unsets the
flag in the process callback.
2020-04-09 19:07:33 +02:00
70f13a3ff3 use RCU to manage JACK backend's container of ports 2020-04-08 19:56:33 -06:00
feff57d29a prefer initialization to assignment 2020-04-08 19:56:08 -06:00
20b4b4ea90 remove debug output 2020-04-08 18:43:20 -06:00
dd94d43c46 when renaming a port, remove the backend's port map entry based on the *old* name (not the new one) 2020-04-08 18:41:37 -06:00
3188fe00aa fix return value 2020-04-08 18:13:13 -06:00
57118c2370
Prevent FX from producing sound after export
This cuts reverb tails and synth sounds after export.
Disabling freewheeling, continues normal processing where
export left off. This previously kept notes ringing, or reverbs
audible.
2020-04-09 01:28:04 +02:00
a6afb31245
Safeguard against libaudiographer exceptions 2020-04-09 00:01:44 +02:00
b8ce25fdab
Fix export-alignment with JACK -- #7916 2020-04-09 00:01:44 +02:00
f32245c156 add required ::clear_ports() call to Dummy backend destructor 2020-04-08 14:55:31 -06:00
cfd95340b1
Fix exporting multiple range (MacOS)
The actual issue was introduced in 61e7f3176b:
Session::non_realtime_stop() no longer unsets PostTransportStop
(other changes from that commit are not relevant).

The real issue however is a race-condition.
So far this only seems to happen on MacOS, Coreaudio.

It seems that non_realtime_stop() is called in the butler-thread
after exporting has started, even though the butler has been
paused in wait_until_finished().

Perhaps Coreaudio thread switches causes TransportFSM to
reinitialize and scheduling the butler?

The use of `usleep()` makes this rather a workaround.
However it's sufficient for the coreaudio rt thread to run
at least once.
2020-04-08 15:59:30 +02:00
John Emmas
02473f058c Add/remove source(s) in our MSVC project (ardour_mackie) 2020-04-08 11:34:54 +01:00
6a8863386a use an Unwinder to provde exception-safety 2020-04-08 00:28:30 -06:00
78a66b7180 improved port cleanup as backend is destroyed 2020-04-07 23:26:51 -06:00
ec9784764c better fix for port destruction 2020-04-07 23:21:48 -06:00
09b51f3901 Revert "PortEngineSharedImpl callbacks should not be pure virtual"
This reverts commit a13ef36b3b.

A better fix is coming.
2020-04-07 23:21:06 -06:00
5b6e2b088e show ARDOUR::Port destructor with either DEBUG::Ports or DEBUG::Destruction 2020-04-07 23:20:15 -06:00
a13ef36b3b PortEngineSharedImpl callbacks should not be pure virtual
A port can callback from its destructor, which if occuring inside the backend destructor
would reach an already partially destructed backend.
2020-04-07 20:36:20 -06:00
ede8b9995a fix another explicit return val for ::get_port_by_name() if JACK has died 2020-04-07 18:57:24 -06:00
2591c81c1a fix explicit return val for ::get_port_by_name() if JACK has died 2020-04-07 18:54:57 -06:00
0a8b670bd0 yet another attempted fix for older gcc/mingw 2020-04-07 18:47:51 -06:00
0c859316a3 another attempted fix for older gcc/mingw 2020-04-07 18:44:40 -06:00
5d2bacd238 do not initialize shared_ptr<Subview> with 0 2020-04-07 18:37:18 -06:00
3f30a0ad39 more code rearrangement ... old gcc/mingw does not allow Enum::Value 2020-04-07 18:32:45 -06:00
595be0e5e9 try some rearrangement to fix old mingw builds 2020-04-07 18:15:51 -06:00
893e835dca NOOP: whitespace 2020-04-07 18:15:51 -06:00
8562582da2
Cont'd work on disk reader channel initialization
Amend 648beb94. If initial re-fill happens via override buffers,
the buffer may still be effectively empty.
2020-04-08 02:12:58 +02:00
d045dae5ff fix missing #include 2020-04-07 17:33:14 -06:00
33ae34124a fix missing #include 2020-04-07 17:27:31 -06:00
e345f38c7b fix missing #include 2020-04-07 17:22:55 -06:00
71e04c945f fix return value to be a legal null shared_ptr<PortPtr> 2020-04-07 17:18:10 -06:00
92005cd992 fix 2 additional "resets" of shared_ptr<PortPtr> 2020-04-07 17:11:50 -06:00
648beb94a0
Fix false-positive under-run messages
Port (or Tracks) can be safely added during playback, however
the disk-reader's playback buffer is initially empty. This lead to
false-positive Underrun() signals when processing takes place
before or concurrently with re-filling the disk-buffer for the new
channels.

Now new empty buffers are ignored, and produce silence until the
initial refill is complete. There is however no per-channel
de-click in, yet.

This fixes: play some audio track, ctrl+drag a region to the
drop-zone, creating a new track while playing.
2020-04-08 01:09:40 +02:00
e893c31701 "fix" some uses of foo<bar<>> by change the closing chars to "> >" (windows 2020-04-07 17:08:17 -06:00
76245107c7 fix 2 additional "resets" of shared_ptr<PortPtr> 2020-04-07 17:02:08 -06:00
260afe85ca fix "reset" of shared_ptr<PortPtr> 2020-04-07 16:57:49 -06:00
32734ce53c fix portaudio backend to use shared_ptr 2020-04-07 16:00:22 -06:00
989e388cad
Add option to reset x-run count on record-start 2020-04-07 23:14:11 +02:00
Phil
69067b9d99 add plugin support for mackie units
Main features: Plugin (Select & Edit)

1.  Plugin Select: When a track is selected that has PluginInserts, pushing the "Plug-In" button on a mackie will list these across the strips. Clicking a vpot of a strip enables editing the parameters of this selected plugin.
2. Plugin Edit: When a Plugin is selected for editing, the input parameters of the plugin are shown across the channel strips and the vpot is assigned the corresponsing AutomationControl for the parameter.

Minor features

- When the number of plugins or the number of parameters exceeds the number of strips available on the surface, one can flip through "pages" of views using the Cursor Left and Right keys (this logic I took from http://www.emagic.de/media/support/content/manuals/LogicControl_en.pdf)
- When in the Plugin Select mode, rearranging the plugins in the mixer strip is reflected on the surface.
- When in Plugin Edit mode, rearranging the plugins in the mixer strip still retains the edit view of the selected plugin (rearranging does not take away the current subview)
 - When removing a plugin in the mixer strip, this is reflected in Plugin Select, while the view jumps to Pan/Surround (the None subview) when in Plugin Edit mode.
- Removing a track resets the subview to None
- When in a Subview that is track-specific (Track, EQ, Send, Plug-In, Inst), selecting a different track retains the subview but updates the channel displays and vpot assignments accordingly. When in Plugin Edit mode for track A, and track B is selected, it changes to Plugin Select mode for track B (if plugins are present).
2020-04-07 14:35:09 -06:00
ff41232d16 fix CoreAudio backend to use shared_ptr 2020-04-07 13:52:35 -06:00
d827f3fdae fix up shared_ptr<> use in JACK backend 2020-04-07 13:23:49 -06:00
b9cb306e8b use shared_ptr to manage backend port lifetimes (Pulse,ALSA,Dummy,JACK)
JACK is not yet finished.

Changes also include minor reformatting and a spelling correction (latecies to latencies)
2020-04-07 13:23:49 -06:00
2377927fc1
NO-OP: whitespace 2020-04-07 16:20:53 +02:00
91a213427e
Remove unused variable 2020-04-07 16:05:47 +02:00
ebf26ddc9b
NO-OP: whitespace 2020-04-07 15:59:18 +02:00
4420f95026
Further tweak ambiguous latency check
Ignore latency of async ports (Virtual Keyboard in particular),
and only consider ardour's own ports.
2020-04-07 13:32:28 +02:00
1ee6b63299
Expose Port::flags() to Lua 2020-04-07 13:27:49 +02:00
5e2eb230bc
Fix typo in API name (1/2) 2020-04-07 04:07:31 +02:00
2932337a32
Fix ambiguous latency check
Only compare playback latency, delaylines in tracks do not
push back the capture latency to the source.
The delayline on tracks sits in between disk-writer and disk-reader,
delaying input to align with the disk-reader.

Furthermore tracks may be connected to different inputs,
even though those inputs are usually from the same hardware
device, capture latency of those ports can differ.
2020-04-07 04:06:02 +02:00
e95d33502f
NO-OP: whitespace 2020-04-07 04:02:52 +02:00
b5ca7d352a
Atomically reset peak meters #7465 2020-04-07 03:58:31 +02:00
f24cabe9e9
Fix rotary control knob mapping
This fixes an issue with Foldback strips pan controls being inverted.
2020-04-07 00:37:30 +02:00
aa2ddb5ea2
API change: LatencyUpdated(), indicate playback/capture 2020-04-07 00:10:29 +02:00
ad0c5f1a1c
NO-OP: whitespace 2020-04-06 23:45:36 +02:00
597837022a
Add method to check for ambiguous port latency 2020-04-06 23:45:20 +02:00
55854e3797 Add foldback busses to OSC GUI 2020-04-05 14:45:18 -07:00
df8c000810 OSC: support foldback busses 2020-04-05 14:10:50 -07:00
Johannes Mueller
3a2f0e40cf Fix crash when adding tracks from a5 route templates
Ardour5 route templates seem not to have a in the root node playlist
property. Ardour generally relies on that Track::playlist() always returns a
valid playlist. Thus we need to create a playlist even if we don't have a
playlist property in the route template's root node.
2020-04-05 19:07:28 +02:00
Johannes Mueller
c74cc2675e Extend FileArchive to import archive entries individually
This is needed primarily for a workaround for #7971. When importing a template
that has been exported on Ardour5 on MacOS we need to fix the paths of the
archive entries.

Later we can use this functionality also to handle imported templates if
templates with the same name already exist.

This commit only adds methods and members to FileArchive, it does not modify
anything to make regressions unlikely. This, however, leads to some duplicated
code. Eventually we should consolidate this a bit.
2020-04-05 16:34:48 +02:00
d0a116b2ae
Forward instrument MIDNAM changed signal 2020-04-04 01:48:30 +02:00
c16ab3a248
Allow to disable input auto-connect when creating tracks
Auto-connect is handled in a background thread, so newly created
tracks are not immediately connected.

This causes a race-condition when fan-out directly disconnects
and re-connects ports after track/bus creation.
2020-04-03 15:36:19 +02:00
80f3b54be4
NO-OP: indent & whitespace 2020-04-03 14:56:57 +02:00
3d98d13760
Add missing include 2020-04-03 14:52:05 +02:00
35aab65d59
Consistent processor labels "Meter"
Track name is implicit, so instead of "meter-<name>", showing a
translatable label "Meter" is sufficient and consistent with "Fader".

Under the hood, for introspection, the processor name remains as is.
2020-04-03 14:49:03 +02:00
John Emmas
fb186aaaa0 2 x new backend/port classes need to be exportable 2020-04-03 10:09:22 +01:00
John Emmas
03f52e622a Add/remove source(s) in our MSVC project (libardour) 2020-04-03 07:15:42 +01:00
6a6b3f2703 fix another iterator type 2020-04-02 19:45:31 -06:00
cb4997f4a4 fix iterator type 2020-04-02 19:45:31 -06:00
af69ac1285 use clear_ports() 2020-04-02 19:45:31 -06:00
6cdc245967 fix header name 2020-04-02 19:45:31 -06:00
7fc5a6c971 initial try (not compiled) of PortAudio backend using PortEngineSharedImpl 2020-04-02 19:45:31 -06:00
72925e4453 use _instance_name in all messages from PortEngineSharedImpl 2020-04-02 19:45:31 -06:00
e5507f7072 use PortEngineSharedImpl with PulseAudio backend 2020-04-02 19:45:31 -06:00
04551c39f6 use PortEngineSharedImpl with DummyAudioBackend 2020-04-02 19:45:31 -06:00
30766c75e8 buildable version of CoreAudio backend using PortEngineSharedImpl 2020-04-02 19:45:31 -06:00
a31d3689bf tentative changes to extend port engine shared impl to coreaudio 2020-04-02 19:45:31 -06:00
6c2e30b790 use new PortEngineSharedImpl in AlsaAudioBackend 2020-04-02 19:45:31 -06:00
9ea6f598bd add new file to wscript 2020-04-02 19:45:31 -06:00
9461a30a97 refactor shared PortEngine implementation from AlsaAudioBackend 2020-04-02 19:45:31 -06:00
9ac0d5b60f add RCU to manage _ports and _portmap in AlsaAudioBackend
This is intended to prevent crashes when unregister_port() modifies the contents of these
two members at the same time that something else is iterating over them.
2020-04-02 19:45:31 -06:00
21c9505652
Allow to query current effective instrument model/mode
This exposes custom plugin model/mode. It can be useful for
the GUI to detect if effective settings have changed, and
context-menus have to be re-build.
2020-04-03 03:29:32 +02:00
dabd5715e9
Revert "move the point of adding a new MIDI track until *after* the instrument is added"
This reverts commit fac8d84786.

This fixes fan-out. The track should be created before any tracks or
busses are created that are fed by the MIDI track.

The apparent motivation for fac8d847 was MIDNAM related
(there was code in the GUI that needed the instrument, which was
called from within ::add_routes).

This should no longer be the case, the GUI needs to pick up
instrument changes after track creation via processors changed;
besides MIDI busses were still created before the instrument.
2020-04-02 21:43:16 +02:00
f0b25a776b
Update fan-out signal
* Signals use camelcase.
* use a static signal, independent of the route

Previously the signal was handled by RouteUI, which
caused various issues:
 * the RouteUI may not yet be available
 * There may be many RouteUIs for a single Route
   (mixer, editor-mixer, meter-bridge strips)
2020-04-02 20:27:51 +02:00
Johannes Mueller
06dee15a18 Emit Locate() in ::locate() even if we are not synced_to_engine()
This reverts 05c77db773 (revert necessary due to 4637c49838)

Since 4637c49838 we no longer emit Located() in ::backend_sync_callback().
Therefore we must emit Located() in ::locate() even if we are
synced_to_engine().

Otherwise the playhead is not updated when synced_to_engine() in some
circumstances.
2020-04-02 18:39:46 +02:00
Johannes Mueller
7a2e9bf224 Re-save templates if they have been loaded from an older version of Ardour 2020-04-02 14:37:12 +02:00
Johannes Mueller
687b3078c3 Don't issue VersionMismatch when creating a new session
When we create a new session and are using a template from an old version of
Ardour, we should not issue the VersionMismatch dialog and not make a copy of
the session file for the old version.

We need to extend the signature of Session::load_state() to tell it if we are
creating a session from a template. Session::_is_new cannot be used for it
because it has a the semantics if to auto connect the the master bus.
2020-04-02 14:33:21 +02:00
1439610f95
Restart Transport FSM after x-run halt #7951 2020-04-02 03:58:21 +02:00
163a065543
Fix gcc-4.2/PPC builds
Old STL has an issue with ambiguity
   reverse_iterator rend();
   const_reverse_iterator rend() const;
2020-04-02 03:43:29 +02:00
20ee430fda
Add API to count named MIDNAM controls 2020-04-01 23:25:19 +02:00
37bbc70179
Cache instrument plugin MIDNAM model & mode 2020-04-01 23:24:45 +02:00
195fe0f712 add method to check for xrun status of a marker 2020-04-01 10:10:50 -06:00
3b77472ac0
Overhaul InstrumentInfo
* Remove unused direct calls into plugin
* Assume empty model to mean plugin-provided MIDNAM (!)

The route owned Instrument-Info is the central access point used
by the GUI for MIDI name lookups.

At this point in time, custom settings are saved/restored by the
GUI (MidiTimeAxisView). InstrumentInfo provides a volatile store
for MIDNAM mode and model.
2020-04-01 16:31:58 +02:00
26c6d3c4c9 fix boolean logic PART FOUR when trying to avoid complete_refill heuristic
This reworking avoids some confusion caused by the use boost::optional here
2020-04-01 07:54:44 -06:00
76070cb8c2 fix boolean logic PART THREE when trying to avoid complete_refill heuristic 2020-03-31 21:47:39 -06:00
76b6c5ebfd fix boolean logic PART TWO when trying to avoid complete_refill heuristic 2020-03-31 21:44:42 -06:00
1c82fc4879 fix boolean logic when trying to avoid complete_refill heuristic 2020-03-31 21:14:07 -06:00
6d0434a3c5 change variable name and debug messages for underrun case (information was misleading/confusing) 2020-03-31 20:54:14 -06:00
0047dc383f clean up logic for declick out in DiskReader
This is intended to be a no-op that makes the code easier to read/reason about
2020-03-31 20:54:14 -06:00
88e84067f2 if a locate brings us within a heuristic-specified distance of the current position in a DiskReader, pay attention to loop status
If the last read was not looped, but the new one should be, we need to ignore the heuristic. Ditto for vice-versa.

This isomorphic with the read-reversed case
2020-03-31 20:54:14 -06:00
bc1c3e5c21
Postpone disk-i/o setup during session-load
This fixes another assert(), caused by configuring processors,
before set_processor_state() was called.
Route::configure_processors() will be called later.

---
#3  0x00007ffff2472102 in __GI___assert_fail at assert.c:101
#4  0x00007ffff7a8ca1f in ARDOUR::Route::setup_invisible_processors() at ../libs/ardour/route.cc:5013
#5  0x00007ffff7a7a665 in ARDOUR::Route::configure_processors_unlocked at ../libs/ardour/route.cc:1870
#6  0x00007ffff7a79377 in ARDOUR::Route::configure_processors at ../libs/ardour/route.cc:1719
#7  0x00007ffff7a902c0 in ARDOUR::Route::set_disk_io_point at ../libs/ardour/route.cc:6041
#8  0x00007ffff7a7ea0a in ARDOUR::Route::set_state at ../libs/ardour/route.cc:2679
2020-03-31 19:48:17 +02:00
5253c7eb8b
Tweak error-dump (when session load fails)
When limiting the message count (e.g. for display in a dialog),
use reverse order, and only print errors.

When loading a session fails, the most recent error is
more likely the real cause.
2020-03-31 18:58:12 +02:00
3df530e7f6
Clean up double/float narrowing math in plugins. 2020-03-30 22:25:21 +02:00
40e3364c66
Always delegate meter-point positioning to rt-thread
Previously set_state() -> set_meter_point() acquired the
process-lock to change meter-position, usually causing x-runs
when setting route-state.

This also fixes an issue introduced in fd414ec158. After
populating the processor list, force setting the meter-position
looks up the output streams of the processor before the meter.
However the processors are not configured. That will only happen
later from Session::post_engine_init().

---
#3 0x00007ff07b7d4102 in __GI___assert_fail at assert.c:101
#4 0x00007ff080d3224a in ARDOUR::PluginInsert::output_streams() const at ../libs/ardour/plugin_insert.cc:289
#5 0x00007ff080de8c30 in ARDOUR::Route::set_meter_point_unlocked() at ../libs/ardour/route.cc:4106
#6 0x00007ff080de8699 in ARDOUR::Route::set_meter_point(ARDOUR::MeterPoint, bool) at ../libs/ardour/route.cc:4037
#7 0x00007ff080ddfad3 in ARDOUR::Route::set_state(XMLNode const&, int) at ../libs/ardour/route.cc:269
2020-03-30 17:58:35 +02:00
a8ff35accb
Reset DSP load on backend re-start and after freewheeling 2020-03-30 16:58:55 +02:00
27b2794133
Add API to reset DSP load state 2020-03-30 16:43:42 +02:00
f866ed6305
Remove duplicate calls 2020-03-30 15:20:54 +02:00
fd414ec158
Assert that plugins are configured before setting custom meter position
This fixes the following issue:
  On the master channel insert the waveform scope before the fader.
  Then set the meter position to custom and move the meter to the
  very beginning of the chain.

Before this change, when set_meter_point() was called the
processor list only contained the Fader (_amp) and no other
processor. _main_outs was not yet present in the list, and
Route::maybe_note_meter_position() triggered an
and assert(_processor_after_last_custom_meter.lock());

See also d0dca7daf0
2020-03-30 15:20:54 +02:00
23baeee829
Tweak engine startup, initial silence
This can help when running with very low latency and the
initial process callback is [indirectly] expensive.

E.g. load a heavy session the a RPi4, initial setup can pull
in a lot of data, which blocks the bus.

In particular with the ALSA backend this can lead to poll timeout
which effectively stops the backend.
2020-03-30 15:20:54 +02:00
2ceaa98c1c
Fix optimized build crashes (missing return value) - #7958 2020-03-29 15:27:12 +02:00
c365c6cdb2
Set thread-names (libs) 2020-03-29 14:56:22 +02:00
d6a38d5450
Set public thread name
This allows to identify Ardour thread using standard unix
tools (ps, htop) and inspect priorities, CPU load etc.
2020-03-29 13:55:20 +02:00
f81442c3bf
Engine: Silence outputs for 1/2 second when loading a session
This allows for caches to warm up, background worker threads to
spin up and things settle down. This also prevents initial
audible artifacts of live input.

In almost all cases this completes before the GUI is brought up.
2020-03-29 01:44:03 +01:00
eea697b260
ALSA backend: try to recover from poll errors
When recover() successfully re-initializes the device,
processing can continue just like after an x-run.

This can happen during initial session load of "expensive"
sessions (in particular on slow systems, e.g. Raspberry Pi)
usually with synths. Worker thread pulls in many external
files in the background which blocks the bus for a long time.
resulting in a poll-timeout.
2020-03-28 22:06:12 +01:00
6a930c81eb remove noisy and unhelpful log message 2020-03-28 10:59:31 -06:00
82eba76c8f prevent CD markers from being placed at or before session start (#7942) 2020-03-28 10:58:45 -06:00
ead883302f
Don't use shared-pointers in cross thread event structs
This fixes a deadlock when closing the session.

Session::destroy() takes the engine-lock while removing
unhandled session-events. In [1], the event-queue held a last
reference to a Track, and releasing that object triggered
events (here ~IO) that required the lock.

---
[1]

#2  0x0041743a in Glib::Threads::Mutex::Lock::Lock at /home/ardour/linux-armhf/stack/include/glibmm-2.4/glibmm/threads.h:643
#3  0xb67433ba in ARDOUR::IO::~IO at ../libs/ardour/io.cc:105
#4  0xb6743612 in ARDOUR::IO::~IO at ../libs/ardour/io.cc:111
#5  0xb6758e66 in boost::checked_delete<ARDOUR::IO> at /home/ardour/linux-armhf/stack/include/boost/core/checked_delete.hpp:34
#6  0xb675912c in boost::detail::sp_counted_impl_p<ARDOUR::IO>::dispose at /home/ardour/linux-armhf/stack/include/boost/smart_ptr/detail/sp_counted_impl.hpp:92
#7  0x004178d8 in boost::detail::sp_counted_base::release at /home/ardour/linux-armhf/stack/include/boost/smart_ptr/detail/sp_counted_base_sync.hpp:129
#8  0x00417986 in boost::detail::shared_count::~shared_count at /home/ardour/linux-armhf/stack/include/boost/smart_ptr/detail/shared_count.hpp:426
#9  0xb662343a in boost::shared_ptr<ARDOUR::IO>::~shared_ptr at /home/ardour/linux-armhf/stack/include/boost/smart_ptr/shared_ptr.hpp:341
#10 0xb6a4af7a in ARDOUR::Route::~Route at ../libs/ardour/route.cc:282
#11 0xb6b9404c in ARDOUR::Track::~Track at ../libs/ardour/track.cc:71
#12 0xb697164a in ARDOUR::MidiTrack::~MidiTrack at ../libs/ardour/midi_track.cc:94
#13 0xb697177a in ARDOUR::MidiTrack::~MidiTrack at ../libs/ardour/midi_track.cc:96
#14 0xb6ac525a in boost::checked_delete<ARDOUR::MidiTrack> at /home/ardour/linux-armhf/stack/include/boost/core/checked_delete.hpp:34
#15 0xb6acde00 in boost::detail::sp_counted_impl_p<ARDOUR::MidiTrack>::dispose at /home/ardour/linux-armhf/stack/include/boost/smart_ptr/detail/sp_counted_impl.hpp:92
#16 0x004178d8 in boost::detail::sp_counted_base::release at /home/ardour/linux-armhf/stack/include/boost/smart_ptr/detail/sp_counted_base_sync.hpp:129
#17 0x00417986 in boost::detail::shared_count::~shared_count at /home/ardour/linux-armhf/stack/include/boost/smart_ptr/detail/shared_count.hpp:426
#18 0xb664dca6 in boost::shared_ptr<ARDOUR::Track>::~shared_ptr at /home/ardour/linux-armhf/stack/include/boost/smart_ptr/shared_ptr.hpp:341
#19 0xb6aaf67e in ARDOUR::SessionEvent::~SessionEvent at ../libs/ardour/ardour/session_event.h:42
#20 0xb6a91a88 in ARDOUR::Session::destroy at ../libs/ardour/session.cc:753
#21 0xb6a8fb20 in ARDOUR::Session::~Session at ../libs/ardour/session.cc:460
#22 0xb6a9075e in ARDOUR::Session::~Session at ../libs/ardour/session.cc:46
2020-03-28 17:31:12 +01:00
6f1b0ce3d0
Add Lua bindings to check engine status 2020-03-28 14:56:29 +01:00
b279c42158
Create write sources for template/dup tracks - #7940
This fixes a crash with missing [MIDI] write-sources after
duplicating tracks [1]: Stealing write-source name fails, because
there is no write-source.

When duplicating tracks, reset_write_sources() is called before
any playlists are set [2]. So no new write-sources are created
because _playlists[DATA-TYPE] is empty.

During normal track creation write-sources are usually added
by the input-change handler [3]. However in this case the
state has been set, and since there is no change,
DiskWriter::configure_io does not call use_new_write_source()


NB. This also re-creates write-source when playlists are changed.

-=-
[1]
#3 0x00007f4420690102 in __GI___assert_fail at assert.c:101
#4 0x0000562bfa300dc9 in boost::shared_ptr<ARDOUR::SMFSource>::operator->() const at /usr/include/boost/smart_ptr/shared_ptr.hpp:734
#5 0x00007f442579ffa1 in ARDOUR::DiskWriter::steal_write_source_name[abi:cxx11]() at ../libs/ardour/disk_writer.cc:1290
#6 0x00007f4425e476b6 in ARDOUR::Track::steal_write_source_name[abi:cxx11]() at ../libs/ardour/track.cc:476
#7 0x00007f4425d060a2 in ARDOUR::Session::create_midi_source_by_stealing_name at ../libs/ardour/session.cc:4955
#8 0x0000562bf9ed39ab in MidiTimeAxisView::add_region at ../gtk2_ardour/midi_time_axis.cc:1650
#9 0x0000562bf9b05f2a in Drag::add_midi_region at ../gtk2_ardour/editor_drag.cc:568

-=-
[2]
#0 0x00007ffff7582e2f in ARDOUR::DiskWriter::reset_write_sources at ../libs/ardour/disk_writer.cc:946
#1 0x00007ffff757fce6 in ARDOUR::DiskWriter::set_state at ../libs/ardour/disk_writer.cc:333
#2 0x00007ffff7a81c93 in ARDOUR::Route::set_processor_state at ../libs/ardour/route.cc:3054
#3 0x00007ffff7a7f5d5 in ARDOUR::Route::set_state at ../libs/ardour/route.cc:2697
#4 0x00007ffff7c2aa1d in ARDOUR::Track::set_state at ../libs/ardour/track.cc:172
#5 0x00007ffff794f204 in ARDOUR::MidiTrack::set_state at ../libs/ardour/midi_track.cc:152
#6 0x00007ffff7b7e06b in ARDOUR::Session::XMLRouteFactory at ../libs/ardour/session_state.cc:1890
#7 0x00007ffff7addf7e in ARDOUR::Session::new_route_from_template at ../libs/ardour/session.cc:3048
#8 0x000055555621329a in DuplicateRouteDialog::on_response(int) at ../gtk2_ardour/duplicate_routes_dialog.cc:194

-=-
[3]
#0 0x00007ffff7583243 in ARDOUR::DiskWriter::use_new_write_source at ../libs/ardour/disk_writer.cc:996
#1 0x00007ffff75831c7 in ARDOUR::DiskWriter::reset_write_sources at ../libs/ardour/disk_writer.cc:989
#2 0x00007ffff75851ea in ARDOUR::DiskWriter::configure_io at ../libs/ardour/disk_writer.cc:1335
#3 0x00007ffff7a7b308 in ARDOUR::Route::configure_processors_unlocked at ../libs/ardour/route.cc:1912
#4 0x00007ffff7a79e4b in ARDOUR::Route::configure_processors at ../libs/ardour/route.cc:1719
#5 0x00007ffff7a86695 in ARDOUR::Route::input_change_handler at ../libs/ardour/route.cc:3632
2020-03-28 02:37:37 +01:00
97a221f1bb
NO-OP: whitespace 2020-03-28 01:25:44 +01:00
08065e87b5
Minor code cleanup - consolidate variables & scope 2020-03-28 01:25:44 +01:00
9b84e61fab
Fix incorrect timestretch duration - #7943
Completing readout available() returns 0, until all
background threads have finished and joined.

This also improves performance by feeding suggested/required
amount of samples on every process() call.
2020-03-28 01:25:44 +01:00
dfe383d23a make MIDI tracing work again for ports that are handled using ::read_and_parse_entire_midi_buffer_with_no_speed_adjustment() 2020-03-27 11:22:37 -06:00
e202b64951 variable rename and comment 2020-03-27 10:25:00 -06:00
e3a848dc65 fix user-driven varispeed 2020-03-27 10:25:00 -06:00
811dd0e6b4
NO-OP fix typo in comment and header guard 2020-03-26 19:00:41 +01:00
f744b5fc12 change velocity bar inside notes to extend to edges of note
Having the velocity bar inset from note causes distracting space at beginning of note
when viewing a MIDI note that is zoomed out
2020-03-26 10:12:54 -06:00
nia
74ef32ec31 Only show the Sun driver on NetBSD and sun-ish systems. 2020-03-26 09:58:34 -06:00
nia
5a1514de33 Add Sun backend option for JACK 2020-03-26 09:58:34 -06:00
nia
9be75befbe Add support for NetBSD by generalizing BSD OS tests. 2020-03-26 09:39:44 -06:00
nia
b490100c1b Use POSIX semaphores on NetBSD too. 2020-03-26 09:39:44 -06:00
1607d6a6c1
Fix websocket to glib IO condition mapping 2020-03-26 16:04:17 +01:00
John Emmas
4dd3d4effe Some initial changes (currently for libpbd only) to help a new contributer who's trying to build with MSVC2017
These changes compile okay for me (using VS2019) although they wouldn't link to my older-built libraries. Hopefully he'll be okay if he builds everything with the same compiler.
2020-03-26 10:40:36 +00:00
eeb2e99a3b
Display unit-label of VST parameters -- #7938 2020-03-26 02:17:22 +01:00
8fe3c367cf
Fix compiler warning 2020-03-26 02:17:22 +01:00
84f8b8beae
Convert polarity invert state from v2 sessions 2020-03-25 23:58:15 +01:00
4151ec1907 remove accumulated debug output 2020-03-25 15:12:30 -06:00
dbcf7dd666 more playhead-drag/click locate debugging 2020-03-25 13:50:23 -06:00
3d6eaf8e69 remove old, undocumented mechanism to set PBD::DEBUG flags from environment variable
An app-level mechanism now exists in main(), via ARDOUR_DEBUG_FLAGS, and will do the same thing
2020-03-25 10:36:10 -06:00
3e962da4bb improve debug flag setting message 2020-03-25 10:30:40 -06:00
1157c7d457 if user chooses not to delete a scratch session, removed the file that identifies it as unnamed
This way they will not be asked again if they reload and then quit the session
2020-03-25 10:24:47 -06:00
75fec524d2 add debug trace output for locate 2020-03-24 18:22:39 -06:00
ad7ff1ffd7
Do not trim MIDI region end to last event on session-load
This amends 295fb3ff5a. Tape tracks were only available
for audio data.
2020-03-24 23:45:23 +01:00
5f1d802307 when saving an unnamed session, rename it
Note that this is done at the GUI level, might need to double check if there are
other paths into a "save" that should be covered. Control surfaces use the action, but
Lua comes to mind
2020-03-24 14:10:39 -06:00
e9be6c23a8 a better approach to the name of the "unnamed" indicator file; remove file after successful save 2020-03-24 14:10:39 -06:00
5766989319 introduce the idea of an "unnamed" session 2020-03-24 14:10:39 -06:00
23d72eedbf remove unused variable 2020-03-24 14:10:39 -06:00
fbcb7b9ffc
Add Lua binding for bounded roll 2020-03-24 18:47:39 +01:00
45d3d5d465
Fix C++98 compat: class-key must be used when declaring a friend 2020-03-24 14:38:35 +01:00
2f0914c730
Allow to disable use of NSGLView
On recent Mac systems (Catalina) OpenGL is slower compared to
directly using GTK's NSView. Furthermore when compiled on
Catalina, and running on a system with a Retina screen, the initial
size of the canvas may be wrong:

   libs/gtkmm2ext/nsglview.mm:175:1: warning: method possibly
   missing a [super reshape] call [-Wobjc-missing-super-calls]

This is not an issue when running versions compiled on older systems.
2020-03-24 14:24:14 +01:00
0f63b82943 fix error in multiple calls to SourceFactory::createWritable()
removal of tape tracks removed an intermediate argument in the argument list; presence of default args for the
last two arguments and implicit conversion from int->bool prevented the compiler from complaining
about any existing calls.

This supplements/extends a54b000a70
2020-03-23 21:47:13 -06:00
43edfc8900 don't stop if master sync is lost and user chose to just keep rolling 2020-03-23 19:08:36 -06:00
db73afcaa5 extend fixed-width improvements to master delta to LTC 2020-03-23 18:37:27 -06:00
83584c6553 add note and increase left-space-padding in transport master delta displays 2020-03-23 18:34:12 -06:00
ddf2c60c9a improve variable width and precision for MTC slave delta display 2020-03-23 18:33:45 -06:00
3e35a68922 remove debug output 2020-03-23 18:33:18 -06:00
c0bbad3c4b add disk i/o apparent speed output to non-RT locate call 2020-03-23 18:32:56 -06:00
b3a1cbbfa2 add in timing for disk buffer reload after locate, to replace hard-coded 0.05 seconds per track
Leave debug output in place for now to get some numbers from any testers
2020-03-23 17:05:45 -06:00
d050256a41
Remove Mixbus Aux-Link special case 1/2 2020-03-23 17:45:38 +01:00
4780a0fd60
NO-OP: whitespace 2020-03-23 17:38:08 +01:00
ac9e16f0b8
Pan: remove automation-state indirection 2/2 2020-03-23 17:38:01 +01:00
ce088f1f44
Constrain panner value to valid range 2020-03-23 06:14:39 +01:00
7aa4d6a91f
Remove unused method (see also 875f69438) 2020-03-23 06:13:34 +01:00
5c3f49ef2b
Fix icon-tool
tape-rec icon was removed in a4d7b45fe, also re-order icons to
retain grouping per line when using the icon render util
2020-03-23 01:18:55 +01:00
a54b000a70
Fix file import (typo in a4d7b45) 2020-03-23 01:06:23 +01:00
f703385d07 fix slaving to JACK transport (again!) 2020-03-22 10:57:54 -06:00
1f3145f8ff fix up JACK transport to use master strategy design 2020-03-22 10:57:54 -06:00
1e474afbce fix typo that passed wrong value as 2nd parameter to Session::plan_master_strategy() 2020-03-22 10:57:54 -06:00
386264bd23
Pan: consolidate what_can_be_automated API 2020-03-21 19:46:39 +01:00
60bcefd03d
Pan: remove/consolidate parameter-descriptor 2020-03-21 19:46:38 +01:00
efb63e1bf2
Pan: remove value-as-string indirection 2020-03-21 19:46:38 +01:00
991f92c2c6
Pan: remove unused APIs 2020-03-21 19:46:38 +01:00
875f694380
Pan: remove VBAP requirement to access session 2020-03-21 19:46:38 +01:00
bf894d80fb
NO-OP: remove unused #includes 2020-03-21 19:46:38 +01:00
8296a030a5 redesign chasing the transport master
Substantive comments associated with code in Session::plan_master_strategy.

Known not to work for reverse TC. Also, the JACK related code has not yet been tested
2020-03-20 17:38:38 -06:00
e6e0edbe90 fix condition under which out-of-window MTC should trigger locate 2020-03-20 17:38:38 -06:00
28f15d3fa6
Add flag to explicitly hide a control
Eventually this is to replace a literal name "hidden" that is
currently used as hack throughout Ardour's codebase.
2020-03-18 18:16:29 +01:00
John Emmas
ca4e3c2556 Add/remove source(s) in our MSVC project (libardour) 2020-03-18 09:21:57 +00:00
1783305077 provide mechanism to report on destructive tracks presence in a session 2020-03-17 16:31:50 -06:00
0738472fee NOOP: indent/whitespace 2020-03-17 16:31:49 -06:00
295fb3ff5a allow loading of regions derived from formerly "destructive" sources with correct length
Without this change, such regions end up with insanely large (though legal) lengths
2020-03-17 16:31:49 -06:00
a30ee6950d restore being able to load a 5.12 session with a destructive track.
Not all is working right yet, however
2020-03-17 16:31:49 -06:00
a4d7b45fe0 remove destructive/tape mode tracks 2020-03-17 16:31:49 -06:00
e89b0cfd27 remove tape_file_matcher source 2020-03-17 16:31:49 -06:00
45026100aa LV2: Implement ui:requestValue feature 2020-03-17 16:55:35 +01:00
a7a781971e
Change default stereo panner to equal power balance
The stereo-width panner is not generally useful. In order to
change the azimuth, width has to be reduced, which usually leads
to comb-filter artifacts.

Equal power stereo, also matches the default mono to stereo panner
better than the stereo-width panner.

Last but not least, control surfaces only have an azimuth control
knob, without an easy way to reduce width, this leaves
the panner insensitive.
2020-03-15 21:39:53 +01:00
dbd4b9d07d
Fix cleanup report #7891
Direct call to Session::cleanup_sources() from ARDOUR_UI::cleanup()
didn't zero initialize size. This centralizes initialization,
so cleanup_trash_sources() does not need to explicitly clear it.
2020-03-15 20:31:57 +01:00
f941b3fadd
Add/use default argument for track creation 2020-03-15 14:03:24 +01:00
7f862298cf
Fix loading playlists of old sessions
Previously when loading Ardour v2, v3-5 sessions, tracks were
created with a dummy name "toBeResetFroXML".

In v6, Track::init() creates a playlist when the track name is
not empty. Later Track::set_state() calls set_name(). When a
playlist exists, the playlist's name is set to match the track's name.

When loading v6 sessions none of this happens. A previously loaded
playlist will be assigned by ID.

Older versions identified Playlists by name and by the time the
playlist is assigned, there may be ambiguities. With the default
(track-name = playlist-name) two playlists with the same name exist:

 (1) the playlist loaded from the session file
 (2) the playlist created by Track::init()

Playlists are stored in an ordered std::set<shared_ptr<Playlist>>,
and name-lookup iterates over the set.

When loading an old session after starting Ardour, it is very
likely to always lookup the playlist (1), because new, later
allocations from (2) are on top of the heap and ordered last.

The session seemingly loads correctly, except for lingering,
unused empty playlists "toBeResetFroXML" renamed to "Track name"
that were never deleted.

However when loading an old session from a running instance,
ordering is mostly random, and many tracks end up with using
the empty playlist (2) instead of the correct playlist (1).
2020-03-15 13:34:13 +01:00
213b3cd593
More useful debug message (print script that failed to parse) 2020-03-15 12:50:30 +01:00
db59711bc9
Fix SessionHandleRef shared-ptr leak when unfreezing tracks 2020-03-14 13:25:54 +01:00
8f37865070
Prevent freeze/bounce of sidechain processors
This also consolidates code to test if a processor can be frozen
from various places.
2020-03-14 13:25:54 +01:00
d95f6039f8 import_pt.cc: Remove process lock on AudioEngine && save less often 2020-03-14 12:03:22 +11:00
91c92f8e25 remove debug output 2020-03-13 13:52:38 -06:00
7ba8714e37 add/alter DEBUG_TRACE output 2020-03-13 13:52:38 -06:00
ee1f8a6fc7 add comment and additional reset when reinitializing transport master engine DLL 2020-03-13 13:52:38 -06:00
c83d509203 when locating to follow a transport master, reset engine DLL 2020-03-13 13:52:38 -06:00
f5ec5ea929 add new API to TransportMasterManager to manage use of DiskReader::{inc,dec}_no_disk_output() 2020-03-13 13:52:38 -06:00
cc43ec3ef6 adjust TransportFSM to avoid declick to locate if DiskReader::_no_disk_output is set
Under those conditions, the DR will not execute a code path that will cause the declick to take place
and therefore the declick will never finish
2020-03-13 13:52:38 -06:00
cf15b6ad7a prevent out-of-window MTC messages from moving transport if we're not using MTC
in 5.x, we would only run the MTC parsing code if slaved to MTC. That's no longer true in 6.0, and without
this change, MTC will cause a locate at startup
2020-03-13 13:52:38 -06:00
26b6b8d840
mingw/gcc-8: use glib's stat(), drop hardlink support 2020-03-13 01:21:51 +01:00
5b113c9c5b
Fix un/bypassing Aux-send panners
This fixes issues with send-panner bypass whenever the
target bus input-count is different from the send's channel count.

--

Previously, when the aux-send panner was bypassed, data was
copied using BufferSet::read_from().
This sets the channel count of the output buffer set (here: mixbufs)
to match the input (here: bufs).

e.g. mono to stereo, "1 in -> 2 out" out was changed to "1 in -> 1 out".

Un-bypassing the panner later does not reconfigure the I/O.
Mixbufs remained mono, and PannerShell::run() "1 in -> 1 out"
does nothing. The panner was effectively not functional.
2020-03-12 02:23:49 +01:00
33f85b094b
NO-OP: reduce scope 2020-03-12 02:13:27 +01:00
dd30b8b31e
NO-OP: whitespace 2020-03-12 01:58:50 +01:00
96daa4036a fix apparent free-ordering issue reported in #7926 2020-03-11 08:50:29 -06:00
d979c9d09c
Fix win32, mingw/gcc-8.3 builds 2020-03-11 07:20:00 +01:00
7202f3ad28
Add Lua binding to query a region's playlist 2020-03-10 23:54:31 +01:00
6569653a3d
Add Lua bindings to access region-fades 2020-03-10 23:10:51 +01:00
ebd743d795
NO-OP: use set/clear_flag() API instead of set_flags() 2020-03-10 20:55:50 +01:00
2b17ded785
Add convenience ControlFlags operators
Explicit functions for operator&=~ and operator|=
2020-03-10 20:55:50 +01:00
bc638c0496 create transport master in the factory method if the engine is running
This fixes the GUI thinking there is no port because it is notified about the TM before the port
is created
2020-03-10 11:56:00 -06:00
aad60e37b9 small adjustments to TransportMaster API to better accomodate the "ignore/accept commands" concept 2020-03-10 11:39:39 -06:00
843907654c do not reset default transport speed when stopping to prepare for a locate 2020-03-10 09:16:39 -06:00
Nikolaus Gullotta
5dcac21092
Adhere to Ardour style guide - 810b2fb78d 2020-03-10 09:41:50 -05:00
John Emmas
4e137d5cbb Avoid using 'boost::aligned_storage' which is known to be problematic in MSVC builds:-
https://www.boost.org/doc/libs/1_65_0/libs/type_traits/doc/html/boost_typetraits/reference/aligned_storage.html
2020-03-10 12:28:52 +00:00
9ef5f4d159 Session::have_looped must only be true when we locate because we reached the loop end
Locating the start of the loop range at transport start does not count as "have looped". This was preventing
pre-roll when starting to loop, which in turn caused data/event loss because the start/end sample ranges
would be incorrect inside process
2020-03-09 15:40:21 -06:00
1d17993a29
Revert failed experiment, scripted multiple MIDI outputs via dsp_run()
This reverts commit 8702ff2189,
and b10d9cf09b.

There was a misconception on the iterator (port vs message
in sequence), besides Ardour's mixer-strip is preferably used
with a single MIDI port. Most plugin-standards also only support
one port.

If need be LuaDSP run_map() can be used to handle multiple
MIDI I/O ports already.
2020-03-09 22:12:23 +01:00
Nikolaus Gullotta
810b2fb78d
Prevent double free of global observers
We accomplish this by explicitly setting the global_obs to NULL after
free'ing it. The crash that led to this fix can be replicated as such

$ sendosc localhost 3819 /set_surface i 8 i 159 i 8
$ sendosc localhost 3819 /set_surface i 0 i 0 i 0
$ sendosc localhost 3819 /set_surface i 0 i 0 i 0

In this example the observer is created, then free'd, and then free'd
*again* because the new observer was never made (sur->feedback[x]
checks fail)
2020-03-09 13:02:38 -05:00
379115a20e
Fix MacOS 10.11 (clang-8.0.0) builds
gcc, and recent clang-10 can construct new objects
using references as arguments.

However clang-8 (and MSVC?) do not:
   "error: no matching function for call to 'operator new'"

The compiler apparently does not expand the template
  class A  <-> `A*`  vs. `A const&`
for different cases.
2020-03-09 18:33:11 +01:00
9e2b896516
Replace strftime() with Glib::DateTime()
This is mainly for windows compatibility "%F" is not supported.
An alternative would be to s/%F/%Y-%m-%d/ to produce the ISO date.
2020-03-08 23:31:51 +01:00
82c8e6c9d0
Fix count-in and loop-as-mode metronome clicks 2020-03-08 03:51:04 +01:00
1196eed89d
Remove Mixbus send special case
Mixbus v6 uses AutomationType BusSendLevel like other Sends,
however with different min/max range compared to default Ardour
Aux sends. Control surfaces should use interface/internal API.
2020-03-07 02:33:36 +01:00
9c97724fc9
Fix OSC endless loop for tracks with hidden plugins 2020-03-07 02:23:56 +01:00
d142619cf4
Fix MIDI export and post-export transport issues
Bug was introduced in 128a45954c, declick-amp gain was
overridden, but declick not cleared. For some reason this did
not affect audio-only exports nor all session exports.
2020-03-06 23:55:56 +01:00
dd46dfe8d2
Fix potential deadlock when exporting w/normalizing
start_post_processing() may be called from the freewheeling
callback, when starting to normalize.
2020-03-06 21:34:55 +01:00
77d12b490e
RT-safety use stack (not heap) for plugin pin mappings 2020-03-06 19:13:54 +01:00
50556db405
Add a STL Allocator using the stack (for rt safety)
This is a dumb stack allocator using LIFO allocation/free, with
a fallback to new/delete. This works well for small STL containers
in particular std::vector, but it's also suitable for std::map<>,
in particular copy constructing small POD maps (plugin pin mappings).

Eventually this could be combined with TLSF for a flexible
memory arena management. This is however not currently needed
for any the planned use-cases.

This code is ANSI C++98 compatible, and yet also works with
modern C++11, C++14
2020-03-06 19:13:44 +01:00
140a3f4a10 Fix Coreaudio buffersize changes 2020-03-06 05:52:55 +01:00
4674dd8534
Increase accuracy of analyzed true-peak positions 2020-03-06 04:13:09 +01:00
d126966952
Remove backend support for region-output export
This use-case is better served via stem-export.
2020-03-06 03:29:16 +01:00
fc65097686
Remove region-output export (GUI)
This use-case is better served via stem-export.

This export mode never worked correctly when latent plugins
are present on the track. or when realtime export was chosen.

This used to call
  track.export_stuff() -> bounce_process()
periodically in small chunks from freewheeling callback,
which is no longer functional.
2020-03-06 03:28:41 +01:00
751f9f9654
Fix export alignment (#7916)
Ardour's playback is aligned to master-out:
 "When the playback clock reads 01:00:00:00, the sample corresponding
  to 01:00:00:00 is audible at the speaker(s)"

When exporting, and grabbing data from output ports, the signal
is offset by the master-bus physical playback latency. This was
compensated for, but lead to initial silence in the exported file.

New approach is to start capturing export data during pre-roll,
at the time when playback is written to the output buffers.

To also shaves off a common offset to make this work with
realtime export. Effectively this emulates processing with
disconnected master-output port, while still keeping any
latency of effects on the master-bus itself.

Last but not least: jack updates latencies when freewheeling,
(setting HW latency to zero). The callback arrives asynchronously
some time after enabling freewheeling, but after Export
Ports have been configured. Those callbacks are ignored.
2020-03-06 01:49:48 +01:00
1851440863
Fix realtime export of multiple time-spans
After exporting a time-span, the next time-span was started
directly from the rt-callback. This had various issues.
In particular with realtime export.

Post-processing of a realtime-export enables freewheeling
and is driven by freewheel callbacks. Freewheeling needs to be
safely disabled for an upcoming realtime export.

A similar issues existed when mixing realtime and non-realtime exports.
2020-03-06 01:49:44 +01:00
128a45954c
Do not de-click during freewheel export 2020-03-06 01:44:32 +01:00
1f6686c2a0
Separate pre-roll cycle calculation
This is also needed when exporting.
2020-03-06 01:44:32 +01:00
f04974aa6c continue with code simplification and add comment given 4a40ff9e53 2020-03-05 08:38:31 -07:00
abcb092adc transport stop resets default_transport_speed
This means that using the wheel in the GUI (or equivalent) ends its effect at transport stop
2020-03-05 08:35:39 -07:00
John Emmas
9a3159c2c0 Remove a suspected C99-ism
'lower_bound()' iterates between param #1 and param #2, comparing the result
with param #3 - either by making the comparison internally or by deferring to
an external comparator function. Prior to C99 however, BOTH cases required
param #3 to match the type being iterated.

In the case of a deferred comparison, there was apparently a proposal to
relax this restriction in C99, though I'm not sure if it in fact got
implemented (can't find any examples of it anywhere...)
2020-03-05 12:52:22 +00:00
82541b33a4
Retain custom internal-send name on session re-load 2020-03-02 21:54:38 +01:00
6e0062d549
Refactor send naming (#7905)
This allows users to rename sends without enforcing a numeric
bitslot number. However this prevents a user to to use "send" names
that are potentially used for new sends or inserts.
2020-03-02 20:07:52 +01:00
711f20a469
Exclude zita-convolver from being available as external lib
Ardour statically links libardour against zita-convolver,
this is required because it's used in plugins and available
by Lua scripts.

libzita-convolver has been modified to be in a custom namespace
and extern global symbols have been removed.

On most GNU/Linux distros system-wide default zita-convolver
is not compatible nor suitable to be used as-is.
2020-03-02 20:06:59 +01:00
7c6eadd84a
Fix some doxygen warnings 2020-03-02 17:58:03 +01:00
be4bdb5365
Do not include <stdint.h> in the Ardour namespace 2020-03-02 17:58:03 +01:00
6edccc78a2
Fix previous commit (increase max, not default) 2020-03-02 02:26:10 +01:00
86821b3afe
Allow a-delay to boost output gain
From #ardour IRC:
> there have been a few times that I wished a-Delay could boost volume
> it has an "output gain" slider, but it only subtracts. the maximum is 0db
> delay is a big part of guitar solos, so a boost in the same plugin would be awesome
2020-03-02 02:24:43 +01:00
c086f05ba5
Fix order setting I/O names
IO::set_name() may fail, in case Port::set_name() fails.
In that case the IOProcessor should not update its name.
2020-02-29 22:20:01 +01:00
814af0f51c
Fix off-by-one, start "Send" names at bitslot 1 (not 2)
Session::next_*_send_id() starts counting at bit 1.
Probably for historical reasons (bit zero = 1).
2020-02-29 22:19:58 +01:00
John Emmas
a4449aa0f6 Fix 'samples / frames' typo in PBD::stacktrace() 2020-02-29 14:38:58 +00:00
dd2c6e7cf1
Convert v5 send state-state 2020-02-28 21:21:16 +01:00
300063c8b9
Bail out if Playlist cannot be created
This prevents later crashes. Tracks cannot exist without a playlist.
2020-02-28 07:33:11 +01:00
fa0a7d6739
Allow to limit error dump
This is in preparation of displaying verbose errors to the user.
2020-02-28 07:26:13 +01:00
a485195453
Ensure that regions have sources when saving
Otherwise this will lead to a corrupt state:
  ERROR: Session: XMLNode describing a AudioRegion references an unknown source id
  ERROR: Session: cannot create Region from XML description. Can not load state for region
  ERROR: Playlist: cannot create region from XML
and a track without playlist is created, resulting in a later crash.

Eventually SessionPlaylists::load() needs to handle this gracefully,
but this should help catch cases causing the actual issue.
2020-02-28 06:35:33 +01:00
016eaddad7
NO-OP: whitespace, re-indent 2020-02-28 06:08:26 +01:00
4b28e4ee3c
Fix some recursive undo removal
~StatefulDiffCommand() may trigger UndoTransaction::command_death()
which may delete the StatefulDiffCommand() that's just being destroyed.

This depends on the signal-connection order, which is undefined.
In any case when a shared_ptr<> object is being destroyed it means
that all references to it are already gone. There's no need to
emit drop_references from the d'tor.
2020-02-28 06:06:44 +01:00
73c5bdd3cb
Fix double free of undo commands (amend 9e6435ff14)
This fixes a case when deleting a plugin, deletes all automation
undo/redo events:
  <UndoTransaction name="add automation event">
    <MementoCommand type-name="ARDOUR::AutomationList">
   ...


`delete this;` calls the d'tor which emits drop_references(),
that leads to UndoTransaction::command_death() destroying the
object, whichh causes a double free.
2020-02-28 02:09:58 +01:00
4eba86b503
Fix libwebsockets compat
LWS_CALLBACK_HTTP_CONFIRM_UPGRADE is only available since v3.1.0
2020-02-27 23:58:00 +01:00
0b027f7678
Fix removal of punch range
set_auto_punch_location() is a NO-OP when there's no punch range.
This disconnects `punch_connections`, clears session-events,
and emits auto_punch_location_changed().
2020-02-27 22:23:59 +01:00
08559abc10
Add signals to indicate Punch/Loop constraints
This is in preparation for GUI sensitivity of Loop and Punch actions.
2020-02-27 22:16:12 +01:00
Luciano Iam
ef512d412d
Avoid occasional response delay when handling HTTP in the websockets surface 2020-02-27 03:42:54 +01:00
Luciano Iam
0921cf8939
Make previous commit 81ecc2b compatible with libwebsockets==2 2020-02-27 03:42:54 +01:00
Luciano Iam
ec8e0f8ee5
Gracefully reject HTTP requests reaching the websockets surface 2020-02-27 03:42:54 +01:00
bc2cbfc7ec
Prevent concurrent loop and punch recording (backend)
This also prevents switching between punch-in/out record
and looping without transport-stop.
2020-02-27 02:36:16 +01:00
R
8702ff2189
Add support for Lua DSP scripts with multiple MIDI outputs 2020-02-26 20:28:54 +01:00
c3fe0cd95e
Consolidate loop en/disable calls 2020-02-26 20:15:00 +01:00
d27cdb3855
Fix DSP::process_map() plugin-pin I/O map handing
The previous approach failed in case where PluginInsert
uses no-inplace buffers with a linear map.
Since buffers are replicated up to a total of number of
all (inputs + outputs), the number of output buffers
could not be determined. There was insufficient information
using the I/O map alone.

With a known number of outputs processing and applying
the i/o map is also a lot easier and faster.

This break the API of process_map().
2020-02-26 17:50:08 +01:00
a5c956883d
Add Lua bindings for libardour amp's simple gain 2020-02-26 17:49:54 +01:00
f372cc0bf2
Fix PI bypass, fix apply linear pin-connections
Previously this could assert(), copying a buffer to itself.
2020-02-26 17:49:01 +01:00
35605ee763
Remove easter-egg
Every day can be x-mas day, how else can we be lovers? :)
2020-02-26 04:03:10 +01:00
69059d7b1b
Fix Conditional jump or move depends on uninitialised value(s)
(valgrind trace, line-numbers from mixbus+6.0-190-g0ec6bc35a)
This may happen initially for unconnected graph nodes,
e.g. Foldback Busses from ARDOUR::Session::post_engine_init().

==29797== Conditional jump or move depends on uninitialised value(s)
==29797==    at 0x6167D3F: trace_terminal(boost::shared_ptr<ARDOUR::Route>, boost::shared_ptr<ARDOUR::Route>, bool) (session.cc:2174)
==29797==    by 0x6167D99: trace_terminal(boost::shared_ptr<ARDOUR::Route>, boost::shared_ptr<ARDOUR::Route>, bool) (session.cc:2174)
==29797==    by 0x6167D99: trace_terminal(boost::shared_ptr<ARDOUR::Route>, boost::shared_ptr<ARDOUR::Route>, bool) (session.cc:2174)
==29797==    by 0x616890D: ARDOUR::Session::resort_routes_using(boost::shared_ptr<std::__cxx11::list<boost::shared_ptr<ARDOUR::Route>, std::allocator<boost::shared_ptr<ARDOUR::Route> > > >) (session.cc:2289)
2020-02-26 01:44:23 +01:00
98d7d04ae7
Fix potential memory corruption at session close
(valgrind trace, line-numbers from mixbus+6.0-190-g0ec6bc35a)
==29797== Invalid write of size 4
==29797==    at 0x619BB3F: boost::dynamic_bitset<unsigned int, std::allocator<unsigned int> >::reference::do_reset() (dynamic_bitset.hpp:120)
==29797==    by 0x6196002: boost::dynamic_bitset<unsigned int, std::allocator<unsigned int> >::reference::do_assign(bool) (dynamic_bitset.hpp:122)
==29797==    by 0x618F670: boost::dynamic_bitset<unsigned int, std::allocator<unsigned int> >::reference::operator=(bool) (dynamic_bitset.hpp:107)
==29797==    by 0x617E426: ARDOUR::Session::unmark_send_id(unsigned int) (session.cc:5633)
==29797==    by 0x6156714: ARDOUR::Send::~Send() (send.cc:125)
==29797==    by 0x5CE12A7: ARDOUR::InternalSend::~InternalSend() (internal_send.cc:71)
==29797==    by 0x5CE1319: ARDOUR::InternalSend::~InternalSend() (internal_send.cc:76)
==29797==    by 0x1556128: void boost::checked_delete<ARDOUR::InternalSend>(ARDOUR::InternalSend*) (checked_delete.hpp:34)
==29797==    by 0x155E689: boost::detail::sp_counted_impl_p<ARDOUR::InternalSend>::dispose() (sp_counted_impl.hpp:92)
==29797==    by 0xCC0E30: boost::detail::sp_counted_base::release() (sp_counted_base_std_atomic.hpp:110)
==29797==    by 0xCC0EA6: boost::detail::shared_count::~shared_count() (shared_count.hpp:426)
==29797==    by 0x134BD15: boost::shared_ptr<ARDOUR::InternalSend>::~shared_ptr() (shared_ptr.hpp:366)
==29797==    by 0x60FACC1: ARDOUR::Route::~Route() (route.cc:498)
==29797==    by 0x60FAF4D: ARDOUR::Route::~Route() (route.cc:517)
==29797==    by 0x166144C: void boost::checked_delete<ARDOUR::Route>(ARDOUR::Route*) (checked_delete.hpp:34)
==29797==    by 0x166338F: boost::detail::sp_counted_impl_p<ARDOUR::Route>::dispose() (sp_counted_impl.hpp:92)
==29797==    by 0xCC0E30: boost::detail::sp_counted_base::release() (sp_counted_base_std_atomic.hpp:110)
==29797==    by 0xCC0EA6: boost::detail::shared_count::~shared_count() (shared_count.hpp:426)
==29797==    by 0xCD2385: boost::shared_ptr<ARDOUR::Route>::~shared_ptr() (shared_ptr.hpp:366)
==29797==    by 0x615D0E5: ARDOUR::Session::~Session() (session.cc:455)
==29797==    by 0x615D4A3: ARDOUR::Session::~Session() (session.cc:461)
2020-02-26 01:35:50 +01:00
61b6b740bc
Fix deadlock, shared_ptr d'tor called from ScopedConnectionList d'tor
See https://ardour.org/styleguide.html #10
https://pastebin.com/gJfrNhL2
2020-02-25 22:55:59 +01:00
bcfe16610a
Consolidate shared-ptr debugging 2020-02-25 22:23:30 +01:00
9e6435ff14
Fix mem-leak, Playlist/Region SessionHandleRef
When a playlist is deleted and drops_references(), any
undo/redo StatefulDiffCommand referncing playlist invoke
Destructible::drop_references() of the Command.

This leads to command_death(). As opposed to UndoTransaction::clear()
the StatefulDiffCommand was not destroyed.

In case of playlists StatefulDiffCommand::_changes contains
PBD::SequenceProperty<std::list<boost::shared_ptr<Region> > >
and shared pointer reference of the playlist regions were kept
indefinitely.

This fixes the following scenario:
New session, import an file, delete the created track,
clean up unused sources (delete unused playlists)[, quit].

A reference to the imported region was kept, because of the
playlist's undo command (insert region). Yet the source file
was deleted.


PS. Most playlist changes are accompanied by GUI zoom/selection
MementoCommands. Those are currently never directly dropped.
command_death() leaves those in place.
2020-02-25 21:45:07 +01:00
aa3f7f2414
Remove undo function from global namespace 2020-02-25 20:09:47 +01:00
7532571fb2
NO-OP: whitespace 2020-02-25 17:55:51 +01:00
e926a580a9
Disable Transport Master boost debug 2020-02-25 16:17:00 +01:00
53a6b3e28d
Fix cleanup, lock source-list, emit SourceRemoved
This fixes various cases where SessionHandleRef shared_ptr<>
were kept when sources were removed.
2020-02-25 16:17:00 +01:00
28c141d450
Remove history file when it's empty
Various operations clear the history (e.g. cleanup). In that
case the GUI correctly had an empty Undo/Redo history, but the
file on disk was left in place.

Next session load restored the old, incorrect Undo/Redo history.
2020-02-25 16:17:00 +01:00
3aaaa7e459
Update region-factory boost-debug 2020-02-25 16:17:00 +01:00
fc91c217d1
Notify owners when removing regions during cleanup
Previously the region was only removed from the Session's
region_map without sending notifications.
2020-02-25 16:16:59 +01:00
8e1a2d7caa
Prefer const iterators 2020-02-25 16:16:59 +01:00
7e4728027c fix thinko when handling set_speed (0.0)
Code only handled a reversing->rolling path, not reversing->stopped
2020-02-24 20:06:43 -07:00
4749fcef86 fix incorrect handling of MIDI data by AsyncMIDIPort
This type of MIDI port fetches all of its data from inside ::cycle_start(),
and delivers it to a FIFO connected to another thread (typically a
control surface).

Unlike regular MidiPorts, which will be read from inside a Session::process()
call, these ports will read their data once per AudioEngine::process() cycle.
They therefore cannot use MidiPort::get_midi_buffer() which scales and adjusts
event timestamps as if the data is being accessed from within Session::process().

It is still an open question whether or not AsyncMIDIPort::cycle_start() should
still scale event timestamps by speed. In some respects it seems more appropriate
to do so, and the reading thread (e.g. a control surface) doesn't care about
the "nframes" limit on timestamps that exists for calls within a Session::process()
tree. For now, leave the timestamps unscaled by speed.
2020-02-24 18:44:58 -07:00
42c13607a2 NOOP: remove whitespace 2020-02-24 18:44:58 -07:00
89e5954953
Add a method to clear ImportStatus arrays
This is in preparation to fix a
 "SessionHandleRef exists across session deletion"
error.
2020-02-25 02:35:36 +01:00
f845bef8c6
Update source-factory boost-debug 2020-02-25 02:34:04 +01:00
André Nusser
0a1ed004f2
Remove unused forward declaration. 2020-02-24 23:01:15 +01:00
021ff2044a
Zero x-run count after session-load and engine restart 2020-02-24 22:21:18 +01:00
f16d97a013
Consolidate startup state = Clean; calls
This also emits DirtyChanged() only if needed.
2020-02-24 22:16:56 +01:00
1074c16299
Websockets: error on unhandled callbacks
This prevents unhandled http request from hogging the backend.
2020-02-24 22:06:15 +01:00
bd00db9e8b
Websockets: use established NDEBUG - see assert(3) 2020-02-24 22:06:15 +01:00
17cd3853e0
Fix initial audible noise on muted or silenced tracks
When loading a session with muted tracks, those tracks were
not initially muted, but ardour only faded them out.
The same happened to sends, and also tracks with non unity fader:
an initial fade from unity to target gain was done.

Now this send and deliveries always fade-in (like default Amp does).
2020-02-24 22:06:15 +01:00
06d4dc0ede Fix uninitialized member variable. 2020-02-24 13:16:32 -06:00
ceea3e3311 NOP: No need to set this variable to itself. 2020-02-24 13:16:32 -06:00
4f8777e968
Tweak mach thread priority debug msg 2020-02-24 05:29:56 +01:00
e737a9b000 Fix setting CoreAudio RT-priority 2020-02-24 04:38:49 +01:00
a9c75f9760
Fix CoreAudio systemic latency, implement hw latency report 2020-02-24 04:24:50 +01:00
53a6c24147
Add API to query hardware latency (as reported by the driver)
So far only MacOS/X CoreAudio supports this. This is intended
for defualt values in case a user has not callibrated the device, yet.
2020-02-24 04:24:12 +01:00
bf649cd68a
Fix another websocket surface crash when no panner is available
This amends 224be91211
2020-02-23 19:12:26 +01:00
8b092f8658
Websockets: use unique header guards 2020-02-23 16:21:55 +01:00
5e3480ba8f
NO-OP: Re-indent websockets code
"Always use Tabstops for block-indent (the code must be
formatted correctly with "[TAB] = N spaces" for any value of N).
Use space only for alignment." - https://ardour.org/styleguide.html
2020-02-23 16:21:55 +01:00
224be91211
Fix websockets surface crash when panner is not available 2020-02-23 16:21:55 +01:00
3e77680a57 surfaces transport hotfix: surfaces should query the transport state via BasicUI, when possible 2020-02-23 09:02:25 -06:00
276baee8ad surfaces transport hotfix: BasicUI: prefer actual_speed() and transport_stopped_or_stopping() for current Transport FSM 2020-02-23 09:02:21 -06:00
8efb642c46 surfaces transport hotfix: actual_speed() is preferred over transport_speed() for current Transport FSM 2020-02-23 09:02:13 -06:00
7fdc35bb45
Fix Unix compile with older libwebsockets
Debian/Ubuntu still only ship libwebsockets 2.x.
Recent libWS abstracts the poll interface to be
compatible with Windows.
2020-02-22 23:27:08 +01:00
Luciano Iam
d7ef188aea
Prefix events with LWS_ 2020-02-22 23:10:25 +01:00
Luciano Iam
5abce5aae5
Properly initialize IOCondition in events_to_ioc() 2020-02-22 23:10:25 +01:00
Luciano Iam
7f73cfb36e
Properly initialize lws config structs 2020-02-22 23:10:25 +01:00
Luciano Iam
047b05b860
Remove all initializer list usages 2020-02-22 23:10:24 +01:00
Luciano Iam
bb448080b6
Remove locally defined classes 2020-02-22 23:10:24 +01:00
Luciano Iam
d8d70adab8
Replace C++11 lambdas with functors 2020-02-22 23:10:24 +01:00
Luciano Iam
6e499e2cc5
Make code adhere to C++98 (WIP) 2020-02-22 23:10:24 +01:00
Luciano Iam
8db9755d1e
Add websockets surface module 2020-02-22 23:10:24 +01:00
4416530929
Tweak ArdorIcon display-tool & re-order icons
* add option to render a border
* group icons (assume 7x7 grid)
2020-02-22 21:40:35 +01:00
541ea5ccad avoid double-locate call when locating-while-stopped
Session::locate() used TransportFSM::stopped() to determine if realtime stop was required. But this would
return false, since the motion state at that time is WaitingForLocate. So invert the test and use
!TransportFSM::rolling
2020-02-21 15:48:53 -07:00
db3995c559 fix playback glitch : do not adjust file_sample[Type] after read, it is canonical
We told the DR to read from pos+shift, and it increment file_sample[T] appropriately. We should not adjust it. The
only thing that gets adjusted is the sample that will playback (as a result of PlaybackBuffer::increment_read_ptr()
2020-02-21 13:19:31 -07:00
8e8d2f86a8 centralize determination of "read-audio-data-in-reverse" and fix seek "shift" offset
There is still a bug related to "shift" that causes a playback discontinuity
2020-02-21 11:54:08 -07:00
f0316430c6 make "reversing" back into a DirectionState and prohibit speed changes while reversing 2020-02-21 11:54:08 -07:00
2fb260e6e8
Update Control flags of Aux Sends
This fixes old session-state of sessions saved after
6.0-pre0-3039-g93180ceea9 and before 6.0-pre0-3459-g587fc50059.
It's mainly relevant for Mixbus6.0
2020-02-20 23:11:04 +01:00
587fc50059
Fix Inline-control visibility state
This fixes an issue when copy/pasting plugins or aux-sends from
one track to another. After copying the processor, the state
is copied, however the Controllable state did save
the InlineControl flag, so this as lost.

(amend 93180ceea)
2020-02-20 23:06:55 +01:00
57598acbcf remove unused members 2020-02-20 12:53:57 -07:00
2398f6127f fix up apparent design thinkos in US2400 key binding handler 2020-02-20 12:53:57 -07:00