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

June 2024

  • 1 participants
  • 1566 discussions
[M] Change in libosmo-abis[master]: build config: add --disable-ortp option
by fixeria 26 Jun '24

26 Jun '24
Attention is currently required from: falconia, osmith. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/36975?usp=email ) Change subject: build config: add --disable-ortp option ...................................................................... Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/36975?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Change-Id: I554260483b94d812ac3a957c969a902870f53883 Gerrit-Change-Number: 36975 Gerrit-PatchSet: 3 Gerrit-Owner: falconia <falcon(a)freecalypso.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: falconia <falcon(a)freecalypso.org> Gerrit-Comment-Date: Wed, 26 Jun 2024 20:58:43 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in libosmo-abis[master]: build config: add --disable-ortp option
by falconia 26 Jun '24

26 Jun '24
Attention is currently required from: fixeria, osmith. falconia has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/36975?usp=email ) Change subject: build config: add --disable-ortp option ...................................................................... Patch Set 3: (1 comment) This change is ready for review. File configure.ac: https://gerrit.osmocom.org/c/libosmo-abis/+/36975/comment/739c6cb6_6dec6ecc PS2, Line 150: _cflags_save=$CFLAGS > You are right, thanks for the catch! The current patch works in that the build passes with --disable […] This issue should be fixed in the new patch revision. -- To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/36975?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Change-Id: I554260483b94d812ac3a957c969a902870f53883 Gerrit-Change-Number: 36975 Gerrit-PatchSet: 3 Gerrit-Owner: falconia <falcon(a)freecalypso.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Wed, 26 Jun 2024 20:33:00 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: falconia <falcon(a)freecalypso.org> Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: SIP_Templates: Allow setting Session-Expires and Min_SE in INVITE tem...
by fixeria 26 Jun '24

26 Jun '24
Attention is currently required from: pespin. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37298?usp=email ) Change subject: SIP_Templates: Allow setting Session-Expires and Min_SE in INVITE templates ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37298?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ib2bc6258c072e88539ccc852d057b517822936bd Gerrit-Change-Number: 37298 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-Comment-Date: Wed, 26 Jun 2024 18:22:10 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-mgw[master]: E1: support HRv1 codec on both 16k and 8k subslots
by falconia 26 Jun '24

26 Jun '24
Attention is currently required from: falconia. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-mgw/+/37299?usp=email to look at the new patch set (#2). The following approvals got outdated and were removed: Verified-1 by Jenkins Builder Change subject: E1: support HRv1 codec on both 16k and 8k subslots ...................................................................... E1: support HRv1 codec on both 16k and 8k subslots HRv1 support in OsmoMGW-E1 was previously broken (couldn't work on either 16k or 8k subslots) because of inconsistency: the TRAU frame type was set to OSMO_TRAU16_FT_HR, but the TRAU sync pattern was set to OSMO_TRAU_SYNCP_8_HR. However, now that libosmotrau has proper support for HRv1 TRAU frame encoding and RTP conversion in both 16k and 8k formats, drive it correctly in OsmoMGW-E1. While at it, change the code structure to avoid else-after-return. Was the original code written and merged in a time before strict linter checks? Change-Id: Ifadbdc68905178c6ffdd673a6fb71c18610c9847 --- M src/libosmo-mgcp/mgcp_e1.c 1 file changed, 56 insertions(+), 16 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/99/37299/2 -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/37299?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: Ifadbdc68905178c6ffdd673a6fb71c18610c9847 Gerrit-Change-Number: 37299 Gerrit-PatchSet: 2 Gerrit-Owner: falconia <falcon(a)freecalypso.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Attention: falconia <falcon(a)freecalypso.org> Gerrit-MessageType: newpatchset
1 0
0 0
[S] Change in osmo-mgw[master]: E1: support HRv1 codec on both 16k and 8k subslots
by Jenkins Builder 26 Jun '24

26 Jun '24
Jenkins Builder has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/37299?usp=email ) Change subject: E1: support HRv1 codec on both 16k and 8k subslots ...................................................................... Patch Set 1: (2 comments) File src/libosmo-mgcp/mgcp_e1.c: Robot Comment from checkpatch (run ID jenkins-gerrit-lint-16868): https://gerrit.osmocom.org/c/osmo-mgw/+/37299/comment/9d0bad4a_34973f6b PS1, Line 475: else { else is not generally useful after a break or return Robot Comment from checkpatch (run ID jenkins-gerrit-lint-16868): https://gerrit.osmocom.org/c/osmo-mgw/+/37299/comment/62728d45_73bde42a PS1, Line 518: else { else is not generally useful after a break or return -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/37299?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: Ifadbdc68905178c6ffdd673a6fb71c18610c9847 Gerrit-Change-Number: 37299 Gerrit-PatchSet: 1 Gerrit-Owner: falconia <falcon(a)freecalypso.org> Gerrit-CC: Jenkins Builder Gerrit-Comment-Date: Wed, 26 Jun 2024 17:38:30 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-mgw[master]: E1: support HRv1 codec on both 16k and 8k subslots
by falconia 26 Jun '24

26 Jun '24
falconia has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/37299?usp=email ) Change subject: E1: support HRv1 codec on both 16k and 8k subslots ...................................................................... E1: support HRv1 codec on both 16k and 8k subslots HRv1 support in OsmoMGW-E1 was previously broken (couldn't work on either 16k or 8k subslots) because of inconsistency: the TRAU frame type was set to OSMO_TRAU16_FT_HR, but the TRAU sync pattern was set to OSMO_TRAU_SYNCP_8_HR. However, now that libosmotrau has proper support for HRv1 TRAU frame encoding and RTP conversion in both 16k and 8k formats, drive it correctly in OsmoMGW-E1. Change-Id: Ifadbdc68905178c6ffdd673a6fb71c18610c9847 --- M src/libosmo-mgcp/mgcp_e1.c 1 file changed, 38 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/99/37299/1 diff --git a/src/libosmo-mgcp/mgcp_e1.c b/src/libosmo-mgcp/mgcp_e1.c index 20aff95..28d943d 100644 --- a/src/libosmo-mgcp/mgcp_e1.c +++ b/src/libosmo-mgcp/mgcp_e1.c @@ -467,9 +467,17 @@ return OSMO_TRAU16_FT_FR; else if (strcmp(sdp_subtype_name, "GSM-EFR") == 0) return OSMO_TRAU16_FT_EFR; - else if (strcmp(sdp_subtype_name, "GSM-HR-08") == 0) - return OSMO_TRAU16_FT_HR; - else if (strcmp(sdp_subtype_name, "AMR") == 0) { + else if (strcmp(sdp_subtype_name, "GSM-HR-08") == 0) { + if (i460_rate == OSMO_I460_RATE_16k) + return OSMO_TRAU16_FT_HR; + else if (i460_rate == OSMO_I460_RATE_8k) + return OSMO_TRAU8_SPEECH; + else { + LOGPENDP(endp, DE1, LOGL_ERROR, + "E1-TRAU-TX: unsupported or illegal I.460 rate for HR\n"); + return OSMO_TRAU_FT_NONE; + } + } else if (strcmp(sdp_subtype_name, "AMR") == 0) { if (i460_rate == OSMO_I460_RATE_8k) { switch (amr_ft) { case AMR_4_75: @@ -502,9 +510,17 @@ return OSMO_TRAU_SYNCP_16_FR_EFR; else if (strcmp(sdp_subtype_name, "GSM-EFR") == 0) return OSMO_TRAU_SYNCP_16_FR_EFR; - else if (strcmp(sdp_subtype_name, "GSM-HR-08") == 0) - return OSMO_TRAU_SYNCP_8_HR; - else if (strcmp(sdp_subtype_name, "AMR") == 0) { + else if (strcmp(sdp_subtype_name, "GSM-HR-08") == 0) { + if (i460_rate == OSMO_I460_RATE_16k) + return OSMO_TRAU_SYNCP_16_FR_EFR; + else if (i460_rate == OSMO_I460_RATE_8k) + return OSMO_TRAU_SYNCP_8_HR; + else { + LOGPENDP(endp, DE1, LOGL_ERROR, + "E1-TRAU-TX: unsupported or illegal I.460 rate for HR\n"); + return OSMO_TRAU_SYNCP_16_FR_EFR; + } + } else if (strcmp(sdp_subtype_name, "AMR") == 0) { if (i460_rate == OSMO_I460_RATE_8k) { switch (amr_ft) { case AMR_4_75: -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/37299?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: Ifadbdc68905178c6ffdd673a6fb71c18610c9847 Gerrit-Change-Number: 37299 Gerrit-PatchSet: 1 Gerrit-Owner: falconia <falcon(a)freecalypso.org> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in libosmo-abis[master]: build config: add --disable-ortp option
by falconia 26 Jun '24

26 Jun '24
Attention is currently required from: fixeria, neels, pespin. falconia has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/36975?usp=email ) Change subject: build config: add --disable-ortp option ...................................................................... Patch Set 2: (1 comment) File configure.ac: https://gerrit.osmocom.org/c/libosmo-abis/+/36975/comment/eea85380_2cc3418c PS2, Line 150: _cflags_save=$CFLAGS > I believe these API quirks should not be executed if `ENABLE_ORTP = no`? You are right, thanks for the catch! The current patch works in that the build passes with --disable-ortp and no ortp present, but those now-bogus tests still run, setting variables which then remain unused. I will revise my patch to conditionalize the tests in question. -- To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/36975?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Change-Id: I554260483b94d812ac3a957c969a902870f53883 Gerrit-Change-Number: 36975 Gerrit-PatchSet: 2 Gerrit-Owner: falconia <falcon(a)freecalypso.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Wed, 26 Jun 2024 16:13:04 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmo-abis[master]: trau_frame: fix 8k decoding
by falconia 26 Jun '24

26 Jun '24
falconia has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/37286?usp=email ) Change subject: trau_frame: fix 8k decoding ...................................................................... trau_frame: fix 8k decoding osmo_trau_frame_decode_8k() API was broken for most TRAU frame types: the processing begins with identifying the sync pattern, but the check for the leading 8 zeros in HRv1, AMR-low and AMR-6k7 formats was broken in that it was checking for 16 zero bits instead of 8. While at it, fix global namespace pollution: the bit8_0[] datum used in this logic was defined as global when it should be static. Change-Id: Idabc1283d477473b479f2d76d783ca9aeaf0af5d --- M src/trau/trau_frame.c 1 file changed, 18 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified fixeria: Looks good to me, approved diff --git a/src/trau/trau_frame.c b/src/trau/trau_frame.c index 389495c..98e26da 100644 --- a/src/trau/trau_frame.c +++ b/src/trau/trau_frame.c @@ -1360,7 +1360,7 @@ #define TRAU8_FT_AMR_NO_SPEECH_CMR 0x14 /* 1, 0, 1, 0, 0 */ #define TRAU8_FT_AMR_475_515_590 0..7 -const uint8_t bit8_0[16] = { 0, }; +static const uint8_t bit8_0[8] = { 0, }; /*!< check sync pattern for hr/data/oam */ static bool is_hr(const ubit_t *bits) -- To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/37286?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Change-Id: Idabc1283d477473b479f2d76d783ca9aeaf0af5d Gerrit-Change-Number: 37286 Gerrit-PatchSet: 1 Gerrit-Owner: falconia <falcon(a)freecalypso.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: falconia <falcon(a)freecalypso.org> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in libosmo-abis[master]: {de,en}code8_hr: fix totally broken functions
by falconia 26 Jun '24

26 Jun '24
falconia has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/37285?usp=email ) Change subject: {de,en}code8_hr: fix totally broken functions ...................................................................... {de,en}code8_hr: fix totally broken functions The functions decode8_hr() and encode8_hr() in trau_frame.c (encoding and decoding HRv1 TRAU frames in 8 kbit/s format) are available via osmo_trau_frame_decode_8k() and osmo_trau_frame_encode() public APIs, but they are not currently used anywhere in Osmocom. (OsmoMGW-E1 has no working support for HR codec, and there is no support for HRv1-8k in the TRAU<->RTP layer until next patch in this series.) Study of the code reveals that these functions were totally broken prior to this change: * The movement of Dn bits between trau_bits and fr->d_bits used wrong offsets for some of the bits (and even missed one group of bits entirely in the encoding direction), producing garbled codec frames. * The filling of XCn bits in the encoding direction was likewise garbled by use of wrong offset. * When encoding TRAU-UL frames in this format, bit C5 (odd parity) was set incorrectly. * The order of bits in fr->crc_bits array (Osmocom internal) was opposite the order needed for osmo_crc8gen_check_bits() and osmo_crc8gen_set_bits() functions - contrast with HRv1-16k functions that use sensible bit order for this fr->crc_bits array. Given that this HRv1-8k mode within TRAU frame encoding and decoding API was totally broken and not used anywhere, there are no compatibility concerns with changing aspects of this API such as CRC bit order. Change-Id: I7cf0275f2ff212e001db38d7b090f222f292cdb0 --- M src/trau/trau_frame.c 1 file changed, 49 insertions(+), 11 deletions(-) Approvals: falconia: Looks good to me, approved fixeria: Looks good to me, but someone else must approve laforge: Looks good to me, but someone else must approve pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/src/trau/trau_frame.c b/src/trau/trau_frame.c index 0be005a..389495c 100644 --- a/src/trau/trau_frame.c +++ b/src/trau/trau_frame.c @@ -780,15 +780,14 @@ } /* CRC0 .. CRC2 */ - fr->crc_bits[2] = trau_bits[82]; - fr->crc_bits[1] = trau_bits[83]; - fr->crc_bits[0] = trau_bits[84]; + memcpy(fr->crc_bits, trau_bits + 73, 3); /* D45 .. D48 */ - memcpy(fr->d_bits + d_idx, trau_bits + 85, 4); + memcpy(fr->d_bits + d_idx, trau_bits + 76, 4); + d_idx += 4; /* D49 .. D111 */ - for (i = 10; i < 10 + 10; i++) { + for (i = 10; i < 10 + 9; i++) { int offset = i * 8; memcpy(fr->d_bits + d_idx, trau_bits + offset + 1, 7); d_idx += 7; @@ -843,7 +842,7 @@ cbits_out[1] = 0; cbits_out[2] = 0; cbits_out[3] = 1; - cbits_out[4] = 1; + cbits_out[4] = 0; } else { cbits_out[0] = 0; cbits_out[1] = 0; @@ -855,7 +854,7 @@ /* XC1 .. XC2 */ memcpy(trau_bits + 1 * 8 + 6, fr->xc_bits, 2); /* XC3 .. XC6 */ - memcpy(trau_bits + 2 * 8 + 2, fr->xc_bits, 4); + memcpy(trau_bits + 2 * 8 + 2, fr->xc_bits + 2, 4); /* D1 .. D2 */ memcpy(trau_bits + 2 * 8 + 6, fr->d_bits, 2); d_idx += 2; @@ -868,12 +867,14 @@ }; /* CRC0 .. CRC2 */ - trau_bits[82] = fr->crc_bits[2]; - trau_bits[83] = fr->crc_bits[1]; - trau_bits[84] = fr->crc_bits[0]; + memcpy(trau_bits + 73, fr->crc_bits, 3); + + /* D45 .. D48 */ + memcpy(trau_bits + 76, fr->d_bits + d_idx, 4); + d_idx += 4; /* D49 .. D111 */ - for (i = 10; i < 10 + 10; i++) { + for (i = 10; i < 10 + 9; i++) { int offset = i * 8; memcpy(trau_bits + offset + 1, fr->d_bits + d_idx, 7); d_idx += 7; -- To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/37285?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Change-Id: I7cf0275f2ff212e001db38d7b090f222f292cdb0 Gerrit-Change-Number: 37285 Gerrit-PatchSet: 1 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> Gerrit-MessageType: merged
1 0
0 0
[M] Change in libosmo-abis[master]: trau_rtp_conv: add support for HRv1 in 8k format
by falconia 26 Jun '24

26 Jun '24
falconia has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/37287?usp=email ) Change subject: trau_rtp_conv: add support for HRv1 in 8k format ...................................................................... trau_rtp_conv: add support for HRv1 in 8k format GSM 08.61 defines two alternative Abis transport formats for HRv1 codec, using either 16 kbit/s or 8 kbit/s submultiplexing, as chosen by each BSS hardware manufacturer. libosmotrau previously supported TRAU<->RTP conversion only for 16k format - add support for HRv1 in 8k submux format. Change-Id: I8ee01b73360501ca380a8695cbc7070ceaaba1be --- M src/trau/trau_rtp_conv.c 1 file changed, 186 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, approved diff --git a/src/trau/trau_rtp_conv.c b/src/trau/trau_rtp_conv.c index 91bf228..d149264 100644 --- a/src/trau/trau_rtp_conv.c +++ b/src/trau/trau_rtp_conv.c @@ -249,6 +249,110 @@ return 0; } +static bool hr8_xc_bits_good_parity(const ubit_t *xc_bits) +{ + int i; + unsigned int sum = 0; + + for (i = 0; i < 6; i++) + sum += xc_bits[i]; + if (sum & 1) + return true; /* odd sum good */ + else + return false; /* even sum bad */ +} + +static void twts002_hr8_set_extra_flags(uint8_t *out, const struct osmo_trau_frame *tf) +{ + if (tf->c_bits[8]) /* DTXd */ + out[0] |= 0x08; + if (tf->xc_bits[4]) /* UFI */ + out[0] |= 0x02; +} + +/*! Generate an RFC 5993 or TW-TS-002 RTP payload for HRv1 + * from a decoded 8k TRAU frame. + * \param[out] out caller-provided output buffer + * \param[in] out_len length of out buffer in bytes + * \param[in] tf input TRAU frame in decoded form + * \param[in] emit_twts002 self-explanatory + * \returns number of bytes generated in 'out'; negative on error. */ +static int trau2rtp_hr8(uint8_t *out, size_t out_len, + const struct osmo_trau_frame *tf, bool emit_twts002) +{ + unsigned xc1_4; + + /* function interface preliminaries */ + if (tf->type != OSMO_TRAU8_SPEECH) + return -EINVAL; + if (out_len < GSM_HR_BYTES_RTP_RFC5993) + return -ENOSPC; + + /* Before considering anything else, if we have bad parity in + * frame classification bits or bad CRC in payload bits, + * we treat this frame as totally invalid: BFI with no data. */ + if (!hr8_xc_bits_good_parity(tf->xc_bits) || + osmo_crc8gen_check_bits(&gsm0860_efr_crc3, tf->d_bits, 44, + tf->crc_bits)) + goto bad_frame; + + /* classify this frame per XC1..XC4 */ + xc1_4 = (tf->xc_bits[0] << 3) | (tf->xc_bits[1] << 2) | + (tf->xc_bits[2] << 1) | (tf->xc_bits[3] << 0); + switch (xc1_4) { + case 0: + /* good speech frame (BFI=0, SID=0) */ + out[0] = FT_GOOD_SPEECH << 4; + if (emit_twts002) + twts002_hr8_set_extra_flags(out, tf); + osmo_ubit2pbit(out + 1, tf->d_bits, 112); + return GSM_HR_BYTES_RTP_RFC5993; + case 1: + /* valid SID frame (BFI=0, SID=2) */ + out[0] = FT_GOOD_SID << 4; + if (emit_twts002) + twts002_hr8_set_extra_flags(out, tf); + osmo_ubit2pbit(out + 1, tf->d_bits, 112); + /* RFC 5993 requires SID frames to be perfect, error-free */ + if (!emit_twts002) + osmo_hr_sid_reset(out + 1); + return GSM_HR_BYTES_RTP_RFC5993; + case 4: + case 5: + /* invalid SID frame (multiple BFI/SID combinations) */ + /* can be represented only in TW-TS-002, not in RFC 5993 */ + if (!emit_twts002) + return 0; + out[0] = FT_INVALID_SID << 4; + twts002_hr8_set_extra_flags(out, tf); + /* XC4 is TAF with this frame type */ + if (tf->xc_bits[3]) + out[0] |= 0x01; + return 1; /* short format per TW-TS-002 */ + case 6: + case 7: + /* bad speech frame (BFI=1, SID=0) */ + if (!emit_twts002) + return 0; + out[0] = FT_BFI_WITH_DATA << 4; + twts002_hr8_set_extra_flags(out, tf); + /* XC4 is TAF with this frame type */ + if (tf->xc_bits[3]) + out[0] |= 0x01; + osmo_ubit2pbit(out + 1, tf->d_bits, 112); + return GSM_HR_BYTES_RTP_RFC5993; + default: +bad_frame: + /* received garbage, emit BFI with no data */ + if (emit_twts002) { + out[0] = FT_NO_DATA << 4; + twts002_hr8_set_extra_flags(out, tf); + return 1; + } else + return 0; + } +} + /*! Generate the 31 bytes RTP payload for GSM-EFR from a decoded TRAU frame. * \param[out] out caller-provided output buffer * \param[in] out_len length of out buffer in bytes @@ -524,6 +628,69 @@ return 0; } +static int rtp2trau_hr8(struct osmo_trau_frame *tf, const uint8_t *data, size_t data_len) +{ + /* accept both TS 101 318 and RFC 5993 payloads */ + switch (data_len) { + case GSM_HR_BYTES: + break; + case GSM_HR_BYTES_RTP_RFC5993: + data++; + data_len--; + break; + case 0: + /* accept no-data input */ + break; + default: + return -EINVAL; + } + + /* FIXME: implement TRAU-UL frame generation if and when + * someone actually needs it in a program that uses + * this library. */ + if (tf->dir != OSMO_TRAU_DIR_DL) + return -ENOTSUP; + + tf->type = OSMO_TRAU8_SPEECH; + + /* C1..C5 */ + tf->c_bits[0] = 0; + tf->c_bits[1] = 0; + tf->c_bits[2] = 0; + tf->c_bits[3] = 1; /* UFE: good uplink */ + tf->c_bits[4] = 0; /* odd parity */ + /* C6..C9: spare bits */ + memset(tf->c_bits + 5, 1, 4); + + /* XC1..XC6 */ + if (osmo_hr_check_sid(data, data_len)) { + tf->xc_bits[0] = 0; + tf->xc_bits[1] = 0; + tf->xc_bits[2] = 0; + tf->xc_bits[3] = 1; + tf->xc_bits[4] = 0; + tf->xc_bits[5] = 0; /* odd parity */ + } else { + tf->xc_bits[0] = 0; + tf->xc_bits[1] = 0; + tf->xc_bits[2] = 0; + tf->xc_bits[3] = 0; + tf->xc_bits[4] = 0; + tf->xc_bits[5] = 1; /* odd parity */ + } + + memset(&tf->t_bits[0], 1, 2); + + if (data_len) + osmo_pbit2ubit(tf->d_bits, data, GSM_HR_BYTES * 8); + else + memset(tf->d_bits, 0, GSM_HR_BYTES * 8); + /* CRC is *not* computed by TRAU frame encoder - we have to do it */ + osmo_crc8gen_set_bits(&gsm0860_efr_crc3, tf->d_bits, 44, tf->crc_bits); + + return 0; +} + /* TS 48.060 Section 5.5.1.1.2 */ static int rtp2trau_efr(struct osmo_trau_frame *tf, const uint8_t *data, size_t data_len) { @@ -801,6 +968,8 @@ 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_TRAU8_SPEECH: + return trau2rtp_hr8(out, out_len, tf, check_twts002(st)); default: return -EINVAL; } @@ -816,6 +985,8 @@ return rtp2trau_efr(tf, rtp, rtp_len); case OSMO_TRAU16_FT_HR: return rtp2trau_hr16(tf, rtp, rtp_len); + case OSMO_TRAU8_SPEECH: + return rtp2trau_hr8(tf, rtp, rtp_len); default: return -EINVAL; } -- To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/37287?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Change-Id: I8ee01b73360501ca380a8695cbc7070ceaaba1be Gerrit-Change-Number: 37287 Gerrit-PatchSet: 3 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> Gerrit-MessageType: merged
1 0
0 0
  • ← Newer
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • ...
  • 157
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.