Harald Welte has submitted this change and it was merged.

Change subject: l1sap.c: fn_ms_adj: Add err logging and always return 
GSM_RTP_DURATION
......................................................................


l1sap.c: fn_ms_adj: Add err logging and always return GSM_RTP_DURATION

After latest changes, l2 expects to receive an event for every TCH
frame, that is, no TCH frame event should be lost on that layer. We
should now then be safe returning always GSM_RTP_DURATION.

The code which used to calculate the variable duration is left there to
assert that indeed we are not longer having this kind of issues.

Change-Id: I9d112c6db142be138e71393e77129e6d069d9973
---
M src/common/l1sap.c
1 file changed, 6 insertions(+), 5 deletions(-)

Approvals:
  Max: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index bb27457..3f9da4f 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -27,6 +27,7 @@
 #include <stdbool.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <inttypes.h>
 
 #include <osmocom/core/msgb.h>
 #include <osmocom/gsm/l1sap.h>
@@ -87,10 +88,6 @@
 {
        uint32_t samples_passed, r;
 
-       /* don't adjust duration when DTX is not enabled */
-       if (lchan->ts->trx->bts->dtxu == GSM48_DTX_SHALL_NOT_BE_USED)
-               return GSM_RTP_DURATION;
-
        if (lchan->tch.last_fn != LCHAN_FN_DUMMY) {
                /* 12/13 frames usable for audio in TCH,
                   160 samples per RTP packet,
@@ -100,7 +97,11 @@
                   GSM_RTP_DURATION */
                r = samples_passed + GSM_RTP_DURATION / 2;
                r -= r % GSM_RTP_DURATION;
-               return r;
+
+               if (r != GSM_RTP_DURATION)
+                       LOGP(DL1P, LOGL_ERROR, "RTP clock out of sync with 
lower layer:"
+                               " %"PRIu32" vs %d (%"PRIu32"->%"PRIu32")\n",
+                               r, GSM_RTP_DURATION, lchan->tch.last_fn, fn);
        }
        return GSM_RTP_DURATION;
 }

-- 
To view, visit https://gerrit.osmocom.org/3084
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I9d112c6db142be138e71393e77129e6d069d9973
Gerrit-PatchSet: 5
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <[email protected]>
Gerrit-Reviewer: Harald Welte <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <[email protected]>
Gerrit-Reviewer: Pau Espin Pedrol <[email protected]>

Reply via email to