Commit a839b645 authored by Anne Heimes's avatar Anne Heimes

bugixes, running new protocol 2

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