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

Merge branch 'develop' of https://git.rwth-aachen.de/ita/VACore into develop

parents 05872e88 266bcfde
conf/VACore.ini
conf/VACore.experimental.ini
HTML
*.bat
*.mat
......
......@@ -39,6 +39,7 @@ endif( )
vista_use_package( VistaCoreLibs REQUIRED COMPONENTS VistaInterProcComm FIND_DEPENDENCIES )
vista_use_package( VABase REQUIRED FIND_DEPENDENCIES )
vista_use_package( ITABase REQUIRED FIND_DEPENDENCIES )
vista_use_package( ITADSP REQUIRED FIND_DEPENDENCIES )
vista_use_package( ITADataSources REQUIRED FIND_DEPENDENCIES )
vista_use_package( ITAConvolution REQUIRED FIND_DEPENDENCIES )
vista_use_package( ITACTC REQUIRED FIND_DEPENDENCIES )
......@@ -53,7 +54,7 @@ if( NOT DEFINED ITA_VACORE_VERSION_MAJOR )
set( ITA_VACORE_VERSION_MAJOR "v2017" CACHE STRING "VACore version major (usually 'v' and year)" )
endif( )
if( NOT DEFINED ITA_VACORE_VERSION_MINOR )
set( ITA_VACORE_VERSION_MINOR "a" CACHE STRING "VACore version minor (usually a,b,c ...)" )
set( ITA_VACORE_VERSION_MINOR "c" CACHE STRING "VACore version minor (usually a,b,c ...)" )
endif( )
# Settings
......@@ -82,6 +83,9 @@ endif( )
if( NOT DEFINED ITA_VACORE_MAX_NUM_LISTENERS )
set( ITA_VACORE_MAX_NUM_LISTENERS 0 CACHE INT "VACore maximum number of listeners ( 0 = unlimited )" )
endif( )
if( NOT DEFINED ITA_VACORE_WITH_TTS_SIGNAL_SOURCE )
set( ITA_VACORE_WITH_TTS_SIGNAL_SOURCE ${TTSReleay} CACHE BOOL "VACore with text-to-speech signal source support" )
endif( )
# Data dirs
......@@ -310,6 +314,14 @@ endif( )
string( TIMESTAMP VACORE_CMAKE_DATE "%Y-%m-%d" )
add_definitions( "-DVACORE_CMAKE_DATE=\"${VACORE_CMAKE_DATE}\"" )
if( ITA_VACORE_WITH_TTS_SIGNAL_SOURCE )
vista_use_package( CereVoice REQUIRED FIND_DEPENDENCIES)
vista_use_package( samplerate REQUIRED FIND_DEPENDENCIES)
if( VCEREVOICE_FOUND )
add_definitions( "-DVACORE_WITH_TTS_SIGNAL_SOURCE" )
endif( )
endif( )
# Dev switches
if( ITA_VACORE_REPRODUCTION_NCTC_WITH_SWEET_SPOT_WIDENING )
add_definitions( "-DVACORE_REPRODUCTION_NCTC_WITH_SWEET_SPOT_WIDENING" )
......@@ -334,7 +346,11 @@ vista_create_default_info_file( VACore )
set_property( TARGET VACore PROPERTY FOLDER "VA" )
# VA core configuration file
configure_file( "conf/VACore.ini.proto" "${CMAKE_CURRENT_SOURCE_DIR}/conf/${ITA_VACORE_DEFAULT_CONFIG_FILE_NAME}" @ONLY )
if( NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/conf/${ITA_VACORE_DEFAULT_CONFIG_FILE_NAME}" )
configure_file( "conf/VACore.ini.proto" "${CMAKE_CURRENT_SOURCE_DIR}/conf/${ITA_VACORE_DEFAULT_CONFIG_FILE_NAME}" @ONLY )
else()
message( "conf/VACore.ini exists, skipping overwrite. Manually remove generated conf/VACore.ini first, if you want to re-generate from default prototype config file." )
endif()
# deploy
if( ITA_VACORE_DEPLOY_WITH_COMMON_DATA )
......@@ -342,7 +358,7 @@ if( ITA_VACORE_DEPLOY_WITH_COMMON_DATA )
endif( )
if( ITA_VACORE_DEPLOY_WITH_COMMON_CONFIGS )
install( DIRECTORY "conf" DESTINATION "." FILES_MATCHING PATTERN "*.ini" )
install( DIRECTORY "conf" DESTINATION "." FILES_MATCHING PATTERN "*.ini" )
endif( )
if( ITA_VACORE_DEPLOY_WITH_COMMON_SCRIPTS )
......@@ -355,3 +371,10 @@ if( ITA_VA_WITH_TESTS OR ITA_VACORE_WITH_TESTS )
set( VACORE_COMMON_BUILD TRUE )
add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/tests" )
endif( )
# benchmarks
if( ITA_VA_WITH_BENCHMARKS OR ITA_VACORE_WITH_BENCHMARKS )
set( VACORE_COMMON_BUILD TRUE )
add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/benchmarks" )
endif( )
Copyright 2015-2016 Institute of Technical Acoustics, RWTH Aachen University
Copyright 2015-2017 Institute of Technical Acoustics, RWTH Aachen University
Any usage and distribution is prohibited, unless explicitly granted by the authors.
\ No newline at end of file
......@@ -3,20 +3,23 @@
VACore implements the core functionality for real-time auralization of virtual environments and sophisticated reproduction of various types. It can be
created using a factory method and exposes the IVACore abstract class methods. Manage the core by the C++ interface (directly or over TCP/IP network in VANet) or via various binding interfaces, i.e. for Matlab (VAMatlab).
### License
Copyright 2015-2016 Institute of Technical Acoustics, RWTH Aachen University. Any usage and distribution is prohibited, unless explicitly granted by the authors.
Copyright 2015-2017 Institute of Technical Acoustics, RWTH Aachen University. Any usage and distribution is prohibited, unless explicitly granted by the authors.
See [License](LICENSE.md) file for more information
### Quick build guide
VACore uses CMake configuration files to create project files for your preferred development environment. It requires the VistaCMakeCommon extension package, which can be downloaded from [devhub.com](http://devhub.com).
Further packages are required, such as the VistaCoreLibs and the ITACoreLibs.
### Additional software
Some applications like the VAServer and the VAGUI are using the VACore to manage the auralization and reproduction. Also, bindings for C++ and Matlab exist, where you can connect to the VACore via network connection.
### Help
VACore is an in-house development of ITA and not for use to anyone else. Help is only provided within projects where ITA is involved.
### Quick build guide
It is recommended to clone and follow the build guide of the parent project [VA](https://git.rwth-aachen.de/ita/VA), which includes this project as a submodule.
cmake_minimum_required( VERSION 2.8 )
project( VACoreBenchmarks )
add_subdirectory( "core" )
cmake_minimum_required( VERSION 2.8 )
project( VACoreBenchmarks )
list( APPEND CMAKE_MODULE_PATH "$ENV{VISTA_CMAKE_COMMON}" )
include( VistaCommon )
vista_use_package( VistaCoreLibs REQUIRED COMPONENTS VistaBase )
vista_use_package( VACore REQUIRED FIND_DEPENDENCIES )
add_executable( VACoreSourceManagementBenchmark VACoreSourceManagementBenchmark.cpp )
target_link_libraries( VACoreSourceManagementBenchmark ${VISTA_USE_PACKAGE_LIBRARIES} )
vista_configure_app( VACoreSourceManagementBenchmark )
vista_install( VACoreSourceManagementBenchmark )
vista_create_default_info_file( VACoreSourceManagementBenchmark )
set_property( TARGET VACoreSourceManagementBenchmark PROPERTY FOLDER "VA/Benchmarks/VACore" )
#include <VACore.h>
#include <VACoreEvent.h>
#include <VACoreFactory.h>
#include <VACoreVersion.h>
#include <VAException.h>
#include <iostream>
#include <vector>
#include <VistaBase/VistaTimeUtils.h>
#include <ITAStopWatch.h>
using namespace std;
int main( int, char** )
{
IVACore* pCore = NULL;
try
{
CVAStruct oConfig;
CVAStruct oSectionDebug;
oSectionDebug[ "loglevel" ] = 1;
oConfig[ "debug" ] = oSectionDebug;
CVAStruct oSectionDriver;
oSectionDriver[ "driver" ] = "Portaudio";
oConfig[ "audio driver" ] = oSectionDriver;
CVAStruct oDevice1;
oDevice1[ "type" ] = "HP";
oDevice1[ "channels" ] = "1,2";
oConfig[ "OutputDevice:MyHP" ] = oDevice1;
CVAStruct oOutput1;
oOutput1[ "devices" ] = "MyHP";
oConfig[ "Output:MyDesktopHP" ] = oOutput1;
CVAStruct oReproduction;
oReproduction[ "class" ] = "Talkthrough";
oReproduction[ "outputs" ] = "MyDesktopHP";
oConfig[ "Reproduction:MyTalkthroughHeadphones" ] = oReproduction;
CVAStruct oRenderer;
oRenderer[ "class" ] = "PrototypeDummy";
oRenderer[ "outputs" ] = "MyTalkthroughHeadphones";
oRenderer[ "outputgroup" ] = "MyDesktopHP";
oConfig[ "Renderer:BenchmarkDummyRenderer" ] = oRenderer;
pCore = VACore::CreateCoreInstance( oConfig );
pCore->Initialize();
int iIterations = 100;
int iMaxNumParallelSources = 200;
for( int i = 1; i < iMaxNumParallelSources; i++ )
{
ITAStopWatch swIterations;
for( int j = 0; j < iIterations; j++ )
{
swIterations.start();
std::vector< int > viSourceIDs( i );
for( int k = 0; k < i; k++ )
viSourceIDs[ k ] = pCore->CreateSoundSource( "BenchmarkSoundSource" );
for( int k = 0; k < i; k++ )
pCore->DeleteSoundSource( viSourceIDs[ k ] );
swIterations.stop();
}
cout << "Statistics for " << i << " parallel source: " << swIterations.ToString() << endl;
}
delete pCore;
}
catch( CVAException& e )
{
delete pCore;
cerr << "Error with core " << e.GetErrorCode() << ": " << e << endl;
return 255;
}
return 0;
}
......@@ -39,6 +39,9 @@ big_data_dir = @ITA_VACORE_BIG_DATA_DIR@
# Inside scene data directory
InsideSceneData = @INSIDE_SCENE_DATA@
# Path for TTS Voices of CereVoice
voices_dir = data/Voices
[Files]
......@@ -87,6 +90,8 @@ Driver = Portaudio
#Device = ASIO Fireface USB
#Device = ASIO MADIface USB
#Device = Focusrite USB 2.0 Audio Driver
#Device = M-Audio Fast Track Ultra ASIO
#Device = Yamaha Steinberg USB ASIO
Device = default
# MANDATORY: Sampling rate [Hz]
......@@ -121,6 +126,7 @@ MotionModelLogInputSources = false
MotionModelLogEstimatedOutputSources = false
MotionModelLogInputListener = false
MotionModelLogEstimatedOutputListener = false
SwitchingAlgorithm = linear
[Renderer:MyAmbientMixer]
class = AmbientMixer
......@@ -175,7 +181,7 @@ MotionModelLogEstimatedOutputSources = false
DumpListeners = false
DumpListenersGain = 1.0
SpeedOfSound = 344.0
SwitchingAlgorithm = cubicspline
SwitchingAlgorithm = linear
[Renderer:MyHearingAidRenderer]
Class = PrototypeHearingAid
......
......@@ -30,7 +30,7 @@ Devices = LS_BF, LS_BR, LS_BB, LS_BL
[Output:VRLAB_LS_SUBWOOFER]
Description = ITA VRLab subwoofer loudspeaker setup
Enabled = false
Enabled = true
Devices = LS_SUB
[Output:VRLAB_HP_MAIN]
......
/*
*
* VVV VVV A
* VVV VVV AAA Virtual Acoustics
* VVV VVV AAA Real-time auralisation for virtual reality
* VVV VVV AAA
* VVVVVV AAA (c) Copyright Institut fr Technische Akustik (ITA)
* VVVV AAA RWTH Aachen (http://www.akustik.rwth-aachen.de)
*
* ---------------------------------------------------------------------------------
*
* Datei: VACoreDumper.h
*
* Zweck: Dumper-Klasse welche VACore-Calls als Strings ausgibt
*
* Autor(en): Frank Wefers (Frank.Wefers@akustik.rwth-aachen.de
*
* ---------------------------------------------------------------------------------
*/
// $Id: VACoreDumper.h 2729 2012-06-26 13:23:36Z fwefers $
#ifndef __VACORE_DUMPER_H__
#define __VACORE_DUMPER_H__
#include <VACoreDefinitions.h>
#include <VACore.h>
#include <iostream>
#include <string>
//! Dumper-Klasse welche Aufrufe und Ereignisse als Strings auf einem Stream ausgibt
class VACORE_API CVACoreDumper : public IVACore {
public:
CVACoreDumper(IVACore* pTarget=NULL, std::ostream* pOutputStream=&std::cout);
virtual ~CVACoreDumper();
//! Zielinstanz des Dumpers zurckgeben
IVACore* getCoreInstance() const;
//! Zielinstanz des Dumpers zurckgeben
void setCoreInstance(IVACore* pTarget);
//! Ausgabestream fr das Dump zurckgeben
std::ostream* getOutputStream() const;
//! Ausgabestream fr das Dump setzen
void setOutputStream(std::ostream* pOutputStream) const;
// --= Interface "IVACore" =--
private:
IVACore* m_pTarget;
std::ostream* m_pStream;
};
#endif // __VACORE_DUMPER_H__
......@@ -16,7 +16,6 @@
#include <VACoreDefinitions.h>
#include <VAReferenceableObject.h>
#include <VAUncopyable.h>
#include <string>
......@@ -120,95 +119,4 @@ protected:
friend class CVAPoolObject;
};
//! Pool objects base class
/**
* Pool objects are referencable and linked to a superior pool. The
* reference counter holds information on number of usages/links of
* the specific object. In case the reference counter states that
* no connections to the given object are available, it is marked
* for new usage (recycling). The object releases itself to
* the pool if no references are existent.
*/
class VACORE_API CVAPoolObject : public IVAUncopyable, public CVAReferenceableObject
{
public:
//! Redefined method to remove reference
/**
* Releases object to the pool if no reference available anymore
*/
virtual int RemoveReference() const;
protected:
//! Protected constructor [Jonas fragt Frank: so richtig?! (hinzugefgt, damit m_pParentPool auf nullptr gesetzt werden kann]
/**
* Can only be called by CVAObjectPool(), protected for users
*/
CVAPoolObject();
//! Protected destructor
/**
* Can only be called by CVAObjectPool(), protected for users
*/
virtual ~CVAPoolObject();
//! Pre request method
/**
* The PreRequest method is called before the object is used
*/
virtual void PreRequest() {};
//! Pre release method
/**
* The PreRelease method is called after the object has been released
*/
virtual void PreRelease() {};
private:
IVAObjectPool* m_pParentPool; //!< Pointer to the pool
friend class CVAObjectPool;
friend class CVALockfreeObjectPool;
};
//! Pool object factory interface
/**
* Interface for the creation of a pool object (factory method)
*/
class VACORE_API IVAPoolObjectFactory
{
public:
inline virtual ~IVAPoolObjectFactory() {};
//! Factory method (abstract)
/**
* Interface method to create a new pool object
*
* \return Pointer to the new pool object
*/
virtual CVAPoolObject* CreatePoolObject() = 0;
};
//! Default factory for pool objects with standard constructor
/**
* Pool object factory for objects using the default constructor
*/
template< class T > class CVAPoolObjectDefaultFactory : public IVAPoolObjectFactory
{
public:
//! Factory method
/**
* Creates new pool object using the standard constructor of the template object
*
* \return Pointer to the new pool object
*/
inline virtual CVAPoolObject* CreatePoolObject()
{
return new T;
}
};
#endif // IW_VACORE_OBJECT_POOL
\ No newline at end of file
/*
* --------------------------------------------------------------------------------------------
*
* VVV VVV A
* VVV VVV AAA Virtual Acoustics (VA)
* VVV VVV AAA Real-time auralisation for virtual reality
* VVV VVV AAA
* VVVVVV AAA (c) Copyright Institute of Technical Acoustics (ITA), 2015-2017
* VVVV AAA RWTH Aachen University (http://www.akustik.rwth-aachen.de)
*
* --------------------------------------------------------------------------------------------
*/
#ifndef IW_VA_POOL_OBJECT
#define IW_VA_POOL_OBJECT
#include <VACoreDefinitions.h>
#include <VAReferenceableObject.h>
#include <VAUncopyable.h>
class IVAObjectPool;
//! Pool objects base class
/**
* Pool objects are referencable and linked to a superior pool. The
* reference counter holds information on number of usages/links of
* the specific object. In case the reference counter states that
* no connections to the given object are available, it is marked
* for new usage (recycling). The object releases itself to
* the pool if no references are existent.
*/
class VACORE_API CVAPoolObject : public IVAUncopyable, public CVAReferenceableObject
{
public:
//! Redefined method to remove reference
/**
* Releases object to the pool if no reference available anymore
*/
virtual int RemoveReference() const;
protected:
//! Protected constructor [Jonas fragt Frank: so richtig?! (hinzugefgt, damit m_pParentPool auf nullptr gesetzt werden kann]
/**
* Can only be called by CVAObjectPool(), protected for users
*/
CVAPoolObject();
//! Protected destructor
/**
* Can only be called by CVAObjectPool(), protected for users
*/
virtual ~CVAPoolObject();
//! Pre request method
/**
* The PreRequest method is called before the object is used
*/
virtual inline void PreRequest() {};
//! Pre release method
/**
* The PreRelease method is called after the object has been released
*/
virtual inline void PreRelease() {};
private:
IVAObjectPool* m_pParentPool; //!< Pointer to the pool
friend class CVAObjectPool;
friend class CVALockfreeObjectPool;
};
//! Pool object factory interface
/**
* Interface for the creation of a pool object (factory method)
*/
class VACORE_API IVAPoolObjectFactory
{
public:
inline virtual ~IVAPoolObjectFactory() {};
//! Factory method (abstract)
/**
* Interface method to create a new pool object
*
* \return Pointer to the new pool object
*/
virtual CVAPoolObject* CreatePoolObject() = 0;
};
//! Default factory for pool objects with standard constructor
/**
* Pool object factory for objects using the default constructor
*/
template< class T > class CVAPoolObjectDefaultFactory : public IVAPoolObjectFactory
{
public:
//! Factory method
/**
* Creates new pool object using the standard constructor of the template object
*
* \return Pointer to the new pool object
*/
inline virtual CVAPoolObject* CreatePoolObject()
{
return new T;
}
};
#endif // IW_VA_POOL_OBJECT
......@@ -5,10 +5,10 @@ set( RelativeSourceGroup "include" )
set( DirFiles
VACoreDefinitions.h
#VACoreDumper.h
VACoreFactory.h
VANetworkStreamAudioSignalSource.h
VAObjectPool.h
VAPoolObject.h
VAReferenceableObject.h
VAUncopyable.h
_SourceFiles.cmake
......
......@@ -11,6 +11,7 @@
#include "VASequencerSignalSource.h"
#include "VAEngineSignalSource.h"
#include "VAMachineSignalSource.h"
#include "VATextToSpeechSignalSource.h"
#include <ITAException.h>
#include <ITAStringUtils.h>
......@@ -22,27 +23,27 @@
#include <sstream>
CVAAudioSignalSourceManager::CVAAudioSignalSourceManager(CVACoreImpl* pParentCore,
const CVAAudioDriverConfig& oAudioDriverConfig,
ITADatasource* pDeviceInputSource)
: m_pParentCore(pParentCore),
m_dSamplerate(oAudioDriverConfig.dSampleRate),
m_iBlocklength(oAudioDriverConfig.iBuffersize),
m_iDeviceInputs(oAudioDriverConfig.iInputChannels),
m_pDeviceInputSource(pDeviceInputSource),
m_vsbDeviceInputBuffers(oAudioDriverConfig.iInputChannels),
m_evStreamCounterInc( VistaThreadEvent::NON_WAITABLE_EVENT ),
m_iStreamCounter(0)
CVAAudioSignalSourceManager::CVAAudioSignalSourceManager( CVACoreImpl* pParentCore,
const CVAAudioDriverConfig& oAudioDriverConfig,
ITADatasource* pDeviceInputSource )
: m_pParentCore( pParentCore ),
m_dSamplerate( oAudioDriverConfig.dSampleRate ),
m_iBlocklength( oAudioDriverConfig.iBuffersize ),
m_iDeviceInputs( oAudioDriverConfig.iInputChannels ),
m_pDeviceInputSource( pDeviceInputSource ),
m_vsbDeviceInputBuffers( oAudioDriverConfig.iInputChannels ),
m_evStreamCounterInc( VistaThreadEvent::NON_WAITABLE_EVENT ),
m_iStreamCounter( 0 )
{
m_sbSilence.Init( oAudioDriverConfig.iBuffersize, true );
// Puffer und Signalquellen fr Audio-Eingnge anlegen
for (int i=0; i<oAudioDriverConfig.iInputChannels; i++) {
m_vsbDeviceInputBuffers[i].Init( oAudioDriverConfig.iBuffersize, false);
for( int i = 0; i < oAudioDriverConfig.iInputChannels; i++ ) {
m_vsbDeviceInputBuffers[ i ].Init( oAudioDriverConfig.iBuffersize, false );
std::stringstream ss;
ss << "Audio device input " << (i+1);
IVAAudioSignalSource* pSource = new CVADeviceInputSignalSource(&m_vsbDeviceInputBuffers[i], ss.str());
m_vsDeviceInputSourceIDs.push_back( RegisterSignalSource(pSource, ss.str(), true, false) );
ss << "Audio device input " << ( i + 1 );
IVAAudioSignalSource* pSource = new CVADeviceInputSignalSource( &m_vsbDeviceInputBuffers[ i ], ss.str() );
m_vsDeviceInputSourceIDs.push_back( RegisterSignalSource( pSource, ss.str(), true, false ) );
}
}
......@@ -58,7 +59,7 @@ void CVAAudioSignalSourceManager::Reset() {
std::vector< IVAAudioSignalSource* > vpDelayedRemoveList;
// Alle gemanageten Quellen freigeben
for( RecordMapIt it=m_mRecords.begin(); it!=m_mRecords.end(); )
for( RecordMapIt it = m_mRecords.begin(); it != m_mRecords.end(); )
{
// Forced reference count reset - OK here
it->second.iRefCount = 0;
......@@ -89,7 +90,7 @@ void CVAAudioSignalSourceManager::Reset() {
SyncSignalSources();
// Falls kein Streaming luft. Direkt die Queue leeren.
if( !m_pParentCore->IsStreaming() )
if( !m_pParentCore->IsStreaming() )
m_qpDelReqSources.clear();