Attention is currently required from: pespin.
osmith has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/upf-benchmark/+/39468?usp=email )
Change subject: gtplab-sysmo2025: Initial tunend test setup
......................................................................
Patch Set 7: Code-Review+1
(4 comments)
File testsuites/gtplab-sysmo2025/tunend/README.md:
https://gerrit.osmocom.org/c/upf-benchmark/+/39468/comment/aebf2a69_d1d0c05… :
PS7, Line 2: towards UPF on its 1st iface and which which should be sent back decapsulated (tunend) towards CN and received at TRex 2nd interface.
wrap this line?
https://gerrit.osmocom.org/c/upf-benchmark/+/39468/comment/f1805385_bef0320… :
PS7, Line 14: ----
Use \`\`\` instead of --- to make a markdown code block
File testsuites/gtplab-sysmo2025/tunend/trex/gtpu_topo.py:
https://gerrit.osmocom.org/c/upf-benchmark/+/39468/comment/7cd02e10_3bc9a88… :
PS7, Line 17: return ".".join(li)
add a new line afterwards? (or two as in PEP-8)
File testsuites/gtplab-sysmo2025/tunend/upf/osmo-upf/configure.sh:
https://gerrit.osmocom.org/c/upf-benchmark/+/39468/comment/e0fd1541_499fe77… :
PS7, Line 34: sudo ip addr add 172.16.32.1/24 dev $IFACE_RAN || true;
; is not needed at the end of these lines (same below)
--
To view, visit https://gerrit.osmocom.org/c/upf-benchmark/+/39468?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: upf-benchmark
Gerrit-Branch: master
Gerrit-Change-Id: I834b62d29c8dcf2553fc665821135fb08a8bae9e
Gerrit-Change-Number: 39468
Gerrit-PatchSet: 7
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 20 Feb 2025 09:59:58 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Jenkins Builder has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/upf-benchmark/+/39590?usp=email )
Change subject: testsuites/gtplab-sysmo2025/tunend: Initial eupf setup
......................................................................
Patch Set 1:
(1 comment)
File testsuites/gtplab-sysmo2025/tunend/upf/eupf/configure.sh:
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-21611):
https://gerrit.osmocom.org/c/upf-benchmark/+/39590/comment/3d757f39_cfeff64… :
PS1, Line 45: sudo ip route add 48.0.0.0/16 via $ADDR_GW_CN dev $IFACE_CN || true;
adding a line without newline at end of file
--
To view, visit https://gerrit.osmocom.org/c/upf-benchmark/+/39590?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: upf-benchmark
Gerrit-Branch: master
Gerrit-Change-Id: I82ebaa785c67fc7a28a0e71eac55fe31a21d13d5
Gerrit-Change-Number: 39590
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-CC: Jenkins Builder
Gerrit-Comment-Date: Wed, 19 Feb 2025 20:36:48 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
falconia has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/39559?usp=email )
Change subject: tests: add unit test for HRv1 TRAU->RTP
......................................................................
tests: add unit test for HRv1 TRAU->RTP
Unit tests for TRAU->RTP conversion for FRv1 and EFR codecs were
implemented earlier, but not for HRv1. Fill this gap in unit test
coverage.
The library code path exercised here is osmo_trau_frame_decode_8k()
followed by osmo_trau2rtp(). Both plain (RFC 5993) and extended
(TW-TS-002) RTP output formats are tested.
Change-Id: Id2703d313f52fa54465a13f3370ebb6d7d976bbd
---
M tests/Makefile.am
M tests/testsuite.at
A tests/trau_conv/trau2rtp_hr.in
A tests/trau_conv/trau2rtp_hr_std.ok
A tests/trau_conv/trau2rtp_hr_twts002.ok
5 files changed, 103 insertions(+), 0 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
pespin: Looks good to me, but someone else must approve
Jenkins Builder: Verified
fixeria: Looks good to me, approved
diff --git a/tests/Makefile.am b/tests/Makefile.am
index d904241..4abfc4a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -92,6 +92,8 @@
trau_conv/trau16_efr_twts001.ok \
trau_conv/trau16_fr.in trau_conv/trau16_fr_std.ok \
trau_conv/trau16_fr_twts001.ok \
+ trau_conv/trau2rtp_hr.in trau_conv/trau2rtp_hr_std.ok \
+ trau_conv/trau2rtp_hr_twts002.ok \
trau_sync/trau_sync_test.ok trau_sync/trau_sync_test.err \
trau_pcu_ericsson/trau_pcu_ericsson_test.ok
diff --git a/tests/testsuite.at b/tests/testsuite.at
index 70e7f25..291d47d 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -78,3 +78,15 @@
cat $abs_srcdir/trau_conv/trau16_efr_twts001.ok > expout
AT_CHECK([$abs_top_builddir/tests/trau_conv/trau16_to_rtp $abs_srcdir/trau_conv/trau16_efr.in ul tw-ts-001], [0], [expout], [ignore])
AT_CLEANUP
+
+AT_SETUP([trau2rtp_hr_std])
+AT_KEYWORDS([trau2rtp_hr_std])
+cat $abs_srcdir/trau_conv/trau2rtp_hr_std.ok > expout
+AT_CHECK([$abs_top_builddir/tests/trau_conv/trau2rtp_gen -8 $abs_srcdir/trau_conv/trau2rtp_hr.in], [0], [expout], [ignore])
+AT_CLEANUP
+
+AT_SETUP([trau2rtp_hr_twts002])
+AT_KEYWORDS([trau2rtp_hr_twts002])
+cat $abs_srcdir/trau_conv/trau2rtp_hr_twts002.ok > expout
+AT_CHECK([$abs_top_builddir/tests/trau_conv/trau2rtp_gen -8 -x $abs_srcdir/trau_conv/trau2rtp_hr.in], [0], [expout], [ignore])
+AT_CLEANUP
diff --git a/tests/trau_conv/trau2rtp_hr.in b/tests/trau_conv/trau2rtp_hr.in
new file mode 100644
index 0000000..dcf33f8
--- /dev/null
+++ b/tests/trau_conv/trau2rtp_hr.in
@@ -0,0 +1,61 @@
+# This file is an input to trau2rtp_gen unit test program, containing
+# TRAU-8k Abis-UL frames for TCH/HS.
+#
+# Most test frames in this set (all except a few hand-crafted ones) were
+# taken from an E1-Abis UL capture from Nokia InSite BTS, specifically
+# from hr-test2.bin E1 timeslot capture file posted here:
+#
+# https://osmocom.org/projects/retro-gsm/wiki/InSite_UL_captures
+#
+# The extraction of hex-encoded TRAU frames from the E1 timeslot octet stream
+# capture was done with trau-hr-dump program (-r option) developed in this
+# repository:
+#
+# https://www.freecalypso.org/hg/gsm-net-reveng/
+
+# 2 good speech frames from the beginning of the call
+
+# Frame at 0xcf5e:
+008846a6afdaf9a197a79d82b1efc4c9b8b0e4bb
+# Frame at 0xcffe:
+008844b78bdef8a8bd8da681abd6a2aabdf3e8fb
+
+# a pair of frames stolen for FACCH, the first of which falls on a TAF position
+
+# Frame at 0xd31e:
+008970e480e5808081f180a180fc809881d084fb
+# Frame at 0xd3be:
+008964e48681808081f182eb80e78099eb9d89fb
+
+# some voiced speech frames
+
+# Frame at 0xdb3e:
+00884694caaa89dc8083b89cc881e99a86adbebb
+# Frame at 0xdbde:
+008846e9e692c49bd1d3afac8aeec9f7a9d1efbb
+# Frame at 0xdc7e:
+00884789ff91c1bc93c7efca9f92c6f5a4b1f5fb
+# Frame at 0xdd1e:
+00884799ff82e09febd8aec895f4c2f1e1cfe8bb
+
+# a valid SID frame
+
+# Frame at 0x12c7e:
+00885084dfddccdfffaffffffffffffffffffffb
+
+# an invalid SID frame
+
+# Frame at 0x133fe:
+0089408799deb8ffffdffffffffffef5fffafffb
+
+# hand-crafted test frames follow
+
+# test handling of CRC: frames that begin like good speech,
+# but the 115 bits of payload+CRC are either all-0 or all-1
+00884480808080808080808080808080808080bb
+008847fffffffffffffffffffffffffffffffffb
+
+# good speech frame (copy of 0xdd1e) with XC6 flipped (parity error)
+00884399ff82e09febd8aec895f4c2f1e1cfe8bb
+# flip XC1 too: parity becomes good again, but the code is now undefined
+008a4399ff82e09febd8aec895f4c2f1e1cfe8bb
diff --git a/tests/trau_conv/trau2rtp_hr_std.ok b/tests/trau_conv/trau2rtp_hr_std.ok
new file mode 100644
index 0000000..d017a87
--- /dev/null
+++ b/tests/trau_conv/trau2rtp_hr_std.ok
@@ -0,0 +1,14 @@
+00932FB5E509773A098EF8925C30C8
+001B8BBDE143DD4C055D644A9EF3D1
+NULL
+NULL
+008A4A5426E0037072401D26832D7C
+00B4E62510DD135EB056E93DD4D1DE
+00C4FF2305E137DF28F928DD5231EB
+00CCFF0580FEB85D20AF485C70CFD0
+20025FBB32FFFFFFFFFFFFFFFFFFFF
+NULL
+NULL
+NULL
+NULL
+NULL
diff --git a/tests/trau_conv/trau2rtp_hr_twts002.ok b/tests/trau_conv/trau2rtp_hr_twts002.ok
new file mode 100644
index 0000000..db65082
--- /dev/null
+++ b/tests/trau_conv/trau2rtp_hr_twts002.ok
@@ -0,0 +1,14 @@
+00932FB5E509773A098EF8925C30C8
+001B8BBDE143DD4C055D644A9EF3D1
+613200CA000011008407C00600D009
+6032060200001105AC067006759D13
+008A4A5426E0037072401D26832D7C
+00B4E62510DD135EB056E93DD4D1DE
+00C4FF2305E137DF28F928DD5231EB
+00CCFF0580FEB85D20AF485C70CFD0
+20025FBB32FFFFFFFFFFFFFFFFFFFF
+10
+70
+70
+70
+70
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/39559?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: Id2703d313f52fa54465a13f3370ebb6d7d976bbd
Gerrit-Change-Number: 39559
Gerrit-PatchSet: 2
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
falconia has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/39558?usp=email )
Change subject: tests: add trau2rtp_gen program
......................................................................
tests: add trau2rtp_gen program
This test program converts TRAU-16k or TRAU-8k frames into RTP payloads,
both represented in hex. (Hex representation of RTP payloads follows
TW-TS-005 spec; hex representation of TRAU frames is ad hoc.) It can
be used as a basis for unit tests, verifying that a given TRAU frame
input turns into corresponding RTP output, and it can also be used
(in conjuction with additional Themyscira utilities) to turn captured
TRAU frame streams into playable audio.
Change-Id: I3cc8502406e930317b680b0ace2fce479e495ccd
---
M .gitignore
M tests/Makefile.am
A tests/trau_conv/trau2rtp_gen.c
A tests/trau_conv/trau2rtp_gen.notes
4 files changed, 342 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, approved
pespin: Looks good to me, but someone else must approve
diff --git a/.gitignore b/.gitignore
index fd0974d..dbe50db 100644
--- a/.gitignore
+++ b/.gitignore
@@ -44,6 +44,7 @@
tests/raa_prime/test_enc
tests/trau_pcu_ericsson/trau_pcu_ericsson_test
tests/trau_conv/trau16_to_rtp
+tests/trau_conv/trau2rtp_gen
tests/trau_sync/trau_sync_test
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 04ce529..d904241 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -9,6 +9,7 @@
raa_prime/test_dec \
raa_prime/test_enc \
trau_conv/trau16_to_rtp \
+ trau_conv/trau2rtp_gen \
trau_sync/trau_sync_test \
trau_pcu_ericsson/trau_pcu_ericsson_test
@@ -54,6 +55,9 @@
trau_conv_trau16_to_rtp_SOURCES = trau_conv/trau16_to_rtp.c
trau_conv_trau16_to_rtp_LDADD = $(TRAU_LA_LIBS)
+trau_conv_trau2rtp_gen_SOURCES = trau_conv/trau2rtp_gen.c
+trau_conv_trau2rtp_gen_LDADD = $(TRAU_LA_LIBS)
+
trau_sync_trau_sync_test_SOURCES = trau_sync/trau_sync_test.c
trau_sync_trau_sync_test_LDADD = $(TRAU_LA_LIBS)
diff --git a/tests/trau_conv/trau2rtp_gen.c b/tests/trau_conv/trau2rtp_gen.c
new file mode 100644
index 0000000..0f36d15
--- /dev/null
+++ b/tests/trau_conv/trau2rtp_gen.c
@@ -0,0 +1,208 @@
+/*
+ * This program is a generic exerciser for libosmotrau functions
+ * osmo_trau_frame_decode_16k() or osmo_trau_frame_decode_8k(),
+ * followed by osmo_trau2rtp(). See trau2rtp_gen.notes file
+ * for details about usage and file formats.
+ *
+ * Author: Mychaela N. Falconia <falcon(a)freecalypso.org>, 2025 - however,
+ * Mother Mychaela's contributions are NOT subject to copyright.
+ * No rights reserved, all rights relinquished.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <ctype.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <osmocom/core/bits.h>
+#include <osmocom/core/utils.h>
+#include <osmocom/trau/trau_frame.h>
+#include <osmocom/trau/trau_rtp.h>
+#include <osmocom/gsm/rtp_extensions.h>
+
+static enum osmo_trau_frame_direction direction;
+static bool trau_8k_mode;
+static struct osmo_trau2rtp_state trau2rtp_st;
+static FILE *out_file;
+
+static void do_trau_frame_16k(struct osmo_trau_frame *tf, const char *hex_str)
+{
+ uint8_t input_bytes[40];
+ ubit_t trau_bits[320];
+ int rc;
+
+ osmo_hexparse(hex_str, input_bytes, sizeof(input_bytes));
+ osmo_pbit2ubit(trau_bits, input_bytes, sizeof(trau_bits));
+ rc = osmo_trau_frame_decode_16k(tf, trau_bits, direction);
+ if (rc < 0) {
+ fprintf(stderr,
+ "error: osmo_trau_frame_decode_16k() returned %d\n",
+ rc);
+ exit(1);
+ }
+}
+
+static void do_trau_frame_8k(struct osmo_trau_frame *tf, const char *hex_str)
+{
+ uint8_t input_bytes[20];
+ ubit_t trau_bits[160];
+ int rc;
+
+ osmo_hexparse(hex_str, input_bytes, sizeof(input_bytes));
+ osmo_pbit2ubit(trau_bits, input_bytes, sizeof(trau_bits));
+ rc = osmo_trau_frame_decode_8k(tf, trau_bits, direction);
+ if (rc < 0) {
+ fprintf(stderr,
+ "error: osmo_trau_frame_decode_8k() returned %d\n",
+ rc);
+ exit(1);
+ }
+}
+
+static void emit_hex_frame(const uint8_t *frame, unsigned nbytes)
+{
+ unsigned n;
+
+ for (n = 0; n < nbytes; n++)
+ fprintf(out_file, "%02X", frame[n]);
+ putc('\n', out_file);
+}
+
+static void process_record(const char *hex_input)
+{
+ struct osmo_trau_frame tf;
+ uint8_t rtp_pl[40]; /* maximum RTP payload length for TW-TS-005 */
+ int rc;
+
+ if (trau_8k_mode)
+ do_trau_frame_8k(&tf, hex_input);
+ else
+ do_trau_frame_16k(&tf, hex_input);
+ trau2rtp_st.type = tf.type;
+ rc = osmo_trau2rtp(rtp_pl, sizeof(rtp_pl), &tf, &trau2rtp_st);
+ if (rc < 0) {
+ fprintf(stderr, "error: osmo_trau2rtp() returned %d\n", rc);
+ exit(1);
+ }
+ if (rc == 0) {
+ /* TW-TS-005 section 4.3.1 */
+ fputs("NULL\n", out_file);
+ return;
+ }
+ emit_hex_frame(rtp_pl, rc);
+}
+
+static void process_line(char *linebuf, const char *infname, int lineno)
+{
+ char *cp = linebuf, *hex_str;
+ int ndig, expect_digits;
+
+ while (isspace(*cp))
+ cp++;
+ if (*cp == '\0' || *cp == '#')
+ return;
+ /* expect string of 40 or 80 hex digits */
+ if (trau_8k_mode)
+ expect_digits = 40;
+ else
+ expect_digits = 80;
+ hex_str = cp;
+ for (ndig = 0; ndig < expect_digits; ndig++) {
+ if (!isxdigit(*cp))
+ goto inv_syntax;
+ cp++;
+ }
+ if (*cp) {
+ if (!isspace(*cp))
+ goto inv_syntax;
+ *cp++ = '\0';
+ }
+ /* must be end of non-comment line */
+ while (isspace(*cp))
+ cp++;
+ if (*cp != '\0' && *cp != '#')
+ goto inv_syntax;
+
+ process_record(hex_str);
+ return;
+
+inv_syntax:
+ fprintf(stderr, "%s line %d: invalid syntax\n", infname, lineno);
+ exit(1);
+}
+
+static void process_file(const char *infname, const char *outfname)
+{
+ FILE *inf;
+ char linebuf[256];
+ int lineno;
+
+ inf = fopen(infname, "r");
+ if (!inf) {
+ perror(infname);
+ exit(1);
+ }
+ if (outfname) {
+ out_file = fopen(outfname, "w");
+ if (!out_file) {
+ perror(outfname);
+ exit(1);
+ }
+ } else {
+ out_file = stdout;
+ }
+ for (lineno = 1; fgets(linebuf, sizeof(linebuf), inf); lineno++)
+ process_line(linebuf, infname, lineno);
+ fclose(inf);
+ if (outfname) {
+ fclose(out_file);
+ out_file = NULL;
+ }
+}
+
+int main(int argc, char **argv)
+{
+ int opt;
+ extern int optind;
+
+ trau_8k_mode = false;
+ direction = OSMO_TRAU_DIR_UL;
+ trau2rtp_st.rtp_extensions = 0;
+ while ((opt = getopt(argc, argv, "8dx")) != EOF) {
+ switch (opt) {
+ case '8':
+ trau_8k_mode = true;
+ break;
+ case 'd':
+ direction = OSMO_TRAU_DIR_DL;
+ break;
+ case 'x':
+ trau2rtp_st.rtp_extensions =
+ OSMO_RTP_EXT_TWTS001 | OSMO_RTP_EXT_TWTS002;
+ break;
+ default:
+ goto usage;
+ }
+ }
+ if (argc < optind + 1 || argc > optind + 2)
+ goto usage;
+ process_file(argv[optind], argv[optind + 1]);
+ exit(0);
+
+usage: fprintf(stderr, "usage: %s [-8] [-d] [-x] input-file [output-file]\n",
+ argv[0]);
+ exit(1);
+}
diff --git a/tests/trau_conv/trau2rtp_gen.notes b/tests/trau_conv/trau2rtp_gen.notes
new file mode 100644
index 0000000..90027f5
--- /dev/null
+++ b/tests/trau_conv/trau2rtp_gen.notes
@@ -0,0 +1,129 @@
+trau2rtp_gen is a generic exerciser for libosmotrau functions
+osmo_trau_frame_decode_16k() or osmo_trau_frame_decode_8k(), followed by
+osmo_trau2rtp(). Specifically, it reads input in the form of hex lines,
+with each line representing a TRAU-16k frame as a string of 80 hex digits
+or a TRAU-8k frame as a string of 40 hex digits, passes each TRAU frame
+thus read into libosmotrau functions under test, and emits the resulting
+RTP payload in another hex format defined in TW-TS-005. IOW, this program
+is a hex-to-hex converter where input hex lines represent TRAU frames
+and output hex lines represent RTP payloads.
+
+Usage synopsis:
+
+trau2rtp_gen [-8] [-d] [-x] input-file [output-file]
+
+Option flags:
+
+-8 Without this flag, trau2rtp_gen operates on 16 kbit/s TRAU frames,
+ expects every input hex line to be 80 hex digits long, and exercises
+ osmo_trau_frame_decode_16k() function. With -8 flag, trau2rtp_gen
+ operates on 8 kbit/s TRAU frames, expects every input hex line to be
+ 40 hex digits long, and exercises osmo_trau_frame_decode_8k() function.
+
+-d Per GSM 08.60 and 08.61 specs, TRAU frames have different semantics and
+ sometimes different metadata flags included in the frame in uplink and
+ downlink directions. By default, trau2rtp_gen operates with uplink
+ semantics and treats all frames it processes as TRAU-UL frames. With
+ -d option, each processed frame is to be treated as a TRAU-DL frame
+ instead. Please note, however, that osmo_trau2rtp() function currently
+ implements only TRAU-UL semantics - thus the present -d option won't do
+ anything useful - but it was implemented for the sake of completeness.
+
+-x Without this flag, FR/EFR output will be in RFC 3551 format and HR
+ output will be in RFC 5993 format, as prescribed by 3GPP from Rel8
+ onward for AoIP. With -x flag, FR/EFR output will be in TW-TS-001
+ format and HR output will be in TW-TS-002 format - extended RTP payload
+ formats that preserve the full semantics of TRAU frames from earlier
+ GSM and 3GPP releases.
+
+The following GSM speech codecs and TRAU frame formats are supported:
+
+Codec Frame format Spec reference
+--------------------------------------
+FRv1 TRAU-16k TS 48.060 sections 5.1.1 and 5.5.1.1
+EFR TRAU-16k TS 48.060 sections 5.1.1 and 5.5.1.1
+HRv1 TRAU-16k TS 48.061 sections 5.1.1.1 and 5.1.4.1.1
+HRv1 TRAU-8k TS 48.061 sections 5.2.1.1 and 5.2.4.1
+
+Input format and examples
+=========================
+
+The input hex format to trau2rtp_gen is completely ad hoc, not defined in any
+spec. In TRAU-16k mode (no -8 option), each non-blank, non-comment input line
+is expected to consist of exactly 80 hex digits, carrying a TRAU-16k frame of
+320 bits. In TRAU-8k mode (with -8 option), each non-empty input line is
+similarly expected to consist of exactly 40 hex digits, carrying a TRAU-8k frame
+of 160 bits. Such hex-represented TRAU frames can be hand-crafted for testing,
+but there are also tools that extract TRAU frames from E1 timeslot octet stream
+recordings and emit those extracted frames in the present hex format:
+
+https://www.freecalypso.org/hg/gsm-net-reveng/file/tip/trau-decode
+
+Example input for FRv1:
+
+000088b0bd72ba9a94288012a492a492a2808124c924c9248710edb69468b5b5bc12a49ca685c6ff
+000088b08c0fce6ee368831ba4edd833a38f82e4e46b8eb8ec68eba1d3d29c8ec50b86139d8792ff
+000088b0cc29bedc9c46a83ce650af55cee8c234e947943caa90ea92e2cecba6ed05e663b1cfb2ff
+
+Example input for EFR:
+
+0000e8c0ecc6e6d39ae5ac008013b21780ec800080008002aad6800080008036eb00800080008eff
+0000e8c0c5959c70daf191608000800081abb8ccf580a07c873fb977a81cc410f1588c7fdd61ceff
+0000e8c0d01dc9f2f67a885ff583d73fa9daf2cca28a91babde68c43a24efc32aa69ad8af003caff
+
+Example input for HRv1 in TRAU-8k format:
+
+008846a6afdaf9a197a79d82b1efc4c9b8b0e4bb
+008844b78bdef8a8bd8da681abd6a2aabdf3e8fb
+00885084dfddccdfffaffffffffffffffffffffb
+
+Output hex format and tools
+===========================
+
+TW-TS-005 is a hex file format for sequences of RTP payloads for GSM speech
+codecs; trau2rtp_gen emits its generated RTP payloads in this hex format.
+Spec document:
+
+https://www.freecalypso.org/specs/tw-ts-005-v010003.txt
+
+What can one do with a TW-TS-005 hex file? Some possibilities:
+
+* All header/metadata fields defined in RFC 5993, TW-TS-001 and TW-TS-002 specs
+ are simple enough for easy mental decoding just by looking at the generated
+ RTP payload in hex;
+
+* Deeper decoding into individual FR/HR/EFR codec parameters can be done with
+ tw5a-dump (FR/EFR) and tw5b-dump (HR) utilities from Themyscira Wireless GSM
+ codec libraries and utilities package;
+
+* Other utilities in the same just-referenced package can be used to transcode
+ FR/HR/EFR speech recordings in TW-TS-005 hex format (which in the present case
+ can be captured Abis-UL output from an E1 BTS, converted with trau2rtp_gen)
+ into playable audio.
+
+No AMR or CSD
+=============
+
+One limitation of the present trau2rtp_gen utility that should be noted is the
+lack of support for AMR or CSD. The reasons for this limitation are:
+
+* AMR is currently not supported by osmo_trau2rtp() or osmo_rtp2trau()
+ functions, and it is not entirely clear if this API would be a good match for
+ the much more complex processing that will be needed in a software TRAU or
+ TRAU-emulating MGW for AMR.
+
+* CSD is supported by the chain of libosmotrau functions exercised by
+ trau2rtp_gen, but the resulting bloated RTP payloads cannot be represented in
+ TW-TS-005: spec section 4.1 limits each hex line to 80 characters, effectively
+ limiting the domain of application for this hex file format to RTP payloads
+ that are no larger than 40 bytes.
+
+When and if a need arises to represent CSD frame streams in hex, there does not
+seem to be one single solution that would be best for all use cases - instead
+the problem might need to be approached on a case-by-case basis. For the
+specific use case of unit tests, verifying correct operation of osmo_trau2rtp()
+and osmo_rtp2trau() functions in data modes, one possible approach would be to
+copy what is currently done in raa_prime unit tests: break each 160-byte CSD RTP
+payload into 4 hex lines of 80 digits each. In any case, whichever hex format
+is to be chosen for CSD, it will be its own separate test program, independent
+of trau2rtp_gen.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/39558?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I3cc8502406e930317b680b0ace2fce479e495ccd
Gerrit-Change-Number: 39558
Gerrit-PatchSet: 2
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>