falconia has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/41050?usp=email )
Change subject: HRv1 codec: add support for TW-TS-002
......................................................................
HRv1 codec: add support for TW-TS-002
OsmoBTS supports TW-TS-001 enhanced RTP format for FR and EFR codecs
since 2024, providing functional equivalent of GSM 08.60 TRAU-UL
output over IP physical transport. Now do the same with TW-TS-002,
IP equivalent of GSM 08.61 for HRv1 codec.
Only TCH UL path is affected; no changes are needed to TCH DL path
because existing RTP Rx handling for RFC 5993 also covers TW-TS-002.
Related: OS#6036
Change-Id: Icf11e43d4ce9df990d0e0a856d62d9ea11cb837c
---
M src/common/bts.c
M src/common/l1sap.c
2 files changed, 74 insertions(+), 7 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/50/41050/1
diff --git a/src/common/bts.c b/src/common/bts.c
index 282d730..73cb8a6 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -394,6 +394,7 @@
osmo_bts_set_feature(bts->features, BTS_FEAT_IPV6_NSVC);
osmo_bts_set_feature(bts->features, BTS_FEAT_PAGING_COORDINATION);
osmo_bts_set_feature(bts->features, BTS_FEAT_TWTS001);
+ osmo_bts_set_feature(bts->features, BTS_FEAT_TWTS002);
/* Maximum TA supported by the PHY (can be overridden by PHY specific code) */
bts->support.max_ta = MAX_TA_DEF;
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index e8453b8..d8754f6 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -2227,12 +2227,66 @@
}
}
+/* See Section 5.2 of RFC5993 and TW-TS-002 */
+enum super5993_ft {
+ FT_GOOD_SPEECH = 0,
+ FT_INVALID_SID = 1,
+ FT_GOOD_SID = 2,
+ FT_BFI_WITH_DATA = 6,
+ FT_NO_DATA = 7,
+};
+
+/* a helper function for emitting GSM-HR UL in TW-TS-002 format */
+static void send_rtp_twts002(struct gsm_lchan *lchan, uint32_t fn,
+ struct msgb *msg)
+{
+ enum super5993_ft ft;
+ uint8_t toc;
+ bool send_frame;
+
+ if (msg->len == GSM_HR_BYTES) {
+ switch (tch_ul_msg_sid(msg)) {
+ case OSMO_GSM631_SID_CLASS_SPEECH:
+ ft = tch_ul_msg_bfi(msg) ? FT_BFI_WITH_DATA
+ : FT_GOOD_SPEECH;
+ break;
+ case OSMO_GSM631_SID_CLASS_INVALID:
+ ft = FT_INVALID_SID;
+ break;
+ case OSMO_GSM631_SID_CLASS_VALID:
+ ft = tch_ul_msg_bfi(msg) ? FT_INVALID_SID : FT_GOOD_SID;
+ break;
+ default:
+ OSMO_ASSERT(0);
+ }
+ send_frame = true;
+ } else {
+ ft = FT_NO_DATA;
+ send_frame = false;
+ }
+ /* ToC octet of TW-TS-002 is an extension of RFC 5993 */
+ toc = ft << 4;
+ if (ft == FT_INVALID_SID)
+ toc |= 0x04; /* TW-TS-002 version 1.2.0 */
+ /* always set DTXd and TAF bits */
+ if (lchan->ts->trx->bts->dtxd)
+ toc |= 0x08;
+ if (fr_hr_efr_sid_position(lchan, fn))
+ toc |= 0x01;
+ if (send_frame) {
+ msgb_push_u8(msg, toc);
+ send_ul_rtp_packet(lchan, fn, msg->data, msg->len);
+ } else {
+ send_ul_rtp_packet(lchan, fn, &toc, 1);
+ }
+}
+
/* A helper function for l1sap_tch_ind(): handling BFI
*
* Please note that the msgb passed to this function is used only when
- * the CN asked the BSS to emit extended RTP formats (currently TW-TS-001,
- * later TW-TS-002 as well) that can indicate BFI along with deemed-bad
- * frame data bits, just like GSM 08.60 and 08.61 TRAU-UL frames.
+ * the CN asked the BSS to emit extended RTP formats of TW-TS-001 or
+ * TW-TS-002 that can indicate BFI along with deemed-bad frame data bits,
+ * just like GSM 08.60 and 08.61 TRAU-UL frames.
*/
static void tch_ul_bfi_handler(struct gsm_lchan *lchan,
const struct gsm_time *g_time, struct msgb *msg)
@@ -2255,6 +2309,14 @@
return;
}
+ /* Ditto for TCH/HS and TW-TS-002. */
+ if ((lchan->abis_ip.rtp_extensions & OSMO_RTP_EXT_TWTS002) &&
+ lchan->type == GSM_LCHAN_TCH_H &&
+ lchan->tch_mode == GSM48_CMODE_SPEECH_V1) {
+ send_rtp_twts002(lchan, fn, msg);
+ return;
+ }
+
/* Are we applying an ECU to this uplink, and are we in a state
* (not DTX pause) where we emit ECU output? */
if (lchan->ecu_state && !osmo_ecu_is_dtx_pause(lchan->ecu_state)) {
@@ -2526,10 +2588,14 @@
send_ul_rtp_packet(lchan, fn, msg->data, msg->len);
} else if (lchan->type == GSM_LCHAN_TCH_H &&
lchan->tch_mode == GSM48_CMODE_SPEECH_V1) {
- /* HR codec: TS 101 318 or RFC 5993,
- * will also support TW-TS-002 in the future. */
- send_gsmhr_std_rtp(lchan, &g_time, msg,
- bts->emit_hr_rfc5993);
+ /* HR codec: TW-TS-002 in ThemWi environment,
+ * or TS 101 318 or RFC 5993 in traditional
+ * 3GPP or Osmocom environments. */
+ if (lchan->abis_ip.rtp_extensions & OSMO_RTP_EXT_TWTS002)
+ send_rtp_twts002(lchan, fn, msg);
+ else
+ send_gsmhr_std_rtp(lchan, &g_time, msg,
+ bts->emit_hr_rfc5993);
} else {
/* generic case, no RTP alterations */
send_ul_rtp_packet(lchan, fn, msg->data, msg->len);
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/41050?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Icf11e43d4ce9df990d0e0a856d62d9ea11cb837c
Gerrit-Change-Number: 41050
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Attention is currently required from: osmith, pespin.
fixeria has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-msc/+/41041?usp=email )
Change subject: gsm48_cc_tx_setup_encode_msg: split out
......................................................................
Patch Set 1: Code-Review+1
(1 comment)
File src/libmsc/gsm_04_08_cc.c:
https://gerrit.osmocom.org/c/osmo-msc/+/41041/comment/fee02fef_9aa9073e?usp… :
PS1, Line 1052: msg = gsm48_cc_tx_setup_encode_msg(setup, &bearer_cap);
> Probably want to also swap the param order to have it inline with the ones above.
Acknowledged
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/41041?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I443b4b54c6ad40d852e4c21c896c2d0da5fac239
Gerrit-Change-Number: 41041
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 04 Sep 2025 17:29:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Attention is currently required from: osmith, pespin.
fixeria has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-msc/+/41040?usp=email )
Change subject: gsm48_cc_tx_setup_set_bearer_cap: split out
......................................................................
Patch Set 1:
(3 comments)
File src/libmsc/gsm_04_08_cc.c:
https://gerrit.osmocom.org/c/osmo-msc/+/41040/comment/af53d59f_75b2c43a?usp… :
PS1, Line 918: static int gsm48_cc_tx_setup_set_bearer_cap(struct gsm_trans *trans, const struct gsm_mncc *setup,
> Since we have 2 inout pars and 1 in par, please move the in par to the end instead of having it in t […]
Ack. This ordering is influenced by the Intel assembly flavor ;)
https://gerrit.osmocom.org/c/osmo-msc/+/41040/comment/80f4690f_703fb703?usp… :
PS1, Line 945: rc
`rc` is set but not used here
https://gerrit.osmocom.org/c/osmo-msc/+/41040/comment/c7bc73b9_65460967?usp… :
PS1, Line 971: rc
`rc` is set but not used here
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/41040?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I3fe6bb2af90d729bb32cae8f5a1a38dcf8f87eb9
Gerrit-Change-Number: 41040
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 04 Sep 2025 17:28:42 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Attention is currently required from: osmith, pespin.
fixeria has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-msc/+/41039?usp=email )
Change subject: gsm48_cc_tx_setup_select_codecs: split out
......................................................................
Patch Set 1: Code-Review+1
(1 comment)
File src/libmsc/gsm_04_08_cc.c:
https://gerrit.osmocom.org/c/osmo-msc/+/41039/comment/dc5bc324_45e471c0?usp… :
PS1, Line 928: if (setup->fields & MNCC_F_BEARER_CAP)
> Why is this branch left here and not moved into the helper function?
I believe because this chunk is not directly related to codec selection?
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/41039?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: Ic502f9ed77ea57de4cf6d362c0e7070d9147d6f3
Gerrit-Change-Number: 41039
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 04 Sep 2025 17:17:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Attention is currently required from: osmith.
fixeria has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-msc/+/41038?usp=email )
Change subject: gsm48_cc_tx_setup_set_transaction_id: split out
......................................................................
Patch Set 1: Code-Review+1
(2 comments)
File src/libmsc/gsm_04_08_cc.c:
https://gerrit.osmocom.org/c/osmo-msc/+/41038/comment/14236da5_97064c19?usp… :
PS1, Line 845: TX Setup with assigned transaction. This is not allowed
I find this message a bit confusing, maybe say "transaction ID is already assigned"?
Not critical, can be done in a separate patch.
https://gerrit.osmocom.org/c/osmo-msc/+/41038/comment/740888d2_f2d1128e?usp… :
PS1, Line 847: mncc_release_ind(trans->net, trans, trans->callref,
: GSM48_CAUSE_LOC_PRN_S_LU,
: GSM48_CC_CAUSE_RESOURCE_UNAVAIL);
:
Maybe keep this in `gsm48_cc_tx_setup()`?
```
rc = gsm48_cc_tx_setup_set_transaction_id(trans);
if (rc < 0) {
mncc_release_ind(trans->net, trans, trans->callref,
GSM48_CAUSE_LOC_PRN_S_LU,
GSM48_CC_CAUSE_RESOURCE_UNAVAIL);
trans->callref = 0;
goto error;
}
```
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/41038?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I715f12d09570211a98b667c56960309bd326e8d8
Gerrit-Change-Number: 41038
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 04 Sep 2025 17:09:30 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/41045?usp=email )
Change subject: docs/suci-keytool.rst: spelling fix
......................................................................
docs/suci-keytool.rst: spelling fix
Change-Id: Idb45086d9d5963072fbc97835d551e2f78ad847f
---
M docs/suci-keytool.rst
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/45/41045/1
diff --git a/docs/suci-keytool.rst b/docs/suci-keytool.rst
index 88e3a24..37c2435 100644
--- a/docs/suci-keytool.rst
+++ b/docs/suci-keytool.rst
@@ -17,7 +17,7 @@
#. deploy the public key on your USIMs
#. deploy the private key on your 5GC, specifically the UDM function
-pysim contains (int its `contrib` directory) a small utility program that can make it easy to generate
+pysim contains (in its `contrib` directory) a small utility program that can make it easy to generate
such keys: `suci-keytool.py`
Generating keys
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41045?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Idb45086d9d5963072fbc97835d551e2f78ad847f
Gerrit-Change-Number: 41045
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>