13
0

adding DSP stats to coreaudio backend (uncompiled)

This commit is contained in:
Paul Davis 2021-06-26 11:04:03 -06:00
parent 995137aeb3
commit c7bed1320e
3 changed files with 16 additions and 5 deletions

View File

@ -548,7 +548,7 @@ CoreAudioBackend::_start (bool for_latency_measurement)
_pcmio->set_buffer_size_callback (buffer_size_callback_ptr, this);
_pcmio->set_sample_rate_callback (sample_rate_callback_ptr, this);
_pcmio->pcm_start (device1, device2, _samplerate, _samples_per_period, process_callback_ptr, this);
_pcmio->pcm_start (device1, device2, _samplerate, _samples_per_period, process_callback_ptr, this, dsp_stats[AudioBackend::DeviceWait]);
#ifndef NDEBUG
printf("STATE: %d\n", _pcmio->state ());
#endif
@ -1366,6 +1366,7 @@ CoreAudioBackend::process_callback (const uint32_t n_samples, const uint64_t hos
{
uint32_t i = 0;
uint64_t clock1;
PBD::TimerRAII tr (dsp_stats[RunLoop]);
_active_ca = true;

View File

@ -794,7 +794,8 @@ int
CoreAudioPCM::pcm_start (
uint32_t device_id_in, uint32_t device_id_out,
uint32_t sample_rate, uint32_t samples_per_period,
int (process_callback (void*, const uint32_t, const uint64_t)), void *process_arg)
int (process_callback (void*, const uint32_t, const uint64_t)), void *process_arg,
PBD::Timing& dsp_timer)
{
assert(_device_ids);
@ -812,6 +813,7 @@ CoreAudioPCM::pcm_start (
_process_arg = process_arg;
_samples_per_period = samples_per_period;
_cur_samples_per_period = 0;
_dsp_timer = &dsp_timer;
_active_device_id = 0;
_capture_channels = 0;
_playback_channels = 0;
@ -1119,6 +1121,7 @@ CoreAudioPCM::render_callback (
UInt32 inNumberSamples,
AudioBufferList* ioData)
{
PBD::WaitTimerRAII tr (*_dsp_timer);
OSStatus retVal = kAudioHardwareNoError;
if (_samples_per_period < inNumberSamples) {

View File

@ -36,6 +36,10 @@
#define AUHAL_INPUT_ELEMENT 1
namespace PBD {
class Timing;
}
namespace ARDOUR {
class CoreAudioPCM {
@ -78,6 +82,7 @@ public:
uint32_t samples_per_period,
int (process_callback (void*, const uint32_t, const uint64_t)),
void * process_arg
PBD::Timing& dsp_timer,
);
void set_error_callback (
@ -174,6 +179,8 @@ private:
int (* _process_callback) (void*, const uint32_t, const uint64_t);
void * _process_arg;
PBD::Timing* _dsp_timer;
void (* _error_callback) (void*);
void * _error_arg;