This fixes a bug introduced in d06a0d9c9d. The MIDI data
has to be written first, otherwise the CC-event do not exit
and MidiModel::source_interpolation_changed() crashes.
There were many logical errors in the previous implementation. This one is
simpler to read, and appears to work much better.
It also allows the caller to specify the quarter-note subdivision to use when
generating the grid, rather than choosing only between some bar modulo or
quarter notes.
It can happen that the main AlsaAudioBackend::_device_reservation
is still busy while I/O devices are set. In this case a
dedicated AlsaDeviceReservation needs to be used which can fail
silently.
A common example is disconnecting a USB device while it is in
use. The Halted signal can show the session dialog, which calls
set_input_device_name before the device reservation of the
unplugged device terminated.
ALSA backend modified the internal state when different devices
were used, re-assigning one (usually input-device) to "None"
when it's resampled. This lead to EngineHints not matching the
EngineState, and autostart was disabled, and a dialog
"Engine I/O device has changed since you last opened this session."
Archiving creates a dedicated mono file for each Source.
When the original session has (embedded) stereo files, the
channel needs to be temporarily set to 0.
introducing a new time signature that uses non-quarter notes as the denominator
will move the beat position a given BBT time (since the middle "B" of BBT
refers to "beats" given by the denominator, not quarters).
This issue was introduced in f3423b8a77, which assumed that
number of input channels matches the number of outputs.
With flexible I/O this is not necessarily the case.
This fixes#9106, along with the previous commit.
If Route::configure_processors fails at session start,
meters are not configured (#9106), leading to a crash when
::run() is called (insufficient peak/max/midi buffers).
Previously the flag was not honored. AudioSource::write() calls
-> SndFileSource::write_unlocked()
-> SndFileSource::nondestructive_write_unlocked() which calls
-> AudioSource::compute_and_write_peaks
This produced "cannot open _peakpath" messages during
session-archive FLAC encoding. Likewise closing an audio file
calls touch_peakfile(). Although this simply failed silently.
Keep file-system paths and PBD::Searchpath mostly separate.
This amends 58c2b0a848 libs/fst directly includes relevant
ardour C++ code, so lib/fst must not link against libardour.
The problem was that 58c2b0a848 introduced additional
dependencies on other libardour functions.
libardourcp and now libardour_midisurface are not control
surfaces, but helper libraries for those.
They need to be deployed to the library folder (shared between
ctrl surfaces) and not scanned as ctrl surfaces at runtime.
Writing partial messages will lead to undefined behavior.
This does not generally happen (LV2 forge prevents overflow
of the Atom buffer itself), however if the GUI is frozen messages
may accumulate in Ardour's Ringbuffer.
Processor::deactivate must not be called concurrently with
processing. e.g. Threading rules https://lv2plug.in/ns/lv2core
This fixes a potential crash when freezing tracks
* in the past, the default behavior was: hiding a group would disable it,
and then showing the group would re-enable it
* problem occurs when user has disabled a group; hiding and showing it
unexpectedly re-enable the group
* there was a config variable to disable this behavior, but it was never
shown on the GUI and therefore not discoverable
Despite the longstanding policy, there's really no reason for
group visibility and enablement to be intertwined.
If this chnage causes a big problem for someone, they can revert to
the prior behavior by setting the new config variable in the text file
MP3 support was introduced in libsndfile 1.1.0 . It will be a simple
alternative to using external ffmpeg.
To avoid dependency on the new libsndfile or config-time checking,
hardcode the constants from sndfile.h . The actual availability will
have to be checked at runtime.
In some cases copying an instance requires an explicit
set_state() call (e.g. copy internal plugin state). This is
done by calling `set_state(other->get_state())`.
::get_state() produces XML as matching current_state_version.
(not loading_state_version).
These might be the values that PA would have chosen anyway, but make it
clear that Ardour is in control ... and will let the user control
"everything" with the buffer size.
This will also change the internal backend name, so it will miss the
previous 'config' setting '<State backend="Pulseaudio" ...'` and the
session file's '<EngineHints backend="Pulseaudio" ...'. But that is no
big deal after upgrading. Especially after the backend has been broken
for some users for a while.
In the log output, the error would look like:
[ERROR]: Export initialization failed: Exception thrown by AudioGrapher::SndfileWriter<short>: Could create output file (.../export/something.wav)
Add the missing negation.
But it would perhaps be better phrase the message differently so it not
just hints so strongly towards a file system error preventing file
creation.
Perhaps something like "Failed to initialize sound export to %s"?
Many formats use ExportFormatBase::SF_Double which incorrectly would end
up in the default "we don't handle anything else within ardour" branch.
(It happened to work correctly anyway, since ExportGraphBuilder::SFC
handled the "magic" value 1 the same was as the "error" value 0.)
For correctness, use the "magic" value 1 for double.
The libsndfile format was masked with 0xf instead of the usual
SF_FORMAT_SUBMASK. It seems like the end result generally was correct
anyway, since no supported format used subtypes that used the low bits
for anything else. Most formats use SF_FORMAT_PCM subtypes. (Only Ogg
Vorbis uses a subtype, but that happens to have 0 in the low bits and
ended up in the "this will never happen branch" ... which happened to
work too.)
This could however be a real problem when SF_FORMAT_MPEG_LAYER_III with
value 0x82 is supported ... unless worked around in some way.
I don't see anything anywhere that could stuff anything in the high bits
of the subtype, so this trivially fixed by using SF_FORMAT_SUBMASK
correctly.
Apply SF_FORMAT_SUBMASK before comparing with the expected value.
It seems like it accidentally used to work correctly for all supported
libsndfile formats anyway.
But: It seems unfortunate to hardcode Vorbis in this place. Other
formats with quality control would have to be added to the list too. It
would be nice to do use something like has_codec_quality ...
Before, an export format with an invalid enum value (for example in the
Encoding id) would crash Ardour with:
unhandled exception (type std::exception) in signal handler:
what: unknown enumerator FOO in PBD::EnumWriter
That kind of error can happen if a new type is introduced and users
switch back to versions without it.
Instead, catch such exceptions while loading a format, log an error, and
skip the format - similar to how other format loading errors are
handled.
DeviceInfo (bindings file) can include explicit motorized
and threshold settings. These values, when specified, are
used during load_bindings() during set_state and overwrote
any user customization.
Furthermore showing the GUI invalidated any prior setting
by explicitly calling binding_changed, which re-applies.
It adds some new strings to translate. These strings might be so rare
and technical that it is a bit pointless to translate them. But let's
stay consistent...
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.
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.
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.
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.