lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

September 2024

  • 1 participants
  • 1983 discussions
[XS] Change in osmo-ttcn3-hacks[master]: testenv: display current test name on ^C
by osmith 13 Sep '24

13 Sep '24
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38136?usp=email ) Change subject: testenv: display current test name on ^C ...................................................................... testenv: display current test name on ^C When running a whole testsuite and getting a lot of output, it can be useful to know which test was currently running when pressing ^C. Now that we have a function that provides this information, show it to the user. Change-Id: I2eb639f47440447ac71027956b9c234323565956 --- M _testenv/testenv.py 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/36/38136/1 diff --git a/_testenv/testenv.py b/_testenv/testenv.py index 6ed1e51..e1f1210 100755 --- a/_testenv/testenv.py +++ b/_testenv/testenv.py @@ -119,6 +119,9 @@ sys.exit(2) except KeyboardInterrupt: print("") # new line + test = testenv.testsuite.get_current_test() + if test: + logging.critical(f"^C during {test}") testenv.podman.stop() sys.exit(3) except: -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38136?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I2eb639f47440447ac71027956b9c234323565956 Gerrit-Change-Number: 38136 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de>
1 0
0 0
[XS] Change in osmo-ci[master]: publish-tarballs: ignore some libosmo-sccp-legacy
by pespin 13 Sep '24

13 Sep '24
Attention is currently required from: osmith. pespin has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-ci/+/38134?usp=email ) Change subject: publish-tarballs: ignore some libosmo-sccp-legacy ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/38134?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: Id894d49c579998c02f32aa45f5585234fb11746b Gerrit-Change-Number: 38134 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Fri, 13 Sep 2024 14:33:08 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[XS] Change in osmo-ci[master]: publish-tarballs: ignore some libosmo-sccp-legacy
by osmith 13 Sep '24

13 Sep '24
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/38134?usp=email ) Change subject: publish-tarballs: ignore some libosmo-sccp-legacy ...................................................................... publish-tarballs: ignore some libosmo-sccp-legacy "make dist-bzip2" doesn't work in these versions, so don't attempt to build a tarball for them. It was fixed in 2.0.3. Related: https://gitea.osmocom.org/osmocom/libosmo-sccp-legacy/commit/27d2423b15463a… Change-Id: Id894d49c579998c02f32aa45f5585234fb11746b --- M scripts/tarballs/publish-tarballs-for-tags.sh 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/34/38134/1 diff --git a/scripts/tarballs/publish-tarballs-for-tags.sh b/scripts/tarballs/publish-tarballs-for-tags.sh index 93e861b..0335bd3 100755 --- a/scripts/tarballs/publish-tarballs-for-tags.sh +++ b/scripts/tarballs/publish-tarballs-for-tags.sh @@ -111,6 +111,10 @@ osmo-trx:0.2.0, osmo-trx:0.3.0, osmo-trx:1.3.0, + + libosmo-sccp-legacy:2.0.0, + libosmo-sccp-legacy:2.0.1, + libosmo-sccp-legacy:2.0.2, " mkdir -p \ -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/38134?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: Id894d49c579998c02f32aa45f5585234fb11746b Gerrit-Change-Number: 38134 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de>
1 0
0 0
[M] Change in libosmo-abis[master]: rtp2trau: add CSD support
by fixeria 13 Sep '24

13 Sep '24
Attention is currently required from: falconia, laforge. fixeria has posted comments on this change by falconia. ( https://gerrit.osmocom.org/c/libosmo-abis/+/38133?usp=email ) Change subject: rtp2trau: add CSD support ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/38133?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Change-Id: Ifa1a671f3797a22523bef4b5712d91d0131cdef7 Gerrit-Change-Number: 38133 Gerrit-PatchSet: 1 Gerrit-Owner: falconia <falcon(a)freecalypso.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: falconia <falcon(a)freecalypso.org> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Fri, 13 Sep 2024 10:34:36 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[M] Change in libosmo-abis[master]: trau2rtp: add CSD support
by fixeria 13 Sep '24

13 Sep '24
Attention is currently required from: falconia, laforge. fixeria has posted comments on this change by falconia. ( https://gerrit.osmocom.org/c/libosmo-abis/+/38132?usp=email ) Change subject: trau2rtp: add CSD support ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/38132?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Change-Id: Ibc062c7297899fab106b3dbab301e665422a0d8b Gerrit-Change-Number: 38132 Gerrit-PatchSet: 1 Gerrit-Owner: falconia <falcon(a)freecalypso.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: falconia <falcon(a)freecalypso.org> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Fri, 13 Sep 2024 10:31:58 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[XS] Change in libosmo-abis[master]: osmo_trau_frame_decode_8k: fix recognition of O&M UL
by fixeria 13 Sep '24

13 Sep '24
Attention is currently required from: falconia. fixeria has posted comments on this change by falconia. ( https://gerrit.osmocom.org/c/libosmo-abis/+/38131?usp=email ) Change subject: osmo_trau_frame_decode_8k: fix recognition of O&M UL ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/38131?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Change-Id: I16c6b598ce5c843b5306aa69592a7d66723622d4 Gerrit-Change-Number: 38131 Gerrit-PatchSet: 1 Gerrit-Owner: falconia <falcon(a)freecalypso.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: falconia <falcon(a)freecalypso.org> Gerrit-Comment-Date: Fri, 13 Sep 2024 10:28:01 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[XS] Change in libosmo-abis[master]: osmo_trau_frame_decode_8k: check all sync bits
by fixeria 13 Sep '24

13 Sep '24
Attention is currently required from: falconia. fixeria has posted comments on this change by falconia. ( https://gerrit.osmocom.org/c/libosmo-abis/+/38130?usp=email ) Change subject: osmo_trau_frame_decode_8k: check all sync bits ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/38130?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Change-Id: I47b055b4d3b92f018508fd7baa0784dfcabe6262 Gerrit-Change-Number: 38130 Gerrit-PatchSet: 1 Gerrit-Owner: falconia <falcon(a)freecalypso.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: falconia <falcon(a)freecalypso.org> Gerrit-Comment-Date: Fri, 13 Sep 2024 10:27:33 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[S] Change in libosmo-abis[master]: trau_frame: fix de/encoding of HR-data-8k frames
by fixeria 13 Sep '24

13 Sep '24
Attention is currently required from: dexter, falconia. fixeria has posted comments on this change by falconia. ( https://gerrit.osmocom.org/c/libosmo-abis/+/38129?usp=email ) Change subject: trau_frame: fix de/encoding of HR-data-8k frames ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/38129?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Change-Id: I051b0b70adffcc473dcbb42a555c19088973cc90 Gerrit-Change-Number: 38129 Gerrit-PatchSet: 1 Gerrit-Owner: falconia <falcon(a)freecalypso.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: falconia <falcon(a)freecalypso.org> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Fri, 13 Sep 2024 10:26:57 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[M] Change in libosmo-abis[master]: trau2rtp: add CSD support
by falconia 13 Sep '24

13 Sep '24
falconia has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-abis/+/38132?usp=email ) Change subject: trau2rtp: add CSD support ...................................................................... trau2rtp: add CSD support TRAU frame formats are defined for both speech and data; classic E1 BTSes implement CSD with TRAU data frames on Abis. Support converting these TRAU data frames to RTP clearmode representation, essentially replicating the Rate Adaptor part of standard TRAU. Change-Id: Ibc062c7297899fab106b3dbab301e665422a0d8b --- M src/trau/trau_rtp_conv.c 1 file changed, 120 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/32/38132/1 diff --git a/src/trau/trau_rtp_conv.c b/src/trau/trau_rtp_conv.c index d149264..9113f10 100644 --- a/src/trau/trau_rtp_conv.c +++ b/src/trau/trau_rtp_conv.c @@ -31,6 +31,9 @@ #include <osmocom/trau/trau_frame.h> #include <osmocom/trau/trau_rtp.h> +/* RFC4040 "clearmode" RTP payload length */ +#define RFC4040_RTP_PLEN 160 + /* this corresponds to the bit-lengths of the individual codec * parameters as indicated in Table 1.1 of TS 46.010 */ static const uint8_t gsm_fr_map[] = { @@ -46,7 +49,6 @@ 3, 3, 3, 3 }; - /* * EFR TRAU parity (also used for HR) * @@ -942,6 +944,117 @@ } #endif +/* + * CSD support: converting TRAU frames of type 'data' to 64 kbit/s + * like the RA part of TRAU, using RTP clearmode representation. + */ + +static void trau2v110_bits(ubit_t *out, const ubit_t *in) +{ + int i; + + /* the first 8 bits are sync zeros */ + memset(out, 0, 8); + out += 8; + /* for the rest, we have to expand 63 bits into 72 */ + for (i = 0; i < 9; i++) { + *out++ = 1; + memcpy(out, in, 7); + in += 7; + out += 7; + } +} + +/* intermediate rate 8 kbit/s */ +static void trau2v110_ir8(uint8_t *out, const ubit_t *in) +{ + ubit_t ra_bits[80]; + int i; + + trau2v110_bits(ra_bits, in); + + /* RA2: 1 bit per output byte */ + for (i = 0; i < 80; i++) + out[i] = 0x7F | (ra_bits[i] << 7); +} + +/* intermediate rate 16 kbit/s */ +static void trau2v110_ir16(uint8_t *out, const ubit_t *in) +{ + ubit_t ra_bits[80]; + int i, o; + uint8_t b; + + trau2v110_bits(ra_bits, in); + + /* RA2: 2 bits per output byte */ + i = 0; + for (o = 0; o < 40; o++) { + b = 0x3F; + b |= (ra_bits[i++] << 7); + b |= (ra_bits[i++] << 6); + out[o] = b; + } +} + +static int trau2rtp_data_fr(uint8_t *out, size_t out_len, + const struct osmo_trau_frame *tf) +{ + /* function interface preliminaries */ + if (tf->type != OSMO_TRAU16_FT_DATA) + return -EINVAL; + if (out_len < RFC4040_RTP_PLEN) + return -ENOSPC; + + /* Is it TCH/F9.6 with 16 kbit/s IR, + * or TCH/F4.8 or TCH/F2.4 with 8 kbit/s IR? */ + if (tf->c_bits[5]) { + trau2v110_ir16(out, tf->d_bits); + trau2v110_ir16(out + 40, tf->d_bits + 63); + trau2v110_ir16(out + 80, tf->d_bits + 63 * 2); + trau2v110_ir16(out + 120, tf->d_bits + 63 * 3); + } else { + trau2v110_ir8(out, tf->d_bits); + trau2v110_ir8(out + 80, tf->d_bits + 63 * 2); + } + + return RFC4040_RTP_PLEN; +} + +static int trau2rtp_data_hr16(uint8_t *out, size_t out_len, + const struct osmo_trau_frame *tf) +{ + /* function interface preliminaries */ + if (tf->type != OSMO_TRAU16_FT_DATA_HR) + return -EINVAL; + if (out_len < RFC4040_RTP_PLEN) + return -ENOSPC; + + /* Note that Osmocom trau_frame decoding and encoding API + * puts the second reduced V.110 frame at d_bits position 63, + * unlike 8 kbit/s IR in FR-data frame type where it resides + * at d_bits position 63 * 2. */ + trau2v110_ir8(out, tf->d_bits); + trau2v110_ir8(out + 80, tf->d_bits + 63); + + return RFC4040_RTP_PLEN; +} + +static int trau2rtp_data_hr8(uint8_t *out, size_t out_len, + const struct osmo_trau_frame *tf) +{ + /* function interface preliminaries */ + if (tf->type != OSMO_TRAU8_DATA) + return -EINVAL; + if (out_len < RFC4040_RTP_PLEN) + return -ENOSPC; + + trau2v110_ir8(out, tf->d_bits); + trau2v110_ir8(out + 80, tf->d_bits + 63); + + return RFC4040_RTP_PLEN; +} + static inline bool check_twts001(struct osmo_trau2rtp_state *st) { if (st->rtp_extensions & OSMO_RTP_EXT_TWTS001) @@ -968,8 +1081,14 @@ return trau2rtp_efr(out, out_len, tf, check_twts001(st)); case OSMO_TRAU16_FT_HR: return trau2rtp_hr16(out, out_len, tf, check_twts002(st)); + case OSMO_TRAU16_FT_DATA: + return trau2rtp_data_fr(out, out_len, tf); + case OSMO_TRAU16_FT_DATA_HR: + return trau2rtp_data_hr16(out, out_len, tf); case OSMO_TRAU8_SPEECH: return trau2rtp_hr8(out, out_len, tf, check_twts002(st)); + case OSMO_TRAU8_DATA: + return trau2rtp_data_hr8(out, out_len, tf); default: return -EINVAL; } -- To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/38132?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Change-Id: Ibc062c7297899fab106b3dbab301e665422a0d8b Gerrit-Change-Number: 38132 Gerrit-PatchSet: 1 Gerrit-Owner: falconia <falcon(a)freecalypso.org>
1 0
0 0
[M] Change in libosmo-abis[master]: rtp2trau: add CSD support
by falconia 13 Sep '24

13 Sep '24
falconia has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-abis/+/38133?usp=email ) Change subject: rtp2trau: add CSD support ...................................................................... rtp2trau: add CSD support The previous patch in this series added CSD support to trau2rtp converter; now add the same support in the opposite direction. Change-Id: Ifa1a671f3797a22523bef4b5712d91d0131cdef7 --- M TODO-RELEASE M include/osmocom/trau/trau_rtp.h M src/trau/trau_rtp_conv.c 3 files changed, 222 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/33/38133/1 diff --git a/TODO-RELEASE b/TODO-RELEASE index 0ed7189..6160b28 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -7,3 +7,4 @@ # If any interfaces have been added since the last public release: c:r:a + 1. # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line +libosmotrau struct osmo_trau2rtp_state extended (ABI break) diff --git a/include/osmocom/trau/trau_rtp.h b/include/osmocom/trau/trau_rtp.h index 6b2110f..3631b83 100644 --- a/include/osmocom/trau/trau_rtp.h +++ b/include/osmocom/trau/trau_rtp.h @@ -25,6 +25,7 @@ struct osmo_trau2rtp_state { enum osmo_trau_frame_type type; uint8_t rtp_extensions; + bool interm_rate_16k; }; diff --git a/src/trau/trau_rtp_conv.c b/src/trau/trau_rtp_conv.c index 9113f10..06979c6 100644 --- a/src/trau/trau_rtp_conv.c +++ b/src/trau/trau_rtp_conv.c @@ -1055,6 +1055,220 @@ return RFC4040_RTP_PLEN; } +/* + * CSD in the opposite direction: from clearmode RTP input + * to TRAU frame output. + * + * Important note about V.110 frame alignment: in the output from trau2rtp + * process or from OsmoBTS, the 2 or 4 V.110 frames that fit into a 20 ms + * RTP clearmode packet are always perfectly aligned in that packet. + * However, there does not seem to be any formally defined policy in + * Osmocom as to whether this alignment is required in RTP input to + * OsmoBTS or to the future RTP-to-E1 MGW (OsmoMGW extension or otherwise), + * or if these processes are required to hunt for arbitrary V.110 frame + * alignment in their RTP input. + * + * Given that the current CSD implementation in OsmoBTS requires perfect + * V.110 alignment in RTP input, and given that a stateful V.110 alignment + * hunt implementation cannot be fitted into osmo_rtp2trau API, + * the approach implemented here is to also require perfect alignment. + * If our RTP input is not a perfectly aligned pair or quadruple of + * V.110 frames, we emit an idle data frame (all bits set to 1) per + * TS 48.060 section 6.5.1 and TS 48.061 section 6.7.4. + * + * Also note: in the case of OSMO_TRAU16_FT_DATA output, the caller of + * osmo_rtp2trau() API must set st->interm_rate_16k (a Boolean flag) + * appropriately for 8 kbit/s or 16 kbit/s intermediate rate. + * In the absence of out-of-band information, this flag can be set + * from control bit C6 of the first received TRAU-UL frame - that is + * how traditional TRAUs do it. + */ + +static bool check_v110_align(const ubit_t *ra_bits) +{ + int i; + + for (i = 0; i < 8; i++) { + if (ra_bits[i]) + return false; + } + for (i = 1; i < 10; i++) { + if (!ra_bits[i * 8]) + return false; + } + return true; +} + +static void v110_to_63bits(ubit_t *out, const ubit_t *ra_bits) +{ + memcpy(out, ra_bits + 9, 7); + memcpy(out + 7, ra_bits + 17, 7); + memcpy(out + 14, ra_bits + 25, 7); + memcpy(out + 21, ra_bits + 33, 7); + memcpy(out + 28, ra_bits + 41, 7); + memcpy(out + 35, ra_bits + 49, 7); + memcpy(out + 42, ra_bits + 57, 7); + memcpy(out + 49, ra_bits + 65, 7); + memcpy(out + 56, ra_bits + 73, 7); +} + +/* intermediate rate 8 kbit/s */ +static void rtp2trau_data_ir8(struct osmo_trau_frame *tf, const uint8_t *data, + size_t data_len, unsigned second_offset) +{ + ubit_t ra_bits[80 * 2]; + int i; + + if (data_len != RFC4040_RTP_PLEN) + goto idle_fill; + + /* reverse RA2 first */ + for (i = 0; i < sizeof(ra_bits); i++) + ra_bits[i] = (data[i] >> 7) & 1; + + /* enforce two properly aligned V.110 frames */ + if (!check_v110_align(ra_bits)) + goto idle_fill; + if (!check_v110_align(ra_bits + 80)) + goto idle_fill; + + /* all checks passed - copy the payload */ + v110_to_63bits(tf->d_bits, ra_bits); + v110_to_63bits(tf->d_bits + second_offset, ra_bits + 80); + return; + +idle_fill: + memset(tf->d_bits, 1, 63); + memset(tf->d_bits + second_offset, 1, 63); +} + +/* intermediate rate 16 kbit/s */ +static void rtp2trau_data_ir16(struct osmo_trau_frame *tf, const uint8_t *data, + size_t data_len) +{ + ubit_t ra_bits[80 * 4]; + int i, o; + + if (data_len != RFC4040_RTP_PLEN) + goto idle_fill; + + /* reverse RA2 first */ + o = 0; + for (i = 0; i < RFC4040_RTP_PLEN; i++) { + ra_bits[o++] = (data[i] >> 7) & 1; + ra_bits[o++] = (data[i] >> 6) & 1; + } + + /* enforce 4 properly aligned V.110 frames */ + if (!check_v110_align(ra_bits)) + goto idle_fill; + if (!check_v110_align(ra_bits + 80)) + goto idle_fill; + if (!check_v110_align(ra_bits + 80 * 2)) + goto idle_fill; + if (!check_v110_align(ra_bits + 80 * 3)) + goto idle_fill; + + /* all checks passed - copy the payload */ + v110_to_63bits(tf->d_bits, ra_bits); + v110_to_63bits(tf->d_bits + 63, ra_bits + 80); + v110_to_63bits(tf->d_bits + 63 * 2, ra_bits + 80 * 2); + v110_to_63bits(tf->d_bits + 63 * 3, ra_bits + 80 * 3); + return; + +idle_fill: + memset(tf->d_bits, 1, 63 * 4); +} + +static int rtp2trau_data_fr(struct osmo_trau_frame *tf, const uint8_t *data, + size_t data_len, bool interm_rate_16k) +{ + tf->type = OSMO_TRAU16_FT_DATA; + + if (tf->dir == OSMO_TRAU_DIR_UL) { + /* C1 .. C5: FR data UL */ + tf->c_bits[0] = 0; + tf->c_bits[1] = 1; + tf->c_bits[2] = 0; + tf->c_bits[3] = 0; + tf->c_bits[4] = 0; + } else { + /* C1 .. C5: FR data DL */ + tf->c_bits[0] = 1; + tf->c_bits[1] = 0; + tf->c_bits[2] = 1; + tf->c_bits[3] = 1; + tf->c_bits[4] = 0; + } + + if (interm_rate_16k) { + tf->c_bits[5] = 1; + rtp2trau_data_ir16(tf, data, data_len); + } else { + tf->c_bits[5] = 0; + rtp2trau_data_ir8(tf, data, data_len, 63 * 2); + /* remaining data positions are unused in this format */ + memset(tf->d_bits + 63, 1, 63); + memset(tf->d_bits + 63 * 3, 1, 63); + } + + /* remaining C bits are unused */ + memset(tf->c_bits + 6, 1, 9); + + return 0; +} + +static int rtp2trau_data_hr16(struct osmo_trau_frame *tf, const uint8_t *data, + size_t data_len) +{ + tf->type = OSMO_TRAU16_FT_DATA_HR; + + if (tf->dir == OSMO_TRAU_DIR_UL) { + /* C1 .. C5: HR data UL */ + tf->c_bits[0] = 0; + tf->c_bits[1] = 1; + tf->c_bits[2] = 0; + tf->c_bits[3] = 0; + tf->c_bits[4] = 1; + } else { + /* C1 .. C5: HR data DL */ + tf->c_bits[0] = 1; + tf->c_bits[1] = 0; + tf->c_bits[2] = 1; + tf->c_bits[3] = 1; + tf->c_bits[4] = 1; + } + + tf->c_bits[5] = 0; + /* Note that Osmocom trau_frame decoding and encoding API + * puts the second reduced V.110 frame at d_bits position 63, + * unlike 8 kbit/s IR in FR-data frame type where it resides + * at d_bits position 63 * 2. */ + rtp2trau_data_ir8(tf, data, data_len, 63); + + /* remaining C bits are unused */ + memset(tf->c_bits + 6, 1, 9); + + return 0; +} + +static int rtp2trau_data_hr8(struct osmo_trau_frame *tf, const uint8_t *data, + size_t data_len) +{ + tf->type = OSMO_TRAU8_DATA; + + /* C1 .. C5: HR data */ + tf->c_bits[0] = 0; + tf->c_bits[1] = 0; + tf->c_bits[2] = 1; + tf->c_bits[3] = 1; + tf->c_bits[4] = 1; + + rtp2trau_data_ir8(tf, data, data_len, 63); + + return 0; +} + static inline bool check_twts001(struct osmo_trau2rtp_state *st) { if (st->rtp_extensions & OSMO_RTP_EXT_TWTS001) @@ -1104,8 +1318,14 @@ return rtp2trau_efr(tf, rtp, rtp_len); case OSMO_TRAU16_FT_HR: return rtp2trau_hr16(tf, rtp, rtp_len); + case OSMO_TRAU16_FT_DATA: + return rtp2trau_data_fr(tf, rtp, rtp_len, st->interm_rate_16k); + case OSMO_TRAU16_FT_DATA_HR: + return rtp2trau_data_hr16(tf, rtp, rtp_len); case OSMO_TRAU8_SPEECH: return rtp2trau_hr8(tf, rtp, rtp_len); + case OSMO_TRAU8_DATA: + return rtp2trau_data_hr8(tf, rtp, rtp_len); default: return -EINVAL; } -- To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/38133?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Change-Id: Ifa1a671f3797a22523bef4b5712d91d0131cdef7 Gerrit-Change-Number: 38133 Gerrit-PatchSet: 1 Gerrit-Owner: falconia <falcon(a)freecalypso.org>
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • ...
  • 199
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.