Commit 90a01fef authored by Anne Heimes's avatar Anne Heimes

bugfixes logging

parent 1e4b20ab
......@@ -33,7 +33,7 @@ struct ITANetAudioMessageLog : public ITALogDataBase
{
os << uiBlockId;
os << "\t" << std::setprecision( 12 ) << dWorldTimeStamp;
os << "\t" << iMessageType;
os << "\t" << sMessageType;
os << "\t" << sAction;
os << "\t" << std::setprecision( 12 ) << dInternalProcessingTime;
os << "\t" << nMessagePayloadSize;
......@@ -43,7 +43,7 @@ struct ITANetAudioMessageLog : public ITALogDataBase
unsigned int uiBlockId; //!< Block identifier (audio streaming)
double dWorldTimeStamp; //!< Time stamp at beginning of logged message process
int iMessageType; //!< Protocol message type
std::string sMessageType; //!< Protocol message type
std::string sAction; //!< Triggered action
double dInternalProcessingTime; //!< Processing within message class
VistaType::sint32 nMessagePayloadSize; //!< Data
......@@ -75,7 +75,7 @@ void CITANetAudioMessage::ResetMessage()
ITANetAudioMessageLog oLog;
oLog.uiBlockId = m_nMessageId;
oLog.iMessageType = 0;
oLog.sMessageType = "RESET_MESSAGE";
oLog.nMessagePayloadSize = 0;
oLog.dWorldTimeStamp = dInTime;
......@@ -136,7 +136,7 @@ void CITANetAudioMessage::WriteMessage()
// rewrite type dummy
iSwapDummy = m_nMessageType;
oLog.iMessageType = m_nMessageType;
oLog.sMessageType = CITANetAudioProtocol::GetNPMessageID( m_nMessageType );
if( m_oOutgoing.GetByteorderSwapFlag() )
VistaSerializingToolset::Swap4( &iSwapDummy );
std::memcpy( pBuffer, &iSwapDummy, sizeof( VistaType::sint32 ) );
......@@ -235,7 +235,7 @@ bool CITANetAudioMessage::ReadMessage( int timeout )
m_oIncoming.SetBuffer( &m_vecIncomingBuffer[ 0 ], nMessagePayloadSize, false );
m_nMessageType = ReadInt();
m_nMessageId = ReadInt();
oLog.iMessageType = m_nMessageType;
oLog.sMessageType = CITANetAudioProtocol::GetNPMessageID( m_nMessageType );
oLog.uiBlockId = m_nMessageId;
oLog.dWorldTimeStamp = ITAClock::getDefaultClock()->getTime() - dInTime;
m_pMessageLogger->log( oLog );
......
......@@ -122,7 +122,7 @@ bool CITANetAudioStreamingServer::Start( const std::string& sAddress, int iPort,
}
m_pServerLogger = new ITABufferedDataLoggerImplServer();
m_pServerLogger->setOutputFile( m_sServerLogBaseName + ".log" );
m_pServerLogger->setOutputFile( m_sServerLogBaseName + "_Server.log" );
m_pMessage->SetMessageType( CITANetAudioProtocol::NP_SERVER_OPEN );
m_pMessage->WriteDouble( dTimeIntervalCientSendStatus );
......
......@@ -11,24 +11,37 @@
using namespace std;
string g_sServerName = "localhost";
string g_sServerName = "137.226.61.85";
int g_iServerPort = 12480;
double g_dSampleRate = 44100.0;
int g_iBlockLength = 64;
int g_iBlockLength = 32;
int g_iChannels = 2;
int g_iTargetLatencySamples = 44100; // 1.4512ms
double g_dClientStatusMessageTimeout = 0.1; // seconds
int g_iTargetLatencySamples = 2 * g_iBlockLength; // 1.4512ms
int g_iRingBufferSize = 2 * g_iTargetLatencySamples;
double g_dClientStatusMessageTimeout = 0.001; // seconds
string g_sFileName = "gershwin-mono.wav";
int main( int argc, char** argv )
{
if( argc >= 6 )
if ( argc >= 8 )
{
g_sServerName = argv[ 1 ];
g_iServerPort = atoi( argv[ 2 ] );
g_dSampleRate = strtod( argv[ 3 ], NULL );
g_iBlockLength = atoi( argv[ 4 ] );
g_iChannels = atoi( argv[ 5 ] );
if ( argc >= 3 )
{
g_iServerPort = atoi( argv[ 2 ] );
g_dSampleRate = strtod( argv[ 3 ], NULL );
g_iBlockLength = atoi( argv[ 4 ] );
g_iChannels = atoi( argv[ 5 ] );
g_iTargetLatencySamples = atoi( argv[ 6 ] );
g_iRingBufferSize = atoi( argv[ 7 ] );
}
}
else
{
cout << "Syntax: ServerName ServerPort SampleRate BufferSize Channel TargetLatencySamples RingBufferSize" << endl;
cout << "Using default values ..." << endl;
}
ITADatasource* pSource = NULL;
......@@ -53,6 +66,7 @@ int main( int argc, char** argv )
ss << "_C" << g_iChannels;
ss << "_B" << g_iBlockLength;
ss << "_TL" << g_iTargetLatencySamples;
ss << "_RB" << g_iRingBufferSize;
oStreamingServer.SetServerLogBaseName( ss.str() );
oStreamingServer.SetInputStream( &oMuliplier );
......
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