13
0
Commit Graph

17049 Commits

Author SHA1 Message Date
1a9df476c2 waveview: now that _quit is protected by a mutex, it doesn't need to be atomic
No reason to have two memory fences when we only need one
2021-05-11 07:57:31 -06:00
John Emmas
952416c596 Accommodate some changes to 'ssize_t' in VS2019
In more recent versions of MSVC, ssize_t equates to 'long' (for a 32-bit build) or '__int64' (for 64-bit)
2021-05-11 14:06:25 +01:00
166ac63924 waveview: redesign thread exit strategy
The previous design had a race condition. When WaveViewThreads::stop_threads() was called, it would
first acquire the mutex, then set _quit, then call condition.broadcast(). But worker threads would
check _quit without holding the mutex. It was therefore for a thread to be delayed in its
own lock acquisition by the ::stop_threads() caller, then end up back in cond.wait() AFTER
the cond.broadcast() was done. Such a thread would sleep forever and never wake up.

This new design removes WaveViewDrawRequestQueue, which was a clean encapsulation of the
queueing aspects of WaveViewThreads, but unfortunately made correct mutex acquisition
and condition signalling/waiting needlessly complex. THe mutex, condition variable
and actual queue were moved into WaveViewThreads, and all worker threads execute a method
of the class which gives the appropriate code easy access to the mutex and condition var,
which must always be used together.
2021-05-10 21:41:26 -06:00
5343d00382 when adding locations with empty names, generate one (related to 1c753a7f38) 2021-05-09 17:52:29 -06:00
c45be2266e support SMF markers without labels 2021-05-09 17:52:29 -06:00
292547b264
Use RWLock for Locations
This replaces a Mutex and adds additional read-locks.

This is needed to address some threading issues with rt-threads
calling auto_loop_location() while the GUI changes locations.

Since locations are C-pointers this is still not entirely safe!
Locations::remove() may delete a location while a pointer
to it is being used in another thread.
2021-05-09 03:20:14 +02:00
8b1df3e083 fix bad transition problem in transportFSM when slowing to a stop that is then reversed 2021-05-08 17:58:46 -06:00
66bc15f8c5 add stderr output for TransportFSM bad transitions, and remove stacktrace 2021-05-08 17:58:46 -06:00
ad14077587 rearrange transportFSM code to be more explicit about a speed-reset-after-stop 2021-05-08 17:58:46 -06:00
e588fe2057 avoid crash when stopping with "abort" set to true, but after _last_roll_location was reset to -1 2021-05-08 17:58:46 -06:00
8803b55f45
Remove invalid assertion
There are some valid cases to call no-roll with non-zero
transport speed. e.g. export pre_roll/fail_roll when
exporting multiple timespans.
2021-05-08 23:46:10 +02:00
79bf025862
Fix export race condition (and crash)
Previously the freewheel export thread directly called
Session::butler_transport_work(). The butler thread
may concurrently call the same function. This can lead
double free or memory corruption (see below)

Now export thread summons the butler and does nothing
until it completed its work.

```
Export Thread:
3   XMLNode::~XMLNode
4   ARDOUR::AutomationList::snapshot_history
5   ARDOUR::AutomationList::start_write_pass
6   ARDOUR::Automatable::non_realtime_locate
7   ARDOUR::Route::non_realtime_locate
8   ARDOUR::Session::non_realtime_locate
9   ARDOUR::Session::butler_transport_work
10  ARDOUR::Session::process_export_fw

Butler thread:
7   XMLNode::~XMLNode
8   ARDOUR::AutomationList::snapshot_history
9   ARDOUR::AutomationList::start_write_pass
10  ARDOUR::Automatable::non_realtime_locate
11  ARDOUR::Route::non_realtime_locate
12  ARDOUR::Session::non_realtime_locate
13  ARDOUR::Session::butler_transport_work
14  ARDOUR::Butler::thread_work
15  ARDOUR::Butler::_thread_work
```
2021-05-08 23:29:49 +02:00
57b3df8b22 copy over (boo!) transport control changes to BasicUI (control surfaces) 2021-05-08 09:20:21 -06:00
d88e0c6673
Fix windows builds (declare class binding)
see also 2ff8f5a5de
2021-05-08 14:38:43 +02:00
08092d22b4
Prevent invalid frame/child size allocation 2021-05-08 14:36:43 +02:00
4d815554dd Various Control Surfaces: Fix one off in calculation of fader position
MIDI pitch bend holds 14 bits (16384) which gives values of 0 to 16383.
2021-05-07 18:02:44 -05:00
f6c011cb65
Remove old RegionPropertyChanged signal (3/3) 2021-05-07 23:29:25 +02:00
2ff8f5a5de
Consolidate RegionsPropertyChanged signal emission (1/3)
This prepares to combine multiple RegionPropertyChanged signals
(potentially thousands) into a single signal.
2021-05-07 23:29:25 +02:00
f689e9ecab Evoral: add methods to SMF to load and access markers/cues in SMF files 2021-05-07 14:58:16 -06:00
49e1380417
Add missing Lua binding (see also 48e5607f7c) 2021-05-07 21:56:09 +02:00
d2ba90b2c1 Fallback to the default export path when the saved export path is not found.
Previously we would end up with an export path of top level session
directory.
2021-05-07 12:25:42 -05:00
9e6b85f330 Don't save a leading slash when storing a relative export path.
It is not needed in the relative case and causes issues when taking
sessions between platforms.

On windows, the default path would be "\export". When that is used
on linux the resulting fullpath would end up as

/your/session/path/\export

which is then not found on the file system.

This change is consistent with how relative paths are normally written and
does cure the default path when moved across platforms.

It does not solve the larger issue of mixed directory separators.
A relative path of "export\myMixV1" will still fail when moving between
platforms.
2021-05-07 12:25:42 -05:00
98f5224d4c
Fix incorrect port lists due to custom sort
Previously the following were treated as equal
 "MIDI_foo" == "MIDI bar"
So std::map<> PortManager::_ports and PortEngineSharedImpl:_ports
could only have either. This resulted in missing ports
and missing calls to existing ports in cycle_start().

This mainly affected MIDI tracks with imported files, since there
is "MIDI Clock in", and imported files result in tracks
"MIDI_file-name".

This issue was introduced in 6.6-200-g60ff3ef764
2021-05-07 04:24:32 +02:00
bfd52fd94d TransportFSM: do not enter Reversing state too early
We do need to know that a reversal is intended before we do a locate, but we should
not enter Reversing before the declick is finished. So instead, we add a new
member, _reverse_after_declick to keep track, and enter Reversing just before
we start the locate
2021-05-06 19:40:08 -06:00
7dc21fdc96
PortList debug methods (to be called from gdb) 2021-05-07 01:43:19 +02:00
ade679f162 move <poll.h> inside an appropriate #ifdef, since it does not exist on Windows 2021-05-06 14:45:56 -06:00
3a7ea6b217 use poll(2) rather than select(2) for reading output from an exec'ed process
select(2) can only handle file descriptors up to 1024, and there are fairly easy to reproduce
cases where the file descriptor used here is larger than that.
2021-05-06 14:41:28 -06:00
221b272f8a
Fix loading old route-templates
This follows 983c577945, don't allow unlinked
pannable to override main panners.
2021-05-06 21:21:47 +02:00
1173262503
Fix insert-position when adding route from template 2021-05-06 21:21:47 +02:00
31b709b7ff
NO-OP: rename variable, avoid ambiguities
Portmanager uses "ports" as local variable in various places
(usually vector<string>). While the compiler is fine with that,
it is confusing when debugging or reading code.
2021-05-06 21:21:47 +02:00
c47f5eb951 pay attention to auto-return-after-rewind-ffwd 2021-05-06 11:40:20 -06:00
3bbae4ec62 add new config parameter for auto-return after rewind/ffwd (set to false by default) 2021-05-06 11:40:20 -06:00
fd9e9df742
Fix optimized build, amend 5957e14259 2021-05-06 15:50:44 +02:00
fc54ab48ec
Remove unused function, fix optimized builds 2021-05-06 15:27:26 +02:00
John Emmas
a222292e68 Emulate exp2f() for older MS compilers where it wasn't available 2021-05-05 17:50:41 +01:00
5957e14259
Remove unused #include<> (2/2)
PBD::stacktrace() is not used nor needed by default.
It should be used sparingly.
2021-05-05 17:57:16 +02:00
3cd7c3e206
Reduce default max transport speed
Since Ardour 6, a transport speed of 200% will also double
DSP load. Under the hood Ardour rolls twice the distance and
the output is downsampled.

Vari-speed > +/-200% will likely cause dropouts with many
sessions on most systems, users should explicitly select it.
2021-05-05 17:30:48 +02:00
161b36578a
Change default GUI shuttle ctrl behavior
This facilitates vari-speed recording, and also allows for
persistent speed changes (which now work correctly).
2021-05-05 17:13:41 +02:00
273049a5a1 Mackie Control: if master surface has a jog wheel *and* a scrub button, button toggles between scroll and shuttle behavior 2021-05-04 21:30:22 -06:00
1757cfb8ef use rewind/ffwd option to alter behavior of control surface rewind/ffwd buttons
This does not affect GUI equivalents (yet)
2021-05-04 20:52:01 -06:00
8113118b89 add option to control rewind/ffwd behavior 2021-05-04 20:51:11 -06:00
eba96e72cd add back a DEBUG_TRACE statement, this time in the correct location 2021-05-04 18:55:09 -06:00
7381b8a8c6 any varispeed action that doesn't also set the default speed cancels auto-return 2021-05-04 18:54:40 -06:00
4f13ec69c1 expose TransportFSM default_speed 2021-05-04 18:53:57 -06:00
cd4aaa808e use button_varispeed() in BasicUI::rewind() and BasicUI::ffwd() 2021-05-04 16:38:28 -06:00
009e971bfb correct the implementation of BasicUI::button_varispeed() to provide incremental speed shifting (by semitones) in both directions 2021-05-04 16:38:02 -06:00
fbd1221833 move FaderPort8 method "button_varispeed()" into BasicUI for more general use 2021-05-04 16:10:24 -06:00
66aea6559b remove redundant (duplicate) call to set_track_monitor_input_state() 2021-05-04 11:30:38 -06:00
30c03c0c45 remove commented debug output 2021-05-04 11:30:38 -06:00
9448973163
Add Lua bindings to modify region gain curve 2021-05-04 18:18:04 +02:00