falconia has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-bts/+/32678 )
Change subject: all models, FR/EFR UL: change SID check to _is_any_sid()
......................................................................
all models, FR/EFR UL: change SID check to _is_any_sid()
In all OsmoBTS models in FR and EFR speech modes, as the UL traffic
frame stream is passed from the PHY to l1sap and ultimately to RTP
output, all passed frames are checked for SID. The Boolean result
of this SID check is used in two ways:
* RFC 3551 instructs that the Marker bit in the RTP header SHOULD be
set in the first packet of a talkspurt after a period of silence
suppression. OsmoBTS implements this recommendation by setting
the Marker bit in the first RTP-transmitted non-SID UL packet
that was preceded by SID.
* In osmo-bts-trx only, this same SID check serves a second purpose:
handling of BFI conditions depends on whether or not the last received
good traffic frame was a SID. If a BFI condition is received after
a non-SID traffic frame, the ECU is invoked, and if this ECU fails
or when libosmocodec does not provide an ECU for the codec in use,
a special FR (EFR) BFI frame of 260 (244) zero bits is emitted.
Both the ECU call and the peculiar form of BFI are skipped when the
last received good traffic frame was a SID.
For both of the above purposes, in all BTS models, change the SID check
from osmo_{fr,efr}_check_sid() to osmo_{fr,efr}_is_any_sid(). The
effect of this change is that "what counts as a SID" for the just-listed
purposes changes from recognizing only perfectly uncorrupted SID frames
without any bit errors to recognizing all frames which the rules of
GSM 06.31 (FR) or 06.81 (EFR) classify as either valid or invalid SID.
Change-Id: I5c24b379deda8ae551f9924d10770da50e6acbbd
---
M src/osmo-bts-lc15/tch.c
M src/osmo-bts-oc2g/tch.c
M src/osmo-bts-sysmo/tch.c
M src/osmo-bts-trx/sched_lchan_tchf.c
4 files changed, 44 insertions(+), 8 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/78/32678/1
diff --git a/src/osmo-bts-lc15/tch.c b/src/osmo-bts-lc15/tch.c
index fdbf995..56c56ca 100644
--- a/src/osmo-bts-lc15/tch.c
+++ b/src/osmo-bts-lc15/tch.c
@@ -68,7 +68,7 @@
cur = msgb_put(msg, GSM_FR_BYTES);
memcpy(cur, l1_payload, GSM_FR_BYTES);
- lchan_set_marker(osmo_fr_check_sid(l1_payload, payload_len), lchan);
+ lchan_set_marker(osmo_fr_is_any_sid(l1_payload), lchan);
return msg;
}
@@ -102,7 +102,7 @@
cur = msgb_put(msg, GSM_EFR_BYTES);
memcpy(cur, l1_payload, GSM_EFR_BYTES);
- lchan_set_marker(osmo_efr_check_sid(l1_payload, payload_len), lchan);
+ lchan_set_marker(osmo_efr_is_any_sid(l1_payload), lchan);
return msg;
}
diff --git a/src/osmo-bts-oc2g/tch.c b/src/osmo-bts-oc2g/tch.c
index fce100f..491e736 100644
--- a/src/osmo-bts-oc2g/tch.c
+++ b/src/osmo-bts-oc2g/tch.c
@@ -68,7 +68,7 @@
cur = msgb_put(msg, GSM_FR_BYTES);
memcpy(cur, l1_payload, GSM_FR_BYTES);
- lchan_set_marker(osmo_fr_check_sid(l1_payload, payload_len), lchan);
+ lchan_set_marker(osmo_fr_is_any_sid(l1_payload), lchan);
return msg;
}
@@ -102,7 +102,7 @@
cur = msgb_put(msg, GSM_EFR_BYTES);
memcpy(cur, l1_payload, GSM_EFR_BYTES);
- lchan_set_marker(osmo_efr_check_sid(l1_payload, payload_len), lchan);
+ lchan_set_marker(osmo_efr_is_any_sid(l1_payload), lchan);
return msg;
}
diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c
index 5039cc4..0109771 100644
--- a/src/osmo-bts-sysmo/tch.c
+++ b/src/osmo-bts-sysmo/tch.c
@@ -77,7 +77,7 @@
cur[0] |= 0xD0;
#endif /* USE_L1_RTP_MODE */
- lchan_set_marker(osmo_fr_check_sid(l1_payload, payload_len), lchan);
+ lchan_set_marker(osmo_fr_is_any_sid(l1_payload), lchan);
return msg;
}
@@ -132,7 +132,7 @@
cur[0] |= 0xC0;
#endif /* USE_L1_RTP_MODE */
- lchan_set_marker(osmo_efr_check_sid(l1_payload, payload_len), lchan);
+ lchan_set_marker(osmo_efr_is_any_sid(l1_payload), lchan);
return msg;
}
diff --git a/src/osmo-bts-trx/sched_lchan_tchf.c b/src/osmo-bts-trx/sched_lchan_tchf.c
index da4a475..6d6fb0b 100644
--- a/src/osmo-bts-trx/sched_lchan_tchf.c
+++ b/src/osmo-bts-trx/sched_lchan_tchf.c
@@ -146,12 +146,12 @@
case GSM48_CMODE_SPEECH_V1: /* FR */
rc = gsm0503_tch_fr_decode(tch_data, *bursts_p, 1, 0, &n_errors,
&n_bits_total);
if (rc == GSM_FR_BYTES) /* only for valid *speech* frames */
- lchan_set_marker(osmo_fr_check_sid(tch_data, rc), lchan); /* DTXu */
+ lchan_set_marker(osmo_fr_is_any_sid(tch_data), lchan); /* DTXu */
break;
case GSM48_CMODE_SPEECH_EFR: /* EFR */
rc = gsm0503_tch_fr_decode(tch_data, *bursts_p, 1, 1, &n_errors,
&n_bits_total);
if (rc == GSM_EFR_BYTES) /* only for valid *speech* frames */
- lchan_set_marker(osmo_efr_check_sid(tch_data, rc), lchan); /* DTXu */
+ lchan_set_marker(osmo_efr_is_any_sid(tch_data), lchan); /* DTXu */
break;
case GSM48_CMODE_SPEECH_AMR: /* AMR */
/* the first FN 0,8,17 defines that CMI is included in frame,
--
To view, visit
https://gerrit.osmocom.org/c/osmo-bts/+/32678
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I5c24b379deda8ae551f9924d10770da50e6acbbd
Gerrit-Change-Number: 32678
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-MessageType: newchange