Skip to content

Fix: eliminate false epoch drop reports on TX sessions#1478

Draft
Sakoram wants to merge 2 commits intomainfrom
fix/epoch-drop-user-pacing
Draft

Fix: eliminate false epoch drop reports on TX sessions#1478
Sakoram wants to merge 2 commits intomainfrom
fix/epoch-drop-user-pacing

Conversation

@Sakoram
Copy link
Copy Markdown
Collaborator

@Sakoram Sakoram commented Apr 3, 2026

Problem: TX sessions (st20/st30/st40/st41) falsely reported epoch drops in two scenarios:

First frame after session creation pacing state was uninitialized (stale zero values vs PTP time ~10^11)
User-pacing mode library compared current PTP wall-clock against the next free slot, penalizing scheduler jitter as dropped epochs even though the user's timestamp was valid
Fix:

Use cur_epochs == 0 as uninitialized sentinel; on first frame, start from current PTP epoch
When required_tai is set (user controls pacing), skip epoch drop accounting — video/ancillary keep user-derived frame_count, audio/fastmetadata skip the epochs > next_epochs counter
In RxTxApp, initialize base_tai_time from PTP after mtl_start() so frame threads don't stamp frames before the scheduler is running
Tests: Added TX-only epoch drop tests for st20p, st30p, st40p both with and without user_pacing (6 tests total, all pass with 0 drops).

Fixes #1378

Sakoram added 2 commits April 3, 2026 12:19
Use cur_epochs == 0 as sentinel for uninitialized pacing state in all
four TX types (video, audio, ancillary, fast metadata). On first frame,
start from the current PTP epoch instead of stale values, removing the
init_pacing_epoch callbacks.

When user provides timestamps (required_tai), skip epoch drop accounting
since the library was incorrectly penalizing scheduler jitter as drops.
Video/ancillary: keep user-derived frame_count in the late-frame branch.
Audio/fastmetadata: skip the epochs > next_epochs drop counter.

In RxTxApp, initialize base_tai_time from PTP after mtl_start() so
frame threads only stamp frames once the scheduler is running.

Fixes: #1378
Signed-off-by: Kasiewicz, Marek <marek.kasiewicz@intel.com>
Add TX-only epoch drop tests for all three pipeline types. Each test
sends frames for 5 seconds and asserts stat_epoch_drop == 0. Both
non-user-pacing and user-pacing (TAI +20ms) variants are included.

New tests:
  St20p.tx_no_epoch_drop
  St20p.tx_user_pacing_no_epoch_drop
  St30p.tx_no_epoch_drop
  St30p.tx_user_pacing_no_epoch_drop
  St40p.tx_no_epoch_drop
  St40p.tx_user_pacing_no_epoch_drop

Signed-off-by: Kasiewicz, Marek <marek.kasiewicz@intel.com>
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.

false report of epoch drop in tx_st40p

1 participant