-
-
Notifications
You must be signed in to change notification settings - Fork 230
Preparation for E2E latency tuning #786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
bc3295d to
99c8903
Compare
a475567 to
5e85289
Compare
|
🤖 The latest upstream change made this pull request unmergeable. Please resolve the merge conflicts. |
gavv
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, this is big.
I like the approach you use for RTS (set early when possible, set later as a fallback).
src/internal_modules/roc_netio/target_libuv/roc_netio/network_loop.cpp
Outdated
Show resolved
Hide resolved
| if ((code = repair_endpoint_->pull_packets(0)) != status::StatusOK) { | ||
| return code; | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as for receiver slot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I support your thought, but it will make pipeline tests dependent on real-time speed.
So far, LatencyMonitor calls core::timestamp(core::ClockUnix) when it computes latency_metrics_.niq_stalling. If we will set receive timestamp on all passing packets (which is your proposition here), we could not tell the difference between test and real use scenario. In order to pass these tests, I've set base_cts to current timestamp:
diff --git a/src/tests/roc_pipeline/test_loopback_sink_2_source.cpp b/src/tests/roc_pipeline/test_loopback_sink_2_source.cpp
index 4c47930e..2d7e188c 100644
--- a/src/tests/roc_pipeline/test_loopback_sink_2_source.cpp
+++ b/src/tests/roc_pipeline/test_loopback_sink_2_source.cpp
@@ -569,7 +569,7 @@ void send_receive(int flags,
core::nanoseconds_t virtual_e2e_latency = 0;
if (flags & FlagCTS) {
- send_base_cts = 1000000000000000;
+ send_base_cts = core::timestamp(core::ClockUnix);
virtual_e2e_latency = core::Millisecond * 100;
}In receiver_source test latency_lower_bound I had to do the same.
Please, take a look onto 6bd629e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, I propose to hold this change, until (if) we decide to introduce mock for core::timestamp(...) in pipeline tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see. That's not good but I agree that it's outside of scope of this PR. I'll try to take a look at it later, will add it to my todo. Let's follow your proposal then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've reverted these changes for the time being
| if ((code = repair_endpoint_->pull_packets(0)) != status::StatusOK) { | ||
| return code; | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since current_time is used only as a fallback when RTS isn't set, we can safely pass it to all calls I guess? Because why not to guarantee RTS for source and repair packets as well.
| , last_report_ts_(0) | ||
| , dumper_(dumper) | ||
| , rtt_stats_(arena, 15, 0.5) | ||
| , clock_offset_stats_(arena, 100, 0.5) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make this constants to be RttConfig fields with default values.
| } | ||
|
|
||
| // Same, but there is a persistent clock drift between sender and receiver | ||
| TEST(communicator, rtt_clock_drift) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this test doesn't work due to smoothing of RTT, then we can disable smoothing specifically in this test by setting RttConfig fields (in some comment above I suggested to move smoothing settings to config).
|
In Since it's receive timestamp, it has meaning only when we're "delivering" packet to a communicator (and it should correspond to it's "local" time). But in cases when we're reading packet just to inspect it and throw away, timestamp is not actually used and specifying it looks confusing IMHO. Diff below removes timestamps that are not needed. diff --git a/src/tests/roc_rtcp/test_communicator.cpp b/src/tests/roc_rtcp/test_communicator.cpp
index fbe1e0d5..227dd902 100644
--- a/src/tests/roc_rtcp/test_communicator.cpp
+++ b/src/tests/roc_rtcp/test_communicator.cpp
@@ -3107,7 +3107,7 @@ TEST(communicator, report_to_address_sender) {
CHECK_EQUAL(1, send_comm.total_destinations());
CHECK_EQUAL(1, send_queue.size());
- pp = read_packet(send_queue, send_time);
+ pp = read_packet(send_queue);
expect_has_dest_address(pp, send_dest_addr);
expect_has_orig_ssrc(pp, SendSsrc, true);
expect_has_dest_ssrc(pp, Recv1Ssrc, true);
@@ -3279,7 +3279,7 @@ TEST(communicator, report_back_sender) {
CHECK_EQUAL(1, send_comm.total_destinations());
CHECK_EQUAL(1, send_queue.size());
- pp = read_packet(send_queue, send_time);
+ pp = read_packet(send_queue);
expect_has_dest_address(pp, recv1_addr);
expect_has_orig_ssrc(pp, SendSsrc, true);
expect_has_dest_ssrc(pp, Recv1Ssrc, true);
@@ -3320,13 +3320,13 @@ TEST(communicator, report_back_sender) {
CHECK_EQUAL(2, send_comm.total_destinations());
CHECK_EQUAL(2, send_queue.size());
- pp = read_packet(send_queue, send_time);
+ pp = read_packet(send_queue);
expect_has_dest_address(pp, recv1_addr);
expect_has_orig_ssrc(pp, SendSsrc, true);
expect_has_dest_ssrc(pp, Recv1Ssrc, true);
expect_has_dest_ssrc(pp, Recv2Ssrc, false);
- pp = read_packet(send_queue, send_time);
+ pp = read_packet(send_queue);
expect_has_dest_address(pp, recv2_addr);
expect_has_orig_ssrc(pp, SendSsrc, true);
expect_has_dest_ssrc(pp, Recv1Ssrc, false);
@@ -3423,7 +3423,7 @@ TEST(communicator, report_back_receiver) {
CHECK_EQUAL(1, recv_comm.total_destinations());
CHECK_EQUAL(1, recv_queue.size());
- pp = read_packet(recv_queue, send1_time);
+ pp = read_packet(recv_queue);
expect_has_dest_address(pp, send1_addr);
expect_has_orig_ssrc(pp, RecvSsrc, true);
expect_has_dest_ssrc(pp, Send1Ssrc, true);
@@ -3469,13 +3469,13 @@ TEST(communicator, report_back_receiver) {
CHECK_EQUAL(2, recv_comm.total_destinations());
CHECK_EQUAL(2, recv_queue.size());
- pp = read_packet(recv_queue, recv_time);
+ pp = read_packet(recv_queue);
expect_has_dest_address(pp, send1_addr);
expect_has_orig_ssrc(pp, RecvSsrc, true);
expect_has_dest_ssrc(pp, Send1Ssrc, true);
expect_has_dest_ssrc(pp, Send2Ssrc, false);
- pp = read_packet(recv_queue, recv_time);
+ pp = read_packet(recv_queue);
expect_has_dest_address(pp, send2_addr);
expect_has_orig_ssrc(pp, RecvSsrc, true);
expect_has_dest_ssrc(pp, Send1Ssrc, false);
@@ -3606,14 +3606,14 @@ TEST(communicator, report_back_combine_reports) {
CHECK_EQUAL(2, recv_comm.total_destinations());
CHECK_EQUAL(2, recv_queue.size());
- pp = read_packet(recv_queue, send3_time);
+ pp = read_packet(recv_queue);
expect_has_dest_address(pp, send1_addr);
expect_has_orig_ssrc(pp, RecvSsrc, true);
expect_has_dest_ssrc(pp, Send1Ssrc, true);
expect_has_dest_ssrc(pp, Send2Ssrc, true);
expect_has_dest_ssrc(pp, Send3Ssrc, false);
- pp = read_packet(recv_queue, send3_time);
+ pp = read_packet(recv_queue);
expect_has_dest_address(pp, send3_addr);
expect_has_orig_ssrc(pp, RecvSsrc, true);
expect_has_dest_ssrc(pp, Send1Ssrc, false);
@@ -4269,7 +4269,7 @@ TEST(communicator, rtt_network_reordering) {
recv_reorder_countdown = ReorderBurst;
}
recv_reorder_countdown--;
- packet::PacketPtr pp = read_packet(recv_queue, recv_time);
+ packet::PacketPtr pp = read_packet(recv_queue);
recv_packet_stash.push_back(*pp);
} |
7837ebe to
6bd629e
Compare
20a7b7a to
40c5dd5
Compare
|
🤖 The latest upstream change made this pull request unmergeable. Please resolve the merge conflicts. |
40c5dd5 to
75a91d8
Compare
In order to be able to tune receiver's latency relying on timestamp mapping that we get from RTCP feedback, and UDP::Receive_timestamp, adding these features: * roc-streaminggh-674: Use receive timestamp (RTS) as report time when processing RTCP report; * RTT dumping for debugging (csvplotter ts_offset branch); * SCHED_RR for network io thread (run with root privs).
src/tests/public_api/test_context.cpp src/tests/public_api/test_plugin_plc.cpp src/tests/public_api/test_sender.cpp src/tests/public_api/test_sender_encoder.cpp src/tests/public_api/test_version.cpp
c429757 to
d0f9d22
Compare
9a4fbfd to
516ed74
Compare
516ed74 to
e211975
Compare
|
🤖 Pull request is currently unmergeable due to conflicts. |
In order to be able to tune receiver's latency
relying on timestamp mapping that we get from
RTCP feedback, and UDP::Receive_timestamp,
adding these features:
RTCP improvements #674: Use receive timestamp (RTS) as report time when processing RTCP report;
RTT dumping for debugging (csvplotter ts_offset branch);
SCHED_RR for network io thread (run with root privs).