Attention is currently required from: pespin.
Hello Jenkins Builder, fixeria,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmocom-bb/+/32080
to look at the new patch set (#2).
Change subject: layer23: modem: Forward GMMRR primitives between GMM and RLCMAC layers
......................................................................
layer23: modem: Forward GMMRR primitives between GMM and RLCMAC layers
Related: OS#5501
Change-Id: I7603d8bbda0cdd437eb7557267efb7bbc3552565
---
M src/host/layer23/src/modem/gmm.c
M src/host/layer23/src/modem/rlcmac.c
2 files changed, 40 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/80/32080/2
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/32080
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I7603d8bbda0cdd437eb7557267efb7bbc3552565
Gerrit-Change-Number: 32080
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newpatchset
falconia has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/32095 )
Change subject: trx: detect UL SID in EFR just like in FR
......................................................................
trx: detect UL SID in EFR just like in FR
The TCH/F Rx code in osmo-bts-trx uses osmo_fr_check_sid() to detect
when the MS sends SID, and passes the flag to lchan_set_marker().
However, equivalent logic was missing for EFR, as until recently
there was no EFR SID check function in libosmocodec. Now that
we have osmo_efr_check_sid(), use it.
Change-Id: Ib043e00dbf92145c2a6c32f6365517244472a922
---
M src/osmo-bts-trx/sched_lchan_tchf.c
1 file changed, 17 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/95/32095/1
diff --git a/src/osmo-bts-trx/sched_lchan_tchf.c b/src/osmo-bts-trx/sched_lchan_tchf.c
index eff0f63..256125b 100644
--- a/src/osmo-bts-trx/sched_lchan_tchf.c
+++ b/src/osmo-bts-trx/sched_lchan_tchf.c
@@ -150,6 +150,8 @@
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 */
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/+/32095
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ib043e00dbf92145c2a6c32f6365517244472a922
Gerrit-Change-Number: 32095
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-MessageType: newchange
falconia has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/32096 )
Change subject: sysmo: fix handling of SID in EFR
......................................................................
sysmo: fix handling of SID in EFR
Handling of SID in EFR mode was broken in osmo-bts-sysmo.
l1_to_rtppayload_efr(), the function for UL Rx, was using completely
bogus logic (passing bits in ETSI TS 101 318 EFR format to an AMR
decoding function), whereas l1if_tch_encode(), the function for
DL Tx, had missing SID logic for EFR while supporting SID detection
for all other codecs. The fix is to use the new osmo_efr_check_sid()
function in libosmocodec.
Change-Id: Ia56c1bb7432968685110456961d24a907b0a201f
---
M src/osmo-bts-sysmo/tch.c
1 file changed, 23 insertions(+), 7 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/96/32096/1
diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c
index a390c8c..8c9557c 100644
--- a/src/osmo-bts-sysmo/tch.c
+++ b/src/osmo-bts-sysmo/tch.c
@@ -131,12 +131,8 @@
cur[0] |= 0xC0;
#endif /* USE_L1_RTP_MODE */
- enum osmo_amr_type ft;
- enum osmo_amr_quality bfi;
- uint8_t cmr;
- int8_t sti, cmi;
- osmo_amr_rtp_dec(l1_payload, payload_len, &cmr, &cmi, &ft, &bfi, &sti);
- lchan_set_marker(ft == AMR_GSM_EFR_SID, lchan);
+
+ lchan_set_marker(osmo_efr_check_sid(l1_payload, payload_len), lchan);
return msg;
}
@@ -403,7 +399,10 @@
*payload_type = GsmL1_TchPlType_Efr;
rc = rtppayload_to_l1_efr(l1_payload, rtp_pl,
rtp_pl_len);
- /* FIXME: detect and save EFR SID */
+ if (rc && lchan->ts->trx->bts->dtxd)
+ is_sid = osmo_efr_check_sid(rtp_pl, rtp_pl_len);
+ if (is_sid)
+ dtx_cache_payload(lchan, rtp_pl, rtp_pl_len, fn, -1);
break;
#endif
case GSM48_CMODE_SPEECH_AMR:
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/32096
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ia56c1bb7432968685110456961d24a907b0a201f
Gerrit-Change-Number: 32096
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-MessageType: newchange
falconia has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/32098 )
Change subject: common: implement rtp always-output mode
......................................................................
common: implement rtp always-output mode
In some environments it is highly desirable for the RTP stream
coming from each GSM call UL on a BTS to be fully continuous,
without any gaps, with _some_ RTP packet emitted every 20 ms,
even if there is no speech or SID frame to be sent in that frame
time window. The present change adds an rtp always-output vty
option which, when enabled, causes the BTS to emit RTP packets
with a zero-length payload, instead of producing gaps in the RTP
stream, when it has nothing else to send.
Related: OS#5975
Change-Id: Ic0e2edf2ed90ba0ac6bee5e7d9629bf0255e256d
---
M include/osmo-bts/bts.h
M src/common/l1sap.c
M src/common/vty.c
3 files changed, 57 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/98/32098/1
diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h
index ed3da1d..14c78a3 100644
--- a/include/osmo-bts/bts.h
+++ b/include/osmo-bts/bts.h
@@ -314,6 +314,8 @@
int rtp_ip_dscp;
int rtp_priority;
+ bool rtp_nogaps_mode; /* emit RTP stream without any gaps */
+
struct {
uint8_t ciphers; /* flags A5/1==0x1, A5/2==0x2, A5/3==0x4 */
} support;
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 2a1196c..f8320b0 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -1247,6 +1247,11 @@
static bool rtppayload_is_valid(struct gsm_lchan *lchan, struct msgb *resp_msg)
{
+ /* A zero-length payload is never valid, it is merely a BFI marker
+ * and a timing tick, which we are not interested in because we run
+ * on our own TDMA timing. */
+ if (!resp_msg->len)
+ return false;
/* Avoid sending bw-efficient AMR to lower layers, most bts models
* don't support it. */
if (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR &&
@@ -1571,6 +1576,7 @@
static int l1sap_tch_ind(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap,
struct ph_tch_param *tch_ind)
{
+ struct gsm_bts *bts = trx->bts;
struct msgb *msg = l1sap->oph.msg;
struct gsm_time g_time;
struct gsm_lchan *lchan;
@@ -1600,8 +1606,10 @@
/* Low level layers always call us when TCH content is expected, even if
* the content is not available due to decoding issues. Content not
- * available is expected as empty payload. */
- if (msg->len) {
+ * available is expected as empty payload. We send out an RTP packet
+ * if the lower layers sent us a non-empty payload OR if
+ * rtp always-output mode is configured. */
+ if (msg->len || bts->rtp_nogaps_mode) {
/* hand msg to RTP code for transmission */
if (lchan->abis_ip.osmux.use) {
lchan_osmux_send_frame(lchan, msg->data, msg->len,
diff --git a/src/common/vty.c b/src/common/vty.c
index dd1b07f..aa49f6b 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -421,6 +421,8 @@
vty_out(vty, " rtp ip-dscp %i%s", bts->rtp_ip_dscp, VTY_NEWLINE);
if (bts->rtp_priority != -1)
vty_out(vty, " rtp socket-priority %i%s", bts->rtp_priority, VTY_NEWLINE);
+ if (bts->rtp_nogaps_mode)
+ vty_out(vty, " rtp always-output%s", VTY_NEWLINE);
vty_out(vty, " paging queue-size %u%s", paging_get_queue_max(bts->paging_state),
VTY_NEWLINE);
vty_out(vty, " paging lifetime %u%s", paging_get_lifetime(bts->paging_state),
@@ -780,6 +782,28 @@
return CMD_SUCCESS;
}
+DEFUN(cfg_bts_rtp_always_output,
+ cfg_bts_rtp_always_output_cmd,
+ "rtp always-output",
+ RTP_STR "Always emit an RTP packet every 20 ms\n")
+{
+ struct gsm_bts *bts = vty->index;
+
+ bts->rtp_nogaps_mode = true;
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_bts_no_rtp_always_output,
+ cfg_bts_no_rtp_always_output_cmd,
+ "no rtp always-output",
+ NO_STR RTP_STR "Always emit an RTP packet every 20 ms\n")
+{
+ struct gsm_bts *bts = vty->index;
+
+ bts->rtp_nogaps_mode = false;
+ return CMD_SUCCESS;
+}
+
#define PAG_STR "Paging related parameters\n"
DEFUN_ATTR(cfg_bts_paging_queue_size,
@@ -2667,6 +2691,8 @@
install_element(BTS_NODE, &cfg_bts_rtp_port_range_cmd);
install_element(BTS_NODE, &cfg_bts_rtp_ip_dscp_cmd);
install_element(BTS_NODE, &cfg_bts_rtp_priority_cmd);
+ install_element(BTS_NODE, &cfg_bts_rtp_always_output_cmd);
+ install_element(BTS_NODE, &cfg_bts_no_rtp_always_output_cmd);
install_element(BTS_NODE, &cfg_bts_band_cmd);
install_element(BTS_NODE, &cfg_description_cmd);
install_element(BTS_NODE, &cfg_no_description_cmd);
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/32098
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ic0e2edf2ed90ba0ac6bee5e7d9629bf0255e256d
Gerrit-Change-Number: 32098
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-MessageType: newchange
falconia has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/32097 )
Change subject: TCH-IND interface: move link quality check into model code
......................................................................
TCH-IND interface: move link quality check into model code
The l1sap_tch_ind() handler in the common code contains a check
to see if the link quality is >= bts->min_qual_norm; if this
condition is not met, RTP output is suppressed even if the BTS
model sent a non-empty payload. It appears that the purpose of
this check is to prevent emission of bogons during DTXu pauses
with FR1 codec: the only speech frame integrity check in GSM 05.03
coding for FR1 is a CRC-3, radio noise interpreted as frame bits
has 1/8 probability of passing that weak CRC, and if this link
quality check is removed, the resulting behavior (at least with
sysmoBTS) is that fairly frequent RTP bogons (garbage frames
pretending to be valid speech) are emitted during DTXu pauses,
and when the resulting stream is decoded per the specs,
extremely unpleasant noises are heard.
The present change does not alter behavior in any way, but
affects the code structure: the same unchanged check is moved
from the common l1sap_tch_ind() handler into model-specific code
in each BTS model that feeds TCH-IND primitives to the former.
This change allows individual BTS models more fine-grained
control as to what checks are appropriate for their PHY design,
and it paves the way for implementation of the OS#5975 feature
of emitting empty timing tick RTP packets instead of packet gaps
in the RTP stream.
Related: OS#5975
Change-Id: Id95e48a578b7a8ce576862655abbe553c5b9a7bf
---
M src/common/l1sap.c
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
M src/osmo-bts-trx/sched_lchan_tchh.c
6 files changed, 67 insertions(+), 31 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/97/32097/1
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index efde406..2a1196c 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -1571,7 +1571,6 @@
static int l1sap_tch_ind(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap,
struct ph_tch_param *tch_ind)
{
- struct gsm_bts *bts = trx->bts;
struct msgb *msg = l1sap->oph.msg;
struct gsm_time g_time;
struct gsm_lchan *lchan;
@@ -1601,9 +1600,8 @@
/* Low level layers always call us when TCH content is expected, even if
* the content is not available due to decoding issues. Content not
- * available is expected as empty payload. We also check if quality is
- * good enough. */
- if (msg->len && tch_ind->lqual_cb >= bts->min_qual_norm) {
+ * available is expected as empty payload. */
+ if (msg->len) {
/* hand msg to RTP code for transmission */
if (lchan->abis_ip.osmux.use) {
lchan_osmux_send_frame(lchan, msg->data, msg->len,
diff --git a/src/osmo-bts-lc15/tch.c b/src/osmo-bts-lc15/tch.c
index 526b2dd..0aaea22 100644
--- a/src/osmo-bts-lc15/tch.c
+++ b/src/osmo-bts-lc15/tch.c
@@ -363,17 +363,18 @@
uint8_t *payload, payload_type, payload_len, sid_first[9] = { 0 };
struct msgb *rmsg = NULL;
struct gsm_lchan *lchan = &trx->ts[L1SAP_CHAN2TS(chan_nr)].lchan[l1sap_chan2ss(chan_nr)];
+ uint16_t ber10k = data_ind->measParam.fBer * 10000;
+ int16_t lqual_cb = data_ind->measParam.fLinkQuality * 10;
if (is_recv_only(lchan->abis_ip.speech_mode))
return -EAGAIN;
- if (data_ind->msgUnitParam.u8Size < 1) {
+ if (data_ind->msgUnitParam.u8Size < 1 || lqual_cb < trx->bts->min_qual_norm) {
LOGPFN(DL1P, LOGL_DEBUG, data_ind->u32Fn, "chan_nr %d Rx Payload size 0\n", chan_nr);
/* Push empty payload to upper layers */
rmsg = msgb_alloc_headroom(256, 128, "L1P-to-RTP");
return add_l1sap_header(trx, rmsg, lchan, chan_nr, data_ind->u32Fn,
- data_ind->measParam.fBer * 10000,
- data_ind->measParam.fLinkQuality * 10, 0, 0, 0);
+ ber10k, lqual_cb, 0, 0, 0);
}
payload_type = data_ind->msgUnitParam.u8Buffer[0];
@@ -462,8 +463,7 @@
if (rmsg)
return add_l1sap_header(trx, rmsg, lchan, chan_nr, data_ind->u32Fn,
- data_ind->measParam.fBer * 10000,
- data_ind->measParam.fLinkQuality * 10, 0, 0, 0);
+ ber10k, lqual_cb, 0, 0, 0);
return 0;
diff --git a/src/osmo-bts-oc2g/tch.c b/src/osmo-bts-oc2g/tch.c
index 09ee1e7..0e504ad 100644
--- a/src/osmo-bts-oc2g/tch.c
+++ b/src/osmo-bts-oc2g/tch.c
@@ -363,17 +363,18 @@
uint8_t *payload, payload_type, payload_len, sid_first[9] = { 0 };
struct msgb *rmsg = NULL;
struct gsm_lchan *lchan = &trx->ts[L1SAP_CHAN2TS(chan_nr)].lchan[l1sap_chan2ss(chan_nr)];
+ uint16_t ber10k = data_ind->measParam.fBer * 10000;
+ int16_t lqual_cb = data_ind->measParam.fLinkQuality * 10;
if (is_recv_only(lchan->abis_ip.speech_mode))
return -EAGAIN;
- if (data_ind->msgUnitParam.u8Size < 1) {
+ if (data_ind->msgUnitParam.u8Size < 1 || lqual_cb < trx->bts->min_qual_norm) {
LOGPFN(DL1P, LOGL_DEBUG, data_ind->u32Fn, "chan_nr %d Rx Payload size 0\n", chan_nr);
/* Push empty payload to upper layers */
rmsg = msgb_alloc_headroom(256, 128, "L1P-to-RTP");
return add_l1sap_header(trx, rmsg, lchan, chan_nr, data_ind->u32Fn,
- data_ind->measParam.fBer * 10000,
- data_ind->measParam.fLinkQuality * 10, 0, 0, 0);
+ ber10k, lqual_cb, 0, 0, 0);
}
payload_type = data_ind->msgUnitParam.u8Buffer[0];
@@ -474,8 +475,7 @@
if (rmsg)
return add_l1sap_header(trx, rmsg, lchan, chan_nr, data_ind->u32Fn,
- data_ind->measParam.fBer * 10000,
- data_ind->measParam.fLinkQuality * 10, 0, 0, 0);
+ ber10k, lqual_cb, 0, 0, 0);
return 0;
diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c
index 8c9557c..6a5d2c3 100644
--- a/src/osmo-bts-sysmo/tch.c
+++ b/src/osmo-bts-sysmo/tch.c
@@ -507,20 +507,20 @@
uint8_t *payload, payload_type, payload_len, sid_first[9] = { 0 };
struct msgb *rmsg = NULL;
struct gsm_lchan *lchan = &trx->ts[L1SAP_CHAN2TS(chan_nr)].lchan[l1sap_chan2ss(chan_nr)];
+ uint16_t ber10k = data_ind->measParam.fBer * 10000;
+ int16_t lqual_cb = data_ind->measParam.fLinkQuality * 10;
+ int8_t rssi = data_ind->measParam.fRssi;
+ int16_t ta_offs = data_ind->measParam.i16BurstTiming * 64;
if (is_recv_only(lchan->abis_ip.speech_mode))
return -EAGAIN;
- if (data_ind->msgUnitParam.u8Size < 1) {
+ if (data_ind->msgUnitParam.u8Size < 1 || lqual_cb < trx->bts->min_qual_norm) {
LOGPFN(DL1P, LOGL_DEBUG, data_ind->u32Fn, "chan_nr %d Rx Payload size 0\n", chan_nr);
/* Push empty payload to upper layers */
rmsg = msgb_alloc_headroom(256, 128, "L1P-to-RTP");
return add_l1sap_header(trx, rmsg, lchan, chan_nr, data_ind->u32Fn,
- data_ind->measParam.fBer * 10000,
- data_ind->measParam.fLinkQuality * 10,
- data_ind->measParam.fRssi,
- data_ind->measParam.i16BurstTiming * 64,
- 0);
+ ber10k, lqual_cb, rssi, ta_offs, 0);
}
payload_type = data_ind->msgUnitParam.u8Buffer[0];
@@ -614,11 +614,7 @@
if (rmsg)
return add_l1sap_header(trx, rmsg, lchan, chan_nr, data_ind->u32Fn,
- data_ind->measParam.fBer * 10000,
- data_ind->measParam.fLinkQuality * 10,
- data_ind->measParam.fRssi,
- data_ind->measParam.i16BurstTiming * 64,
- 0);
+ ber10k, lqual_cb, rssi, ta_offs, 0);
return 0;
diff --git a/src/osmo-bts-trx/sched_lchan_tchf.c b/src/osmo-bts-trx/sched_lchan_tchf.c
index 256125b..a7e45aa 100644
--- a/src/osmo-bts-trx/sched_lchan_tchf.c
+++ b/src/osmo-bts-trx/sched_lchan_tchf.c
@@ -75,6 +75,7 @@
{
struct l1sched_chan_state *chan_state = &l1ts->chan_state[bi->chan];
struct gsm_lchan *lchan = chan_state->lchan;
+ struct gsm_bts *bts = lchan->ts->trx->bts;
sbit_t *burst, **bursts_p = &chan_state->ul_bursts;
uint8_t *mask = &chan_state->ul_mask;
uint8_t rsl_cmode = chan_state->rsl_cmode;
@@ -281,9 +282,12 @@
bfi:
if (rsl_cmode == RSL_CMOD_SPD_SPEECH) {
- /* indicate bad frame */
- if (lchan->tch.dtx.ul_sid) {
- /* DTXu: pause in progress. Push empty payload to upper layers */
+ /* Indicate bad frame. We push an empty payload to
+ * upper layers under two conditions:
+ *
+ * 1) If there is a DTXu pause in progress, or
+ * 2) If the link quality is too low. */
+ if (lchan->tch.dtx.ul_sid || meas_avg.ci_cb < bts->min_qual_norm) {
rc = 0;
goto compose_l1sap;
}
diff --git a/src/osmo-bts-trx/sched_lchan_tchh.c b/src/osmo-bts-trx/sched_lchan_tchh.c
index 37fd59d..2b6f4c3 100644
--- a/src/osmo-bts-trx/sched_lchan_tchh.c
+++ b/src/osmo-bts-trx/sched_lchan_tchh.c
@@ -97,6 +97,7 @@
{
struct l1sched_chan_state *chan_state = &l1ts->chan_state[bi->chan];
struct gsm_lchan *lchan = chan_state->lchan;
+ struct gsm_bts *bts = lchan->ts->trx->bts;
sbit_t *burst, **bursts_p = &chan_state->ul_bursts;
uint8_t *mask = &chan_state->ul_mask;
uint8_t rsl_cmode = chan_state->rsl_cmode;
@@ -319,9 +320,12 @@
/* A FACCH/H frame replaces two speech frames, so we need to send two BFIs.
* One is sent here, another will be sent two bursts later (see above). */
if (rsl_cmode == RSL_CMOD_SPD_SPEECH) {
- /* indicate bad frame */
- if (lchan->tch.dtx.ul_sid) {
- /* DTXu: pause in progress. Push empty payload to upper layers */
+ /* Indicate bad frame. We push an empty payload to
+ * upper layers under two conditions:
+ *
+ * 1) If there is a DTXu pause in progress, or
+ * 2) If the link quality is too low. */
+ if (lchan->tch.dtx.ul_sid || meas_avg.ci_cb < bts->min_qual_norm) {
rc = 0;
goto compose_l1sap;
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/32097
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Id95e48a578b7a8ce576862655abbe553c5b9a7bf
Gerrit-Change-Number: 32097
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-MessageType: newchange
falconia has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/32099 )
Change subject: speech TCH, all models: implement option of Themyscira BFI packets
......................................................................
speech TCH, all models: implement option of Themyscira BFI packets
Themyscira Wireless System Software is an external add-on to Osmocom
CNI that provides interconnection between an Osmocom GSM network
and regular national public telephone networks, developed initially
for USA PSTN. Voice plane interconnection to PSTN is achieved
by way of G.711 RTP streams, and these public-interfacing RTP streams
are required to be fully continuous, emitting 160 PCM samples every
20 ms no matter what is happening on the GSM side. The transcoding
boundary MGW component of ThemWi is responsible for comfort noise
generation during GSM DTXu pauses and error concealment any time
GSM UL traffic frames are lost for any other reason - but it
requires a bit of assistance from the IP BTS that is the ultimate
origin of the outgoing RTP stream: when FR or EFR codec is used,
ThemWi transcoding MGW expects the IP BTS to emit special
Themyscira-invented BFI packets any time a BFI condition occurs.
These Themyscira BFI packets also carry a TAF bit exactly like
the one in GSM 08.60 TRAU UL frames.
The present change extends the rtp always-output vty option added
just previously: the new option becomes rtp always-output [themyscira-bfi],
and if the last qualifier is included, the special Themyscira
extension mode is enabled. In this mode, which only affects FR and
EFR codecs, RTP packets emitted when there is no speech or SID
frame to be sent change from zero-length RTP payload to Themyscira
BFI marker format, including TAF.
Related: OS#5975
Change-Id: Ib935efb1f7c9c8d919a4a0ea2bef244a47e5fb24
---
M include/osmo-bts/bts.h
M src/common/l1sap.c
M src/common/vty.c
M src/osmo-bts-trx/l1_if.c
M src/osmo-bts-trx/sched_lchan_tchf.c
5 files changed, 95 insertions(+), 15 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/99/32099/1
diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h
index 14c78a3..56bf289 100644
--- a/include/osmo-bts/bts.h
+++ b/include/osmo-bts/bts.h
@@ -315,6 +315,7 @@
int rtp_priority;
bool rtp_nogaps_mode; /* emit RTP stream without any gaps */
+ bool rtp_themyscira_ext; /* Themyscira extension for FR/EFR BFI */
struct {
uint8_t ciphers; /* flags A5/1==0x1, A5/2==0x2, A5/3==0x4 */
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index f8320b0..3e4d2a0 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -1252,6 +1252,9 @@
* on our own TDMA timing. */
if (!resp_msg->len)
return false;
+ /* Likewise weed out Themyscira BFI marker packets. */
+ if (resp_msg->len == 2 && resp_msg->data[0] == 0xBF)
+ return false;
/* Avoid sending bw-efficient AMR to lower layers, most bts models
* don't support it. */
if (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR &&
@@ -1610,13 +1613,27 @@
* if the lower layers sent us a non-empty payload OR if
* rtp always-output mode is configured. */
if (msg->len || bts->rtp_nogaps_mode) {
+ uint8_t *rtp_pl = msg->data;
+ uint16_t rtp_pl_len = msg->len;
+ uint8_t bfi[2];
+
+ /* Generate and substitute Themyscira BFI packet if necessary */
+ if (!msg->len && bts->rtp_themyscira_ext &&
+ (lchan->type == GSM_LCHAN_TCH_F) &&
+ (lchan->tch_mode == GSM48_CMODE_SPEECH_V1 ||
+ lchan->tch_mode == GSM48_CMODE_SPEECH_EFR)) {
+ bfi[0] = 0xBF;
+ bfi[1] = (fn % 104 == 52); /* TAF */
+ rtp_pl = bfi;
+ rtp_pl_len = 2;
+ }
/* hand msg to RTP code for transmission */
if (lchan->abis_ip.osmux.use) {
- lchan_osmux_send_frame(lchan, msg->data, msg->len,
+ lchan_osmux_send_frame(lchan, rtp_pl, rtp_pl_len,
fn_ms_adj(fn, lchan), lchan->rtp_tx_marker);
} else if (lchan->abis_ip.rtp_socket) {
osmo_rtp_send_frame_ext(lchan->abis_ip.rtp_socket,
- msg->data, msg->len, fn_ms_adj(fn, lchan), lchan->rtp_tx_marker);
+ rtp_pl, rtp_pl_len, fn_ms_adj(fn, lchan), lchan->rtp_tx_marker);
}
/* if loopback is enabled, also queue received RTP data */
if (lchan->loopback) {
diff --git a/src/common/vty.c b/src/common/vty.c
index aa49f6b..a8155bf 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -421,8 +421,12 @@
vty_out(vty, " rtp ip-dscp %i%s", bts->rtp_ip_dscp, VTY_NEWLINE);
if (bts->rtp_priority != -1)
vty_out(vty, " rtp socket-priority %i%s", bts->rtp_priority, VTY_NEWLINE);
- if (bts->rtp_nogaps_mode)
- vty_out(vty, " rtp always-output%s", VTY_NEWLINE);
+ if (bts->rtp_nogaps_mode) {
+ vty_out(vty, " rtp always-output");
+ if (bts->rtp_themyscira_ext)
+ vty_out(vty, " themyscira-bfi");
+ vty_out(vty, "%s", VTY_NEWLINE);
+ }
vty_out(vty, " paging queue-size %u%s", paging_get_queue_max(bts->paging_state),
VTY_NEWLINE);
vty_out(vty, " paging lifetime %u%s", paging_get_lifetime(bts->paging_state),
@@ -784,12 +788,17 @@
DEFUN(cfg_bts_rtp_always_output,
cfg_bts_rtp_always_output_cmd,
- "rtp always-output",
- RTP_STR "Always emit an RTP packet every 20 ms\n")
+ "rtp always-output [themyscira-bfi]",
+ RTP_STR "Always emit an RTP packet every 20 ms\n"
+ "Emit Themyscira BFI packets for FR and EFR\n")
{
struct gsm_bts *bts = vty->index;
bts->rtp_nogaps_mode = true;
+ if (argc > 0)
+ bts->rtp_themyscira_ext = true;
+ else
+ bts->rtp_themyscira_ext = false;
return CMD_SUCCESS;
}
@@ -801,6 +810,7 @@
struct gsm_bts *bts = vty->index;
bts->rtp_nogaps_mode = false;
+ bts->rtp_themyscira_ext = false;
return CMD_SUCCESS;
}
diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c
index 2ed1868..93161b2 100644
--- a/src/osmo-bts-trx/l1_if.c
+++ b/src/osmo-bts-trx/l1_if.c
@@ -439,8 +439,14 @@
break;
}
- /* attempt to allocate an Error Concealment Unit instance, if available */
- lchan->ecu_state = osmo_ecu_init(trx, lchan2ecu_codec(lchan));
+ /* Attempt to allocate an Error Concealment Unit
+ * instance, if available - but not in Themyscira
+ * environment, where in-BTS ECU is undesirable.
+ */
+ if (!trx->bts->rtp_themyscira_ext)
+ lchan->ecu_state = osmo_ecu_init(trx, lchan2ecu_codec(lchan));
+ else
+ lchan->ecu_state = NULL;
/* activate dedicated channel */
trx_sched_set_lchan(lchan, chan_nr, LID_DEDIC, true);
@@ -473,7 +479,10 @@
/* ECU for possibly new codec */
if (lchan->ecu_state)
osmo_ecu_destroy(lchan->ecu_state);
- lchan->ecu_state = osmo_ecu_init(trx, lchan2ecu_codec(lchan));
+ if (!trx->bts->rtp_themyscira_ext)
+ lchan->ecu_state = osmo_ecu_init(trx, lchan2ecu_codec(lchan));
+ else
+ lchan->ecu_state = NULL;
/* change mode */
trx_sched_set_mode(lchan->ts, chan_nr,
lchan->rsl_cmode, lchan->tch_mode,
diff --git a/src/osmo-bts-trx/sched_lchan_tchf.c b/src/osmo-bts-trx/sched_lchan_tchf.c
index a7e45aa..7211496 100644
--- a/src/osmo-bts-trx/sched_lchan_tchf.c
+++ b/src/osmo-bts-trx/sched_lchan_tchf.c
@@ -301,14 +301,22 @@
switch (tch_mode) {
case GSM48_CMODE_SPEECH_V1: /* FR */
- memset(tch_data, 0, GSM_FR_BYTES);
- tch_data[0] = 0xd0;
- rc = GSM_FR_BYTES;
+ if (bts->rtp_themyscira_ext)
+ rc = 0;
+ else {
+ memset(tch_data, 0, GSM_FR_BYTES);
+ tch_data[0] = 0xd0;
+ rc = GSM_FR_BYTES;
+ }
break;
case GSM48_CMODE_SPEECH_EFR: /* EFR */
- memset(tch_data, 0, GSM_EFR_BYTES);
- tch_data[0] = 0xc0;
- rc = GSM_EFR_BYTES;
+ if (bts->rtp_themyscira_ext)
+ rc = 0;
+ else {
+ memset(tch_data, 0, GSM_EFR_BYTES);
+ tch_data[0] = 0xc0;
+ rc = GSM_EFR_BYTES;
+ }
break;
case GSM48_CMODE_SPEECH_AMR: /* AMR */
rc = osmo_amr_rtp_enc(tch_data,
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/32099
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ib935efb1f7c9c8d919a4a0ea2bef244a47e5fb24
Gerrit-Change-Number: 32099
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-MessageType: newchange
falconia has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/32100 )
Change subject: sysmo: emit empty RTP ticks during FACCH stealing on TCH/F
......................................................................
sysmo: emit empty RTP ticks during FACCH stealing on TCH/F
When FACCH stealing occurs and sysmoBTS L1 delivers GsmL1_Sapi_FacchF
instead of GsmL1_Sapi_TchF, that 20 ms unit still needs to be
accounted for in the RTP timestamp cadence, and if we run with
rtp always-output output, then an actual BFI packet needs to be
emitted. The original code failed to do either; the present
change implements correct behavior for TCH/F.
The case of TCH/H is still unhandled, and it may or may not be
possible to handle correctly, particularly for rtp always-output mode.
The fundamental difficulty is that in order to produce truly
undisrupted RTP timing, two BFI packets will need to be sent for
one FACCH, spaced 20 ms apart - but if the PHY only sends one
GsmL1_Sapi_FacchH message surrounded by a 40 ms time gap, then
we may be out of luck.
Related: OS#5974
Change-Id: I39d15faade28fb7d670493a99a0e0bdb654e2a4a
---
M src/osmo-bts-sysmo/l1_if.c
M src/osmo-bts-sysmo/l1_if.h
M src/osmo-bts-sysmo/tch.c
3 files changed, 56 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/00/32100/1
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
index 646cf01..06347cf 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -980,6 +980,12 @@
return rc;
}
+ /* If we got FACCH, the RTP clock needs to account for it,
+ * and if we have rtp always-output enabled, an actual BFI packet
+ * will be emitted. */
+ if (data_ind->sapi == GsmL1_Sapi_FacchF)
+ l1if_tch_rx_facch(trx, chan_nr, l1p_msg);
+
/* fill L1SAP header */
sap_msg = l1sap_msgb_alloc(data_ind->msgUnitParam.u8Size);
l1sap = msgb_l1sap_prim(sap_msg);
diff --git a/src/osmo-bts-sysmo/l1_if.h b/src/osmo-bts-sysmo/l1_if.h
index 8691eef..5b2da04 100644
--- a/src/osmo-bts-sysmo/l1_if.h
+++ b/src/osmo-bts-sysmo/l1_if.h
@@ -129,6 +129,8 @@
const uint8_t *rtp_pl, unsigned int rtp_pl_len, uint32_t fn,
bool use_cache, bool marker);
int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg);
+int l1if_tch_rx_facch(struct gsm_bts_trx *trx, uint8_t chan_nr,
+ struct msgb *l1p_msg);
int l1if_tch_fill(struct gsm_lchan *lchan, uint8_t *l1_buffer);
struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan, uint32_t fn);
diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c
index 6a5d2c3..cecb4dd 100644
--- a/src/osmo-bts-sysmo/tch.c
+++ b/src/osmo-bts-sysmo/tch.c
@@ -625,6 +625,29 @@
return -EINVAL;
}
+/*! \brief provide an RTP empty payload "tick" to upper layers upon FACCH */
+int l1if_tch_rx_facch(struct gsm_bts_trx *trx, uint8_t chan_nr,
+ struct msgb *l1p_msg)
+{
+ GsmL1_Prim_t *l1p = msgb_l1prim(l1p_msg);
+ GsmL1_PhDataInd_t *data_ind = &l1p->u.phDataInd;
+ struct msgb *rmsg = NULL;
+ struct gsm_lchan *lchan = &trx->ts[L1SAP_CHAN2TS(chan_nr)].lchan[l1sap_chan2ss(chan_nr)];
+
+ if (is_recv_only(lchan->abis_ip.speech_mode))
+ return -EAGAIN;
+
+ LOGPFN(DL1P, LOGL_DEBUG, data_ind->u32Fn, "chan_nr %d Rx FACCH\n", chan_nr);
+ /* Push empty payload to upper layers */
+ rmsg = msgb_alloc_headroom(256, 128, "L1P-to-RTP");
+ return add_l1sap_header(trx, rmsg, lchan, chan_nr, data_ind->u32Fn,
+ data_ind->measParam.fBer * 10000,
+ data_ind->measParam.fLinkQuality * 10,
+ 0, /* suppress RSSI like in osmo-bts-trx */
+ data_ind->measParam.i16BurstTiming * 64,
+ 0);
+}
+
struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan, uint32_t fn)
{
struct msgb *msg;
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/32100
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I39d15faade28fb7d670493a99a0e0bdb654e2a4a
Gerrit-Change-Number: 32100
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-MessageType: newchange
Attention is currently required from: Matan Perelman.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/gapk/+/32094
to look at the new patch set (#2).
Change subject: fmt_rtp_amr,fmt_rtp_efr: replace damaged packets with silence
......................................................................
fmt_rtp_amr,fmt_rtp_efr: replace damaged packets with silence
Change-Id: I7245aa0bc0955cc8b94d5401a15e694f50498093
---
M src/fmt_rtp_amr.c
M src/fmt_rtp_efr.c
2 files changed, 29 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/gapk refs/changes/94/32094/2
--
To view, visit https://gerrit.osmocom.org/c/gapk/+/32094
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: gapk
Gerrit-Branch: master
Gerrit-Change-Id: I7245aa0bc0955cc8b94d5401a15e694f50498093
Gerrit-Change-Number: 32094
Gerrit-PatchSet: 2
Gerrit-Owner: Matan Perelman <matan1008(a)gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: Matan Perelman <matan1008(a)gmail.com>
Gerrit-MessageType: newpatchset
Jenkins Builder has posted comments on this change. ( https://gerrit.osmocom.org/c/gapk/+/32094 )
Change subject: fmt_rtp_amr,fmt_rtp_efr: replace damaged packets with silence
......................................................................
Patch Set 1:
(1 comment)
File src/fmt_rtp_efr.c:
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-5493):
https://gerrit.osmocom.org/c/gapk/+/32094/comment/f83be597_88627b6c
PS1, Line 70: if (!memcmp(DAMAGED_PACKET, src, EFR_LEN)) {
braces {} are not necessary for single statement blocks
--
To view, visit https://gerrit.osmocom.org/c/gapk/+/32094
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: gapk
Gerrit-Branch: master
Gerrit-Change-Id: I7245aa0bc0955cc8b94d5401a15e694f50498093
Gerrit-Change-Number: 32094
Gerrit-PatchSet: 1
Gerrit-Owner: Matan Perelman <matan1008(a)gmail.com>
Gerrit-CC: Jenkins Builder
Gerrit-Comment-Date: Tue, 28 Mar 2023 05:33:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment