John Emmas
09589c3c94
Add/remove source(s) in our MSVC project (libpbd)
2021-06-28 10:37:54 +01:00
Paul Davis
4fd639eca9
NOOP: remove incomplete comment
2021-06-27 12:48:29 -06:00
Paul Davis
a261d399e0
microsoft docs say that only windows.h is required for QueryPerformance*
2021-06-27 12:17:51 -06:00
Paul Davis
e2f2d0cb0f
fix inadvertent typo that would cause compilation failure on windows
2021-06-27 10:53:31 -06:00
Paul Davis
857a9b14d7
more macOS cleanup for microseconds.cc
2021-06-27 10:39:51 -06:00
Paul Davis
347ca5c2fe
clean up locally-created mess in libs/pbd/microseconds.cc
2021-06-27 10:28:53 -06:00
Paul Davis
412b6a922d
macOS: slight speed up for ::get_microseconds()
...
Move timebase initialization into microsecond_timer_init() and drop conditional
2021-06-27 10:23:44 -06:00
Paul Davis
db0691d236
macOS: fix compilation warnings on macOS versions where clock_gettime() is finally implemented
2021-06-27 08:24:59 -06:00
Robin Gareus
738b0ad21b
Fix OSX builds (amend 04df26244, a2b5962b6)
2021-06-27 05:09:07 +02:00
Paul Davis
b904fdea5d
switch PBD::Timing* to use PBD::get_microseconds()
2021-06-26 20:15:12 -06:00
Paul Davis
2678366555
window compilation fix
2021-06-26 18:53:28 -06:00
Paul Davis
228231d914
window compilation fix
2021-06-26 18:47:08 -06:00
Paul Davis
5c8df87205
window compilation fix
2021-06-26 18:43:17 -06:00
Paul Davis
5289d44821
window compilation fix
2021-06-26 18:40:44 -06:00
Paul Davis
d1967827ca
compilation error fix for windows
2021-06-26 18:35:14 -06:00
Paul Davis
b9a85c7dcd
compilation error fix for windows
2021-06-26 18:34:46 -06:00
Paul Davis
4c1dcb70bb
compilation error fix for windows
2021-06-26 18:33:27 -06:00
Paul Davis
a2b5962b6c
add new files for PBD::get_microseconds()
2021-06-26 18:30:11 -06:00
Paul Davis
9e598548f7
put get_microseconds() into PBD namsepace
...
This implementation is a blend of the two previously in libs/ardour/globals.cc
and libs/pbd/window_timer_utils.cc
2021-06-26 18:25:02 -06:00
Paul Davis
995137aeb3
add PBD::WaitTimerRAII with reverse semantics from PBD::TimerRAII
2021-06-26 11:24:59 -06:00
Robin Gareus
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
Robin Gareus
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
Robin Gareus
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
Paul Davis
a89ad7a265
add queue-reset method to PBD::TimingStats
2021-06-13 10:28:51 -06:00
Paul Davis
7980ea4d27
add a method to SerializedRCUManager to release the lock when no update is required
2021-06-13 07:58:45 -06:00
Paul Davis
182801b8d7
complete manual reversion of 7bce9899c0
2021-06-11 20:56:33 -06:00
Paul Davis
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
Paul Davis
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
Paul Davis
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
Paul Davis
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
Robin Gareus
7ce43739e8
Tweak sched priorities use given and 4 levels below.
2021-06-10 14:38:45 +02:00
Robin Gareus
6e82f3669f
Correctly set ctrl-surface thread priority
2021-06-10 03:17:55 +02:00
Robin Gareus
89a0040f1b
Allow to override rt priority for internal backends
2021-06-10 03:17:53 +02:00
Robin Gareus
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
Robin Gareus
bed992d55f
Minimize false sharing of MPMC queue variables
2021-06-07 23:40:29 +02:00
Robin Gareus
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
Robin Gareus
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
Todd Naugle
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
Todd Naugle
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
Robin Gareus
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
Robin Gareus
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
Paul Davis
ade679f162
move <poll.h> inside an appropriate #ifdef, since it does not exist on Windows
2021-05-06 14:45:56 -06:00
Paul Davis
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
Robin Gareus
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
Robin Gareus
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
Robin Gareus
438b1e5eab
Cont'd work to improve macOS rt priority
2021-05-02 20:24:10 +02:00
Robin Gareus
53e710bc5f
macOS: apply time scaling for rt constraints
2021-05-01 02:49:06 +02:00
Robin Gareus
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