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 getTsbPdTimeBase: carryover within 2 wrapping periods #2043

Merged

Conversation

maxsharabayko
Copy link
Collaborator

The refactoring in PR #1968 had removed TSBPD base update on incoming ACKACK control packet used for drift tracing.
At the same time CTsbpdTime::getTsbPdTimeBase(uint32_t timestamp_us) while in wrapping-aware state was only tracking for packet timestamps below the value of TSBPD_WRAP_PERIOD (30 s).
The wrapping period itself ends once a data packet with a timestamp in range [TSBPD_WRAP_PERIOD; 2 * TSBPD_WRAP_PERIOD] is received.
All these lead to an issue when an ACKACK packet with TS 30.000001 s arrives: the time base is not updated (like before), and the TS is already higher than TSBPD_WRAP_PERIOD, meaning that carryover correction is not applied.

This PR increases the carryover-applicable range for TS up to 2 * TSBPD_WRAP_PERIOD in getTsbPdTimeBase.

Fixes #2041.

Further improvements to timestamp carryover tracing are required. E.g. data sender should track TS carryover based on the incoming ACK packets in case it eventually needs to start receiving data.
Also, idle connections should track TS carryover. See #1936.

@maxsharabayko maxsharabayko added Type: Bug Indicates an unexpected problem or unintended behavior [core] Area: Changes in SRT library core labels Jun 18, 2021
@maxsharabayko maxsharabayko added this to the v1.4.4 milestone Jun 18, 2021
@maxsharabayko maxsharabayko self-assigned this Jun 18, 2021
@maxsharabayko maxsharabayko merged commit e932e8f into Haivision:master Jun 21, 2021
@maxsharabayko maxsharabayko deleted the hotfix/drift-sample-wrap branch June 21, 2021 15:48
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] Periodic packet loss
1 participant