Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
ITADataSources
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Institute of Technical Acoustics (ITA)
ITADataSources
Commits
a37247be
Commit
a37247be
authored
Feb 17, 2017
by
Anne Heimes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
für 32 bit + serverLog update + bugfix ReadMessage
parent
eac2e0db
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
234 additions
and
220 deletions
+234
-220
src/ITANetAudioMessage.cpp
src/ITANetAudioMessage.cpp
+7
-3
src/ITANetAudioStreamingClient.cpp
src/ITANetAudioStreamingClient.cpp
+179
-179
tests/NetAudio/CMakeLists.txt
tests/NetAudio/CMakeLists.txt
+2
-2
tests/NetAudio/ITANetAudioStreamingClientTest.cpp
tests/NetAudio/ITANetAudioStreamingClientTest.cpp
+0
-7
tests/NetAudio/NatLogUnderruns.m
tests/NetAudio/NatLogUnderruns.m
+1
-1
tests/NetAudio/NetAudioLog.m
tests/NetAudio/NetAudioLog.m
+4
-4
tests/NetAudio/NetAudioServerLog.m
tests/NetAudio/NetAudioServerLog.m
+41
-24
No files found.
src/ITANetAudioMessage.cpp
View file @
a37247be
...
...
@@ -124,6 +124,7 @@ bool CITANetAudioMessage::ReadMessage( int timeout)
if
(
nIncomingBytes
==
-
1
)
return
false
;
if
(
timeout
!=
0
)
nIncomingBytes
=
m_pConnection
->
WaitForIncomingData
(
0
);
#if NET_AUDIO_SHOW_TRAFFIC
vstr
::
out
()
<<
"CITANetAudioMessage [ Reading ] "
<<
nIncomingBytes
<<
" bytes incoming"
<<
std
::
endl
;
...
...
@@ -135,8 +136,10 @@ bool CITANetAudioMessage::ReadMessage( int timeout)
#if NET_AUDIO_SHOW_TRAFFIC
vstr
::
out
()
<<
"CITANetAudioMessage [ Reading ] Expecting "
<<
nMessagePayloadSize
<<
" bytes message payload"
<<
std
::
endl
;
#endif
if
(
nMessagePayloadSize
<=
2
*
sizeof
(
VistaType
::
sint32
))
int
i
=
34
;
// we need at least the two protocol ints
assert
(
nMessagePayloadSize
>=
2
*
sizeof
(
VistaType
::
sint32
)
);
//
assert( nMessagePayloadSize >= 2 * sizeof( VistaType::sint32 ) );
if
(
nMessagePayloadSize
>
(
int
)
m_vecIncomingBuffer
.
size
()
)
m_vecIncomingBuffer
.
resize
(
nMessagePayloadSize
);
...
...
@@ -165,6 +168,7 @@ bool CITANetAudioMessage::ReadMessage( int timeout)
#if NET_AUDIO_SHOW_TRAFFIC
vstr
::
out
()
<<
"CITANetAudioMessage [ Reading ] Finished receiving "
<<
m_nMessageType
<<
" (id="
<<
std
::
setw
(
4
)
<<
m_nMessageId
<<
")"
<<
std
::
endl
;
#endif
return
true
;
}
int
CITANetAudioMessage
::
GetMessageType
()
const
...
...
src/ITANetAudioStreamingClient.cpp
View file @
a37247be
tests/NetAudio/CMakeLists.txt
View file @
a37247be
...
...
@@ -72,10 +72,10 @@ vista_install_all_dlls( bin )
set_property
(
TARGET ITANetAudioTest PROPERTY FOLDER
"ITACoreLibs/Tests/ITADataSources/NetAudio"
)
if
(
NOT DEFINED ITA_NETAUDIO_SERVER_WITH_TESTS
)
set
(
ITA_NETAUDIO_SERVER_WITH_TESTS
"default value"
CACHE STRING
"localhost 12480 44100
1024
2"
)
set
(
ITA_NETAUDIO_SERVER_WITH_TESTS
"default value"
CACHE STRING
"localhost 12480 44100
32
2"
)
endif
(
)
if
(
NOT DEFINED ITA_NETAUDIO_CLIENT_WITH_TESTS
)
set
(
ITA_NETAUDIO_CLIENT_WITH_TESTS
"default value"
CACHE STRING
"localhost 12480 44100
1024 2 1024
"
)
set
(
ITA_NETAUDIO_CLIENT_WITH_TESTS
"default value"
CACHE STRING
"localhost 12480 44100
32 2 3200
"
)
endif
(
)
vista_set_target_msvc_arguments
(
ITANetAudioStreamingPortaudioClientTest ITA_NETAUDIO_CLIENT_WITH_TESTS
)
...
...
tests/NetAudio/ITANetAudioStreamingClientTest.cpp
View file @
a37247be
...
...
@@ -18,13 +18,6 @@ int main(int argc, char* argv[])
if
(
argc
!=
7
)
{
cout
<<
"argc = "
<<
argc
<<
endl
;
cout
<<
"sServerName = "
<<
argv
[
1
]
<<
endl
;
cout
<<
"iServerPort = "
<<
argv
[
2
]
<<
endl
;
cout
<<
"dSampleRate = "
<<
argv
[
3
]
<<
endl
;
cout
<<
"iBlockLength = "
<<
argv
[
4
]
<<
endl
;
cout
<<
"iChannels = "
<<
argv
[
5
]
<<
endl
;
cout
<<
"iBufferSize = "
<<
argv
[
6
]
<<
endl
;
fprintf
(
stderr
,
"Fehler: Syntax = ServerName ServerPort SampleRate BufferSize Channel RingBufferSize!
\n
"
);
}
...
...
tests/NetAudio/NatLogUnderruns.m
View file @
a37247be
...
...
@@ -2,7 +2,7 @@
close
all
;
clear
all
;
ChannelVec
=
[
2
];
BlockSize
=
'
1024
'
;
BlockSize
=
'
32
'
;
NetAudioLogClient
=
dir
([
'NetAudioLogClient_BS'
BlockSize
'*.txt'
]);
NetAudioLogClient
=
{
NetAudioLogClient
.
name
};
NetAudioLogClientTab
=
readtable
(
NetAudioLogClient
{
1
},
'FileType'
,
'text'
,
'Delimiter'
,
'\t'
);
...
...
tests/NetAudio/NetAudioLog.m
View file @
a37247be
%% Einlesen der Logs
close
all
;
clear
all
;
NetAudioLogNet
=
readtable
(
'NetAudioLogNet_BS
1024
_Ch2.txt'
,
'FileType'
,
'text'
,
'Delimiter'
,
'\t'
);
NetAudioLogStream
=
readtable
(
'NetAudioLogStream_BS
1024
_Ch2.txt'
,
'FileType'
,
'text'
,
'Delimiter'
,
'\t'
)
NetAudioLogClient
=
readtable
(
'NetAudioLogClient_BS
1024
_Ch2.txt'
,
'FileType'
,
'text'
,
'Delimiter'
,
'\t'
);
NetAudioLogBaseData
=
readtable
(
'NetAudioLogBaseData_BS
1024
_Ch2.txt'
,
'FileType'
,
'text'
,
'Delimiter'
,
'\t'
);
NetAudioLogNet
=
readtable
(
'NetAudioLogNet_BS
32
_Ch2.txt'
,
'FileType'
,
'text'
,
'Delimiter'
,
'\t'
);
NetAudioLogStream
=
readtable
(
'NetAudioLogStream_BS
32
_Ch2.txt'
,
'FileType'
,
'text'
,
'Delimiter'
,
'\t'
)
NetAudioLogClient
=
readtable
(
'NetAudioLogClient_BS
32
_Ch2.txt'
,
'FileType'
,
'text'
,
'Delimiter'
,
'\t'
);
NetAudioLogBaseData
=
readtable
(
'NetAudioLogBaseData_BS
32
_Ch2.txt'
,
'FileType'
,
'text'
,
'Delimiter'
,
'\t'
);
% Save Base Data
Channel
=
NetAudioLogBaseData
.
Channel
(
1
);
...
...
tests/NetAudio/NetAudioServerLog.m
View file @
a37247be
%% Einlesen der Logs
close
all
;
clear
all
;
BlockSize
=
'
1024
'
;
BlockSize
=
'
32
'
;
NetAudioLogServer
=
dir
([
'NetAudioLogServer_BS'
BlockSize
'*.txt'
]);
NetAudioLogServer
=
{
NetAudioLogServer
.
name
};
NetAudioLogServerTab
=
readtable
(
NetAudioLogServer
{
1
},
'FileType'
,
'text'
,
'Delimiter'
,
'\t'
);
...
...
@@ -18,34 +18,51 @@ for k=2:numel(NetAudioLogServer)
end
NetAudioLogServerTab
.
WorldTimeStamp
=
NetAudioLogServerTab
.
WorldTimeStamp
-
minTime
;
%
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
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
%% Protocolstatus ersetzten
Protocol
=
{
'100'
,
'NP
_CLIENT_
OPEN'
;
...
'101'
,
'NP
_CLIENT_
CLOSE'
;
...
'111'
,
'NP
_CLIENT_SENDING_RINGBUFFER_FREE_
SAMPLES'
;
...
'200'
,
'NP
_SERVER_
OPEN'
;
...
'201'
,
'NP
_SERVER_
CLOSE'
;
...
'211'
,
'NP
_SERVER_GET_RINGBUFFER_FREE_
SAMPLES'
;
...
'222'
,
'NP
_SERVER_SENDING_
SAMPLES'
};
Protocol
=
{
'100'
,
'NP
CLIENT
OPEN'
;
...
'101'
,
'NP
CLIENT
CLOSE'
;
...
'111'
,
'NP
CLIENT SENDING RINGBUFFER FREE
SAMPLES'
;
...
'200'
,
'NP
SERVER
OPEN'
;
...
'201'
,
'NP
SERVER
CLOSE'
;
...
'211'
,
'NP
SERVER GET RINGBUFFER FREE
SAMPLES'
;
...
'222'
,
'NP
SERVER SENDING
SAMPLES'
};
%NumPro = zeros(size(NetAudioLogServerTab.ProtocolStatus));
for
k
=
(
1
:
size
(
Protocol
,
1
))
%NumPro( NetAudioLogServerTab.ProtocolStatus == 211) = 'NP_SERVER_GET_RINGBUFFER_FREE_SAMPLES';
end
Time100
=
NetAudioLogServerTab
.
WorldTimeStamp
(
find
(
NetAudioLogServerTab
.
ProtocolStatus
==
100
));
Time101
=
NetAudioLogServerTab
.
WorldTimeStamp
(
find
(
NetAudioLogServerTab
.
ProtocolStatus
==
101
));
Time111
=
NetAudioLogServerTab
.
WorldTimeStamp
(
find
(
NetAudioLogServerTab
.
ProtocolStatus
==
111
));
Time200
=
NetAudioLogServerTab
.
WorldTimeStamp
(
find
(
NetAudioLogServerTab
.
ProtocolStatus
==
200
));
Time201
=
NetAudioLogServerTab
.
WorldTimeStamp
(
find
(
NetAudioLogServerTab
.
ProtocolStatus
==
201
));
Time211
=
NetAudioLogServerTab
.
WorldTimeStamp
(
find
(
NetAudioLogServerTab
.
ProtocolStatus
==
211
));
Time222
=
NetAudioLogServerTab
.
WorldTimeStamp
(
find
(
NetAudioLogServerTab
.
ProtocolStatus
==
222
));
Time
=
{
Time100
Time101
Time111
Time200
Time201
Time211
Time222
};
%% Plot Protocol
plot
(
NetAudioLogServerTab
.
WorldTimeStamp
,
NetAudioLogServerTab
.
ProtocolStatus
)
%
plot(NetAudioLogServerTab.WorldTimeStamp, NetAudioLogServerTab.ProtocolStatus)
hold
on
;
%plot(NetAudioLogServerTab.WorldTimeStamp, NetAudioLogServerTab.FreeSamples)
plot
(
NetAudioLogServerTab
.
WorldTimeStamp
,
NetAudioLogServerTab
.
FreeSamples
)
legende
=
{};
legende
{
1
}
=
'Freie Samples'
;
i
=
2
;
for
k
=
(
1
:
7
)
if
size
(
Time
{
k
},
1
)
~=
0
plot
(
Time
{
k
},
k
*
100
*
ones
(
size
(
Time
{
k
})),
'.'
)
legende
{
i
}
=
Protocol
{
k
,
2
};
i
=
i
+
1
;
end
end
legend
(
legende
);
legend
(
'show'
);
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment