Commit graph

274 commits

Author SHA1 Message Date
Robin Gareus
74c4ca3e52
Reduce reliance on boost - the hard part
the rest from `tools/convert_boost.sh`.

* replace boost::function, boost::bind with std::function and std::bind.

This required some manual fixes, notably std::placeholders,
some static_casts<>, and boost::function::clear -> = {}.
2024-10-19 03:47:21 +02:00
Robin Gareus
30dc9ccc86
Replace boost::scoped_array<T> 2024-10-19 01:04:02 +02:00
Robin Gareus
2d7cce44f1
Replace PBD::Signals (1/2) 2024-10-18 20:41:08 +02:00
Robin Gareus
11f71a3297
Fix playback of sessions with low sample-rate
previously, _chunksize =
```
  minimum_disk_read_bytes / sizeof (Sample)
```

can become larger then actual allocated ringbuffer:

```
  audio_playback_buffer_seconds * sample-rate
```

In which case the buffer was never filled.
The disk writer has similar issues
2024-09-29 18:25:33 +02:00
Robin Gareus
e1f465a952
NO-OP: improve butler and disk-i/o debug messages 2024-09-26 03:25:07 +02:00
Robin Gareus
75e6a77c3e
Fix another debug message 2024-09-26 02:26:30 +02:00
Robin Gareus
18e0cba1cb
Fix underruns when looping/locating and changing region content
Previously loop-wrap around asked the butler to perform
a unnecessary seek operation next time it is summoned.

If the butler is then summoned for a PostTransportOverWrite
event, the seek causes a DR::Underrun.
2024-09-25 20:06:08 +02:00
Robin Gareus
5af023c70b
Fix some debug messages 2024-09-25 20:06:08 +02:00
Robin Gareus
8fd081679d
Add a debug option to investigate RegionFX related underruns 2024-08-27 17:50:24 +02:00
Robin Gareus
84506a041c
Move Mute automation with region(s) #9762
Mute and Panner are the only automatable Route owned controls
(that are not managed by a processor). So they need special
casing to be moved when moving a region.
2024-08-09 16:03:39 +02:00
Robin Gareus
88df55f86d
Remove debug messages, cleanup output (2/2) 2024-05-08 00:56:57 +02:00
Robin Gareus
5b9e4fff63
Parallelize Disk I/O and RegionFx processing 2024-04-30 03:46:39 +02:00
Robin Gareus
457238ec2e
Per [Audio] Region Fx
* apply effects during region-read in non-rt context
* Add multi-channel audioregion read cache
  to process stereo effects
2024-04-23 21:56:15 +02:00
Robin Gareus
922ad14217
Gap-less overwrite_existing_audio
AudioPlaylist::read first clears the buffer passed to it, in
order to sum all layered regions into the buffer.

This cleared data in the ringbuffer that is concurrently being
used for playback.
2024-03-06 02:33:39 +01:00
Paul Davis
cb91334cc6 basic work to permit "MIDI catchup" for MIDI state at any point on the timeline
This currently does nothing and cannot be enabled
2023-11-20 21:32:49 -07:00
Robin Gareus
fd3f475b3f
Fix mono audio after pending overwrite (#9483)
This bug was introduced in 295dbd8e1e when replacing

```diff
-for (ChannelList::iterator chan = c->begin (); chan != c->end (); ++chan, ++n) {
+for (auto const& chan : *c) {
```

see also https://discourse.ardour.org/t/first-10-seconds-of-modified-stereo-region-goes-mono-output/109322
2023-10-15 16:33:13 +02:00
Paul Davis
3b565693c8 objects don't have a time domain, they have a time domain provider (libs) 2023-08-02 15:22:52 -06:00
Robin Gareus
d85277f532
NO-OP: clang-format, whitespace 2023-05-22 21:07:36 +02:00
Robin Gareus
295dbd8e1e
Make RCU reader return a const pointer (omnibus commit) 2023-04-08 00:15:37 +02:00
Paul Davis
70df054d68 try to patch over some type confusion 2023-03-24 17:27:49 -06:00
Paul Davis
a486fba3e9 std::atomic - 2nd batch of changes to convert from glib to std::atomic 2023-03-24 14:19:15 -06:00
Paul Davis
4ba4cd69ff switch from glib atomic to std::atomic (libs edition) 2023-03-24 14:19:15 -06:00
Paul Davis
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
David Robillard
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
Robin Gareus
9327027d98
Revert "Ensure disk buffer refills happen in the right thread"
This reverts commit 96ebac646d.

There are some valid cases where refill is called from the GUI
thread. e.g adding tracks, or adding channels to an existing track.
2022-08-11 22:45:13 +02:00
Robin Gareus
96ebac646d
Ensure disk buffer refills happen in the right thread 2022-08-11 19:14:51 +02:00
Robin Gareus
63c068227f
Improve DR refill error messages to aid debugging 2022-08-11 19:14:51 +02:00
Robin Gareus
2de84c97d0
Fix Temporal::Range::squish reduced to samples
Loop Location start="a1665678660" end="b145920"
Loop-end (at 122BPM) is a2109859636
at 48kHz this is sample 1794098.32

Now play the loop and play sample 1794098 = a2109859248
Range::squish start: a1665678660 end: a2109859636 squish: a2109859248

squish() does nothing, since there are still 388 superclock-ticks
until the end of the loop.

However, DiskReader::get_midi_playback convertes the value back
to samples(), this leads to effective_start == loop_end;
resulting in an endless loop.

Thanks to MikeLupe to provide a session to reproduce this issue.
2022-07-15 19:54:21 +02:00
Paul Davis
873f78de78 NOOP: rearrange code DiskReader::get_midi_playback() to follow the "early exit for conditional" style guide 2022-06-25 13:36:55 -06:00
Paul Davis
0d9656ef82 use new macros to cleanup #ifndef NDEBUG as much as possible (libs edition) 2022-06-22 13:31:08 -06:00
Paul Davis
1e09e0f6fa fix may-be-used-unset warnin 2022-06-22 13:31:07 -06:00
Paul Davis
ed645761d0 fix optimized unused variable warning 2022-06-22 13:31:07 -06:00
Robin Gareus
9c9a7bbf97
Remove debug message 2022-05-13 21:02:37 +02:00
luz paz
1e640563d6
Fix source comment typos in libs/ardour
Found via `codespell`
2022-05-11 00:14:28 +02:00
Robin Gareus
834ca29cde
Silence DR after freewheel export 2022-05-10 16:01:39 +02:00
Paul Davis
7bf89ce109 Constification: make Stateful::get_state() const, with all other required const-ness added (libs) 2022-04-06 21:56:59 -06:00
Robin Gareus
e603b2e12d
Remove debug messages (1/2) 2022-03-16 17:08:14 +01:00
Paul Davis
83c7ac4f38 libardour: use Processor::check_active() in all Processors instead of per-processor code
There are a few exceptions where the semantics make this too complex to be worth forcing check_active()
2021-11-29 21:50:29 -07:00
Paul Davis
7c10cf1d54 Automatable now requires (and owns) a time domain to be used by automation data 2021-08-13 12:51:32 -06:00
Paul Davis
fbdf06a794 cleanup after timecnt_t API changed (libs edition) 2021-08-13 12:51:31 -06:00
Paul Davis
eae9d276fe libardour: conversion to use timeline types (mega-commit) 2021-08-13 12:51:29 -06:00
Paul Davis
0cec44ca4b diskreader: avoid double conditional, use else{} instead 2021-04-21 22:51:06 -06:00
Paul Davis
5ebe78ad2d diskreader: fix decrement of start before zero (#8647) 2021-04-21 22:50:26 -06:00
Robin Gareus
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
Robin Gareus
8089998eaa
Consistent DiskIO Processor naming
Use a name-prefix when creating the processor just like later
DiskReader::set_name() DiskWriter::set_name() do.
2021-02-19 14:03:32 +01:00
Robin Gareus
acae86781b
Fix race condition when deleting tracks
In rare cases it can happen that the GUI thread results in
a call to DropReferences(), while the backend (RCU) still has a
reference to the track and processes the track.

However the call to DropReferences, DiskIO processor will
have cleared the pointer to _track, leading to segfaults when
the processor runs.

Since the DIO processor is owned by the track, one cannot directly
pass a shared_ptr<Track>. That would keep the Track around forever.

However the DIO processor cannot exist without a track passing
a reference is acceptable.
2021-02-14 21:43:36 +01:00
Robin Gareus
751db481a6
Use linear fades for loop-range cross-fades
The cross-over point of an exponential fade occurs further towards
start of the fade. This increases consistency of cross-fades moving
the cross-over point to the center of the fade.

Also looped material is likely correlated in which a linear fade
is more appropriate.
2020-09-25 17:09:25 +02:00
Robin Gareus
c08298e6d8
Fix loop cross-fade glitch #8420
This fixes an off-by one when assigning `fade_length` and
also solves an edge-case with different fade length for
fade-in/fade-out.
2020-09-25 17:09:25 +02:00
Robin Gareus
ecf4a62082
Fix off-by-one in declick fade allocation #8418
This case is only relevant for large sample-rates for
the fade-in curve. see also 6f755c3c02
2020-09-22 16:44:50 +02:00
Robin Gareus
7a9d4b1f64
Tweak default declick fade length #8341 2020-09-04 01:50:58 +02:00