13
0
Commit Graph

17274 Commits

Author SHA1 Message Date
944eae53e6 Add a Midi port per Midi Tracer window that can be connected to for debugging. 2021-06-23 17:54:58 -05:00
89eab2714f Fix double call error in midi tracer handling
Only basic midi ports use the _trace_parser and they enter
here via cycle_start which will pass the _trace_parser to
this function. No need to double up calls.
2021-06-23 17:54:58 -05:00
5adbcd0673 Add function to find transport master by port and expose midi parser 2021-06-23 17:54:58 -05:00
8ad1405cf5
Fix crash when deleting Plugin after MIDI binding #8756
BindingProxy owns a PopUp prompter with 30 sec self-destruct
timeout. However ~BindingProxy explicitly destroys the PopUp.
Later the timeout can lead to a double-free.

This fixes a crash when deleting a plugin within 30 sec
after using MIDI learn.
2021-06-23 04:02:38 +02:00
336319a1df SMF meta-events do not set running status while parsing the file 2021-06-22 14:18:03 -06:00
96febb8f26
Properly solve d'tor order (controllable first) #8756 2021-06-21 20:07:11 +02:00
John Emmas
43da7c6e6f Add/remove source(s) in our MSVC project (libardour) 2021-06-21 11:26:55 +01:00
db1821a363
Fix crash when removing plugin with mapped controllable #8756
MidiControlUI drops the reference to a given controllable in
its own thread. This can happen after the plugin is already
destroyed (even though the PBD::Controllable still exists).
2021-06-21 05:27:11 +02:00
1e5ccd4acc
Use poll timeout workaround on macOS only
Other systems implement proper poll according
to POSIX and return when the pipe is closed.
2021-06-21 03:48:04 +02:00
cc69274234
NO-OP: clang-format 2021-06-21 02:51:23 +02:00
0f7229fb02
Fix some C++11isms 2021-06-21 02:46:39 +02:00
Marijn Kruisselbrink
0a54f96a44
Add M4A support to the audio import dialog using FFMPEG.
This uses the existing optional runtime ffmpeg dependency to add support
for m4a files (and in theory whatever other file formats ffmpeg
supports) to the import audio dialog.

The same functionality is mostly already available via Session -> Open
Video, with the "import audio only" selection (even though m4a isn't
currently included as one of the video formats, it still works). Having
this in the import audio dialog however seems much more user friendly.
2021-06-21 02:30:36 +02:00
f4166fb61d Fix endless poll on macOS #8753
Harvid daemonizes and does not write anything
to stdout/err. as opposed to select(), poll() on
macOS does not return when the child process
terminates or is killed.

However poll() on an invalid FD does throw an
error and POLLNVAL is set.
2021-06-21 01:58:40 +02:00
e7466bddbc Push2: Clean up forward declarations 2021-06-18 13:53:53 -04:00
57a3db06f8 OSC: Fix potential crash on select-prev-route (#8670)
If the selection here is empty for whatever reason, it crashed with a null
pointer dereference.
2021-06-18 12:55:45 -04:00
cc6b58ef00
Fix Windows builds (pthread handle abstraction) 2021-06-17 13:32:10 +02:00
0b1d5e4a45
Remove dead assignment 2021-06-16 22:30:09 +02:00
f85bbaa97d
Fix C++11ism 2021-06-16 03:03:26 +02:00
ad9ac0911e remove some timing stats that it seems unlikely we will use 2021-06-15 14:03:55 -06:00
Luciano Iam
04104b68a6 WebSockets: fix surface build for older systems 2021-06-14 14:50:48 +02:00
Luciano Iam
5fffe985bb WebSockets: update some source headers 2021-06-14 14:45:51 +02:00
Luciano Iam
6cc59ad8e6 WebSockets: update some comments in source
Based on feedback from libwebsockets author
https://github.com/warmcat/libwebsockets/issues/2322#issuecomment-860572124
2021-06-14 12:25:29 +02:00
Luciano Iam
f1d7e1759a WebSockets: repeat 8baf275 for JS files
Like ec131fc does
2021-06-14 10:25:45 +02:00
Luciano Iam
ebee3a8010 WebSockets: remove unnecessary code
Leftovers from copy and pasting from test_ui.cc
2021-06-14 10:02:25 +02:00
Luciano Iam
cb73eb350d WebSockets: less invasive version of 5407232
There is no need to connect signals twice, can connect them directly to the
helper UI loop and skip the surface loop. Then let the server decide if it is
necessary to call lws_cancel_service() or not.

Also rename WebsocketsServer::should_request_write() to read_blocks_event_loop()
it makes more sense for the caller now on-demand write logic is completely
implemented by the server class.
2021-06-14 10:02:25 +02:00
fc6fd7973f
Reset performance counters along with xrun count
This is mainly relevant after session export, which uses
freewheeling and processing take much longer than running realtime.
2021-06-14 03:14:07 +02:00
80c11a763a
Notify GUI of x-run counter resets 2021-06-14 03:09:46 +02:00
c06553c2de
Reset x-run counter after disabling freewheeling 2021-06-14 03:09:42 +02:00
d6a1a64398 remove debug output 2021-06-13 18:36:44 -06:00
c15e6fd7db fix condition-variable race caused by not holding the request lock when signalling the var 2021-06-13 18:35:33 -06:00
21f4598395
Fix DR refill when exporting multiple timespans #8742
In between timespans Ardour disables freewheeling and
only later resumes freewheel. It can happen that
Session::process can summon the butler while start_audio_export()
calls Track::seek.

Just waiting for an earlier Butler::wait_until_finished() does
not prevent the butler from running again later.

This can lead to concurrent calls of DR::refill_audio from both
the butler and start_audio_export(), leading to garbled buffers.
2021-06-14 02:18:54 +02:00
ec131fcb70
Set Thread name to aid debugging 2021-06-14 01:29:16 +02:00
95f8a3aace
Explicitly prevent unsigned int wrap-around
This is a NOOP (0 - 1) + 2 == (0 + 2) - 1 but avoids
a unsigned int wrap-wrap around for good measure.
2021-06-14 00:43:08 +02:00
c8205cc6d9
Fix final export-timespan count
ExportHandler::start_timespan() is also used to stop export
when there are no more timespans to be processed.

This is done because freewheeling has to be stopped from
outside the process cycle.
2021-06-14 00:40:23 +02:00
Luciano Iam
e3569b6469
WebSockets: notify server there are pending client updates
This is an update to the surface ArdourFeedback class that is needed to support
the new event loop integration method.

The various session event callbacks cannot be queued in the surface event loop
because that would create a delay between the time such events are fired and
the time for writing to clients arrive, due to lws_service() blocking while
it waits to read. To solve this issue a helper AbstractUI is created for
catching events as soon as possible and issuing a call to lws_cancel_service().

See WebsocketsServer::glib_idle_callback()
2021-06-13 22:00:29 +02:00
Luciano Iam
b3661af92a
WebSockets: additional method for event loop integration
Some distro repositories offer versions of libwebsockets that have not been
compiled with LWS_WITH_GLIB or LWS_WITH_EXTERNAL_POLL enabled. For such cases
a different event loop integration method is needed.

True for Ubuntu 20.04 as of Jun '21
2021-06-13 22:00:29 +02:00
Luciano Iam
5f504f23ac
WebSockets: reduce server log verbosity 2021-06-13 22:00:28 +02:00
Luciano Iam
373d905a93
Update websockets surface author email in source files 2021-06-13 22:00:28 +02:00
Luciano Iam
12a7480ea3
Move #include inside header guard 2021-06-13 22:00:28 +02:00
8d1e999be4 libardour: reset perf meters after warmup period is over 2021-06-13 12:21:08 -06:00
b939b2e68d libardour: provide a global function for resetting performance meters 2021-06-13 12:20:42 -06:00
e511cd2cb7 JACK backend: "fix" RunLoop timing 2021-06-13 11:11:03 -06:00
a5f7c793e3 add a new "Run Loop" timing stats for ALSA and JACK backends 2021-06-13 10:28:51 -06:00
a89ad7a265 add queue-reset method to PBD::TimingStats 2021-06-13 10:28:51 -06:00
f196256604
Fix jack2 input-port monitoring
Port_connect must be called with correct order (src, dst),
and may only be called after the client is active.

jack2 reported errors:
> Destination port in attempted (dis)connection of ardour:physical_input_monitor_enable and system:capture_1 is not an input port
> Cannot connect ports owned by inactive clients: "ardour" is not active
2021-06-13 17:41:41 +02:00
95215ff405 JACK backend: avoid deadlock if a port is unregistered that is not known to Ardour 2021-06-13 07:59:14 -06:00
7980ea4d27 add a method to SerializedRCUManager to release the lock when no update is required 2021-06-13 07:58:45 -06:00
4c76ff503f measure backend process callback duration in ALSA backend 2021-06-12 15:00:46 -06:00
Mathias Buhr
c5abb7ecda Fix Upsampler new/delete mismatch 2021-06-12 21:16:18 +02:00
8afc994177 add some DSP stats to the JACK backend 2021-06-12 09:20:28 -06:00
Desidiosus
d8e2f2fcad Fix incorrect call in request_roll 2021-06-12 07:56:00 -06:00
182801b8d7 complete manual reversion of 7bce9899c0 2021-06-11 20:56:33 -06:00
f643e231f5 NOOP: add comment as a reminder for post-nutempo merge 2021-06-11 19:13:13 -06:00
1b505ddcb1 Revert "modify PBD::TimingStats to discard the first 1000 recorded values to avoid too much influence from chaotic startup conditions"
This reverts commit 7bce9899c0.

1000 at 8192 samples @ 44.1 is > 3 mins; counter may have overflowed. Not a necessary change.
2021-06-11 18:55:25 -06:00
1777cf8f69 add some initial timing points for dsp stats 2021-06-11 18:55:24 -06:00
462352102c add a new update() method to PBD::TimingStats to allow use of an already-computed interval 2021-06-11 18:55:24 -06:00
c01f68cfca
Fix MIDI bounce w/processing (event times + latency compensation)
see also 8f9c1df183
2021-06-12 02:34:22 +02:00
1c4323e32f
Fix crash on MIDI bounce w/processing
Bounce (Session::write_one_track) uses bounce_chunk_size = 8192
to process data. This requires gain_automation_buffer, and
scratch buffers that can hold 8k samples.

Previously the buffers were not allocated when bounding MIDI
(no synth), leading to a crash when automation was used.
2021-06-12 02:34:22 +02:00
76f30fe74e
NO-OP: whitespace (clang-format) 2021-06-12 02:34:22 +02:00
1ed0e88e23
NO-OP: whitespace 2021-06-12 02:34:22 +02:00
ef72afb963 add PBD::TimerRAII class for easy management of TimingStats in scope contexts with multiple return points 2021-06-11 13:09:52 -06:00
7bce9899c0 modify PBD::TimingStats to discard the first 1000 recorded values to avoid too much influence from chaotic startup conditions 2021-06-11 13:09:52 -06:00
3f6bf2c451
Overhaul connection events, fix capture alignment
Previously there was only a PostDisconnect() signal.
When a port connection is made directly e.g. recorder_ui.cc
r->input()->audio(..)->connect(...), or when connecting
using an external jack control app, Ardour::IO is not informed.

no IOChange::ConnectionsChanged signal is emitted and
Track::set_align_choice_from_io() is not called. This leads to
incorrec capture alignment.

To minimize signal emission the static global PostDisconnect
is changed into a per port ConnectedOrDisconnected signal.
IOs subscribes to signals from owned ports only.
2021-06-11 20:02:39 +02:00
a67a475480 dramtically improve performance of ::get_port_by_name() for JACK backend 2021-06-11 10:41:41 -06:00
47b06afc9d
Leave cpu_dma_latency alone by default (prevent overheating) 2021-06-11 14:29:34 +02:00
b67d783cd6
Reopen cpu_dma device when changing settings
This fixes a bug with previous filedes remaining open,
only allowing to increase the constraint.
2021-06-10 21:35:52 +02:00
53499648be
Allow to change CPU-DMA setting w/o restart 2021-06-10 20:22:09 +02:00
7ce43739e8
Tweak sched priorities use given and 4 levels below. 2021-06-10 14:38:45 +02:00
8c0ef7bd62
Add support for CPU DMA latency requests 2021-06-10 04:30:06 +02:00
2e574a011a
Amend 6e82f3669f, set BaseUI thread priority early on
This is conceptually clearned compared to doing it as
part of the session.
2021-06-10 04:30:03 +02:00
6e82f3669f
Correctly set ctrl-surface thread priority 2021-06-10 03:17:55 +02:00
89a0040f1b
Allow to override rt priority for internal backends 2021-06-10 03:17:53 +02:00
2c8916310a
Consistent env variable naming (see also 6801c2cac2) 2021-06-10 03:17:49 +02:00
444af7b3e8
Fix client_real_time_priority() calls (backend vs engine) 2021-06-10 03:17:45 +02:00
0e570d15ae
Amend 3a7ea6b, do not kill child after 10 sec w/o output
This fixes video-timeline issues (harvid has no output), as well
as ALSA device reservation and xjadeo (when idle).
2021-06-08 23:23:31 +02:00
445d5a75d0
NO-OP: use reference instead of iterator 2021-06-08 19:26:40 +02:00
23e3b6f6a8
Amend previous commit (remove debug instrumentation) 2021-06-08 16:49:55 +02:00
e8130c1f1b
Optimize input-metering
Rely on previously collected I/O port-list, skip expensive call
to get_physical_inputs() and rely on RCU port list alone.
Also skip port_is_mine() test in optimized builds.
2021-06-08 16:43:26 +02:00
b75a37abdb fix arguemnts to transport call in shared control surface code for transport_play() 2021-06-08 08:32:19 -06:00
f4d4dddbeb Paste Mode: overwrite-paste, naive implementation using rec-mode (for testing) 2021-06-08 08:33:48 -05:00
1c9bb9ab41 Playlist UI tweaks: refactor PlaylistSelector (life-cycle, code-cleanup)
* You can now show a selector for each track, rather than one global dialog
* Removed the 'cancel' button: it was too easy to unintentionally revert your selection
* Correctly sort and name new playlists when they are added or renamed from the P menu
* Fix problem where list contents disappeared when changing desktops (on_unmap_event)
2021-06-08 08:33:48 -05:00
c2fb85e37e Cruft removal: behavior of Region List has changed; these functions are deprecated (libardour) 2021-06-08 08:33:48 -05:00
b0db646029
Refactor input port monitoring
* avoid memory allocation (remove std:set<>&)
* skip nested loop using port-names as IDs

However this adds a bit of extra cost in case input ports are
monitored: get_port_by_name() and get_buffer()
2021-06-08 14:34:57 +02:00
bed992d55f
Minimize false sharing of MPMC queue variables 2021-06-07 23:40:29 +02:00
5cec55da2e
Micro-optimization: std::atomic<> vs glib
glib atomic operations include a complete act as a full
compiler and (where appropriate) hardware memory barrier.

std::atomic<> allows dedicated acquire and release barrier
semantics which are not available with glib.
2021-06-07 20:44:29 +02:00
1eb6b82b9f
Prevent L1 cache line evicion in MPMC queue
This reduces cache coherence overhead of the queue
2021-06-07 16:05:42 +02:00
ecb992de64
Remove custom generic plugin UIs (a-eq) 2/2 2021-06-04 01:43:29 +02:00
bc4ef3ff3d
Update weakjack, alternative macOS libjack paths
see also https://github.com/x42/weakjack/pull/13
2021-06-02 17:42:01 +02:00
6cf1083cb6 Playlist UI tweaks: add function playlists_for_pgroup() (libardour) 2021-06-01 17:55:09 -05:00
63629c0a91
NO-OP: whitespace 2021-06-01 19:40:21 +02:00
0e86e3337c Playlist UI tweaks: relax requirement that playlists names must be unique (libardour part) 2021-06-01 09:39:50 -05:00
932b07b7b0 Playlist UI tweaks: assign a pgroup when a playist is first recorded to
* this solves the problem where the first 'take' was not grouped because
 the user has not explicitly created a take for the group yet
2021-06-01 09:39:50 -05:00
28aa22e11a Playlist UI tweaks: Add pgroup_id field to playlists, to associate playlists created in the same operation (libardour) 2021-06-01 09:39:50 -05:00
f6d2229c47 Playlist UI tweaks: Update PlaylistSelector (libardour part)
* Add an option to use a playlist without stealing its ownership. (libardour)
* Tracks emit PlaylistAdded when a new playlist is created either by copying or by creating a new empty pl
2021-06-01 09:15:54 -05:00
7b2854b2fb Prefer storing playlist-IDs for frozen tracks; but if none is provided then search by name
* no version-check should be necessary because when opening an old session,
 playlists can be looked-up by discrete names and will be tracked by ID thereafter
2021-06-01 09:14:07 -05:00
71a414b4b0 Remove unused function (Wunused-function) 2021-05-30 20:09:35 -04:00
8d471e6761 Remove extraneous parentheses (Wparentheses-equality) 2021-05-30 20:09:35 -04:00
74e21e942e Remove unused variables (Wunused-variable) 2021-05-30 20:09:35 -04:00
1b4aaea92a Remove unused private fields (Wunused-private-field) 2021-05-30 20:09:35 -04:00
c57c230dfc
Fix loading old session w/missing playlist #8727 2021-05-30 18:54:45 +02:00