Skip to content
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

[core] Fixed group recv read-ready check. #2938

Merged
merged 3 commits into from
Apr 30, 2024

Conversation

maxsharabayko
Copy link
Collaborator

The CUDTGroup::recv_WaitForReadReady(..) function forms the list of read-ready member sockets.
If a socket was not signaled as read-ready, its receiver buffer is still checked using the CRcvBuffer::isRcvDataReady(..) function. The first mistake is that the current time is not provided as an argument, so it always returns false when TSBPD mode is enabled.
Providing the current time greately redeces false drops of packets by a group (in the test setup described in #2937), but still occasional drop happens sometimes.
Therefore a member socket is instead checked for the existence of the very next packet to read.

Fixes #2937.

@maxsharabayko maxsharabayko added Type: Bug Indicates an unexpected problem or unintended behavior [core] Area: Changes in SRT library core labels Apr 22, 2024
@maxsharabayko maxsharabayko added this to the v1.5.4 milestone Apr 22, 2024
@maxsharabayko
Copy link
Collaborator Author

maxsharabayko commented Apr 24, 2024

Some drops still occur. The time base of members is not 100% in sync, e.g. 3 ms difference in this log.

17:35:04.490000/T25804.N:SRT.br: DRIFT=-3061.000000us AVG=-3.076ms, TB: 8D 22:36:47.203323500 [STDY] EXCESS: 0.000000us UPDATED TO: 
8D 22:36:47.203323500 [STDY]
...
17:28:01.500000/T42308.N:SRT.ts: @1030351480: tsbpd: PLAYING PACKET seq=1321308536 (belated 2ms)
17:28:01.501000/T42308.N:SRT.ts: @1030351480: tsbpd: no data, scheduling wakeup at ack
17:28:01.501000/T16940.N:SRT.gr: group/recv: 1 RDY: @1030351480:[R] 
17:28:01.501000/T42308.N:SRT.ts: @1030351480: tsbpd: WAKE UP!!!
17:28:01.501000/T16940.N:SRT.gr: group/recv: @1030351479:  nextSeqNo=1321308535 gap=0 m_iStartSeqNo=1321308535 
iFirstNonReadSeqNo=1321308595. (TSBPD ready in 0ms, timespan 122 ms. First pkt ts=13091126, time base=772607203323500). 
STDCXX_STEADY drift 0 ms.
17:28:01.501000/T42308.N:SRT.ts: @1030351480: tsbpd: PLAYING PACKET seq=1321308536 (belated 2ms)
17:28:01.501000/T16940!W:SRT.gr: @2104093302 GROUP RCV-DROPPED 1 packet(s): seqno %1321308535 to %1321308535. ReadySockets 2
17:28:01.501000/T16940!W:SRT.gr: @2104093302, member @1030351480: m_iStartSeqNo=1321308537 iFirstNonReadSeqNo=1321308551. (TSBPD 
ready in -2ms, timespan 122 ms. First pkt ts=13091234, time base=772607200821000 ns). STDCXX_STEADY drift 0 ms.
17:28:01.501000/T16940!W:SRT.gr: @2104093302, member @1030351479: m_iStartSeqNo=1321308535 iFirstNonReadSeqNo=1321308601. (TSBPD 
ready in 0ms, timespan 123 ms. First pkt ts=13091126, time base=772607203323500 ns). STDCXX_STEADY drift 0 ms.
17:28:01.501482 [W] [METRICS] Detected loss of 1 packets (seqno [6206; 6207))

srtcore/core.cpp Outdated Show resolved Hide resolved
@maxsharabayko maxsharabayko force-pushed the hotfix/group-recv-sync branch from ffc6f3a to 6c27107 Compare April 26, 2024 09:44
@maxsharabayko
Copy link
Collaborator Author

Test results.

@maxsharabayko maxsharabayko merged commit 07859c8 into Haivision:master Apr 30, 2024
12 checks passed
@maxsharabayko maxsharabayko deleted the hotfix/group-recv-sync branch April 30, 2024 08:08
maxsharabayko added a commit to maxsharabayko/srt that referenced this pull request Apr 30, 2024
maxsharabayko added a commit to maxsharabayko/srt that referenced this pull request Apr 30, 2024
maxsharabayko added a commit that referenced this pull request Apr 30, 2024
maxsharabayko added a commit that referenced this pull request Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[core] Area: Changes in SRT library core Type: Bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Broadcast group loosing packets
2 participants