Commit graph

19707 commits

Author SHA1 Message Date
Mads Kiilerich
06b3d5ba33
PulseAudio: spin waiting for enough capacity to write
pa_threaded_mainloop_wait might wake up for several reasons. And there
is no point (but possibly harm) in moving on before we have verified
that PA actually is ready to receive our write without overflow.
2022-11-02 02:24:34 +01:00
Mads Kiilerich
27a2bf1f59
PulseAudio: clean up freewheeling transitions
ae3c8b19c6 and 03a17df68c reworked the transitions to and from
freewheeling. Some of it seems to have been experiments that tried
several things out, and generally it seems to have worked. It left some
commented out code. Clean that up.
2022-11-02 02:24:34 +01:00
Mads Kiilerich
04c24be2db
PulseAudio: don't drain the stream right after initial uncorking
The draining was introduced in ae3c8b19c6, apparently as an experiment
doing several changes. But the drain is outside the loop where
freewheeling changes, so the fix must have worked for other reasons.

There doesn't seem to be any benefit from draining at that point. The
stream is already empty. If not, we could have flushed it.

Draining right after uncorking will conceptualy create an intentional
underflow, even though it isn't reported as such. PipeWire seems to
(something like 6-12 months ago) have regressed in handling of that grey
area, causing that *underflow* to cause a request for too much data, and
thus causing constant *overflows* and unusable playback.

This change makes PulseAudio playback work for me again.
2022-11-02 02:24:34 +01:00
Robin Gareus
c84073e5cf
Print reversible command debug output
Debug builds will assert, the PBD::warning will not
be readable anywhere after that, so long it to stderr.
2022-11-02 00:47:09 +01:00
Robin Gareus
292cff7cfc
Prevent undo transaction crashes in optimized builds
Worst case this will lead to undo operations not being
saved rather than segfault (debug builds will still assert).
2022-11-02 00:45:06 +01:00
Ben Loftis
c6dade9484 OSC: implement controls and feedback for a banked trigger grid controller
(first iteration ... API may change)
2022-11-01 13:52:54 -05:00
Ben Loftis
bdf9cedb0e triggers: implement grid banking in BasicUI so it can be shared (?) 2022-11-01 13:52:54 -05:00
Ben Loftis
0851d230cd basic_ui: add convenience functions to access an NxM bank of triggers 2022-11-01 13:52:54 -05:00
Ben Loftis
4f5106ae82 triggers: add convenience function to report # of trigger channels 2022-11-01 13:52:54 -05:00
Ben Loftis
756e0beb1b triggers: more session:: functions to access Triggers by index 2022-11-01 13:52:54 -05:00
Ben Loftis
c23210aae8 various fixes to prevent BasicUI diverging from GUI behaviors 2022-11-01 13:52:54 -05:00
Gon Solo
bb27b24596
Fix warning about integer division.
bugprone-integer-division: Result of integer division used in a floating
point context; possible loss of precision.
2022-11-01 15:56:55 +01:00
Robin Gareus
c9a9f40987
Add API for Lua DSP to directly set Biquad coefficients 2022-11-01 14:51:07 +01:00
Paul Davis
62540fb5af tempo map: grid generation, fix use of barmod to insert bar points into return 2022-10-31 17:05:55 -06:00
Paul Davis
0ef10e4f5f canvas: ruler never shows marks/text for points too close to display the label 2022-10-31 17:05:55 -06:00
Robin Gareus
5599e136c0
Implement "vicanek" matched biquad filters 2022-10-31 22:47:30 +01:00
Paul Davis
d93c8d64bc MIDI region combine: fix conceptual errors 2022-10-31 14:22:17 -06:00
Paul Davis
f4a57f83e6 evoral: Sequence::clear() needs to remove patch changes and sysexes too 2022-10-31 14:22:17 -06:00
Robin Gareus
fded5063d9
Yet another automation time-domain fix
This issue was fixed in 6a55146fd but resurfaced in 489c9ace9.
2022-10-31 16:23:20 +01:00
Paul Davis
9c2c08973d tempo map: fix incorrect computation of ::bbt_at() (#9049)
This caused problems with TempoMap::get_grid() ("gone backwards").
2022-10-30 19:35:58 -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
96bab3ce46
NO-OP: doxygenize timepos_t::distance 2022-10-31 00:22:21 +01:00
Paul Davis
1eaaf4303b jack backend: catch some possible errors in ::get_port_name() 2022-10-29 09:37:17 -06:00
Paul Davis
6449bf5464 source: provide a little syntactic sugar via ::time_since_capture_start() 2022-10-28 16:38:46 -06:00
Robin Gareus
1139b38db5
Update comment (amend bd339713) 2022-10-28 13:20:04 +02:00
Robin Gareus
0fe297374d
Remove superfluous call (amend bd339713)
Graph::prep is a private function called initially from the main
process-callback before doing any work, and later at the end of
each process cycle. This sets up the process graph-chain and
process trigger queue.

Tempo information is irrelevant here.
2022-10-28 13:14:13 +02:00
Paul Davis
efdc47bc74 fix MidiRegion::merge() to allow final events of a region to be part of the newly merged result 2022-10-27 17:35:56 -06:00
Paul Davis
bd33971346 triggers/graph: fix location of calls to TempoMap::fetch()
This ensures that RT graph threads have the correct tempo map,
and thus run triggers correctly when timestretch is required.
2022-10-27 16:33:46 -06:00
Paul Davis
b195a04281 fix loading 6.x sessions with initial meter not at sample zero 2022-10-27 15:02:12 -06:00
Paul Davis
33770d0777 remove stacktrace() from TempoMap::dump() 2022-10-27 11:58:39 -06:00
Robin Gareus
2cf59a988c Handle tempo-map changes in sync from the calling thread
This is required to collect relevent undo/redo information, notably
automation-data changes from Playlist::update_after_tempo_map_change and
DiskReader::playlist_ranges_moved.

The realtime thread should not move regions to begin with, and debug
builds woudl also assert since no undo operation was started.
2022-10-27 08:40:09 -06:00
Robin Gareus
fa858a0386
Fix pan automation
The time-domains need to match in order to use the
raw underlying .val() as double for interpolation.
2022-10-27 04:28:07 +02:00
Robin Gareus
489c9ace9f
Fix looping automation - see also 6a55146f 2022-10-26 21:03:08 +02:00
Paul Davis
0ff2c746f7 prevent crash if tempo or meter are dragged back to zero 2022-10-25 12:52:30 -06:00
Paul Davis
b0c162879d fix error with saving MIDI after forking MIDI region
when we save a MidiModel to a new MIDI source, that does not
change the edited status of the Model.
2022-10-25 12:51:08 -06:00
Paul Davis
3efb488629 when moving tempo markers, do nothing unless the marker is moved at least 1 beat
Since tempo markers are always on-beat, this enforces a minumum distance of 1 beat while remaining on-beat.
2022-10-25 11:10:36 -06:00
Robin Gareus
72846814ba
Inherit Region Properties when splitting MIDI regions
see also e40f58c106
2022-10-24 07:13:44 +02:00
Robin Gareus
b5d7754a26
Fix MIDI Clock generator
MIDI clock start at the next beat (round_up_to_beat), so
here we have to round the current tick, rather than fall
back to a tick that is not yet complete, as 14da117bc8 does.

Reproduced with the Session from #9027
Start loop at bar 40 with MClk generator enabled.

```
#3  in __GI___assert_fail (assertion=0x7fedd86c4fd5 "clk_pos >= pos", file=0x7fedd86c38b7 "../libs/temporal/tempo.cc", line=3336, function=0x7fedd86c4f60 "void Temporal::TempoMap::midi_clock_beat_at_or_after(Temporal::samplepos_t, Temporal::samplepos_t&, uint32_t&) const") at assert.c:101
#4  in Temporal::TempoMap::midi_clock_beat_at_or_after(long, long&, unsigned int&) const (this= 0x560187e92c00, pos=20691033, clk_pos=@0x7fedc02178b8: 20691032, clk_beat=@0x7fedc02178c4: 11472) at ../libs/temporal/tempo.cc:3336
#5  in ARDOUR::MidiClockTicker::tick(long, long, unsigned int, long) (this=0x56018eed6db0, start_sample=20691033, end_sample=20692057, n_samples=1024, pre_roll=0) at ../libs/ardour/ticker.cc:170
#6  in ARDOUR::Session::send_mclk_for_cycle(long, long, unsigned int, long) (this=0x56018a216340, start_sample=20691033, end_sample=20692057, n_samples=1024, pre_roll=0) at ../libs/ardour/session.cc:7495
#7  in ARDOUR::AudioEngine::process_callback(unsigned int) (this=0x5601881a4f20, nframes=1024) at ../libs/ardour/audioengine.cc:563
```
2022-10-24 06:18:30 +02:00
Mads Kiilerich
004b32b91e
Update tracker/reference URLs to prefer HTTPs 2022-10-24 04:59:20 +02:00
Mads Kiilerich
b3743227be
Change tools --help URLs to use https 2022-10-24 04:57:30 +02:00
+merlan #flirora
79f55742d6
JACKAudioBackend::join_process_threads: Don’t pass NULL for jack_client_stop_thread
This is needed for PipeWire’s JACK frontend, which implements this
function and expects the first argument to be non-null.
2022-10-24 04:45:08 +02:00
Robin Gareus
0504db2a67 Update region delta-time API
This is the first step to fix various MIDI edit issues for sessions with
tempo-changes.

The old code, using .earlier returned an absolute position when
calculating a relative distance. This is only valid if the session has a
fixed tempo, and the origin is irrelevant when converting the timepos.

This resulted in follow up issues since there is a difference when
summing two positions (each with an origin) vs adding an offset to a
position.

Note: this API changes breaks compilation until the GUI is updated.
2022-10-23 19:05:48 +02:00
Robin Gareus
33348f6332
Fix Windows builds 2022-10-23 06:17:29 +02:00
Robin Gareus
cc30495ba0
Properly convert v6 MusicTime locked MIDI regions 2022-10-22 05:36:23 +02:00
Robin Gareus
30ec62a953 This is clearly broken
Partially revert previous commit. Otherwise snap to bar/beat
clocks-displays display rounded down X|Y|1919 instead of X|Y+1|0
2022-10-22 03:09:32 +02:00
Robin Gareus
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
Robin Gareus
e9bafde628
Catch manual removal of subgroup bus (#9022) 2022-10-21 20:40:27 +02:00
Robin Gareus
2e860cd10d
Move SimpleExport to libardour, add Lua bindings
This allows to export a session from the commandline tool

```Lua
AudioEngine:set_backend("None (Dummy)", "", "")
s = load_session ("/path/to/session", "snapshot")
assert (s);
e = s:simple_export()
assert (e:check_outputs ())
e:run_export ()
e = nil
```
2022-10-21 19:50:26 +02:00
Robin Gareus
03642d3707
Mark window invisible after deleting it
This fixes an issue when destroying VST plugin UIs
rather than hiding them. Even though is hidden before destroying it,
the vistracker is also destroyed in the same function call, before
the event can be processed. The window state remains visible="1"
2022-10-21 18:11:19 +02:00
Paul Davis
d69a2c3c13 small change to Locations::clear_cue_markers() API to bring it into line with other clear_* methods 2022-10-21 07:51:53 -06:00