Commit a839b645 authored by Anne Heimes's avatar Anne Heimes

bugixes, running new protocol 2

parent e378f4a8
......@@ -104,6 +104,9 @@ private:
std::vector< VistaType::byte > m_vecIncomingBuffer; // Net IO buffer
VistaConnectionIP* m_pConnection;
//DEBUG
int i;
};
#endif // INCLUDE_WATCHER_ITA_NET_AUDIO_MESSAGE
......@@ -141,11 +141,6 @@ bool CITANetAudioMessage::ReadMessage( int timeout)
// we need at least the two protocol ints
//assert( nMessagePayloadSize >= 2 * sizeof( VistaType::sint32 ) );
if (nMessagePayloadSize > 26000)
{
int i = 0;
}
if( nMessagePayloadSize > ( int ) m_vecIncomingBuffer.size() )
m_vecIncomingBuffer.resize( nMessagePayloadSize );
......@@ -363,7 +358,6 @@ void CITANetAudioMessage::ReadSampleFrame( ITASampleFrame* pSampleFrame )
{
int iChannels = ReadInt();
int iSamples = ReadInt();
if( pSampleFrame->channels() != iChannels || pSampleFrame->GetLength() != iSamples )
pSampleFrame->init( iChannels, iSamples, false );
......
......@@ -139,15 +139,16 @@ bool CITANetAudioStreamingClient::LoopBody()
m_pMessage->ReadSampleFrame( &m_sfReceivingBuffer );
if ( m_pStream->GetRingBufferFreeSamples( ) >= m_sfReceivingBuffer.GetLength( ) )
m_pStream->Transmit( m_sfReceivingBuffer, m_sfReceivingBuffer.GetLength( ) );
//else
// Fehler
m_pStream->Transmit(m_sfReceivingBuffer, m_sfReceivingBuffer.GetLength());
#ifdef NET_AUDIO_SHOW_TRAFFIC
vstr::out() << "[ITANetAudioStreamingClient] Recived " << m_sfReceivingBuffer.GetLength() << " samples" << std::endl;
#endif
break;
case CITANetAudioProtocol::NP_SERVER_GET_RINGBUFFER_FREE_SAMPLES:
m_pMessage->ReadBool();
m_pMessage->SetMessageType( CITANetAudioProtocol::NP_CLIENT_SENDING_RINGBUFFER_FREE_SAMPLES );
m_pMessage->WriteInt( m_pStream->GetRingBufferFreeSamples( ) );
m_pMessage->WriteMessage( );
m_pMessage->WriteMessage();
break;
case CITANetAudioProtocol::NP_SERVER_CLOSE:
Disconnect( );
......
......@@ -32,7 +32,7 @@ int main(int argc, char* argv[])
cout << "Channel " << iChannels << endl;
CITANetAudioStream oNetAudioStream(iChannels, dSampleRate, iBlockLength, 1 * iBufferSize);
/*
ITAStreamPatchbay oPatchbay(dSampleRate, iBlockLength);
oPatchbay.AddInput( &oNetAudioStream );
int iOutputID = oPatchbay.AddOutput( 2 );
......@@ -40,8 +40,8 @@ int main(int argc, char* argv[])
int N = int( oNetAudioStream.GetNumberOfChannels( ) );
for ( int i = 0; i < N; i++ )
oPatchbay.ConnectChannels( 0, i, 0, i % 2, 1 / double( N ) );
*/
//ITAStreamProbe oProbe( oPatchbay.GetOutputDatasource( iOutputID ), "ITANetAudioTest.stream.wav" );
ITAStreamProbe oProbe( oPatchbay.GetOutputDatasource( iOutputID ), "ITANetAudioTest.stream.wav" );
ITAsioInitializeLibrary();
......@@ -90,7 +90,7 @@ int main(int argc, char* argv[])
}
ITAsioSetPlaybackDatasource( &oNetAudioStream );
ITAsioSetPlaybackDatasource(&oProbe);
if (ITAsioStart() != ASE_OK) {
ITAsioFinalizeLibrary();
......
......@@ -63,39 +63,51 @@ TimeServer = {Time100 Time101 Time111 Time200 Time201 Time211 Time222};
%% Plot Protocol
%plot(NetAudioLogServerTab.WorldTimeStamp, NetAudioLogServerTab.ProtocolStatus)
plots1 = {};
plots2 = {};
subplot(2,2,1:2)
%subplot(2,2,1:4)
plot(NetAudioLogServerTab.WorldTimeStamp, NetAudioLogServerTab.FreeSamples)
plots1{1} = plot([10 0],[3200 3200]);
hold on
%subplot(2,2,3:4)
%plot(NetAudioLogClientTab.WorldTimeStamp, NetAudioLogClientTab.FreeSamples)
plots1{2} = plot(NetAudioLogServerTab.WorldTimeStamp, NetAudioLogServerTab.FreeSamples, '-*');
subplot(2,2,3:4)
maxSamples = 3200;
plots2{1} = plot([10 0],[3200 3200]);
hold on;
plots2{2} = plot(NetAudioLogClientTab.WorldTimeStamp, NetAudioLogClientTab.FreeSamples, '-*');
legendeServer = {};
legendeClient = {};
legendeServer{1} = 'Freie Samples Server';
legendeClient{1} = 'Freie Samples Client';
legendeServer{1} = 'Maximal Freie Samples';
legendeServer{2} = 'Freie Samples Server';
legendeClient{1} = 'Maximal Freie Samples';
legendeClient{2} = 'Freie Samples Client';
i = 2;
j = 2;
i = 3;
j = 3;
for k = (1:7)
if size(TimeServer{k}, 1) ~= 0
%subplot(2,2,1:4)
plot(TimeServer{k}, ones(size(TimeServer{k})),'.')
subplot(2,2,1:2)
plots1{i} = plot(TimeServer{k}, ones(size(TimeServer{k})),'.');
legendeServer{i} = Protocol{k,2};
i = i + 1;
end
if size(TimeClient{k}, 1) ~= 0
%subplot(2,2,3:4)
%plot(TimeClient{k}, ones(size(TimeClient{k})),'.')
legendeClient{i} = Protocol{k,2};
subplot(2,2,3:4)
p = 1;
if k == 3
p = 1500;
end
plots2{j} = plot(TimeClient{k}, ones(size(TimeClient{k})),'.');
legendeClient{j} = Protocol{k,2};
j = j + 1;
end
end
%subplot(2,2,1:2)
subplot(2,2,1:2)
title(['Protokolstatus Server'])
xlabel('Zeit in s')
legend(legendeServer);
%subplot(2,2,3:4)
%title(['Protokolstatus Client'])
%xlabel('Zeit in s')
%legend(legendeClient);
legend([plots1, plots2], {legendeServer, legendeClient});
subplot(2,2,3:4)
title(['Protokolstatus Client'])
xlabel('Zeit in s')
legend('show');
\ 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