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

May 2023

  • 1 participants
  • 2583 discussions
[L] Change in osmo-bts[master]: refactor: replace rtppayload_is_valid() with preening before enqueue
by pespin 25 May '23

25 May '23
Attention is currently required from: falconia. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/32988 ) Change subject: refactor: replace rtppayload_is_valid() with preening before enqueue ...................................................................... Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/32988 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I7fc99aeecba8303b56d397b8952de5eea82b301e Gerrit-Change-Number: 32988 Gerrit-PatchSet: 3 Gerrit-Owner: falconia <falcon(a)freecalypso.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: falconia <falcon(a)freecalypso.org> Gerrit-Comment-Date: Thu, 25 May 2023 20:09:53 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in libosmocore[master]: coding: test FACCH/[FH] bitstealing in test_csd()
by fixeria 25 May '23

25 May '23
Attention is currently required from: fixeria. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/libosmocore/+/33004 to look at the new patch set (#2). Change subject: coding: test FACCH/[FH] bitstealing in test_csd() ...................................................................... coding: test FACCH/[FH] bitstealing in test_csd() In test_csd() we encode three data frames filled-in with three specific patterns and then try decoding them. Additionally execute the same set of tests, but with FACCH/[FH] bitstealing (pattern 0x2b). As can be seen from the test output, we have problems decoding FACCH: * FACCH/F: decoding fails (n_errors=0 / n_bits_total=0), * FACCH/H: decoding with errors (n_errors=2 / n_bits_total=456). A patch fixing the problem follows. Change-Id: Idc6decec3b84981d2aab4e27caab9ad65180f945 Related: OS#1572 --- M tests/coding/coding_test.c M tests/coding/coding_test.ok 2 files changed, 148 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/04/33004/2 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/33004 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Idc6decec3b84981d2aab4e27caab9ad65180f945 Gerrit-Change-Number: 33004 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
[L] Change in libosmocore[master]: coding: implement TCH/F9.6, TCH/[FH]4.8, TCH/H2.4, TCH/F14.4
by fixeria 25 May '23

25 May '23
Attention is currently required from: falconia, laforge. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/32808 ) Change subject: coding: implement TCH/F9.6, TCH/[FH]4.8, TCH/H2.4, TCH/F14.4 ...................................................................... Patch Set 9: This change is ready for review. -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/32808 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ib482817b5f6a4e3c7299f6e0b3841143b60fc93d Gerrit-Change-Number: 32808 Gerrit-PatchSet: 9 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: falconia <falcon(a)freecalypso.org> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: falconia <falcon(a)freecalypso.org> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Thu, 25 May 2023 19:41:45 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[M] Change in libosmocore[master]: coding: test FACCH/[FH] bitstealing in test_csd()
by fixeria 25 May '23

25 May '23
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/33004 ) Change subject: coding: test FACCH/[FH] bitstealing in test_csd() ...................................................................... coding: test FACCH/[FH] bitstealing in test_csd() In test_csd() we encode three data frames filled-in with three specific patterns and then try decoding them. Additionally execute the same set of tests, but with FACCH/[FH] bitstealing (pattern 0x2b). As can be seen from the test output, we have problems decoding FACCH: * FACCH/F: decoding fails (n_errors=0 / n_bits_total=0), * FACCH/H: decoding with errors (n_errors=2 / n_bits_total=456). A patch fixing the problem follows. Change-Id: Idc6decec3b84981d2aab4e27caab9ad65180f945 Related: OS#1572 --- M tests/coding/coding_test.c M tests/coding/coding_test.ok 2 files changed, 148 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/04/33004/1 diff --git a/tests/coding/coding_test.c b/tests/coding/coding_test.c index e8dbe83..332fdc8 100644 --- a/tests/coding/coding_test.c +++ b/tests/coding/coding_test.c @@ -540,6 +540,7 @@ unsigned int num_bits; int (*enc_fn)(ubit_t *out, const ubit_t *in); int (*dec_fn)(ubit_t *out, const sbit_t *in, int *ne, int *nb); + bool half_rate; }; static const struct csd_test_case csd_tests[] = { @@ -560,12 +561,14 @@ .num_bits = 4 * 60, .enc_fn = &gsm0503_tch_hr48_encode, .dec_fn = &gsm0503_tch_hr48_decode, + .half_rate = true, }, { .name = "TCH/H2.4", .num_bits = 2 * 72, .enc_fn = &gsm0503_tch_hr24_encode, .dec_fn = &gsm0503_tch_hr24_decode, + .half_rate = true, }, { .name = "TCH/F14.4", @@ -575,7 +578,7 @@ }, }; -static void test_csd(const struct csd_test_case *tc) +static void test_csd(const struct csd_test_case *tc, bool facch) { const uint8_t patterns[] = { 0x00, 0xaa, 0xff }; ubit_t bursts_u[116 * (22 + 8)] = { 0 }; @@ -590,9 +593,17 @@ rc = tc->enc_fn(&bursts_u[i * 4 * 116], &data[0]); CHECK_RC_OR_RET(rc == 0, "encoding"); - } - /* TODO: test FACCH stealing */ + /* Test FACCH bitstealing */ + if (facch && i == 1) { + memset(&data, GSM_MACBLOCK_PADDING, GSM_MACBLOCK_LEN); + if (tc->half_rate) + rc = gsm0503_tch_hr_facch_encode(&bursts_u[116 * 4], &data[0]); + else + rc = gsm0503_tch_fr_facch_encode(&bursts_u[116 * 4], &data[0]); + CHECK_RC_OR_RET(rc == 0, "encoding FACCH"); + } + } /* Prepare soft-bits */ osmo_ubit2sbit(&bursts_s[0], &bursts_u[0], sizeof(bursts_s)); @@ -618,6 +629,27 @@ printf("\n"); } + /* Test FACCH bitstealing if requested */ + if (facch) { + int n_errors, n_bits_total; + + if (tc->half_rate) { + rc = gsm0503_tch_hr_facch_decode(&data[0], &bursts_s[116 * 4], + &n_errors, &n_bits_total); + } else { + rc = gsm0503_tch_fr_facch_decode(&data[0], &bursts_s[116 * 4], + &n_errors, &n_bits_total); + } +#if 0 + /* FIXME: there's something wrong with CSD mapping */ + CHECK_RC_OR_RET(rc == GSM_MACBLOCK_LEN, "decoding FACCH"); +#endif + + printf("%s(%s): FACCH/%c (pattern 0x2b): n_errors=%d / n_bits_total=%d\n", + __func__, tc->name, tc->half_rate ? 'H' : 'F', n_errors, n_bits_total); + printf("%s\n", osmo_hexdump(&data[0], GSM_MACBLOCK_LEN)); + } + printf("\n"); } @@ -688,9 +720,12 @@ for (i = 0; i < ARRAY_SIZE(test_l2); i++) test_facch(test_l2[i], true); - printf("\nTesting CSD functions:\n"); + printf("\nTesting CSD functions (no FACCH):\n"); for (i = 0; i < ARRAY_SIZE(csd_tests); i++) - test_csd(&csd_tests[i]); + test_csd(&csd_tests[i], false); + printf("\nTesting CSD functions (with FACCH):\n"); + for (i = 0; i < ARRAY_SIZE(csd_tests); i++) + test_csd(&csd_tests[i], true); printf("Success\n"); diff --git a/tests/coding/coding_test.ok b/tests/coding/coding_test.ok index 3985513..c9c6bb7 100644 --- a/tests/coding/coding_test.ok +++ b/tests/coding/coding_test.ok @@ -402,7 +402,7 @@ test_facch(FACCH/H): decoded (BER=0/456): 01 02 03 00 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 -Testing CSD functions: +Testing CSD functions (no FACCH): test_csd(TCH/F9.6): block #0 (pattern 0x00): n_errors=0 / n_bits_total=456 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 @@ -477,4 +477,90 @@ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11 + +Testing CSD functions (with FACCH): +test_csd(TCH/F9.6): block #0 (pattern 0x00): n_errors=34 / n_bits_total=456 +00000000 00000000 00000000 00000000 00010010 01100000 00000000 00000000 +00000000 00010011 01111000 00000000 00000000 00000000 00100100 10000000 +00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 +00000000 00000000 00000000 00000000 00000000 00000000 +test_csd(TCH/F9.6): block #1 (pattern 0xaa): n_errors=34 / n_bits_total=456 +01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 +01010101 01010101 01010101 01010101 01010101 01010101 00101011 01010101 +01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 +01010101 01010101 01010101 01010101 01010101 01010101 +test_csd(TCH/F9.6): block #2 (pattern 0xff): n_errors=6 / n_bits_total=456 +11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 +11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 +11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 +11111111 11111111 11111111 11111111 11111111 11111111 +test_csd(TCH/F9.6): FACCH/F (pattern 0x2b): n_errors=0 / n_bits_total=0 +01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 + +test_csd(TCH/F4.8): block #0 (pattern 0x00): n_errors=38 / n_bits_total=456 +00000000 00000000 01010000 00000000 00000000 00000000 00000000 00000000 +00000000 00000000 00000000 00000000 00000000 00000000 00000000 +test_csd(TCH/F4.8): block #1 (pattern 0xaa): n_errors=37 / n_bits_total=456 +01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 +01010101 01010101 01010101 01010101 01010101 01010101 01010101 +test_csd(TCH/F4.8): block #2 (pattern 0xff): n_errors=1 / n_bits_total=456 +11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 +11111111 11111111 11111111 11111111 11111111 11111111 11111111 +test_csd(TCH/F4.8): FACCH/F (pattern 0x2b): n_errors=0 / n_bits_total=0 +01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 + +test_csd(TCH/H4.8): block #0 (pattern 0x00): n_errors=35 / n_bits_total=456 +00000000 00000000 00000000 00000000 00111000 10000000 00000000 00000000 +00000001 00000000 00000000 00000000 00000000 00000000 00011000 10000000 +00000000 00000000 00000000 00000000 00000000 00001000 00000000 00000000 +00000000 00000000 00000000 00000000 00000000 00000000 +test_csd(TCH/H4.8): block #1 (pattern 0xaa): n_errors=38 / n_bits_total=456 +01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 +01010101 01010101 01010101 01010101 01010101 01010101 00101011 01010101 +01010101 01010101 01010101 00111010 01010101 01010101 01010101 01010101 +01010101 01010101 01010101 01010101 01010101 01010101 +test_csd(TCH/H4.8): block #2 (pattern 0xff): n_errors=1 / n_bits_total=456 +11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 +11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 +11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 +11111111 11111111 11111111 11111111 11111111 11111111 +test_csd(TCH/H4.8): FACCH/H (pattern 0x2b): n_errors=2 / n_bits_total=456 +2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b + +test_csd(TCH/H2.4): block #0 (pattern 0x00): n_errors=38 / n_bits_total=456 +00000000 00000000 00000101 00000000 00000000 00000000 00000000 00000000 +00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 +00000000 00000000 +test_csd(TCH/H2.4): block #1 (pattern 0xaa): n_errors=32 / n_bits_total=456 +01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 +01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 +01010101 01010101 +test_csd(TCH/H2.4): block #2 (pattern 0xff): n_errors=0 / n_bits_total=456 +11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 +11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 +11111111 11111111 +test_csd(TCH/H2.4): FACCH/H (pattern 0x2b): n_errors=2 / n_bits_total=456 +2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b + +test_csd(TCH/F14.4): block #0 (pattern 0x00): n_errors=27 / n_bits_total=456 +00000000 00000000 00000000 00000000 00000000 00111100 01000000 00000000 +00000000 00000000 00000000 00111000 10011000 00000000 10000000 00000000 +00000000 00000000 00001111 10001101 01110000 00000000 00000000 00000000 +00000000 00000000 00001001 11000000 00000000 00000000 00000000 00000000 +00000000 00000010 00100010 01000000 00 +test_csd(TCH/F14.4): block #1 (pattern 0xaa): n_errors=35 / n_bits_total=456 +01010101 01010100 10110111 01010101 01010101 00011000 10010001 11000110 +11011100 11011101 11000110 01010101 01010101 01010101 10100100 10010001 +11000110 00001010 01010101 01010101 11101101 11010101 01010100 01010101 +01010101 01010101 00101001 00100101 01010101 01010101 01010101 01010101 +01010101 01010101 01010101 01010101 01 +test_csd(TCH/F14.4): block #2 (pattern 0xff): n_errors=3 / n_bits_total=456 +11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 +11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 +11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 +11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 +11111111 11111111 11111111 11111111 11 +test_csd(TCH/F14.4): FACCH/F (pattern 0x2b): n_errors=0 / n_bits_total=0 +01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 + Success -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/33004 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Idc6decec3b84981d2aab4e27caab9ad65180f945 Gerrit-Change-Number: 33004 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[L] Change in libosmocore[master]: coding: implement dedicated codec API for FACCH/[FH]
by fixeria 25 May '23

25 May '23
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/33003 ) Change subject: coding: implement dedicated codec API for FACCH/[FH] ...................................................................... coding: implement dedicated codec API for FACCH/[FH] Currently FACCH/[FH] encoding and decoding is implemented as part of the gsm0503_tch_[fh]r_{en,de}code and gsm0503_tch_a[fh]s_{en,de}code API. This works fine for speech because one FACCH frame completely replaces one or two speech frames, but this is not the case for CSD. According to 3GPP TS 45.002, sections 4.2.5 and 4.3.5, for TCH data channels FACCH does not replace data frames but disturbs some amount of bits from them. Therefore we need to be able to perform FACCH encoding and decoding independently from CSD specific coding API. Change-Id: I0c7a9c180dcafe64e6aebe53518d3d11e1f29886 Related: OS#1572 --- M include/osmocom/coding/gsm0503_coding.h M src/coding/gsm0503_coding.c M src/coding/libosmocoding.map M tests/coding/coding_test.c M tests/coding/coding_test.ok 5 files changed, 254 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/03/33003/1 diff --git a/include/osmocom/coding/gsm0503_coding.h b/include/osmocom/coding/gsm0503_coding.h index c6181d8..75e12e6 100644 --- a/include/osmocom/coding/gsm0503_coding.h +++ b/include/osmocom/coding/gsm0503_coding.h @@ -109,4 +109,12 @@ int gsm0503_tch_fr144_decode(ubit_t *data, const sbit_t *bursts, int *n_errors, int *n_bits_total); +int gsm0503_tch_fr_facch_encode(ubit_t *bursts, const uint8_t *data); +int gsm0503_tch_fr_facch_decode(uint8_t *data, const sbit_t *bursts, + int *n_errors, int *n_bits_total); + +int gsm0503_tch_hr_facch_encode(ubit_t *bursts, const uint8_t *data); +int gsm0503_tch_hr_facch_decode(uint8_t *data, const sbit_t *bursts, + int *n_errors, int *n_bits_total); + /*! @} */ diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index b761cd0..5badbd0 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -3589,4 +3589,138 @@ return 290; } +/* + * FACCH/[FH] transcoding + */ + +/*! Perform channel encoding of a FACCH/F data as per section 4.2. + * \param[out] bursts Caller-allocated buffer for symbols of 8 bursts, + * 8 * 2 * 58 == 928 bits total. + * \param[in] data FACCH MAC block to be encoded (GSM_MACBLOCK_LEN). + * \returns 0 in case of success; negative on error */ +int gsm0503_tch_fr_facch_encode(ubit_t *bursts, const uint8_t *data) +{ + ubit_t iB[8 * 114], cB[4 * 114]; + const ubit_t h = 1; + + /* 4.2.1-3 as specified for the SACCH in 4.1.1-3 */ + _xcch_encode_cB(&cB[0], &data[0]); + + /* 4.2.4 Interleaving: as specified for the TCH/FS in subclause 3.1.3 */ + gsm0503_tch_fr_interleave(&cB[0], &iB[0]); + + /* 4.2.5 Mapping on a Burst: + * - hu(B)=1 the even numbered bits in the first 4 bursts and + * - hl(B)=1 the odd numbered bits of the last 4 bursts are stolen. */ + for (unsigned int i = 0; i < 8; i++) + gsm0503_tch_burst_map(&iB[i * 114], &bursts[i * 116], &h, i >> 2); + + return 0; +} + +/*! Perform channel decoding of a FACCH/F data as per section 4.2. + * \param[out] data Caller-allocated buffer for decoded FACCH (GSM_MACBLOCK_LEN). + * \param[in] bursts Buffer containing the symbols of 8 bursts, + * 8 * 2 * 58 == 928 bits total. + * \param[out] n_errors Number of detected bit errors. + * \param[out] n_bits_total Total number of bits. + * \returns Number of bytes used in the output buffer; negative on error. */ +int gsm0503_tch_fr_facch_decode(uint8_t *data, const sbit_t *bursts, + int *n_errors, int *n_bits_total) +{ + sbit_t iB[8 * 114], cB[4 * 114]; + int steal = 0; + + /* FACCH decision: sum of 4 first hu(B) and 4 last hl(B) soft-bits */ + for (unsigned int i = 0; i < 4; i++) + steal -= bursts[i * 116 + 58]; /* hu(B) */ + for (unsigned int i = 4; i < 8; i++) + steal -= bursts[i * 116 + 57]; /* hl(B) */ + if (steal <= 0) + return -1; + + /* 4.2.5 Mapping on a Burst: + * - hu(B)=1 the even numbered bits in the first 4 bursts and + * - hl(B)=1 the odd numbered bits of the last 4 bursts are stolen. */ + for (unsigned int i = 0; i < 8; i++) + gsm0503_tch_burst_unmap(&iB[i * 114], &bursts[i * 116], NULL, i >> 2); + + /* 4.2.4 Interleaving: as specified for the TCH/FS in subclause 3.1.3 */ + gsm0503_tch_fr_deinterleave(&cB[0], &iB[0]); + + /* 4.2.1-3 as specified for the SACCH in 4.1.1-3 */ + if (_xcch_decode_cB(&data[0], &cB[0], n_errors, n_bits_total) != 0) + return -1; + + return GSM_MACBLOCK_LEN; +} + +/*! Perform channel encoding of a FACCH/H data as per section 4.3. + * \param[out] bursts Caller-allocated buffer for symbols of 6 bursts, + * 6 * 2 * 58 == 696 bits total. + * \param[in] data FACCH MAC block to be encoded (GSM_MACBLOCK_LEN). + * \returns 0 in case of success; negative on error */ +int gsm0503_tch_hr_facch_encode(ubit_t *bursts, const uint8_t *data) +{ + ubit_t iB[8 * 114], cB[4 * 114]; + const ubit_t h = 1; + + /* 4.3.1-3 as specified for the SACCH in 4.1.1-3 */ + _xcch_encode_cB(&cB[0], &data[0]); + + /* 4.3.4 Interleaving */ + gsm0503_tch_fr_interleave(&cB[0], &iB[0]); + + /* 4.3.5 Mapping on a Burst: + * - hu(B)=1 the even numbered bits of the first 2 bursts, + * - hu(B)=1 & hl(B)=1 all bits of the middle 2 bursts and + * - hl(B)=1 the odd numbered bits of the last 2 bursts are stolen. */ + for (unsigned int i = 0; i < 6; i++) + gsm0503_tch_burst_map(&iB[i * 114], &bursts[i * 116], &h, i >> 2); + for (unsigned int i = 2; i < 4; i++) + gsm0503_tch_burst_map(&iB[i * 114 + 456], &bursts[i * 116], &h, 1); + + return 0; +} + +/*! Perform channel decoding of a FACCH/H data as per section 4.3. + * \param[out] data Caller-allocated buffer for decoded FACCH (GSM_MACBLOCK_LEN). + * \param[in] bursts Buffer containing the symbols of 6 bursts, + * 6 * 2 * 58 == 696 bits total. + * \param[out] n_errors Number of detected bit errors. + * \param[out] n_bits_total Total number of bits. + * \returns Number of bytes used in the output buffer; negative on error. */ +int gsm0503_tch_hr_facch_decode(uint8_t *data, const sbit_t *bursts, + int *n_errors, int *n_bits_total) +{ + sbit_t iB[8 * 114], cB[4 * 114]; + int steal = 0; + + /* FACCH decision: sum of 4 first hu(B) and 4 last hl(B) soft-bits */ + for (unsigned int i = 0; i < 4; i++) + steal -= bursts[i * 116 + 58]; /* hu(B) */ + for (unsigned int i = 2; i < 6; i++) + steal -= bursts[i * 116 + 57]; /* hl(B) */ + if (steal <= 0) + return -1; + + /* 4.3.5 Mapping on a Burst: + * - hu(B)=1 the even numbered bits of the first 2 bursts, + * - hu(B)=1 & hl(B)=1 all bits of the middle 2 bursts and + * - hl(B)=1 the odd numbered bits of the last 2 bursts are stolen. */ + for (unsigned int i = 0; i < 6; i++) + gsm0503_tch_burst_unmap(&iB[i * 114], &bursts[i * 116], NULL, i >> 2); + for (unsigned int i = 2; i < 4; i++) + gsm0503_tch_burst_unmap(&iB[i * 114 + 456], &bursts[i * 116], NULL, 1); + + /* 4.3.4 Interleaving */ + gsm0503_tch_fr_deinterleave(&cB[0], &iB[0]); + + /* 4.3.1-3 as specified for the SACCH in 4.1.1-3 */ + if (_xcch_decode_cB(&data[0], &cB[0], n_errors, n_bits_total) != 0) + return -1; + + return GSM_MACBLOCK_LEN; +} + /*! @} */ diff --git a/src/coding/libosmocoding.map b/src/coding/libosmocoding.map index a645a58..b1087e3 100644 --- a/src/coding/libosmocoding.map +++ b/src/coding/libosmocoding.map @@ -140,5 +140,10 @@ gsm0503_tch_fr144_encode; gsm0503_tch_fr144_decode; +gsm0503_tch_fr_facch_encode; +gsm0503_tch_fr_facch_decode; +gsm0503_tch_hr_facch_encode; +gsm0503_tch_hr_facch_decode; + local: *; }; diff --git a/tests/coding/coding_test.c b/tests/coding/coding_test.c index a13dc4c..e8dbe83 100644 --- a/tests/coding/coding_test.c +++ b/tests/coding/coding_test.c @@ -24,6 +24,7 @@ #include <osmocom/core/bits.h> #include <osmocom/core/utils.h> +#include <osmocom/gsm/protocol/gsm_04_08.h> #include <osmocom/coding/gsm0503_coding.h> #define DUMP_U_AT(b, x, u) do { \ @@ -312,6 +313,51 @@ printf("\n"); } +static void test_facch(const uint8_t *data, bool half_rate) +{ + ubit_t bursts_u[116 * 8 * 2] = { 0 }; + sbit_t bursts_s[116 * 8 * 2] = { 0 }; + int rc; + + /* Encode the given FACCH message three times (at different offsets) */ + printf("%s(FACCH/%c): encoding: %s\n", + __func__, half_rate ? 'H' : 'F', + osmo_hexdump(&data[0], GSM_MACBLOCK_LEN)); + for (unsigned int i = 0; i < 3; i++) { + ubit_t *pos = &bursts_u[116 * 4 * i]; + + if (half_rate) + rc = gsm0503_tch_hr_facch_encode(pos, &data[0]); + else + rc = gsm0503_tch_fr_facch_encode(pos, &data[0]); + CHECK_RC_OR_RET(rc == 0, "encoding"); + } + + /* Prepare soft-bits */ + osmo_ubit2sbit(bursts_s, bursts_u, sizeof(bursts_s)); + + /* Decode three FACCH messages (at different offsets) */ + for (unsigned int i = 0; i < 3; i++) { + const sbit_t *pos = &bursts_s[116 * 4 * i]; + uint8_t result[GSM_MACBLOCK_LEN]; + int n_errors, n_bits_total; + + if (half_rate) + rc = gsm0503_tch_hr_facch_decode(&result[0], pos, + &n_errors, &n_bits_total); + else + rc = gsm0503_tch_fr_facch_decode(&result[0], pos, + &n_errors, &n_bits_total); + CHECK_RC_OR_RET(rc == GSM_MACBLOCK_LEN, "decoding"); + + printf("%s(FACCH/%c): decoded (BER=%d/%d): %s\n", + __func__, half_rate ? 'H' : 'F', n_errors, n_bits_total, + osmo_hexdump(result, GSM_MACBLOCK_LEN)); + } + + printf("\n"); +} + struct test_macblock { bool is_egprs; uint16_t exp_burst_bits; @@ -635,6 +681,13 @@ } } + printf("\nTesting FACCH/F codec:\n"); + for (i = 0; i < ARRAY_SIZE(test_l2); i++) + test_facch(test_l2[i], false); + printf("\nTesting FACCH/H codec:\n"); + for (i = 0; i < ARRAY_SIZE(test_l2); i++) + test_facch(test_l2[i], true); + printf("\nTesting CSD functions:\n"); for (i = 0; i < ARRAY_SIZE(csd_tests); i++) test_csd(&csd_tests[i]); diff --git a/tests/coding/coding_test.ok b/tests/coding/coding_test.ok index e1bd89d..3985513 100644 --- a/tests/coding/coding_test.ok +++ b/tests/coding/coding_test.ok @@ -368,6 +368,40 @@ 81 81 81 81 7f 7f 7f 7f 81 81 7f 81 7f 7f 81 7f 81 81 7f 81 7f 7f 7f 7f 81 81 7f 81 81 81 81 7f 7f 7f 7f 81 7f 7f 81 7f 7f 81 7f 7f 7f 7f 7f 81 7f 7f 7f 81 7f 7f 81 81 7f 7f 81 7f 7f 7f 7f 7f 7f 81 81 7f 81 81 7f 81 81 7f 81 7f 7f 7f 81 81 81 81 81 7f 81 81 81 81 7f 7f 81 81 7f 7f 81 81 7f 81 81 7f 7f 7f 7f 7f 81 81 81 81 7f 7f 7f 81 7f 7f 7f 81 7f 7f 81 7f 7f 7f 81 81 7f 7f 81 81 7f 81 7f 81 81 7f 7f 81 81 7f 81 81 7f 7f 81 7f 81 81 81 7f 7f 81 7f 7f 7f 81 7f 7f 7f 81 81 7f 81 81 7f 81 7f 81 81 81 7f 7f 7f 7f 7f 81 7f 7f 7f 7f 7f 81 7f 7f 7f 7f 7f 81 7f 7f 81 7f 81 81 7f 7f 7f 81 81 81 81 81 81 81 7f 7f 81 7f 81 81 81 7f 81 7f 81 81 7f 7f 7f 7f 7f 7f 7f 81 81 81 7f 81 81 7f 7f 7f 81 7f +Testing FACCH/F codec: +test_facch(FACCH/F): encoding: 03 03 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +test_facch(FACCH/F): decoded (BER=0/456): 03 03 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +test_facch(FACCH/F): decoded (BER=0/456): 03 03 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +test_facch(FACCH/F): decoded (BER=0/456): 03 03 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + +test_facch(FACCH/F): encoding: a3 af 5f 00 36 43 44 ab d9 6d 7d 62 24 c9 d2 92 fa 27 5d 71 7a 59 a8 +test_facch(FACCH/F): decoded (BER=0/456): a3 af 5f 00 36 43 44 ab d9 6d 7d 62 24 c9 d2 92 fa 27 5d 71 7a 59 a8 +test_facch(FACCH/F): decoded (BER=0/456): a3 af 5f 00 36 43 44 ab d9 6d 7d 62 24 c9 d2 92 fa 27 5d 71 7a 59 a8 +test_facch(FACCH/F): decoded (BER=0/456): a3 af 5f 00 36 43 44 ab d9 6d 7d 62 24 c9 d2 92 fa 27 5d 71 7a 59 a8 + +test_facch(FACCH/F): encoding: 01 02 03 00 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 +test_facch(FACCH/F): decoded (BER=0/456): 01 02 03 00 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 +test_facch(FACCH/F): decoded (BER=0/456): 01 02 03 00 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 +test_facch(FACCH/F): decoded (BER=0/456): 01 02 03 00 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 + + +Testing FACCH/H codec: +test_facch(FACCH/H): encoding: 03 03 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +test_facch(FACCH/H): decoded (BER=0/456): 03 03 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +test_facch(FACCH/H): decoded (BER=0/456): 03 03 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +test_facch(FACCH/H): decoded (BER=0/456): 03 03 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + +test_facch(FACCH/H): encoding: a3 af 5f 00 36 43 44 ab d9 6d 7d 62 24 c9 d2 92 fa 27 5d 71 7a 59 a8 +test_facch(FACCH/H): decoded (BER=0/456): a3 af 5f 00 36 43 44 ab d9 6d 7d 62 24 c9 d2 92 fa 27 5d 71 7a 59 a8 +test_facch(FACCH/H): decoded (BER=0/456): a3 af 5f 00 36 43 44 ab d9 6d 7d 62 24 c9 d2 92 fa 27 5d 71 7a 59 a8 +test_facch(FACCH/H): decoded (BER=0/456): a3 af 5f 00 36 43 44 ab d9 6d 7d 62 24 c9 d2 92 fa 27 5d 71 7a 59 a8 + +test_facch(FACCH/H): encoding: 01 02 03 00 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 +test_facch(FACCH/H): decoded (BER=0/456): 01 02 03 00 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 +test_facch(FACCH/H): decoded (BER=0/456): 01 02 03 00 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 +test_facch(FACCH/H): decoded (BER=0/456): 01 02 03 00 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 + + Testing CSD functions: test_csd(TCH/F9.6): block #0 (pattern 0x00): n_errors=0 / n_bits_total=456 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/33003 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I0c7a9c180dcafe64e6aebe53518d3d11e1f29886 Gerrit-Change-Number: 33003 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in libosmocore[master]: coding: fix _tch_csd_burst_map(): do not overwrite FACCH
by fixeria 25 May '23

25 May '23
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/33005 ) Change subject: coding: fix _tch_csd_burst_map(): do not overwrite FACCH ...................................................................... coding: fix _tch_csd_burst_map(): do not overwrite FACCH As was demonstrated in the unit test [1], FACCH bitstealing does not work as expected in conjunction CSD specific encoding functions. The problem is in _tch_csd_burst_map(): we don't check the stealing flags hu(B) and hl(B) and overwrite both odd and even numbered bits unconditionally. Even worse, we reset these stealing flags to 0. * Do not overwrite the hu(B) and hl(B) flags. * Copy *even* numbered bits only if hu(B) is not set. * Copy *odd* numbered bits only if hl(B) is not set. Change-Id: Ib5395c70e3e725469c18ff7d4c47c62ddfdbd55d Related: [1] Idc6decec3b84981d2aab4e27caab9ad65180f945 Related: OS#1572 --- M src/coding/gsm0503_coding.c M tests/coding/coding_test.c M tests/coding/coding_test.ok 3 files changed, 51 insertions(+), 22 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/05/33005/1 diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index 5badbd0..a34cd92 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -3298,13 +3298,23 @@ static inline void _tch_csd_burst_map(ubit_t *burst, const ubit_t *iB) { - for (unsigned int i = 0; i < 57; i++) { - burst[i] |= iB[i]; - burst[59 + i] |= iB[57 + i]; + unsigned int i; + + /* hu(B): copy *even* numbered bits if not stolen by FACCH */ + if (burst[58] == 0) { + for (i = 0; i < 57; i += 2) + burst[i] |= iB[i]; + for (i = 58; i < 114; i += 2) + burst[i + 2] |= iB[i]; } - burst[57] = 0; /* hl(B) */ - burst[58] = 0; /* hu(B) */ + /* hl(B): copy *odd* numbered bits if not stolen by FACCH */ + if (burst[57] == 0) { + for (i = 1; i < 57; i += 2) + burst[i] |= iB[i]; + for (i = 57; i < 114; i += 2) + burst[i + 2] |= iB[i]; + } } /*! Perform channel encoding of a TCH/F9.6 channel as per section 3.3. diff --git a/tests/coding/coding_test.c b/tests/coding/coding_test.c index 332fdc8..d6a1f6f 100644 --- a/tests/coding/coding_test.c +++ b/tests/coding/coding_test.c @@ -640,10 +640,7 @@ rc = gsm0503_tch_fr_facch_decode(&data[0], &bursts_s[116 * 4], &n_errors, &n_bits_total); } -#if 0 - /* FIXME: there's something wrong with CSD mapping */ CHECK_RC_OR_RET(rc == GSM_MACBLOCK_LEN, "decoding FACCH"); -#endif printf("%s(%s): FACCH/%c (pattern 0x2b): n_errors=%d / n_bits_total=%d\n", __func__, tc->name, tc->half_rate ? 'H' : 'F', n_errors, n_bits_total); diff --git a/tests/coding/coding_test.ok b/tests/coding/coding_test.ok index c9c6bb7..c5c145d 100644 --- a/tests/coding/coding_test.ok +++ b/tests/coding/coding_test.ok @@ -489,13 +489,13 @@ 01010101 01010101 01010101 01010101 01010101 01010101 00101011 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 -test_csd(TCH/F9.6): block #2 (pattern 0xff): n_errors=6 / n_bits_total=456 -11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 +test_csd(TCH/F9.6): block #2 (pattern 0xff): n_errors=14 / n_bits_total=456 +11111111 11111111 11111111 11110111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 -test_csd(TCH/F9.6): FACCH/F (pattern 0x2b): n_errors=0 / n_bits_total=0 -01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 +test_csd(TCH/F9.6): FACCH/F (pattern 0x2b): n_errors=0 / n_bits_total=456 +2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b test_csd(TCH/F4.8): block #0 (pattern 0x00): n_errors=38 / n_bits_total=456 00000000 00000000 01010000 00000000 00000000 00000000 00000000 00000000 @@ -503,11 +503,11 @@ test_csd(TCH/F4.8): block #1 (pattern 0xaa): n_errors=37 / n_bits_total=456 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 -test_csd(TCH/F4.8): block #2 (pattern 0xff): n_errors=1 / n_bits_total=456 +test_csd(TCH/F4.8): block #2 (pattern 0xff): n_errors=13 / n_bits_total=456 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 -test_csd(TCH/F4.8): FACCH/F (pattern 0x2b): n_errors=0 / n_bits_total=0 -01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 +test_csd(TCH/F4.8): FACCH/F (pattern 0x2b): n_errors=0 / n_bits_total=456 +2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b test_csd(TCH/H4.8): block #0 (pattern 0x00): n_errors=35 / n_bits_total=456 00000000 00000000 00000000 00000000 00111000 10000000 00000000 00000000 @@ -519,12 +519,12 @@ 01010101 01010101 01010101 01010101 01010101 01010101 00101011 01010101 01010101 01010101 01010101 00111010 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 -test_csd(TCH/H4.8): block #2 (pattern 0xff): n_errors=1 / n_bits_total=456 +test_csd(TCH/H4.8): block #2 (pattern 0xff): n_errors=3 / n_bits_total=456 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 -test_csd(TCH/H4.8): FACCH/H (pattern 0x2b): n_errors=2 / n_bits_total=456 +test_csd(TCH/H4.8): FACCH/H (pattern 0x2b): n_errors=0 / n_bits_total=456 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b test_csd(TCH/H2.4): block #0 (pattern 0x00): n_errors=38 / n_bits_total=456 @@ -535,11 +535,11 @@ 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 -test_csd(TCH/H2.4): block #2 (pattern 0xff): n_errors=0 / n_bits_total=456 +test_csd(TCH/H2.4): block #2 (pattern 0xff): n_errors=2 / n_bits_total=456 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 -test_csd(TCH/H2.4): FACCH/H (pattern 0x2b): n_errors=2 / n_bits_total=456 +test_csd(TCH/H2.4): FACCH/H (pattern 0x2b): n_errors=0 / n_bits_total=456 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b test_csd(TCH/F14.4): block #0 (pattern 0x00): n_errors=27 / n_bits_total=456 @@ -554,13 +554,13 @@ 11000110 00001010 01010101 01010101 11101101 11010101 01010100 01010101 01010101 01010101 00101001 00100101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101 01 -test_csd(TCH/F14.4): block #2 (pattern 0xff): n_errors=3 / n_bits_total=456 +test_csd(TCH/F14.4): block #2 (pattern 0xff): n_errors=10 / n_bits_total=456 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11 -test_csd(TCH/F14.4): FACCH/F (pattern 0x2b): n_errors=0 / n_bits_total=0 -01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 +test_csd(TCH/F14.4): FACCH/F (pattern 0x2b): n_errors=0 / n_bits_total=456 +2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Success -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/33005 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ib5395c70e3e725469c18ff7d4c47c62ddfdbd55d Gerrit-Change-Number: 33005 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[L] Change in osmo-bts[master]: refactor: replace rtppayload_is_valid() with preening before enqueue
by falconia 25 May '23

25 May '23
Attention is currently required from: pespin. falconia has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/32988 ) Change subject: refactor: replace rtppayload_is_valid() with preening before enqueue ...................................................................... Patch Set 3: (2 comments) File src/common/l1sap.c: https://gerrit.osmocom.org/c/osmo-bts/+/32988/comment/6fb30cbf_dd458549 PS2, Line 1891: case PL_DECISION_ACCEPT_ASIS: > I'd go for PL_DECISION_ACCEPT. Sounds shorter and more familiar to other systems (eg. iptables). Done File src/common/rtp_input_preen.c: https://gerrit.osmocom.org/c/osmo-bts/+/32988/comment/e0e1fda7_1bc49a8e PS2, Line 37: static bool rtppayload_is_octet_aligned(const uint8_t *rtp_pl, unsigned payload_len) > Adding it to my mental notes for the next version. Done -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/32988 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I7fc99aeecba8303b56d397b8952de5eea82b301e Gerrit-Change-Number: 32988 Gerrit-PatchSet: 3 Gerrit-Owner: falconia <falcon(a)freecalypso.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Thu, 25 May 2023 19:15:09 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: falconia <falcon(a)freecalypso.org> Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-bts[master]: all models, HR1 codec: accept both TS101318 and RFC5993 formats
by falconia 25 May '23

25 May '23
Attention is currently required from: laforge, pespin, dexter. Hello Jenkins Builder, pespin, dexter, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-bts/+/32968 to look at the new patch set (#4). Change subject: all models, HR1 codec: accept both TS101318 and RFC5993 formats ...................................................................... all models, HR1 codec: accept both TS101318 and RFC5993 formats There exist two different RTP encoding formats for HR1 codec: one "simple" format defined in ETSI TS 101 318, and an extended format (adding a ToC octet) defined in IETF RFC 5993. Following the liberal-accept clause of Postel's law, we would like to accept both formats. Implement this feature by first converting all HR1 RTP inputs to the more basic TS 101 318 format at the point of input preening, and then consistently using this basic format internally. Related: OS#5688 Depends: I13eaad366f9f68615b9e9e4a5f87396a0e9dea0f (libosmocore) Change-Id: I702e26c3ad5b9d8347e73c6cd23efa38a3a3407e --- M TODO-RELEASE M src/common/rtp_input_preen.c 2 files changed, 39 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/68/32968/4 -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/32968 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I702e26c3ad5b9d8347e73c6cd23efa38a3a3407e Gerrit-Change-Number: 32968 Gerrit-PatchSet: 4 Gerrit-Owner: falconia <falcon(a)freecalypso.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
[L] Change in osmo-bts[master]: refactor: replace rtppayload_is_valid() with preening before enqueue
by falconia 25 May '23

25 May '23
Attention is currently required from: falconia. Hello Jenkins Builder, pespin, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-bts/+/32988 to look at the new patch set (#3). Change subject: refactor: replace rtppayload_is_valid() with preening before enqueue ...................................................................... refactor: replace rtppayload_is_valid() with preening before enqueue Up until now, our approach to validating incoming RTP payloads and dropping invalid ones has been to apply the preening function inside l1sap_tch_rts_ind(), at the point of dequeueing from the DL input queue. However, there are some RTP formats where we need to strip one byte of header from the payload before passing the rest to our innards: there is RFC 5993 for HR codec, and there also exists a non-standard extension (rtp_traulike) that does a similar deal for FR and EFR. Because of alignment issues, it will be more efficient (avoids memmove) if we can do this header octet stripping before we copy the payload into msgb - but doing so requires that we move this preening logic to the point of RTP input before enqueueing. Make this change. Related: OS#5688 Change-Id: I7fc99aeecba8303b56d397b8952de5eea82b301e --- M include/osmo-bts/Makefile.am A include/osmo-bts/rtp_input_preen.h M src/common/Makefile.am M src/common/l1sap.c A src/common/rtp_input_preen.c 5 files changed, 192 insertions(+), 72 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/88/32988/3 -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/32988 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I7fc99aeecba8303b56d397b8952de5eea82b301e Gerrit-Change-Number: 32988 Gerrit-PatchSet: 3 Gerrit-Owner: falconia <falcon(a)freecalypso.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: falconia <falcon(a)freecalypso.org> Gerrit-MessageType: newpatchset
1 0
0 0
[S] Change in osmo-bts[master]: all models, HR1 codec: accept both TS101318 and RFC5993 formats
by falconia 25 May '23

25 May '23
Attention is currently required from: laforge, pespin, dexter. falconia has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/32968 ) Change subject: all models, HR1 codec: accept both TS101318 and RFC5993 formats ...................................................................... Patch Set 3: (1 comment) File src/common/rtp_input_preen.c: https://gerrit.osmocom.org/c/osmo-bts/+/32968/comment/03dd81c6_2277301b PS3, Line 93: return PL_DECISION_STRIP_HDR_OCTET; > Thanks, I see you have a plan for it then and it's not simply dropped without consideration. […] When a GSM MS generates a SID frame during DTXu silence, or when a network transcoder configured to prepare a frame stream for DTXd does the same, that 112-bit frame begins its life as a perfect or pristine SID: 79 bits of the SID marker field set to all ones, plus 33 bits of comfort noise parameters. However, per GSM 06.41 (DTX spec for HR) receivers are required to recognize not only such perfect error-free SID frames, but also ones that have been corrupted with some bit errors, classifying them as either valid or invalid SID. A frame classified as valid-SID is used as a source of CN params; if a received frame is classified as invalid SID, no CN params are taken from it, but knowing that it was meant to be SID, the prescribed Rx DTX handler treats it differently from regular BFI conditions (total absence of a frame). In the classic E1 Abis architecture the BTS performs ternary SID classification (valid SID, invalid SID or non-SID) of received UL frames and sends the resulting classification decision to the TRAU in out-of-band bits, outside the 112-bit frame itself. All 3 TS 101 318 RTP formats (FR, EFR and HR) got rid of TRAU-frame-like out-of-band flag bits, causing pain and misery for those who like the classic architecture and seek to fully recreate it over IP RAN. With FR and EFR the workaround is to have the RTP packet recipient reconstruct SID classification status from the payload using osmo_{fr,efr}_sid_classify() - the computation rules are fixed in the DTX specs for FR and EFR. But the DTX spec for HR differs in that the exact rules for classifying a received radio frame as valid SID, invalid SID or non-SID are left up to BTS implementation - hence we really need to have the UL handler in the BTS make this determination and then propagate it out-of-band. The ToC octet of RFC 5993 brings back this E1 Abis-originating out-of-band SID indication, albeit with a defect: the official word of this RFC disallows invalid SID frames, only valid SID or non-SID. In the E1 Abis world SID=0 means non-SID speech, SID=1 means invalid SID and SID=2 means valid SID. RFC 5993 defines FT=0 as non-SID speech, FT=2 as SID (implied valid), and leaves FT=1 as reserved. When I reach the point of implementing this functionality (as part of OS#6036, *after* the present patch series has been merged), I am thinking of extending "rtp hr-format" vty option to allow a third state of rfc5993-ext beyond rfc5993 and ts101318; rfc5993-ext will allow sending out "obvious" but non-standard extensions to RFC 5993 such as FT=1 meaning invalid SID. -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/32968 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I702e26c3ad5b9d8347e73c6cd23efa38a3a3407e Gerrit-Change-Number: 32968 Gerrit-PatchSet: 3 Gerrit-Owner: falconia <falcon(a)freecalypso.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Thu, 25 May 2023 18:26:23 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: falconia <falcon(a)freecalypso.org> Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • ...
  • 259
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.