Commit 24cde1b3 authored by Anne's avatar Anne

protocol 2 not running

log im server implementieren
parent 671c79a6
......@@ -56,7 +56,7 @@ public:
void WriteMessage();
// Returns false if no incomming data
bool ReadMessage();
bool ReadMessage( int timeout );
void ResetMessage();
......
......@@ -47,22 +47,14 @@ class CITANetAudioStream;
class ITA_DATA_SOURCES_API CITANetAudioProtocol
{
public:
static const int NET_AUDIO_VERSION = 1;
static const int NP_INVALID = -1;
static const int NP_GET_VERSION_INFO = 1;
static const int NP_NO_MESSAGE = 2;
static const int NP_CLIENT_OPEN = 100;
static const int NP_CLIENT_CLOSE = 101;
static const int NP_CLIENT_WAITING_FOR_SAMPLES = 111;
static const int NP_CLIENT_SENDING_RINGBUFFER_FREE_SAMPLES = 111;
static const int NP_SERVER_CLOSE = 200;
static const int NP_SERVER_OPEN = 201;
static const int NP_SERVER_GET_RINGBUFFER_SIZE = 210;
static const int NP_SERVER_GET_RINGBUFFER_FREE = 211;
static const int NP_SERVER_WAITING_FOR_TRIGGER = 221;
static const int NP_SERVER_SEND_SAMPLES = 222;
static const int NP_SERVER_OPEN = 200;
static const int NP_SERVER_CLOSE = 201;
static const int NP_SERVER_GET_RINGBUFFER_FREE_SAMPLES = 211;
static const int NP_SERVER_SENDING_SAMPLES = 222;
inline CITANetAudioProtocol() {};
inline ~CITANetAudioProtocol() {};
......@@ -72,19 +64,19 @@ public:
int iChannels;
double dSampleRate;
int iBlockSize;
int iBufferSize;
int iRingBufferSize;
inline StreamingParameters()
{
iChannels = 0;
dSampleRate = 0.0f;
iBlockSize = 0;
iBufferSize = 0;
iRingBufferSize = 0;
};
inline bool operator==( const StreamingParameters& rhs )
{
if ( ( iChannels == rhs.iChannels ) && ( dSampleRate == rhs.dSampleRate ) && ( iBlockSize == rhs.iBlockSize ) && ( iBufferSize == rhs.iBufferSize ) )
if ( ( iChannels == rhs.iChannels ) && ( dSampleRate == rhs.dSampleRate ) && ( iBlockSize == rhs.iBlockSize ) && ( iRingBufferSize == rhs.iRingBufferSize ) )
return true;
else
return false;
......
......@@ -44,7 +44,7 @@ void CITANetAudioMessage::ResetMessage()
m_oIncoming.SetBuffer( NULL, 0 );
m_nMessageType = CITANetAudioProtocol::NP_INVALID;
m_nMessageType = -1;
//m_pConnection = NULL;
......@@ -110,22 +110,20 @@ void CITANetAudioMessage::WriteMessage()
}
bool CITANetAudioMessage::ReadMessage()
bool CITANetAudioMessage::ReadMessage( int timeout)
{
#if NET_AUDIO_SHOW_TRAFFIC
vstr::out() << "CITANetAudioMessage [ Reading ] Waiting for incoming data" << std::endl;
#endif
double dTimeBefore = ITAClock::getDefaultClock( )->getTime( );
// WaitForIncomming Data int in ca ms
long nIncomingBytes = m_pConnection->WaitForIncomingData( 1 );
long nIncomingBytes = m_pConnection->WaitForIncomingData( timeout );
double dTimeAfter = ITAClock::getDefaultClock( )->getTime( );
double DTimeDiff = dTimeAfter - dTimeBefore;
// TODO Timer entfernen
if ( nIncomingBytes == -1)
{
m_nMessageType = CITANetAudioProtocol::NP_NO_MESSAGE;
return false;
}
nIncomingBytes = m_pConnection->WaitForIncomingData( 0 );
#if NET_AUDIO_SHOW_TRAFFIC
vstr::out() << "CITANetAudioMessage [ Reading ] " << nIncomingBytes << " bytes incoming" << std::endl;
......@@ -318,7 +316,7 @@ CITANetAudioProtocol::StreamingParameters CITANetAudioMessage::ReadStreamingPara
oParams.iChannels = ReadInt();
oParams.dSampleRate = ReadDouble( );
oParams.iBlockSize = ReadInt( );
oParams.iBufferSize = ReadInt( );
oParams.iRingBufferSize = ReadInt( );
return oParams;
}
......@@ -328,7 +326,7 @@ void CITANetAudioMessage::WriteStreamingParameters( const CITANetAudioProtocol::
WriteInt( oParams.iChannels );
WriteDouble( oParams.dSampleRate );
WriteInt( oParams.iBlockSize );
WriteInt( oParams.iBufferSize );
WriteInt( oParams.iRingBufferSize );
}
int CITANetAudioMessage::ReadRingBufferSize()
......
......@@ -56,7 +56,7 @@ CITANetAudioStreamingClient::CITANetAudioStreamingClient( CITANetAudioStream* pP
m_oParams.iChannels = pParent->GetNumberOfChannels();
m_oParams.dSampleRate = pParent->GetSampleRate( );
m_oParams.iBlockSize = pParent->GetBlocklength( );
m_oParams.iBufferSize = pParent->GetRingBufferSize( );
m_oParams.iRingBufferSize = pParent->GetRingBufferSize( );
std::string paras = std::string("NetAudioLogClient") + std::string("_BS") + std::to_string(pParent->GetBlocklength()) + std::string("_Ch") + std::to_string(pParent->GetNumberOfChannels()) + std::string(".txt");
m_pClientLogger = new ITABufferedDataLoggerImplClient( );
......@@ -102,7 +102,7 @@ bool CITANetAudioStreamingClient::Connect( const std::string& sAddress, int iPor
m_pMessage->WriteStreamingParameters( m_oParams );
m_pMessage->WriteMessage();
while ( !m_pMessage->ReadMessage( ) );
while ( !m_pMessage->ReadMessage( 0 ) );
assert( m_pMessage->GetMessageType( ) == CITANetAudioProtocol::NP_SERVER_OPEN );
bool bOK = m_pMessage->ReadBool();
......@@ -125,55 +125,41 @@ bool CITANetAudioStreamingClient::LoopBody()
// Send message to server that samples can be received
m_pMessage->ResetMessage();
m_pMessage->SetConnection( m_pConnection );
m_pMessage->SetMessageType( CITANetAudioProtocol::NP_CLIENT_WAITING_FOR_SAMPLES );
int iFreeSamplesUntilAllowedReached = m_pStream->GetAllowedLatencySamples() - m_pStream->GetRingBufferAvailableSamples();
oLog.iFreeSamples = iFreeSamplesUntilAllowedReached;
if( iFreeSamplesUntilAllowedReached < 0 )
iFreeSamplesUntilAllowedReached = 0;
m_pMessage->WriteInt( iFreeSamplesUntilAllowedReached );
m_pMessage->WriteMessage();
// Read answer
if ( m_pMessage->ReadMessage( ) )
if ( m_pMessage->ReadMessage( 0 ) )
{
int iAnswerType = m_pMessage->GetMessageType( );
switch ( iAnswerType )
int iMsgType = m_pMessage->GetMessageType( );
switch ( iMsgType )
{
case CITANetAudioProtocol::NP_INVALID:
// Something went wrong
vstr::err( ) << "Received invalid message type" << std::endl;
break;
case CITANetAudioProtocol::NP_SERVER_CLOSE:
Disconnect( );
break;
case CITANetAudioProtocol::NP_SERVER_WAITING_FOR_TRIGGER:
// Wait until block increment is triggered by audio context (more free samples in ring buffer)
m_oBlockIncrementEvent.WaitForEvent( true );
break;
case CITANetAudioProtocol::NP_SERVER_SEND_SAMPLES:
// Receive samples from net message and forward them to the stream ring buffer
m_pMessage->ReadSampleFrame( &m_sfReceivingBuffer );
if ( m_pStream->GetRingBufferFreeSamples( ) >= m_sfReceivingBuffer.GetLength( ) )
m_pStream->Transmit( m_sfReceivingBuffer, m_sfReceivingBuffer.GetLength( ) );
//else
// Fehler
break;
case CITANetAudioProtocol::NP_SERVER_GET_RINGBUFFER_FREE:
break;
case CITANetAudioProtocol::NP_SERVER_SENDING_SAMPLES:
// Receive samples from net message and forward them to the stream ring buffer
m_pMessage->ReadSampleFrame( &m_sfReceivingBuffer );
if ( m_pStream->GetRingBufferFreeSamples( ) >= m_sfReceivingBuffer.GetLength( ) )
m_pStream->Transmit( m_sfReceivingBuffer, m_sfReceivingBuffer.GetLength( ) );
//else
// Fehler
break;
case CITANetAudioProtocol::NP_SERVER_GET_RINGBUFFER_FREE_SAMPLES:
m_pMessage->SetMessageType( CITANetAudioProtocol::NP_CLIENT_SENDING_RINGBUFFER_FREE_SAMPLES );
m_pMessage->WriteInt( m_pStream->GetRingBufferFreeSamples( ) );
m_pMessage->WriteMessage( );
break;
case CITANetAudioProtocol::NP_SERVER_CLOSE:
Disconnect( );
break;
default:
vstr::out( ) << "[ITANetAudioStreamingServer] Unkown protocol type : " << iMsgType << std::endl;
break;
}
oLog.iChannel = m_pStream->GetNumberOfChannels( );
oLog.iProtocolStatus = iAnswerType;
oLog.iProtocolStatus = iMsgType;
oLog.dWorldTimeStamp = ITAClock::getDefaultClock( )->getTime( );
m_pClientLogger->log( oLog );
}
return true;
return false;
}
void CITANetAudioStreamingClient::TriggerBlockIncrement()
......
......@@ -41,13 +41,13 @@ bool CITANetAudioStreamingServer::Start( const std::string& sAddress, int iPort
m_pMessage = new CITANetAudioMessage( m_pConnection->GetByteorderSwapFlag( ) );
m_pMessage->ResetMessage( );
m_pMessage->SetConnection( m_pConnection );
while ( !m_pMessage->ReadMessage( ) ); //blocking
while ( !m_pMessage->ReadMessage( 0 ) ); //blocking
assert( m_pMessage->GetMessageType( ) == CITANetAudioProtocol::NP_CLIENT_OPEN );
CITANetAudioProtocol::StreamingParameters oClientParams = m_pMessage->ReadStreamingParameters( );
bool bOK = false;
m_oServerParams.iBufferSize = oClientParams.iBufferSize;
m_oServerParams.iRingBufferSize = oClientParams.iRingBufferSize;
if ( m_oServerParams == oClientParams )
{
bOK = true;
......@@ -72,49 +72,52 @@ bool CITANetAudioStreamingServer::Start( const std::string& sAddress, int iPort
bool CITANetAudioStreamingServer::LoopBody( )
{
// Sending Samples
if ( m_iClientRingBufferFreeSamples >= int( m_pInputStream->GetBlocklength( ) ) )
{
// Send Samples
for ( int i = 0; i < int( m_pInputStream->GetNumberOfChannels( ) ); i++ )
{
ITAStreamInfo oStreamInfo;
oStreamInfo.nSamples = m_sfTempTransmitBuffer.GetLength( );
const float* pfData = m_pInputStream->GetBlockPointer( i, &oStreamInfo );
if ( pfData != 0 )
m_sfTempTransmitBuffer[ i ].write( pfData, m_sfTempTransmitBuffer.GetLength( ) );
}
m_pInputStream->IncrementBlockPointer( );
m_pMessage->SetMessageType( CITANetAudioProtocol::NP_SERVER_SENDING_SAMPLES );
m_pMessage->WriteSampleFrame( &m_sfTempTransmitBuffer );
m_pMessage->WriteMessage( );
m_iClientRingBufferFreeSamples -= m_sfTempTransmitBuffer.GetLength( );
#ifdef NET_AUDIO_SHOW_TRAFFIC
vstr::out( ) << "[ITANetAudioStreamingServer] Transmitted " << m_sfTempTransmitBuffer.GetLength( ) << " samples for "
<< m_pInputStream->GetNumberOfChannels( ) << " channels" << std::endl;
#endif
}
else
{
// Waiting for Trigger
m_pMessage->SetMessageType( CITANetAudioProtocol::NP_SERVER_GET_RINGBUFFER_FREE_SAMPLES );
m_pMessage->WriteMessage( );
#ifdef NET_AUDIO_SHOW_TRAFFIC
vstr::out( ) << "[ITANetAudioStreamingServer] Not enough free samples in client buffer, requesting a trigger when more free samples available" << std::endl;
#endif
}
// Try to Empfange Daten
//m_pMessage->SetConnection( m_pConnection );
m_pMessage->ResetMessage( );
if ( m_pMessage->ReadMessage( ) )
if ( m_pMessage->ReadMessage( 1 ) )
{
int iMsgType = m_pMessage->GetMessageType( );
switch ( iMsgType )
{
case CITANetAudioProtocol::NP_CLIENT_WAITING_FOR_SAMPLES:
case CITANetAudioProtocol::NP_CLIENT_SENDING_RINGBUFFER_FREE_SAMPLES:
{
int iFreeSamples = m_pMessage->ReadInt( );
if ( iFreeSamples >= int( m_pInputStream->GetBlocklength( ) ) )
{
// Send Samples
for ( int i = 0; i < int( m_pInputStream->GetNumberOfChannels( ) ); i++ )
{
ITAStreamInfo oStreamInfo;
oStreamInfo.nSamples = m_sfTempTransmitBuffer.GetLength( );
const float* pfData = m_pInputStream->GetBlockPointer( i, &oStreamInfo );
if ( pfData != 0 )
m_sfTempTransmitBuffer[ i ].write( pfData, m_sfTempTransmitBuffer.GetLength( ) );
}
m_pInputStream->IncrementBlockPointer( );
m_pMessage->SetMessageType( CITANetAudioProtocol::NP_SERVER_SEND_SAMPLES );
m_pMessage->WriteSampleFrame( &m_sfTempTransmitBuffer );
m_pMessage->WriteMessage( );
#ifdef NET_AUDIO_SHOW_TRAFFIC
vstr::out() << "[ITANetAudioStreamingServer] Transmitted "<< m_sfTempTransmitBuffer.GetLength() << " samples for "
<< m_pInputStream->GetNumberOfChannels() << " channels" << std::endl;
#endif
}
else
{
// Waiting for Trigger
m_pMessage->SetMessageType( CITANetAudioProtocol::NP_SERVER_WAITING_FOR_TRIGGER );
m_pMessage->WriteMessage( );
#ifdef NET_AUDIO_SHOW_TRAFFIC
vstr::out() << "[ITANetAudioStreamingServer] Not enough free samples in client buffer, requesting a trigger when more free samples available" << std::endl;
#endif
}
m_iClientRingBufferFreeSamples = m_pMessage->ReadInt( );
break;
}
case CITANetAudioProtocol::NP_CLIENT_CLOSE:
......@@ -122,7 +125,7 @@ bool CITANetAudioStreamingServer::LoopBody( )
//m_pMessage->SetAnswerType( CITANetAudioProtocol::NP_SERVER_CLOSE );
//m_pMessage->WriteAnswer();
StopGently( false );
//m_pConnection = NULL;
m_pConnection = NULL;
Stop( );
return false;
}
......@@ -135,7 +138,7 @@ bool CITANetAudioStreamingServer::LoopBody( )
}
return true;
return false;
}
void CITANetAudioStreamingServer::SetInputStream( ITADatasource* pInStream )
......
......@@ -31,9 +31,8 @@ int main(int argc, char* argv[])
int iChannels = atoi(argv[5]);
int iBufferSize = atoi(argv[6]);
CITANetAudioStream oNetAudioStream( iChannels, dSampleRate, iBlockLength, iBufferSize );
ITAStreamPatchbay oPatchbay( dSampleRate, iBufferSize );
CITANetAudioStream oNetAudioStream( iChannels, dSampleRate, iBlockLength, iBlockLength*16 );
ITAStreamPatchbay oPatchbay( dSampleRate, iBlockLength );
oPatchbay.AddInput( &oNetAudioStream );
int iOutputID = oPatchbay.AddOutput( 2 );
int N = int( oNetAudioStream.GetNumberOfChannels( ) );
......@@ -61,7 +60,7 @@ int main(int argc, char* argv[])
}
cout << "Connected." << endl;
// Playback
float fSeconds = 20.0f; // 15min
float fSeconds = 10.0f; // 15min
cout << "Playback started, waiting " << fSeconds << " seconds" << endl;
ITAPA.Sleep( fSeconds ); // blocking
cout << "Done." << endl;
......
%% Einlesen der Logs
close all;
clear all;
ChannelVec = [2];
BlockSize = '1024';
NetAudioLogClient = dir(['NetAudioLogClient_BS' BlockSize '*.txt']);
NetAudioLogClient = {NetAudioLogClient.name};
NetAudioLogClientTab = readtable(NetAudioLogClient{1}, 'FileType', 'text', 'Delimiter', '\t');
minTime = NetAudioLogClientTab.WorldTimeStamp(1);
maxTime = NetAudioLogClientTab.WorldTimeStamp(end);
for k=2:numel(NetAudioLogClient)
temp = readtable(NetAudioLogClient{k}, 'FileType', 'text', 'Delimiter', '\t');
NetAudioLogClientTab = [NetAudioLogClientTab; temp];
minTime = min(minTime, temp.WorldTimeStamp(1));
maxTime = max(maxTime, temp.WorldTimeStamp(end));
end
NetAudioLogStream = dir(['NetAudioLogStream_BS' BlockSize '*.txt']);
NetAudioLogStream = {NetAudioLogStream.name};
NetAudioLogStreamTab = readtable(NetAudioLogStream{1}, 'FileType', 'text', 'Delimiter', '\t');
for k=2:numel(NetAudioLogStream)
temp = readtable(NetAudioLogStream{k}, 'FileType', 'text', 'Delimiter', '\t');
NetAudioLogStreamTab = [NetAudioLogStreamTab; temp];
end
NetAudioLogBaseData = dir(['NetAudioLogBaseData_BS' BlockSize '*.txt']);
NetAudioLogBaseData = {NetAudioLogBaseData.name};
NetAudioLogBaseData = readtable(NetAudioLogBaseData{1}, 'FileType', 'text', 'Delimiter', '\t');
%% Berechne Underruns
TimeStream = NetAudioLogStreamTab.WorldTimeStamp - minTime;
TimeState = [TimeStream NetAudioLogStreamTab.StreamingStatus];
TimeUnderrun = TimeState(find(TimeState(:,2)==3), 1);
TimeUnderrun = sortrows(TimeUnderrun, 1);
%% Save Base Data
Channel = NetAudioLogBaseData.Channel(1);
SampleRate = NetAudioLogBaseData.Samplerate(1);
BufferSize = NetAudioLogBaseData.BufferSize(1);
RingBufferSize = NetAudioLogBaseData.RingBufferSize(1);
TargetSampleLatency = NetAudioLogBaseData.TargetSampleLatency(1);
%% Calculate Latency
DiffTime = diff(NetAudioLogClientTab.WorldTimeStamp * 1000);
DiffTime = [NetAudioLogClientTab.WorldTimeStamp(2:end) - minTime DiffTime NetAudioLogClientTab.ProtocolStatus(2:end) NetAudioLogClientTab.Channel(2:end)];
LatenzWaiting = DiffTime(find(DiffTime(:,3)==221), (1:4));
LatenzRunnning = DiffTime(find(DiffTime(:,3)==222), (1:4));
LatenzRunnning = sortrows(LatenzRunnning,1);
%% Get Anzahl Dropouts
plotMean = ChannelVec;
AnzUnderrun = ChannelVec;
channel = [];
latenz = [];
for k = ChannelVec
plotTime = LatenzRunnning(find(LatenzRunnning(:,4)==k), 1);
plotLatency = LatenzRunnning(find(LatenzRunnning(:,4)==k), 2);
plotChannel = LatenzRunnning(find(LatenzRunnning(:,4)==k), 4);
plotMean(k) = round(mean(plotLatency(2:end)),3);
underruns = TimeUnderrun < plotTime(end) & TimeUnderrun > plotTime(1);
AnzUnderrun(k) = sum(underruns);
end
%% Plot Anzahl der Underruns
plot(AnzUnderrun(:,1), AnzUnderrun(:,2), '*')
title(['Anzahl der Underruns bei x Kanlen'])
xlabel('Anzahl der Kanle')
ylabel('Anzahl der Underruns')
\ No newline at end of file
%% Einlesen der Logs
close all;
clear all;
NetAudioLogNet = readtable( 'NetAudioLogNet.txt', 'FileType', 'text', 'Delimiter', '\t');
NetAudioLogStream = readtable( 'NetAudioLogStream.txt', 'FileType', 'text', 'Delimiter', '\t')
NetAudioLogClient = readtable( 'NetAudioLogClient.txt', 'FileType', 'text', 'Delimiter', '\t' );
NetAudioLogBaseData = readtable( 'NetAudioLogBaseData.txt', 'FileType', 'text', 'Delimiter', '\t' );
NetAudioLogNet = readtable( 'NetAudioLogNet_BS1024_Ch2.txt', 'FileType', 'text', 'Delimiter', '\t');
NetAudioLogStream = readtable( 'NetAudioLogStream_BS1024_Ch2.txt', 'FileType', 'text', 'Delimiter', '\t')
NetAudioLogClient = readtable( 'NetAudioLogClient_BS1024_Ch2.txt', 'FileType', 'text', 'Delimiter', '\t' );
NetAudioLogBaseData = readtable( 'NetAudioLogBaseData_BS1024_Ch2.txt', 'FileType', 'text', 'Delimiter', '\t' );
% Save Base Data
Channel = NetAudioLogBaseData.Channel(1);
......
%% Einlesen der Logs
close all;
clear all;
ChannelVec = [2];
BlockSize = '1024';
NetAudioLogClient = dir(['NetAudioLogClient_BS' BlockSize '*.txt']);
NetAudioLogClient = {NetAudioLogClient.name};
NetAudioLogClientTab = readtable(NetAudioLogClient{1}, 'FileType', 'text', 'Delimiter', '\t');
minTime = NetAudioLogClientTab.WorldTimeStamp(1);
maxTime = NetAudioLogClientTab.WorldTimeStamp(end);
for k=2:numel(NetAudioLogClient)
temp = readtable(NetAudioLogClient{k}, 'FileType', 'text', 'Delimiter', '\t');
NetAudioLogClientTab = [NetAudioLogClientTab; temp];
minTime = min(minTime, temp.WorldTimeStamp(1));
maxTime = max(maxTime, temp.WorldTimeStamp(end));
end
NetAudioLogStream = dir(['NetAudioLogStream_BS' BlockSize '*.txt']);
NetAudioLogStream = {NetAudioLogStream.name};
NetAudioLogStreamTab = readtable(NetAudioLogStream{1}, 'FileType', 'text', 'Delimiter', '\t');
for k=2:numel(NetAudioLogStream)
temp = readtable(NetAudioLogStream{k}, 'FileType', 'text', 'Delimiter', '\t');
NetAudioLogStreamTab = [NetAudioLogStreamTab; temp];
end
NetAudioLogBaseData = dir(['NetAudioLogBaseData_BS' BlockSize '*.txt']);
NetAudioLogBaseData = {NetAudioLogBaseData.name};
NetAudioLogBaseData = readtable(NetAudioLogBaseData{1}, 'FileType', 'text', 'Delimiter', '\t');
%% Berechne Underruns
TimeStream = NetAudioLogStreamTab.WorldTimeStamp - minTime;
TimeState = [TimeStream NetAudioLogStreamTab.StreamingStatus];
TimeUnderrun = TimeState(find(TimeState(:,2)==3), 1);
TimeUnderrun = sortrows(TimeUnderrun, 1);
%% Save Base Data
Channel = NetAudioLogBaseData.Channel(1);
SampleRate = NetAudioLogBaseData.Samplerate(1);
BufferSize = NetAudioLogBaseData.BufferSize(1);
RingBufferSize = NetAudioLogBaseData.RingBufferSize(1);
TargetSampleLatency = NetAudioLogBaseData.TargetSampleLatency(1);
%% Calculate Latency
DiffTime = diff(NetAudioLogClientTab.WorldTimeStamp * 1000);
DiffTime = [NetAudioLogClientTab.WorldTimeStamp(2:end) - minTime DiffTime NetAudioLogClientTab.ProtocolStatus(2:end) NetAudioLogClientTab.Channel(2:end)];
LatenzWaiting = DiffTime(find(DiffTime(:,3)==221), (1:4));
LatenzRunnning = DiffTime(find(DiffTime(:,3)==222), (1:4));
LatenzRunnning = sortrows(LatenzRunnning,1);
%% Plot Latency
plotMean = ChannelVec;
AnzUnderrun = ChannelVec;
channel = [];
latenz = [];
for k = ChannelVec
plotTime = LatenzRunnning(find(LatenzRunnning(:,4)==k), 1);
plotLatency = LatenzRunnning(find(LatenzRunnning(:,4)==k), 2);
plotChannel = LatenzRunnning(find(LatenzRunnning(:,4)==k), 4);
channel = [channel; plotChannel(2:end)];
latenz = [latenz; plotLatency(2:end) ];
end
boxplot(latenz,channel)
sollLatenz = (BufferSize / SampleRate) * 1000;
Llang{21} = ['Grenz Latenz (' num2str(sollLatenz) 'ms)'];
Llang{22} = ['Underruns'];
Lkurz{21} = ['Grenz Latenz'];
Lkurz{22} = ['Underruns'];
Durchsatz = [num2str((32 * SampleRate * Channel)/1000) ' kbit/s'];
title(['Latenz pro Block (' num2str(BufferSize) ' Samples)'])
xlabel('Anzahl der Channel')
ylabel('Latenz in ms')
legend('show')
name = ['Latency' num2str(BufferSize) ' ' num2str(RingBufferSize) ' - ' num2str(Channel)];
\ No newline at end of file
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