Change in osmo-bts[master]: measurement: expect at least 1 SUB frame for AMR

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/.

dexter gerrit-no-reply at lists.osmocom.org
Wed Apr 22 13:41:43 UTC 2020


dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/17929 )


Change subject: measurement: expect at least 1 SUB frame for AMR
......................................................................

measurement: expect at least 1 SUB frame for AMR

The amount of SUB frames that may occur in AMR is not fixed, nor can it
be determined by some formular or lookup table. The reason for this is
that the DTX period may negotiated dynamicly. This means that the lower
layers must make the decision if an AMR sub frame is a SUB frame early
and tag the repective measurement / frame they hand up to the upper
layers accordingly. However, regardles of the occurrence of DTX periods
the amount of SUB frames in AMR must be always 1 or more because SACCH
frames always count as SUB frames as well. Lets make sure that this is
respected in the debug log as well as in the logic that tries to
substitue missing SUB frame measuremnets.

Change-Id: I1fd91b576ff7274caa6d4356bcd7a4fa4311219d
Related: OS#4465
---
M src/common/measurement.c
1 file changed, 49 insertions(+), 19 deletions(-)



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

diff --git a/src/common/measurement.c b/src/common/measurement.c
index c5cbbb0..4ea820a 100644
--- a/src/common/measurement.c
+++ b/src/common/measurement.c
@@ -569,10 +569,11 @@
 	if (lchan->tch_mode != GSM48_CMODE_SPEECH_AMR)
 		num_meas_sub_expect = lchan_meas_sub_num_expected(lchan);
 	else {
-		/* FIXME: the amount of SUB Measurements is a dynamic parameter
-		 * in AMR and can not be determined by using a lookup table.
-		 * See also: OS#2978 */
-		num_meas_sub_expect = 0;
+		/* When AMR is used, we expect at least one SUB frame, since
+		 * the SACCH will always be SUB frame. There may occur more
+		 * SUB frames but since DTX periods in AMR are dynamic, we
+		 * can not know how much exactly. */
+		num_meas_sub_expect = 1;
 	}
 
 	if (lchan->meas.num_ul_meas > num_ul_meas_expect)
@@ -616,9 +617,17 @@
 			num_ul_meas_actual++;
 		} else {
 			m = &measurement_dummy;
-			if (num_ul_meas_expect - i <= num_meas_sub_expect - num_meas_sub) {
-				num_meas_sub_subst++;
-				is_sub = true;
+
+			/* For AMR the amount of SUB frames is defined by the
+			 * the occurrence of DTX periods, which are dynamically
+			 * negotiated in AMD, so we can not know if and how many
+			 * SUB frames are missing. */
+			if (lchan->tch_mode != GSM48_CMODE_SPEECH_AMR) {
+				if (num_ul_meas_expect - i <=
+				    num_meas_sub_expect - num_meas_sub) {
+					num_meas_sub_subst++;
+					is_sub = true;
+				}
 			}
 
 			num_ul_meas_subst++;
@@ -631,21 +640,42 @@
 		}
 	}
 
-	LOGP(DMEAS, LOGL_DEBUG, "%s received UL measurements contain %u SUB measurements, expected %u\n",
-	     gsm_lchan_name(lchan), num_meas_sub_actual, num_meas_sub_expect);
+	if (lchan->tch_mode != GSM48_CMODE_SPEECH_AMR) {
+		LOGP(DMEAS, LOGL_DEBUG,
+		     "%s received UL measurements contain %u SUB measurements, expected %u\n",
+		     gsm_lchan_name(lchan), num_meas_sub_actual,
+		     num_meas_sub_expect);
+	} else {
+		LOGP(DMEAS, LOGL_DEBUG,
+		     "%s received UL measurements contain %u SUB measurements, expected at least %u\n",
+		     gsm_lchan_name(lchan), num_meas_sub_actual,
+		     num_meas_sub_expect);
+	}
+
 	LOGP(DMEAS, LOGL_DEBUG, "%s replaced %u measurements with dummy values, from which %u were SUB measurements\n",
 	     gsm_lchan_name(lchan), num_ul_meas_subst, num_meas_sub_subst);
 
-	if (num_meas_sub != num_meas_sub_expect) {
-		LOGP(DMEAS, LOGL_ERROR, "%s Incorrect number of SUB measurements detected! (%u vs exp %u)\n",
-		     gsm_lchan_name(lchan), num_meas_sub, num_meas_sub_expect);
-		/* Normally the logic above should make sure that there is
-		 * always the exact amount of SUB measurements taken into
-		 * account. If not then the logic that decides tags the received
-		 * measurements as is_sub works incorrectly. Since the logic
-		 * above only adds missing measurements during the calculation
-		 * it can not remove excess SUB measurements or add missing SUB
-		 * measurements when there is no more room in the interval. */
+	/* Normally the logic above should make sure that there is
+	 * always the exact amount of SUB measurements taken into
+	 * account. If not then the logic that decides tags the received
+	 * measurements as is_sub works incorrectly. Since the logic
+	 * above only adds missing measurements during the calculation
+	 * it can not remove excess SUB measurements or add missing SUB
+	 * measurements when there is no more room in the interval. */
+	if (lchan->tch_mode != GSM48_CMODE_SPEECH_AMR) {
+		if (num_meas_sub != num_meas_sub_expect) {
+			LOGP(DMEAS, LOGL_ERROR,
+			     "%s Incorrect number of SUB measurements detected! (%u vs exp %u)\n",
+			     gsm_lchan_name(lchan), num_meas_sub,
+			     num_meas_sub_expect);
+		}
+	} else {
+		if (num_meas_sub < num_meas_sub_expect) {
+			LOGP(DMEAS, LOGL_ERROR,
+			     "%s Incorrect number of SUB measurements detected! (%u vs exp >=%u)\n",
+			     gsm_lchan_name(lchan), num_meas_sub,
+			     num_meas_sub_expect);
+		}
 	}
 
 	/* Measurement computation step 2: divide */

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/17929
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I1fd91b576ff7274caa6d4356bcd7a4fa4311219d
Gerrit-Change-Number: 17929
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200422/bc82a5c4/attachment.htm>


More information about the gerrit-log mailing list