Commit dc041b0b authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Adding verbose output monitor that prints output RMS and warns if the overall...

Adding verbose output monitor that prints output RMS and warns if the overall output is zero. Activating NCTC reproduction module for default config
parent 14618eec
......@@ -153,6 +153,7 @@ Outputs = MyTalkthroughHeadphones
NumChannels = 2
IRFilterLengthSamples = 88200
IRFilterDelaySamples = 0
OutputMonitoring = true
[Renderer:MyAirTrafficNoiseRenderer]
Class = BinauralAirTrafficNoise
......
......@@ -193,12 +193,15 @@ void CVAPTGenericPathAudioRenderer::Init( const CVAStruct& oArgs )
conf.OptInteger( "FilterDelaySamples", m_iFilterDelaySamples, 0 );
if( m_iIRFilterLengthSamples < 0 )
ITA_EXCEPT1( INVALID_PARAMETER, "IR filter size must be positive" );
if( m_iFilterDelaySamples >= m_iIRFilterLengthSamples )
ITA_EXCEPT1( INVALID_PARAMETER, "IR filter delay samples must be smaller than IR filter length" );
conf.OptBool( "OutputMonitoring", m_bOutputMonitoring, false );
return;
}
......@@ -803,7 +806,31 @@ void CVAPTGenericPathAudioRenderer::HandleProcessStream( ITADatasourceRealizatio
CVAPTGPListener* pActiveListener = m_mListeners.begin()->second;
for( int n=0; n< int( m_pOutput->GetNumberOfChannels() ); n++ )
for( int i=0; i<int( m_pOutput->GetBlocklength() ); i++ )
m_pOutput->GetWritePointer( n )[i] = (*pActiveListener->psfOutput)[n][i];
m_pOutput->GetWritePointer( n )[ i ] = ( *pActiveListener->psfOutput )[ n ][ i ];
bool bDataPresent = false;
std::vector< float > vfRMS( m_iNumChannels );
for( int n = 0; n< int( m_pOutput->GetNumberOfChannels() ); n++ )
{
vfRMS[ n ] = 0.0f;
for( int i = 0; i<int( m_pOutput->GetBlocklength() ); i++ )
vfRMS[ n ] += pow( std::abs( m_pOutput->GetWritePointer( n )[ i ] ), 2 );
vfRMS[ n ] = std::sqrtf( vfRMS[ n ] ) / m_pOutput->GetBlocklength();
if( vfRMS[ n ] != 0.0f )
bDataPresent = true;
}
if( m_bOutputMonitoring && int( pStreamInfo->nSamples / m_pOutput->GetBlocklength() ) % int( m_pOutput->GetSamplerate() / m_pOutput->GetBlocklength() * 2.0f ) == 0 )
{
if( bDataPresent )
{
VA_TRACE( GetObjectName(), "RMS at active listener: <Ch1," << vfRMS[ 0 ] << "> <Ch2," << vfRMS[ 1 ] << "> " );
}
else
{
VA_WARN( GetObjectName(), "Not data on output channel for active listener present (empty filters?)" );
}
}
}
else
{
......
......@@ -132,6 +132,7 @@ private:
int m_iIRFilterLengthSamples; //!< Length of the HRIR filter DSP module
int m_iNumChannels; //!< Number of channels per sound path
int m_iFilterDelaySamples; //!< Filter delay in samples
bool m_bOutputMonitoring; //!< Shows output infos / warnings if the overall listener output is zero (no filter loaded)
ITADatasourceRealization* m_pOutput;
class CVAPTGPUpdateMessage : public CVAPoolObject
......
......@@ -54,7 +54,7 @@
#define VACORE_REPRODUCTION_TALKTHROUGH 1
#define VACORE_REPRODUCTION_HEADPHONES 0
#define VACORE_REPRODUCTION_AMBISONICS 0
#define VACORE_REPRODUCTION_BINAURAL_NCTC 0
#define VACORE_REPRODUCTION_BINAURAL_NCTC 1
#define VACORE_REPRODUCTION_BINAURAL_MIXDOWN 0
#define VACORE_REPRODUCTION_AMBISONICS_BINAURAL_MIXDOWN 0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment