Skip to content

Add: support for dropping late frames in RxTxApp#1458

Open
DawidWesierski4 wants to merge 9 commits intomainfrom
dropped_v2_debug1
Open

Add: support for dropping late frames in RxTxApp#1458
DawidWesierski4 wants to merge 9 commits intomainfrom
dropped_v2_debug1

Conversation

@DawidWesierski4
Copy link
Collaborator

@DawidWesierski4 DawidWesierski4 commented Mar 4, 2026

commit 4e97bb1 (HEAD -> dropped_v2_debug1, upstream/dropped_v2_debug1)
Author: Wesierski, Dawid dawid.wesierski@intel.com
Date: Mon Mar 9 10:09:30 2026 -0400

Add: unify frame status across RX pipelines

Set st_frame_status on received frames before notifying the
application, consistent with st20p RX:
- st22p RX: propagate meta->status to src and dst frames
- st30p RX: set COMPLETE (audio frames always arrive whole)
- st40p RX: set COMPLETE or CORRUPTED based on seq_discont

Add status field to struct st30_frame and struct st40_frame_info.
Update st_frame_status doc comment for TX+RX usage.

commit f4f6a07
Author: Wesierski, Dawid dawid.wesierski@intel.com
Date: Mon Mar 9 09:43:27 2026 -0400

Fix: correct audio TX epoch drop count reporting

Use -to_epoch/pkt_time instead of epochs-next_epochs for the
stat_epoch_drop counter and notify_frame_late callback argument
in tx_audio_session_sync_pacing.

commit 0649e9c
Author: Wesierski, Dawid dawid.wesierski@intel.com
Date: Mon Mar 9 08:36:31 2026 -0400

Add: port late-frame-drop to TX pipelines

Add the same proactive timestamp-based drop logic from st20p to all
remaining TX pipeline types:
- st22p: check ENCODED frames in next_frame
- st30p: check READY frames in next_frame
- st40p: check READY frames in next_frame

Add DROPPED frame state, frame_done_cb_called guard,
and set frame status (COMPLETE/DROPPED) before notify_frame_done.

Add ST_FRAME_STATUS_DROPPED to enum st_frame_status and
st20p_tx_get_drop_count() public API.

commit 50ccfa9
Author: Wesierski, Dawid dawid.wesierski@intel.com
Date: Mon Mar 2 06:14:08 2026 -0500

Add: pipeline check for late frames in st20p TX

Replace the reactive st20p_tx_late_frame_drop (called from transport
notify_frame_late) with a proactive timestamp check in next_frame.
When DROP_WHEN_LATE + USER_PACING are both set, the pipeline now
compares frame TAI against PTP wall time before handing a converted
frame to transport. Dropped frames fire notify_frame_done and
notify_frame_late callbacks, then recycle the slot.

Also add drop_when_late JSON flag to RxTxApp configuration.

@DawidWesierski4 DawidWesierski4 marked this pull request as draft March 4, 2026 15:39
@DawidWesierski4 DawidWesierski4 force-pushed the dropped_v2_debug1 branch 5 times, most recently from f0346f2 to d934735 Compare March 10, 2026 12:16
@DawidWesierski4 DawidWesierski4 marked this pull request as ready for review March 10, 2026 12:16
@DawidWesierski4 DawidWesierski4 force-pushed the dropped_v2_debug1 branch 3 times, most recently from eb98c84 to df8218d Compare March 11, 2026 14:56
Replace the reactive st20p_tx_late_frame_drop (called from transport
notify_frame_late) with a proactive timestamp check in next_frame.
When DROP_WHEN_LATE + USER_PACING are both set, the pipeline now
compares frame TAI against PTP wall time before handing a converted
frame to transport. Dropped frames fire notify_frame_done and
notify_frame_late callbacks, then recycle the slot.

Also add drop_when_late JSON flag to RxTxApp configuration.
Add the same proactive timestamp-based drop logic from st20p to all
remaining TX pipeline types:
- st22p: check ENCODED frames in next_frame
- st30p: check READY frames in next_frame
- st40p: check READY frames in next_frame

Add DROPPED frame state, frame_done_cb_called guard,
and set frame status (COMPLETE/DROPPED) before notify_frame_done.

Add ST_FRAME_STATUS_DROPPED to enum st_frame_status and
st20p_tx_get_drop_count() public API.
Use -to_epoch/pkt_time instead of epochs-next_epochs for the
stat_epoch_drop counter and notify_frame_late callback argument
in tx_audio_session_sync_pacing.
Set st_frame_status on received frames before notifying the
application, consistent with st20p RX:
- st22p RX: propagate meta->status to src and dst frames
- st30p RX: set COMPLETE (audio frames always arrive whole)
- st40p RX: set COMPLETE or CORRUPTED based on seq_discont

Add status field to struct st30_frame and struct st40_frame_info.
Update st_frame_status doc comment for TX+RX usage.
add unified drop-frame parsing in RxTxApp, allow users to test drop
frame functionality.
Degrade the log level of late frame drops from NOTICE to DBG.
As the statistics every 10s will show them.
Move the late frame notification callback to avoid returning
zeroed epoch time to the caller.
@DawidWesierski4 DawidWesierski4 force-pushed the dropped_v2_debug1 branch 6 times, most recently from 8d69d75 to 2ef73b4 Compare March 12, 2026 15:08
/* time bigger than the assigned epoch time */
ST_SESSION_STAT_INC(s, port_user_stats, stat_epoch_mismatch);
if (s->ops.notify_frame_late) {
s->ops.notify_frame_late(s->ops.priv, -to_epoch / pkt_time);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Did you consider using abs() instead of adding a minus (-) to the negative value?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants