[PATCH] osmo-bts[master]: Fix RTP timestamps in case of DTX

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Max gerrit-no-reply at lists.osmocom.org
Fri Jun 3 11:31:01 UTC 2016


Review at  https://gerrit.osmocom.org/196

Fix RTP timestamps in case of DTX

Compute RTP user_ts adjustment based on the difference between current
and previous FN instead of hard-coded value.

Change-Id: If1677ddcf754b29990ff7cd846e11c32e3d30b33
Related: OS#1562
---
M src/common/l1sap.c
1 file changed, 9 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/96/196/1

diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index ac398d3..e060473 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -69,6 +69,13 @@
 
 static int l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap);
 
+static uint32_t fn_ms_adj(uint32_t fn, uint32_t last_fn, uint32_t base)
+{
+	if (last_fn) /* 8 samples, 120 ms, 26 bursts */
+		return (fn - last_fn) * 8 * 120 / 26;
+	return base;
+}
+
 static const uint8_t fill_frame[GSM_MACBLOCK_LEN] = {
         0x03, 0x03, 0x01, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B,
         0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B,
@@ -853,7 +860,7 @@
 	/* hand msg to RTP code for transmission */
 	if (lchan->abis_ip.rtp_socket)
 		osmo_rtp_send_frame(lchan->abis_ip.rtp_socket,
-			msg->data, msg->len, 160);
+			msg->data, msg->len, fn_ms_adj(fn, lchan->tch.last_fn, GSM_RTP_DURATION));
 
 	/* if loopback is enabled, also queue received RTP data */
 	if (lchan->loopback) {
@@ -871,7 +878,7 @@
 
 		msgb_enqueue(&lchan->dl_tch_queue, msg);
 	}
-
+	lchan->tch.last_fn = fn;
 	return 0;
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If1677ddcf754b29990ff7cd846e11c32e3d30b33
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>



More information about the gerrit-log mailing list