Commit Graph

90 Commits

Author SHA1 Message Date
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
Paul Davis 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
John Emmas f8557cc00f Export AudioGraphper::Source and AudioGrapher::ListedSource
after an MSVC update this morning, these classes need to be exportable now - I'm not quite sure why :-(
2023-03-15 13:39:56 +00:00
Robin Gareus b8d07b8be2
Export CmdPipeWriter: add option to use tmpfile
Investigate issues with mp3 export (#9193)
2023-01-16 05:10:32 +01:00
Robin Gareus 27e136dcfc
Cont'd tweaks of ffmpeg export pipe 2023-01-05 03:32:40 +01:00
Robin Gareus bb4394b8a5
Use pipe through ffmpeg, use glib to write output
This is intended to fix an issue with odd filenames on Windows,
particularly forward and backwards single quotes as part of a filename.

Previously the filename was passed as parameter to ffmpeg as
UTF-8 string to SystemExec::make_wargs, which is fragile on Windows
in absence of a execve() call.
2023-01-04 17:26:43 +01:00
Gon Solo 1cf6886775
std::iterator is deprecated in C++17, use bidirectional_iterator_tag 2022-11-22 19:49:41 +01:00
Mads Kiilerich d2fa78ba95 Fix "Could create output file" error message
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"?
2022-11-04 03:52:45 +01:00
Robin Gareus 7f3681c7ac
Scale export-analysis dataset 2021-12-24 21:59:03 +01:00
Robin Gareus 6da997ef30
Revert "use -90dB as default threshold for silence trim during export, rather than -inf dB"
This reverts commit fe8418ffea,
which had no effect, since the default c'tor argument is not used.
2021-04-24 16:42:17 +02:00
Paul Davis fe8418ffea use -90dB as default threshold for silence trim during export, rather than -inf dB 2021-04-23 11:03:17 -06:00
Robin Gareus c4f0393cf9
Keep track of export-limiter redux 2021-04-12 23:15:30 +02:00
Robin Gareus 89a65f76b0
Update analysis duration when post-processing
This prevents the need to re-bin data in case silence is
trimmed at start or end of the export.
2021-04-12 23:15:30 +02:00
Robin Gareus 75829d20f2
Overhaul export loudness normalization
* Fix exporting multiple formats with different
  normalization settings or demo-noise settings
* Add true-peak limiter (based on x42-limiter dpl.lv2)
* Optionally use a limiter for loudness normalization
* Fall back to short-term loudness when normalizing
  material too short for integrating loudness.
2021-04-12 23:15:30 +02: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 820165d238
Add export demo noise watermarking 2020-06-04 21:20:32 +02:00
Robin Gareus c365c6cdb2
Set thread-names (libs) 2020-03-29 14:56:22 +02:00
Robin Gareus 7c6eadd84a
Fix some doxygen warnings 2020-03-02 17:58:03 +01:00
Robin Gareus 98c65406e3
Prefer std::vector<> over C-style malloc/free**
This fixes a potential out of bounds read `if (_dbtp_plugin[c])`
if c is larger than the allocated channel count.
2019-08-12 15:02:24 +02:00
Robin Gareus c1bd70d8b0
Update audiographer GPL boilerplate and (C) from git log 2019-08-03 15:53:16 +02:00
Robin Gareus e4cbd5115e Add Pipe-to-command export backend
A first step towards allowing external encoders without intermediate
temporary file.
2018-11-19 03:30:40 +01:00
Robin Gareus 16ef78ade0 Clarify error message when file cannot be created,
The default error is "Not a valid SNDFILE* pointer." which is rather
obscure to end-users.
2018-07-25 17:46:15 +02:00
Paul Davis 30b087ab3d globally change all use of "frame" to refer to audio into "sample".
Generated by tools/f2s. Some hand-editing will be required in a few places to fix up comments related to timecode
and video in order to keep the legible
2017-09-18 12:39:17 -04:00
Robin Gareus 7258c6334d Namespace PBD::RingBuffer
class RingBuffer<> is a very generic name and should not pollute the
global namespace.
2017-09-16 16:37:29 +02:00
Tim Mayberry 4985f0d7ae Include last sample in reverse test for nonsilence in end trim during export 2016-12-06 20:55:17 +10:00
Tim Mayberry bd52d4e328 Fix issues in export with trim enabled
A complete reimplementation of AudioGrapher::SilentTrimmer::process to support
trimming the beginning and end in the same processing block

Fix export with trim end enabled to actually trim silent frames

Only add silence to beginning or end of export data if data was written

Should resolve: #6412
2016-12-06 13:44:19 +10:00
Tim Mayberry 568cf861f9 Rename AudioGrapher::SilentTrimmer method to reflect behaviour
Unlike many of the other uses of the term "frame" this is actually returning
the index to the first sample in the interleaved frame that contains
non-silence.
2016-12-06 13:43:10 +10:00
Tim Mayberry 2c67e71e98 Always signal writing to file is complete at end of the export process
With end trim enabled, the only case that would successfully export was if
there was at least some samples above the silence threshold in the last export
processing block.

The issue was that the EndOfInput flag was not being passed to
AudioGrapher::SndFileWriter::process which would then call sf_write_sync and
emit the FileWritten signal to start post processing. Fix that by always
passing the EndOfInput flag in the last export process cycle.

Related: #6412
2016-12-06 13:43:09 +10:00
Robin Gareus b55975a861 consistent VAMP includes
This resolves an ambiguity VampHost::Vamp::Plugin and Vamp::Plugin
2016-10-03 05:13:12 +02:00
Robin Gareus 77687519b6 Refactor TmpFile into an abstract base class
This allows a TmpFile pointer to be either a Sync or Async (Threaded)
writer. As result we must be able to handle both RT and non RT processing.

Still, post-processing (normalization and encoding) should always
happen faster than realtime (freewheeling).

Since jack does not allow a client to change to freewheeling from within
the process-callback, the async-writer disk-thread FileFlushed is used
to initiate post-processing.
2016-07-16 02:14:13 +02:00
Robin Gareus e55ef88ee9 refactoring to prepare for real-time export
* add a threaded TmpFile Writer
* update API calls to that process_export_fw() can be used as
  process_function

The idea is to re-use export infrastructure from normalization:
export to a tmp-file and then encode target formats after that.
2016-07-14 04:35:48 +02:00
Robin Gareus 7547f02c07 prepare loudness normalization 2016-05-02 15:44:13 +02:00
John Emmas f00342b2d8 Some AudioGrapher classes need to be exportable now, to support newly introduced 'AnalysisGraph' class
(not entirely sure why - but it might be because 'ProcessContext<Sample>' is now used in multiple sources within libardour).
2016-03-12 13:59:44 +00:00
Robin Gareus f30d1d6073 fix normalize + trim silence at end. 2016-02-16 22:24:01 +01:00
Robin Gareus 0ce4113dbb prepare threshold for silence trim 2016-02-16 21:25:54 +01:00
Robin Gareus e6ea35c3de Add normalization gain factor to Export Analysis 2016-02-15 15:46:49 +01:00
John Emmas 52ebf94c1e Class 'AudioGrapher::Analyser' needs to be exportable for building with MSVC 2016-02-12 12:31:24 +00:00
Robin Gareus 4b17bcb8b8 update export analyser for dBTP 2016-02-11 14:14:01 +01:00
Robin Gareus d8b04d3124 cleanup: unhardcode spectrum size, logscale, whitespace fixes 2016-02-10 19:28:21 +01:00
Robin Gareus 6c8a062be9 move export-analysis implementation into cc-file.
lib/libfftw3f.a(apiplan.o):apiplan.c:(.text+0x430): multiple definition of `fftwf_destroy_plan'

This is because static symbols in a .dll have no fixed address and
are mapped when loading the dll. Static functions in .exe do have a fixed
address.
With a header-only implementation the functions are provided
libardour.dll and ardour.exe
2016-02-10 15:11:45 +01:00
Robin Gareus c1642fead8 Post-export Analysis 2016-02-10 03:01:05 +01:00
Robin Gareus 2397429e99 use quotes for in-tree pbd/glib wrapper include 2015-10-05 22:15:18 +02:00
Robin Gareus 22b07e0233 NOOP, remove trailing tabs/whitespace. 2015-10-05 16:17:49 +02:00
Paul Davis 4dc63966f0 globally remove all trailing whitespace from ardour code base.
Paul Davis was responsible for introducing almost all of this.
2015-10-04 14:51:05 -04:00
Robin Gareus 7ac691ec82 use pbd's gstdio compatibility wrapper 2015-09-17 14:37:57 +02:00
Paul Davis ec06f2c49f spelling error fixes (notably "overriden" => "overidden") from IOhannes m zmölnig 2015-09-11 09:23:43 -04:00
Paul Davis 729bc00f13 no need to close a file that will not be removed (and has no name) 2015-04-29 15:01:33 -04:00
Robin Gareus 5cfa389978 explicitly close tmpfiles before unlink.
fixes issue on export tmpfiles remaining on windows
2015-03-02 23:12:06 +01:00
Robin Gareus 36bbd14113 towards fixing #5711
Don’t call ::output() [here: SilenceTrimmer::process()] 
with no data to process. 

If (position + N * period-size) % chunksize == 0;
frames_left == 0 before the last call to ::output().
chunker.h:60 keeps the ProcessContext<T>::EndOfInput
flag and the SilenceTrimmer will already have done ‘in_end’ processing.
2015-01-27 23:13:55 +01:00