Skip to content

Commit f4df31c

Browse files
Fix: User controlled pacing sync for st2110-20
A mechanism that allows the session to move the pacing window if the current epoch is just a little bit behind was applied to user controlled pacing, which in turn made the scenarios where big PTP updates or other small issues may cause incremental delays, which is not really a problem as long as we don't enable user controlled pacing. Fix it by ignoring all discrepancies for user controlled pacing scenarios (required_tai) and just forcing the session to send the packets asap.
1 parent 9168009 commit f4df31c

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

lib/src/st2110/st_tx_video_session.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -645,25 +645,26 @@ static int tv_sync_pacing(struct mtl_main_impl* impl, struct st_tx_video_session
645645
", ptp_time %" PRIu64 "ms\n",
646646
__func__, idx, to_epoch, epochs, pacing->cur_epochs, ptp_time / 1000 / 1000);
647647
s->stat_epoch_troffset_mismatch++;
648-
epochs++; /* assign to next */
649-
start_time_ptp = pacing_start_time(pacing, epochs);
650-
to_epoch = start_time_ptp - ptp_time;
651-
}
652648

653-
if (to_epoch < 0) {
654-
/* should never happen */
655-
err("%s(%d), error to_epoch %f, ptp_time %" PRIu64 ", epochs %" PRIu64 " %" PRIu64
656-
"\n",
657-
__func__, idx, to_epoch, ptp_time, epochs, pacing->cur_epochs);
658-
to_epoch = 0;
649+
/* in case of user controlled pacing we need to send this even if late
650+
as close to the user defiend time as possible*/
651+
if (required_tai) {
652+
to_epoch = 0;
653+
} else {
654+
to_epoch = start_time_ptp - ptp_time;
655+
epochs++; /* assign to next */
656+
start_time_ptp = pacing_start_time(pacing, epochs);
657+
}
659658
}
660659

661660
if (epochs > next_epochs) {
662661
dbg("%s(%d), epochs %" PRIu64 " next_epochs %" PRIu64 "\n", __func__, idx, epochs,
663662
next_epochs);
664663
s->stat_epoch_drop += (epochs - next_epochs);
665664
}
665+
666666
if (epochs < next_epochs) s->stat_epoch_onward += (next_epochs - epochs);
667+
667668
pacing->cur_epochs = epochs;
668669
pacing->cur_epoch_time = pacing_time(pacing, epochs);
669670
pacing->rtp_time_stamp = pacing_time_stamp(s, pacing, epochs);

0 commit comments

Comments
 (0)