Aufgrund von Umarbeiten des s3 Storage wird es in GitLab, in nächster Zeit, mögliche Performance-Einbußen geben. Näheres dazu unter: https://maintenance.itc.rwth-aachen.de/ticket/status/messages/43/show_ticket/6670

Fixing manual reset problem for all rendering modules when using a virtual...

Fixing manual reset problem for all rendering modules when using a virtual user-triggered sound card. Also adding a VDL before FIR filtering in PrototypeGenericPath to support Doppler shifts, smooth delay handling and sound propagation based on FIR filters for various situations (especially outdoors with fast moving sound sources)
parent df7dfe87
......@@ -27,12 +27,12 @@ CVAVirtualAudioDriverBackend::~CVAVirtualAudioDriverBackend()
std::string CVAVirtualAudioDriverBackend::getDriverName() const
{
return "Dummy";
return "Virtual";
}
std::string CVAVirtualAudioDriverBackend::getDeviceName() const
{
return "Dummy";
return "Trigger";
}
int CVAVirtualAudioDriverBackend::getNumberOfInputs() const
......
......@@ -334,7 +334,7 @@ void CVAAmbisonicsFreeFieldAudioRenderer::Reset()
VA_VERBOSE( "AmbisonicsFreeFieldAudioRenderer", "Received reset call, indicating reset now" );
ctxAudio.m_iResetFlag = 1; // Request reset
if( ctxAudio.m_iStatus == 0 )
if( ctxAudio.m_iStatus == 0 || m_oParams.bOfflineRendering )
{
VA_VERBOSE( "AmbisonicsFreeFieldAudioRenderer", "Was not streaming, will reset manually" );
// if no streaming active, reset manually
......
......@@ -410,7 +410,7 @@ void CVABinauralAirTrafficNoiseAudioRenderer::Reset()
{
ctxAudio.m_iResetFlag = 1; // Request reset
if( ctxAudio.m_iStatus == 0 )
if( ctxAudio.m_iStatus == 0 || m_oParams.bOfflineRendering )
{
// if no streaming active, reset manually
//SyncInternalData();
......
......@@ -491,7 +491,7 @@ void CVABinauralArtificialReverbAudioRenderer::Reset()
{
ctxAudio.m_iResetFlag = 1; // Request reset
if( ctxAudio.m_iStatus == 0 )
if( ctxAudio.m_iStatus == 0 || m_oParams.bOfflineRendering )
{
// if no streaming active, reset manually
ResetInternalData();
......
......@@ -267,7 +267,6 @@ CVABinauralFreeFieldAudioRenderer::CVABinauralFreeFieldAudioRenderer( const CVAA
, m_iHRIRFilterLength( -1 )
, m_dAdditionalStaticDelaySeconds( 0.0f )
, m_oParams( oParams )
, m_bManualResetApparent( false )
{
// read config
Init( *oParams.pConfig );
......@@ -364,13 +363,12 @@ void CVABinauralFreeFieldAudioRenderer::Reset()
VA_VERBOSE( "BinauralFreeFieldAudioRenderer", "Received reset call, indicating reset now" );
ctxAudio.m_iResetFlag = 1; // Request reset
if( ctxAudio.m_iStatus == 0 || m_bManualResetApparent )
if( ctxAudio.m_iStatus == 0 || m_oParams.bOfflineRendering )
{
VA_VERBOSE( "BinauralFreeFieldAudioRenderer", "Was not streaming, will reset manually" );
// if no streaming active, reset manually
//SyncInternalData();
ResetInternalData();
m_bManualResetApparent = false;
}
else
{
......@@ -1396,8 +1394,13 @@ CVAStruct CVABinauralFreeFieldAudioRenderer::CallObject( const CVAStruct& oArgs
void CVABinauralFreeFieldAudioRenderer::SetParameters( const CVAStruct& oParams )
{
if( oParams.HasKey( "prepare_manual_reset" ) )
m_bManualResetApparent = true;
// Only delegate
CallObject( oParams );
}
CVAStruct CVABinauralFreeFieldAudioRenderer::GetParameters( const CVAStruct& )
{
return CVAStruct( *m_oParams.pConfig );
}
void CVABinauralFreeFieldAudioRenderer::onStartDumpListeners( const std::string& sFilenameFormat )
......
......@@ -119,6 +119,7 @@ public:
CVAStruct CallObject( const CVAStruct& oArgs );
void SetParameters( const CVAStruct& oParams );
CVAStruct GetParameters( const CVAStruct& );
void onStartDumpListeners( const std::string& sFilenameFormat );
void onStopDumpListeners();
......@@ -340,8 +341,6 @@ private:
ITAAtomicInt m_iStatus; //!< Current status flag: 0=stopped, 1=running
} ctxAudio;
bool m_bManualResetApparent; //!< Special case .. for resetting manually with no audio thread to sync with
void Init( const CVAStruct& oArgs );
void ManageSoundPaths( const CVASceneState* pCurScene, const CVASceneState* pNewScene, const CVASceneStateDiff* pDiff );
......
......@@ -370,7 +370,7 @@ void CVAPrototypeFreeFieldAudioRenderer::Reset()
VA_VERBOSE( "PrototypeFreeFieldAudioRenderer", "Received reset call, indicating reset now" );
ctxAudio.m_iResetFlag = 1; // Request reset
if( ctxAudio.m_iStatus == 0 )
if( ctxAudio.m_iStatus == 0 || m_oParams.bOfflineRendering )
{
VA_VERBOSE( "PrototypeFreeFieldAudioRenderer", "Was not streaming, will reset manually" );
// if no streaming active, reset manually
......
......@@ -120,9 +120,9 @@ 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;
ITASampleBuffer m_sfTempBuffer;
class CVAPTGPUpdateMessage : public CVAPoolObject
{
......@@ -179,6 +179,7 @@ private:
void UpdateGenericSoundPath( int iListenerID, int iSourceID, int iChannel, const std::string& sIRFilePath );
void UpdateGenericSoundPath( int iListenerID, int iSourceID, ITASampleFrame& sfIR );
void UpdateGenericSoundPath( int iListenerID, int iSourceID, int iChannel, ITASampleBuffer& sbIR );
void UpdateGenericSoundPath( const int iListenerID, const int iSourceID, const double dDelaySeconds );
friend class CVAPTGenericSoundPath;
friend class CVAPTGPListenerPoolFactory;
......
......@@ -405,7 +405,7 @@ void CVAPTHearingAidRenderer::Reset()
{
ctxAudio.m_iResetFlag = 1; // Request reset
if( ctxAudio.m_iStatus == 0 )
if( ctxAudio.m_iStatus == 0 || m_oParams.bOfflineRendering )
{
// if no streaming active, reset manually
//SyncInternalData();
......
......@@ -39,6 +39,7 @@ public:
bool bRecordOutputEnabled; //!< Renderer output recording and storing flag
std::string sRecordOutputFilePath; //!< Renderer output recording and storing file path
bool bOutputLevelMeterEnabled; //!< Renderer output level meter will be used (uses a little bit CPU resources)
bool bOfflineRendering; //!< Offline rendering indicator (using a virtual audio device and external trigger)
};
//! Audio renderer interface
......
......@@ -4332,7 +4332,15 @@ void CVACoreImpl::InitializeAudioDriver()
#ifdef VACORE_WITH_AUDIO_BACKEND_VIRTUAL
if( m_oCoreConfig.oAudioDriverConfig.sDriver == "Virtual" )
{
m_oCoreConfig.oAudioDriverConfig.iInputChannels = 0; // not allowed
if( m_oCoreConfig.oAudioDriverConfig.iBuffersize == -1 )
VA_EXCEPT2( INVALID_PARAMETER, "For a virtual audio device, the buffer size has to be set (AUTO detect not possible)" );
if( m_oCoreConfig.oAudioDriverConfig.iOutputChannels == -1 )
VA_EXCEPT2( INVALID_PARAMETER, "For a virtual audio device, the output channel number has to be set (AUTO detect not possible)" );
m_oCoreConfig.oAudioDriverConfig.iInputChannels = 0; // not allowed, override
CVAVirtualAudioDriverBackend* pAudioDriverBackend = new CVAVirtualAudioDriverBackend( &m_oCoreConfig.oAudioDriverConfig );
RegisterModule( pAudioDriverBackend );
m_pAudioDriverBackend = pAudioDriverBackend;
......@@ -4454,6 +4462,7 @@ void CVACoreImpl::InitializeAudioRenderers()
oParams.sClass = sClass;
oParams.pCore = this;
oParams.pConfig = &cit->second.GetStruct();
oParams.bOfflineRendering = ( m_oCoreConfig.oAudioDriverConfig.sDriver == "Virtual" ) ? true : false;
conf.ReqStringListRegex( "Reproductions", oParams.vsReproductions, "\\s*,\\s*" );
std::unique( oParams.vsReproductions.begin(), oParams.vsReproductions.end() );
......
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