# HG changeset patch # User Chris Cannam # Date 1580906004 0 # Node ID 497d80d3b9c4aeac77f3d25533a4052a4918a686 # Parent 4b58b8f44be776242be8d1b9a48659bd39458a05 More useful error reporting in cases where auditioning plugin fails diff -r 4b58b8f44be7 -r 497d80d3b9c4 audio/AudioCallbackPlaySource.cpp --- a/audio/AudioCallbackPlaySource.cpp Wed Feb 05 10:45:03 2020 +0000 +++ b/audio/AudioCallbackPlaySource.cpp Wed Feb 05 12:33:24 2020 +0000 @@ -75,6 +75,7 @@ m_levelsSet(false), m_auditioningPlugin(nullptr), m_auditioningPluginBypassed(false), + m_auditioningPluginFailed(false), m_playStartFrame(0), m_playStartFramePassed(false), m_timeStretcher(nullptr), @@ -1012,7 +1013,12 @@ m_mutex.lock(); m_auditioningPlugin = plugin; m_auditioningPluginBypassed = false; + m_auditioningPluginFailed = false; m_mutex.unlock(); + + SVDEBUG << "AudioCallbackPlaySource::setAuditioningEffect: set plugin to " + << plugin << " and bypassed to " << m_auditioningPluginBypassed + << endl; } void @@ -1364,26 +1370,44 @@ if (m_auditioningPluginBypassed) return; RealTimePluginInstance *plugin = m_auditioningPlugin; if (!plugin) return; - + if ((int)plugin->getAudioInputCount() != getTargetChannelCount()) { -// cout << "plugin input count " << plugin->getAudioInputCount() -// << " != our channel count " << getTargetChannelCount() -// << endl; + if (!m_auditioningPluginFailed) { + SVCERR << "AudioCallbackPlaySource::applyAuditioningEffect: " + << "Can't run plugin: plugin input count " + << plugin->getAudioInputCount() + << " != our channel count " << getTargetChannelCount() + << " (future errors for this plugin will be suppressed)" + << endl; + m_auditioningPluginFailed = true; + } return; } if ((int)plugin->getAudioOutputCount() != getTargetChannelCount()) { -// cout << "plugin output count " << plugin->getAudioOutputCount() -// << " != our channel count " << getTargetChannelCount() -// << endl; + if (!m_auditioningPluginFailed) { + SVCERR << "AudioCallbackPlaySource::applyAuditioningEffect: " + << "Can't run plugin: plugin output count " + << plugin->getAudioOutputCount() + << " != our channel count " << getTargetChannelCount() + << " (future errors for this plugin will be suppressed)" + << endl; + m_auditioningPluginFailed = true; + } return; } if ((int)plugin->getBufferSize() < count) { -// cout << "plugin buffer size " << plugin->getBufferSize() -// << " < our block size " << count -// << endl; + if (!m_auditioningPluginFailed) { + SVCERR << "AudioCallbackPlaySource::applyAuditioningEffect: " + << "Can't run plugin: plugin buffer size " + << plugin->getBufferSize() + << " < our block size " << count + << " (future errors for this plugin will be suppressed)" + << endl; + m_auditioningPluginFailed = true; + } return; } - + float **ib = plugin->getAudioInputBuffers(); float **ob = plugin->getAudioOutputBuffers(); diff -r 4b58b8f44be7 -r 497d80d3b9c4 audio/AudioCallbackPlaySource.h --- a/audio/AudioCallbackPlaySource.h Wed Feb 05 10:45:03 2020 +0000 +++ b/audio/AudioCallbackPlaySource.h Wed Feb 05 12:33:24 2020 +0000 @@ -371,6 +371,7 @@ bool m_levelsSet; RealTimePluginInstance *m_auditioningPlugin; bool m_auditioningPluginBypassed; + bool m_auditioningPluginFailed; Scavenger m_pluginScavenger; sv_frame_t m_playStartFrame; bool m_playStartFramePassed;