13
0
Commit Graph

1385 Commits

Author SHA1 Message Date
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
7ce43739e8
Tweak sched priorities use given and 4 levels below. 2021-06-10 14:38:45 +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
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
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
1a1e67f595 Use Posix style return values for sem wait when on windows.
0 on success, -1 on error
2021-05-27 15:17:15 -05:00
be6d0fa95c Do not use named semaphores on Windows since they are system wide
https://docs.microsoft.com/en-us/dotnet/standard/threading/semaphore-and-semaphoreslim#named-semaphores

Running multiple instances of Ardour or Ardour/Mixbus would fail in very
odd ways since they would signal each other. Unnamed sems are
correct for this use case.
2021-05-27 15:13:40 -05:00
28619fe71b
Fix window process thread priorities
While POSIX defines a single contiguous range of numbers that
determine a thread's priority. Win32 defines priority classes
and priority levels relative to these classes.

pthread maps those to -15 .. +15 with the top six ones
corresponding to REALTIME_PRIORITY_CLASS and max being
THREAD_PRIORITY_TIME_CRITICAL

Note that the PA backend can USE_MMCSS_THREAD_PRIORITIES
and PBD::MMCSS::set_thread_characteristics() directly for
the I/O threads.
2021-05-14 01:59:20 +02: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
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
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
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
438b1e5eab
Cont'd work to improve macOS rt priority 2021-05-02 20:24:10 +02:00
53e710bc5f
macOS: apply time scaling for rt constraints 2021-05-01 02:49:06 +02:00
58557e88c9
Do not move automation when inserting regions
RegionInsertDrag or Consolidate Range or any other operation
calling Playlist::add_region() previously triggered RangesMoved()
which resulted in DiskReader::move_processor_automation()

NB. insert + ripple still moves automation correctly.
2021-04-29 23:26:24 +02:00
b23f260d21
Move glib include out of PBD namespace
strictly speaking the include is not needed here since
g_atomic_compat.h includes glib.h. However it is idempotent,
the file does use glib methods, and g_atomic_compat.h may
one day be removed again.
2021-04-16 17:43:31 +02:00
a1d53c1d2e
Fix linking unit-tests with lld
ld.lld: error: libs/pbd/libpbd.so: undefined reference to dlopen [--no-allow-shlib-undefined]
2021-04-13 23:29:02 +02:00
8f5c3fcddb
Fix non-layered record-undo
Previously an empty RegionList was used (auto-partition
changes were never collected at rec-stop), furthermore
auto-partitioned regions do not have an old ARDOUR::AutomationList
(fade in/out) property (_have_old is false).
2021-04-12 23:14:13 +02:00
bc1d19ab39
Increase process-thread stack size (same value as jack2) 2021-04-09 22:00:11 +02:00
ea01ec5988
Correctly detect glib volatile atomic
see also https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1919
2021-03-30 15:29:53 +02:00
60ff3ef764
Work around ffado port-name idiosyncrasies 2021-03-26 17:18:23 +01:00
cc7b8b1bc5
gcc-11 compat, volatile atomic variables (1/2)
"While 'atomic' has a volatile qualifier, this is a historical
artifact and the pointer passed to it should not be volatile."

Furthermore "It is very important that all accesses to a
particular integer or pointer be performed using only this API"
(from https://developer.gnome.org/glib/2.68/glib-Atomic-Operations.html)

Hence initialization of atomic variables is changed to also use
this API, instead of directly initializing the value.

This also fixes a few cases where atomic variables were
accessed directly.

see also libs/pbd/pbd/g_atomic_compat.h
2021-03-22 15:30:07 +01:00
d08b9eaa8d
Fix debug message: missing newline 2021-03-21 22:31:40 +01:00
John Emmas
15f12bd3a9 A few minor changes to keep VS2019 happy 2021-02-09 10:52:37 +00:00
7e74f9eb1e
Keep track of recently touched Controllable 2021-02-09 02:11:04 +01:00
John Emmas
b496a71d2e Some preliminary changes needed to support building with VS2019
(these get me about as far as 'libardour' )
2021-01-30 13:55:25 +00:00
John Emmas
ef7a5e1b00 For 64-bit compilation, MSVC no longer supports inline assembly 2021-01-07 09:22:43 +00:00
Ayan Shafqat
407882d23d
Add support for Intel/AMD's FMA extension
By supporting FMA extension, the number of instruction needed
for multiply accumulate to mix channels are reduced. Since,
this extension has been around since middle of 2012, more
computers have this instruction set available.
2021-01-01 21:05:16 +01:00
1db219b3d8
Fix compilation with mingw/gcc-8 2020-12-10 20:21:29 +01:00
13e6fdb6b3
Ensure ringbuffers are never copy-constructed 2020-12-07 02:54:51 +01:00
a974a3135e
Prevent duplicate search paths
This fixes an issue with VST3 plugins being listed up multiple times
if a user also explicitly adds standard built-in search paths.
2020-12-02 21:34:52 +01:00
0404876d7b Fix reliance on deprecated implicit assignment operators
Either both, or neither, a copy constructor and assignment operator should be
defined.  This fixes Wdeprecated-copy warnings.
2020-12-01 12:03:38 +01:00
ff7bd23661
NO-OP: comments 2020-11-10 19:31:25 +01:00
512b47c878
micro-optimization (skip atomic test) 2020-11-10 19:31:09 +01:00
01cdaa49b4
Fix gcc-4.x/C++98 builds (amend f87de76b9f)
This resolves error: invalid use of 'unary *' on pointer to member
error: 'volatile gint RCUManager<std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<ARDOUR::Port>, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<const std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<ARDOUR::Port> > > > >::active_reads' is protected
2020-11-10 18:41:27 +01:00
b1846a578d
NO-OP: whitespace, doxygen formatting and naming 2020-11-10 17:05:22 +01:00
Hector Martin
f87de76b9f
RCU: Fix race condition between writer/reader
This uses an atomic counter and spins only on the writer side, which
preserves realtime behavior on the reader side. The spinning yields (by
using the same Boost function from Boost spinlocks) to be
scheduler-friendly.

Fixing this bug also lets us be able to confidently drop garbage early
in the writer if appropriate, so do that and avoid keeping dead wood if
possible.

This reverts commit f95439a502275e656c17ea5d6d39f71e6ff57056:
"add spinlock to RCU manager to protect concurrent reader() and update() calls"
2020-11-10 17:05:16 +01:00
John Emmas
5f082e2c9d Add an extra option when querying Windows registry keys
(this option will be needed when 32-bit Ardour is running in 64-bit Windows)
2020-11-09 11:35:35 +00:00
f95439a502 add spinlock to RCU manager to protect concurrent reader() and update() calls 2020-11-08 11:28:10 -07:00
01f9332458
Fix RCU Unit-test on macOS/X
Apple's pthread does not implement barriers
2020-11-07 10:37:52 +01:00
88fc0ed392
Add RCU unit test 2020-11-05 02:24:54 +01:00
cf0904f752
Handle vfork/exec failure
Don't call atexit, exit without cleanup.
2020-10-31 22:33:10 +01:00
a9bd7b2848
Remove unused compile-time option to not use vfork 2020-10-31 22:30:45 +01:00
7896c30508
Fix cmdline parameter escape 2020-10-31 13:42:14 +01:00