13
0
Commit Graph

1568 Commits

Author SHA1 Message Date
295dbd8e1e
Make RCU reader return a const pointer (omnibus commit) 2023-04-08 00:15:37 +02:00
0b8d5d3dc5
Tweak Window system-exec, wait for process to terminate 2023-04-05 00:16:37 +02:00
473f575a05
Catch Glib::ConvertError when checking for files
This fixes some edge-cases when scanning recent sessions
in get_state_files_in_directory() and likely some other
places that use run_functor_for_paths in case the folder
contains files with non UTF-8 names.
2023-04-03 22:10:11 +02:00
3715154a8e
Allow concurrent child processes
When multiple child processes are running, closing the
stdin of one child did not send EOF or cause POLLNVAL,
as long as a dup()'ed filedes still existed.

This fixes an issue when running an mp3 encoder while the
video monitor is visible, and will allow to concurrently
run multiple mp3 encoders or other child processes.

Previously this caused Ardour to hang indefinitely in CmdPipeWriter
```
 _proc->close_stdin();
 _proc->wait(); // << here
```
2023-03-25 06:43:46 +01:00
8075b55919 Fix amiguity in atomic load
operator _Tp() const volatile _NOEXCEPT {return load();}
operator _Tp() const _NOEXCEPT  {return load();}
2023-03-25 00:07:56 +01:00
45490bf43f more functional tempo mapping 2023-03-24 14:19:16 -06:00
4137271188 int62_t: use explicit memory order for all loads and stores
Also, improve implementation of CAS loops for operator <X>=.

Ideally, we ought to test this on ARM, both before and after.
2023-03-24 14:19:15 -06:00
fe17b98079 use explicit memory order for rcu reader/write exclusion 2023-03-24 14:19:15 -06:00
a486fba3e9 std::atomic - 2nd batch of changes to convert from glib to std::atomic 2023-03-24 14:19:15 -06:00
4ba4cd69ff switch from glib atomic to std::atomic (libs edition) 2023-03-24 14:19:15 -06:00
945c19b8b4 libpbd: make RCU more C++-ish 2023-03-24 14:19:15 -06:00
b35518e212 switch from boost::{shared,weak}_ptr to std::{shared,weak}_ptr
This is mostly a simple lexical search+replace but the absence of operator< for
std::weak_ptr<T> leads to some complications, particularly with Evoral::Sequence
and ExportPortChannel.
2023-03-24 14:19:15 -06:00
90c5524e7b libbd: add required <cassert> include 2023-03-24 14:19:15 -06:00
39ed528e25 std-ize: convert all boost shared/weak ptr includes to <memory>
Also fix stdint.h -> cstdint and alphabetically order std includes
2023-03-24 14:19:15 -06:00
eeaf0bdadc
Fix non-intel arch builds (cpuid.h header) 2023-02-09 20:54:46 +01:00
Ayan Shafqat
bb31125c94
Fix CPUID to detect AVX512F
CPUID is part of x86_64 ISA to query CPU features. In order to determine
AVX512F ISA extension, EAX and ECX needs to be set to 7 and 0
respectively before invoking `cpuid` instruction. This commit also
removes inline assembly for __cpuid in favor of using compiler provided
intrinsic functions. Both GCC and clang provides __cpuid like function
via __cpuid_count intrinsic.

This commit also creates a portable wrapper over compiler intrinsic
functions, __cpuid and __cpuidex. `cpuid' provides base level ISA query
and `cpuidex` provides extra extension information like AVX512F. These
wrappers lean towards MSVC like API.

References:
CPUID Docs: https://en.wikipedia.org/wiki/CPUID

GCC's ``docs" on __cpuid_count:
https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/config/i386/cpuid.h

Clang's docs on __cpuid_count:
https://clang.llvm.org/doxygen/cpuid_8h.html

MSVC's docs on __cpuid and __cpuidex:
https://learn.microsoft.com/en-us/cpp/intrinsics/cpuid-cpuidex
2023-02-08 23:20:20 +01:00
Ayan Shafqat
bf8fced073
Add CPU detection 2023-02-04 23:07:17 +01:00
John Emmas
2ff05d9e9d class 'PBD::Configuration' now needs to be exportable 2023-01-28 17:44:11 +00:00
68f4c7ce8e add upcase() method; remove upcase version of internationalize() 2023-01-27 15:13:27 -07:00
3c1c6e7b68 continued work on use of Metadata in various Configuration objects (libs edition) 2023-01-27 15:13:27 -07:00
f7387a5d77 infrastructure for PBD::Configuration to deliver metadata 2023-01-27 15:13:27 -07:00
d982507085 move match_search_strings() function from plugin utils to PBD 2023-01-22 17:41:43 -07:00
2522deabda
SystemExec: tweak writing to stdin of child process 2023-01-16 16:39:37 +01:00
117cfc844b
Fix 128 bit integer math rounding (#9057)
The previous code only used the 1st multiplicand was use to
determine the direction of rounding, breaking commutative property

`muldiv_round (1, 3, 4) != muldiv_round (3, 1, 4)`
2023-01-12 16:08:53 +01:00
09b0734028
Increase system-exec stdout bufsiz (from 512 to 8k) 2023-01-05 04:54:07 +01:00
27e136dcfc
Cont'd tweaks of ffmpeg export pipe 2023-01-05 03:32:40 +01:00
3da7f71fb6
Windows process: allow for binary data output
Do not rely on null termination.
2023-01-04 20:28:22 +01:00
d568bb5a06 Fix unused computed values
For example:

../libs/pbd/reallocpool.cc:138:38: warning: value computed is not used
[-Wunused-value]
  138 |                 ASSERT (_asize (ptr) <= newsize);
2022-12-11 11:54:03 -05:00
cd7c981e6e Use macOS API to open finder at given path 2022-12-08 02:15:29 +01:00
201617f03b Fix macOS URI open
curl_easy_escape() escapes slashes, which fails with openURL on modern macOS.
Also add missing call to curl_easy_cleanup().
2022-12-08 02:12:15 +01:00
c69cfaa124
Fix Ardour's rm -r implementation, delete symlinks 2022-11-19 20:20:58 +01:00
4f3b8a9776
Allow to override default stack limit for background processes 2022-11-13 03:01:57 +01:00
2ae670055d
Explicitly initialize futex word
This is mainly to silence valgrind warnings, the actual value
is irrelevant here.
2022-11-13 03:01:50 +01:00
bdacfb8724 Fix invalid use of Doxygen "@param" command
This is never for inline references to parameters, only for starting parameter
documentation blocks.  The "@p" command is for this, although unfortunately
Doxygen doesn't actually do anything with it and it's just an alias for code
text.
2022-10-30 20:44:28 -04:00
Mads Kiilerich
004b32b91e
Update tracker/reference URLs to prefer HTTPs 2022-10-24 04:59:20 +02:00
14da117bc8 Add explicit round/floor integer multiply/divide
This fixes various rounding issues. Notably superclock to sample
conversion must always round down when playing forward.

`::process (start, end, speed = 1)` uses exclusive end.
Processing begins at `start` and end ends just before `end`.
Next cycle will begin with the current end.

One example where this failed:
 - New session at 48kHz
 - Change tempo to 130 BPM
 - Enable snap to 1/8 note
 - Snap playhead to 1|3|0
 - Enable Metronome
 - Play

`assert (superclock_to_samples ((*i).sclock(), sample_rate()) < end);`

end = 177231 samples == superclock 1042118280
A grid point is found at superclock 1042116920 (that is < 1042118280).
However converting it back to samples rounded it to sample 177231 == end,
while actual location is 1360 super-clock ticks before end.

The metronome click has to be started this cycle, since the same
position will not be found at the beginning of the next cycle, with
start = 177232.

Similarly a samplecnt_t t, converted to music-time and back must not be
later than the given sample.

```
timepos_t tsc (t);
assert (timepos_t::from_ticks (tsc.ticks ()).samples () <= t);
```

IOW. When playing forward, all super-clock time between 1|1|0 and 1|1|1
should round down to 1|1|0. "We have not yet reached the first tick".
2022-10-22 02:10:05 +02:00
5016c950d0
Move ControllableSet up in PBD's namespace
This is in preparation to supersede AutomationControlSet
with a lower level generic std::set usable in any relevant
context.
2022-10-18 00:08:21 +02:00
ebf59d4426 Insert_or_assign properties, allow to override properties
This allows to copy a property list and then selectively
replace various properties. e.g.

```
PropertyList plist (region->properties ());
plist.add (Properties::length, len);
plist.remove (Properties::start);
```

See also 8b0ab38675
and 97f0fac7d5
This also fixes the issue referenced in
8c83149c4c
2022-10-07 00:32:14 +02:00
f2eddd404b downloader: create destdir if it does not already exist, throw exception if this fails 2022-09-26 01:10:20 -06:00
luz paz
7f06beda50 Fix typos
Found via `codespell -q 3 -S *.po,./.git,./share/patchfiles,./libs,./msvc_extra_headers,./share/web_surfaces,*.patch  -L acount,ba,buss,busses,discreet,doubleclick,hsi,ontop,retrn,ro,scrollin,seh,siz,sord,sur,te,trough,ue`
2022-09-21 19:09:55 -06:00
be24b51a6b downloader: remove unnecessary header 2022-09-13 14:15:24 -06:00
d087cd9465 downloader: use PBD::Thread instead of std::thread 2022-09-13 14:14:53 -06:00
aeccb137fd threaded archive inflation for library mgmt 2022-09-13 13:53:45 -06:00
375daf4810 libpbd: new threader Inflater and Downlaoder classes 2022-09-13 13:53:45 -06:00
2061c3780d FileArchive: minor fixes to get progress reporting working 2022-09-13 13:53:45 -06:00
18474d89f8
SystemExec try SIGINT before SIGKILL
Even though SIGINT is intended to be sent from terminals only,
it is more successful at terminating various child processes than
closing stdin and sending SIGTERM.
2022-09-12 16:17:55 +02:00
John Emmas
7418da4703 Add a missing #include
(needed for call to std::back_insert_iterator)
2022-09-10 10:20:37 +01:00
57430f33c2
Fix file-archive, curl API 2022-09-08 15:46:06 +02:00
73331ae46a libpbd: fix decl of remove_extra_whitespaces 2022-09-07 17:56:52 -06:00
5563117a1b add remove_extra_whitespace() to libpbd 2022-09-07 17:03:08 -06:00