Commit Graph

300 Commits

Author SHA1 Message Date
Tim Mayberry
3eb4b43fa6 Initialize AudioEngine::last_backend_error() to the default error string
Currently the last backend error string is only set when calling
AudioBackend::start. Errors that occur when calling other AudioBackend methods
like AudioBackend::set_buffer_size do not set the last backend error string.
So until all the required AudioBackend methods return an ErrorCode and
last_backend_error() can be removed just set it to a default string.

Until all errors that occur are correctly indicated by returning an error code
there will still be situations where last_backend_error() is not indicative of
the true error. For instance AudioEngine::start is called and it fails but
returns a valid error code so last_backend_error() is set, then some other
engine/backend method is called that fails and as last_backend_error is not
set the GUI will display the incorrect error message.
2015-10-06 13:29:57 +10:00
Tim Mayberry
da46df6225 Show DSP/CPU load of 0.0% when AudioEngine isn't running 2015-10-06 13:29:57 +10: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
Paul Davis
136b659f1c remove debug output 2015-10-02 22:08:14 -04:00
Paul Davis
64b4877ef6 the return of the 1 second fade out at session close 2015-10-02 22:08:14 -04:00
Tim Mayberry
d85ab8af89 Reinterpret the return value of AudioBackend::start as AudioBackend::ErrorCode
This will allow backends to return a more meaningful error message. Eventually
an error code could be returned by AudioEngine::start and the GUI can then use
AudioBackend::get_error_string to convert the error into a translated error
message directly, or it may be desirable to define its own error messages.

The reasons for not doing that right now is that this is a workable solution
with the least change required.
2015-10-01 09:10:19 +10:00
Robin Gareus
3a3d5c41be synchronous shutdown of process graph. 2015-08-28 15:39:06 +02:00
Robin Gareus
2e38cb81fe fix deadlock at exit on SMP systems
graph process-threads won't terminate properly while active.
2015-08-11 20:22:20 +02:00
GZharun
6584a89c4e Fixed incomplete merge for audioengine.cc
[To be reviewed by] Paul Davis
2015-06-29 14:18:15 -04:00
Paul Davis
f34d870a2c increase event pool for backend reset thread (somewhat unnecessarily, but lets keep Kyiv happy) 2015-06-29 14:18:14 -04:00
Paul Davis
2911bb9fb8 AudioEngine tweaks from Tracks, related to stopping audioengine and halting 2015-06-29 14:18:14 -04:00
Paul Davis
c46ec135e5 initial incorporation of Tracks' automatic reconnect features, based on current Tracks code 2015-06-29 14:18:11 -04:00
GZharun
ef59fbffa1 [Summary] Added possibility to identify IO thread which does not have required resources initialized during process callback handling
Conflicts:
	libs/ardour/ardour/audioengine.h
	libs/backends/wavesaudio/waves_audiobackend.cc
	libs/pbd/pbd/pool.h
2015-06-29 14:16:42 -04:00
Robin Gareus
9ec3085d71 fix thinko in 2e4428b
perspective of Ardour: signal sinks are outputs
2015-05-04 00:29:15 +02:00
Robin Gareus
aee658ef96 no more noise during startup. 2015-05-03 23:17:15 +02:00
Robin Gareus
ce259edbcd professionalize peak-meters
The peak meter needs to withstand various test-signals
without visual jitter (in particular 1kHz sine) regardless
of settings (period-size, sample-rate, custom fall-off).

This needs to be done in sync (and not by a random non-rt
‘smoothing’ thread).

On the downside this voids the ‘visual smoothing’ particularly 
with large buffersizes - but then again exactly this “always 
fall-off no matter what [the next real data will be]” is the
problem.

One the upside, there’s one less high-frequency (100Hz) thread
(Yay!) PS. it probably never worked on windows, anyway.

Only peak-meters are affected by his change.
K-meters, IEC I/II and VU were never visually smoothed.
2015-05-02 03:46:49 +02:00
Robin Gareus
840b871245 don’t count silent [x]runs if there’s no session. 2015-04-30 22:55:42 +02:00
Robin Gareus
c4696fe2d5 emit an xrun if the process_lock is taken 2015-04-29 01:33:23 +02:00
Robin Gareus
a43901ead9 Fix crash when switching backends.
cycle_end() can write to invalid buffers.
2015-04-26 01:36:09 +02:00
Ben Loftis
46f97e8d92 Initial Gain Coefficient tweaks
1)  Disambiguate 1.0 to GAIN_COEFF_UNITY, and 0.0 to GAIN_COEFF_ZERO
2)  Add GAIN_COEFF_SMALL which replaces SMALL_SIGNAL (-140dB)
3)  GAIN_COEFF_SMALL can used to avoid interpolating towards -inf on a db scale
4)  GAIN_COEFF_SMALL is used to detect very small (denormal?) gains and memset to zero
2015-04-22 00:22:43 +02:00
Paul Davis
a83305169a fix ambiguous use of pow() 2015-04-05 15:13:59 -04:00
Paul Davis
2f02b921f1 bump default silent-after-seconds duration to 10 minutes 2015-04-05 14:04:28 -04:00
Paul Davis
8a5b5145cc add libardour code for going completely silent after a compile-time defined number of seconds 2015-04-05 14:02:30 -04:00
Greg Zharun
23214f6e61 [Summary] Fixed several backend issues: made reset counter check atomic, removed copy/paste mistakes
Conflicts:
	libs/ardour/audioengine.cc
	libs/ardour/engine_state_controller.cc
	libs/backends/wavesaudio/waves_audiobackend.cc
2015-03-31 17:29:41 -04:00
Greg Zharun
a2f82f8c5d [Summary] Added actions to handle abnormal behavior during stream stop for MIDI and Audio devices.
Made correct error handling for cases we didn't see before.
Removed redundant and experimental code I forgot to remove months ago.
Added debug output which will help in future testing

Conflicts:
	libs/ardour/ardour/audioengine.h
	libs/ardour/engine_state_controller.cc
	libs/backends/wavesaudio/waves_midi_device.cc
2015-03-31 17:29:41 -04:00
Greg Zharun
ce069da682 [Summary] Made device control panel open request synchronized with other critical device operations. Made device reset correctly when control panel is closed.
Conflicts:
	gtk2_ardour/tracks_control_panel.logic.cc
	libs/ardour/ardour/audioengine.h
	libs/backends/wavesaudio/wavesapi/devicemanager/WCMRPortAudioDeviceManager.cpp
2015-03-31 17:29:41 -04:00
Robin Gareus
1089f19a4c create engine thread before sending notifications.
Fixes missing thread in Pool in session_process,
when switching backend threads (CoreAudio, Waves)
2015-03-05 16:46:20 +01:00
Robin Gareus
105ecfa464 fix routing midi data on export:
MidiPort::cycle_end() was never called, hence after the 
first cycle all midi buffers were assumed to be 
“mixed down” already.

this fixes 
Midi-track 1 -[midi]-> Midi-track2 synth -[audio]-> out
on export.
2015-02-28 05:49:16 +01:00
Paul Davis
582138f280 change Audio backend sample time methods to use a 64 bit timeline 2015-02-19 17:44:01 -05:00
Robin Gareus
e6bb75cf01 audio-engine use internal API to stop
emit signal(s) when engine is stopped due to backend
change.
2015-01-25 10:19:06 +01:00
Robin Gareus
32269f0c5a fix audio-engine dtor.
backends - once instantiated - keep a reference to the engine.
when audioengine is destroyed, the backends must be deinstantiated.
This fixes various unit-test cases.
2014-12-03 20:44:47 +01:00
Robin Gareus
c194e4df18 remove superfluous if-branch (_session is checked a few lines above) 2014-11-18 02:15:06 +01:00
Robin Gareus
9a60bb58b2 skip unavailable backends early on. 2014-10-23 16:53:14 +02:00
Paul Davis
aafd1d77e9 remove unused code 2014-10-22 17:07:11 -04:00
Robin Gareus
ab445a0e28 windows: don’t popup message box when libjack is not found 2014-10-17 10:58:49 +02:00
Robin Gareus
aac3ca5521 initialize some uninitialized vars - closes #5974 2014-10-08 19:16:21 +02:00
Paul Davis
8d59afb048 copy over current Waves version of their backend, along with minor changes in libs/ardour and libs/backend/jack to fit with API changes 2014-09-30 21:00:34 -04:00
Robin Gareus
7d3f0bfd75 prepare for clang static analysis of RT-functions:
see: https://github.com/fundamental/stoat
eventually more functions should be annotated, and
a common header file should be used to
  #define REALTIME __attribute__((annotate("realtime")))
2014-08-31 07:50:17 +02:00
Tim Mayberry
8d0cba3384 Use PBD::find_files_matching_pattern instead of other variations 2014-06-25 12:40:10 -04:00
Robin Gareus
157161e482 fix port-unregister (on failed latency measurement) 2014-06-19 19:44:14 +02:00
Robin Gareus
81182b5bf6 prepare MIDI latency measurement (backend) 2014-06-08 11:18:18 +02:00
Tim Mayberry
5086cc3f49 Revert windows backend search expression to "*backend.dll" 2014-06-07 14:31:32 +10:00
Robin Gareus
ec49e351c3 fixes to change engines while Ardour is running.
When a new backend is selected, it is loaded to query
available devices etc. This effectively drops the current backend.
2014-06-04 17:17:14 +02:00
Tim Mayberry
9cde7b6051 Fix pattern to match possible audio backends on windows 2014-05-14 09:47:40 +10:00
Paul Davis
392c3a6bef use AudioBackendInfo::already_configured() to correctly determine if backend requires setup
Fixes issues when using JACK backend in combination with others, that prevented connecting to an existing JACK server.
2014-05-01 09:15:26 -04:00
Paul Davis
55ce05c486 call AudioBackend::drop_device() when dropping a backend.
It is not clear that ::drop_device() is part of the same semantic operation as ::stop(), so
we call them separatey
2014-03-24 13:42:11 -04:00
John Emmas
06fe0a5172 Create 'libs/ardour/search_paths.cc/.h' and transfer backend_search_path() to it 2014-03-10 16:24:05 +00:00
Paul Davis
55f6c5ab76 remove unused and unimplementable audio engine sample format code 2014-02-24 14:46:08 -05:00
Paul Davis
e58b337c84 add (finally) DEBUG::AudioEngine bit and convert existing debug trace messages to use it 2014-02-24 13:51:31 -05:00