Skip to content

Conversation

@DawidWesierski4
Copy link
Collaborator

Redundant fixes and improvments

@DawidWesierski4 DawidWesierski4 added the TO_REBASE Please don't squash this PR, use the rebase option during merging process label Oct 23, 2025
@DawidWesierski4 DawidWesierski4 force-pushed the redundant branch 4 times, most recently from a5f19a8 to cb2d369 Compare October 24, 2025 06:20
@DawidWesierski4 DawidWesierski4 force-pushed the redundant branch 3 times, most recently from 0829b5d to 1ddf265 Compare October 24, 2025 06:36
@Sakoram
Copy link
Collaborator

Sakoram commented Oct 24, 2025

You want to rebase this, but changes to lib/src/mt_util.h are added in 4th commit and used in 2nd, thus 2nd commit wont build.
Idk if we want all commits to work separately, I guess we do

@DawidWesierski4 DawidWesierski4 force-pushed the redundant branch 2 times, most recently from 6e512b9 to ff631dd Compare October 24, 2025 13:48
@DawidWesierski4 DawidWesierski4 force-pushed the redundant branch 4 times, most recently from 067191a to 9dec36f Compare October 28, 2025 14:16
@DawidWesierski4 DawidWesierski4 force-pushed the redundant branch 2 times, most recently from 2b60cce to 72f7556 Compare October 29, 2025 20:40
Fix a bug where rtp_timestamp_delta_us was ignored when users set
ST20_TX_FLAG_USER_TIMESTAMP or ST22_TX_FLAG_USER_TIMESTAMP flags.
Use timestamps as primary method for redundancy detection instead of seq_id.
ST30 audio uses timestamps only, while ancillary data uses both seq_id and
timestamps. Move seq_id tracking to per-port structs for better logging.

Fixes: 7c9b061
Add noctx tests for ST20 and refactor the entire gtest suite,
renaming to integration tests since they are not true unit tests.

The goal is to allow for easy and simple tests for scenarios where
isolated scenario would be required.
Fix slots allocation falling into wrong state when redundant streams are old.
This caused primary streams to set 2 slots while redundant streams allocated
new slots, resulting in all frames being incomplete.

Issue occurs when the latency of redundnat stream is greater than
slot number * frame time.

This would not adress an issue where 2 streams with slightly diffrent
timestamps would be sent to rx but that case is not worth fixing
as this would be incompliat with st2110

To test:
./build/tests/KahawaiTest \
    --auto_start_stop \
    --port_list=0000:xx:xx.x,0000:xx:xx.x,0000:xx:xx.x,0000:xx:xx.x \
    --gtest_filter=noctx.st20p_redundant_latency
Unify redundant packet logging with regular packet reporting.
Use global session ID for redundant checking across
st40/st41 sessions, similar to timestamp validation
to make things as similar to eachoder as possible.

Change API to report out-of-order packets in user port statistics.

Note: Out-of-order per port tracking not implemented for st20.
Packet timestamps were only calculated when
the RTP time differed from the previous frame,
which failed for the initial packet. This caused
the first TX packet to be transmitted with
timestamp 0, resulting in DDoS-like behavior
on the RX side.

During initalization make the session calculate
the timestamp to avoid such issues.

To test set the date into problematic clock area
sudo date -s "2025-10-29 17:28:30"
@DawidWesierski4 DawidWesierski4 force-pushed the redundant branch 6 times, most recently from 8c291c4 to ebfba8f Compare October 30, 2025 10:56
Copy link
Collaborator

@Sakoram Sakoram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job, looks good.

@DawidWesierski4 DawidWesierski4 merged commit be5563d into main Oct 30, 2025
15 of 16 checks passed
@DawidWesierski4 DawidWesierski4 deleted the redundant branch October 30, 2025 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

TO_REBASE Please don't squash this PR, use the rebase option during merging process

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants