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 2022

  • 2 participants
  • 1343 discussions
Change in osmo-ttcn3-hacks[master]: tcpdump capture script: check permissions to fix running in a netns
by Hoernchen 24 May '22

24 May '22
Hoernchen has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27604 ) Change subject: tcpdump capture script: check permissions to fix running in a netns ...................................................................... tcpdump capture script: check permissions to fix running in a netns This might be all caps (=ep), or a list of all caps. Change-Id: I75f7af6cc67e96ffb7b002591f7f7d1da9b5a51d --- M ttcn3-tcpdump-start.sh 1 file changed, 13 insertions(+), 0 deletions(-) Approvals: pespin: Looks good to me, but someone else must approve Hoernchen: Looks good to me, approved Jenkins Builder: Verified diff --git a/ttcn3-tcpdump-start.sh b/ttcn3-tcpdump-start.sh index 9b7a8b5..0ce07cd 100755 --- a/ttcn3-tcpdump-start.sh +++ b/ttcn3-tcpdump-start.sh @@ -42,6 +42,19 @@ /sbin/setcap -q -v 'cap_net_admin,cap_net_raw=pie' $DUMPCAP CAP_ERR="$?" fi + + # did we implicitly inherit all those caps because we're root in a netns? + if [ -u $DUMPCAP -o "$CAP_ERR" = "1" ]; then + getpcaps 0 2>&1 | grep -e cap_net_admin | grep -q -e cap_net_raw + CAP_ERR="$?" + fi + + # did we implicitly inherit all those caps because we're root in a netns? + if [ -u $DUMPCAP -o "$CAP_ERR" = "1" ]; then + getpcaps 0 2>&1 | grep -q -e " =ep" # all perms + CAP_ERR="$?" + fi + if [ -u $DUMPCAP -o "$CAP_ERR" = "0" ]; then CMD="$DUMPCAP -q" else -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27604 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: I75f7af6cc67e96ffb7b002591f7f7d1da9b5a51d Gerrit-Change-Number: 27604 Gerrit-PatchSet: 9 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-ttcn3-hacks[master]: msc tests: fix test so they don't depend on previous test runs
by Hoernchen 24 May '22

24 May '22
Hoernchen has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27603 ) Change subject: msc tests: fix test so they don't depend on previous test runs ...................................................................... msc tests: fix test so they don't depend on previous test runs The test currently implicitly check the vlr state left by preceding tests. Change-Id: Iebaecd28a426b15baf4729f40b46dd33da79cbae --- M msc/MSC_Tests.ttcn 1 file changed, 7 insertions(+), 7 deletions(-) Approvals: fixeria: Looks good to me, but someone else must approve pespin: Looks good to me, but someone else must approve Hoernchen: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 5bf199c..7244555 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -1170,7 +1170,7 @@ f_expect_mm_info(); /* wait for normal teardown */ - f_expect_clear(); + f_expect_clear(verify_vlr_cell_id := false); /* Now the same IMSI is still attached in the VLR, and a LU with an unknown TMSI reveals the same IMSI only * later during ID Response. osmo-msc first creates a new vlr_subscr for the unknown TMSI, and as soon as the @@ -1207,7 +1207,7 @@ f_expect_mm_info(); /* wait for normal teardown */ - f_expect_clear(); + f_expect_clear(verify_vlr_cell_id := false); } testcase TC_attached_imsi_lu_unknown_tmsi() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -4410,7 +4410,7 @@ mtc.stop; } } - f_expect_clear(); + f_expect_clear(verify_vlr_cell_id:=false); } testcase TC_lu_with_invalid_mcc_mnc() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -6386,7 +6386,7 @@ f_msc_lu_hlr(); f_mm_imei(); f_expect_lu_reject(); - f_expect_clear(); + f_expect_clear(verify_vlr_cell_id:=false); } testcase TC_lu_imsi_auth_tmsi_check_imei_nack() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -6416,7 +6416,7 @@ f_msc_lu_hlr(); f_mm_imei(); f_expect_lu_reject(); - f_expect_clear(); + f_expect_clear(verify_vlr_cell_id:=false); } testcase TC_lu_imsi_auth_tmsi_check_imei_err() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -6507,7 +6507,7 @@ f_mm_imei_early(); f_expect_lu_reject(); - f_expect_clear(); + f_expect_clear(verify_vlr_cell_id:=false); } testcase TC_lu_imsi_auth_tmsi_check_imei_early_nack() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -6535,7 +6535,7 @@ f_mm_imei_early(); f_expect_lu_reject(); - f_expect_clear(); + f_expect_clear(verify_vlr_cell_id:=false); } testcase TC_lu_imsi_auth_tmsi_check_imei_early_err() runs on MTC_CT { var BSC_ConnHdlr vc_conn; -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27603 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: Iebaecd28a426b15baf4729f40b46dd33da79cbae Gerrit-Change-Number: 27603 Gerrit-PatchSet: 5 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-ttcn3-hacks[master]: msc tests: fix test so they don't depend on previous test runs
by Hoernchen 24 May '22

24 May '22
Hoernchen has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27603 ) Change subject: msc tests: fix test so they don't depend on previous test runs ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27603 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: Iebaecd28a426b15baf4729f40b46dd33da79cbae Gerrit-Change-Number: 27603 Gerrit-PatchSet: 4 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Tue, 24 May 2022 08:30:02 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-ttcn3-hacks[master]: tcpdump capture script: check permissions to fix running in a netns
by Hoernchen 24 May '22

24 May '22
Hoernchen has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27604 ) Change subject: tcpdump capture script: check permissions to fix running in a netns ...................................................................... Patch Set 8: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27604 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: I75f7af6cc67e96ffb7b002591f7f7d1da9b5a51d Gerrit-Change-Number: 27604 Gerrit-PatchSet: 8 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Tue, 24 May 2022 08:29:45 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in libasn1c[master]: configure.ac: fix libtool issue with clang and sanitizer
by Hoernchen 24 May '22

24 May '22
Hoernchen has submitted this change. ( https://gerrit.osmocom.org/c/libasn1c/+/28174 ) Change subject: configure.ac: fix libtool issue with clang and sanitizer ...................................................................... configure.ac: fix libtool issue with clang and sanitizer As pointed out at https://github.com/libexpat/libexpat/issues/312 libtool does not play nice with clang sanitizer builds at all. For those builds LD shoud be set to clang too (and LDFLAGS needs the sanitizer flags as well), because the clang compiler driver knows how linking to the sanitizer libs works, but then at a later stage libtool fails to actually produce the shared libraries and the build fails. This is fixed by this patch. Addtionally LD_LIBRARY_PATH has no effect on conftest runs during configure time, so the rpath needs to be set to the asan library path to ensure the configure run does not fail due to a missing asan library, i.e.: SANS='-fsanitize=memory -fsanitize-recover=all -shared-libsan' export CC=clang-10 ASANPATH=$(dirname `$CC -print-file-name=libclang_rt.asan-x86_64.so`) export LDFLAGS="-Wl,-rpath,$ASANPATH $SANS $LDFLAGS" Change-Id: Ie38fa9985187c76b4e456d8b0a83006ef341b97e --- M configure.ac 1 file changed, 5 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified fixeria: Looks good to me, but someone else must approve pespin: Looks good to me, but someone else must approve Hoernchen: Looks good to me, approved diff --git a/configure.ac b/configure.ac index 8c93c3f..6ba1d37 100644 --- a/configure.ac +++ b/configure.ac @@ -20,6 +20,11 @@ AC_CONFIG_MACRO_DIR([m4]) +dnl patching ${archive_cmds} to affect generation of file "libtool" to fix linking with clang +AS_CASE(["$LD"],[*clang*], + [AS_CASE(["${host_os}"], + [*linux*],[archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'])]) + PKG_CHECK_MODULES(LIBTALLOC, talloc) AC_ARG_ENABLE(sanitize, -- To view, visit https://gerrit.osmocom.org/c/libasn1c/+/28174 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Change-Id: Ie38fa9985187c76b4e456d8b0a83006ef341b97e Gerrit-Change-Number: 28174 Gerrit-PatchSet: 1 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in libasn1c[master]: configure.ac: fix libtool issue with clang and sanitizer
by Hoernchen 24 May '22

24 May '22
Hoernchen has posted comments on this change. ( https://gerrit.osmocom.org/c/libasn1c/+/28174 ) Change subject: configure.ac: fix libtool issue with clang and sanitizer ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libasn1c/+/28174 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Change-Id: Ie38fa9985187c76b4e456d8b0a83006ef341b97e Gerrit-Change-Number: 28174 Gerrit-PatchSet: 1 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Tue, 24 May 2022 08:25:06 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in libosmocore[master]: coding: separate gsm0503_tch_a[fh]s_decode_inband()
by fixeria 24 May '22

24 May '22
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/28177 ) Change subject: coding: separate gsm0503_tch_a[fh]s_decode_inband() ...................................................................... coding: separate gsm0503_tch_a[fh]s_decode_inband() These functions can be re-used for parsing in-band data from DTX specific frames like SID_FIRST, SID_UPDATE, SID_ONSET, etc. Change-Id: I0106de7a7f87517006e323299b2dc08457d1c6cf Related: OS#5570 --- M src/coding/gsm0503_coding.c 1 file changed, 46 insertions(+), 26 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/77/28177/1 diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index 168e120..9ddc094 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -2115,6 +2115,26 @@ return 0; } +/* TCH/AFS: parse codec ID (CMI or CMC/CMR) from coded in-band data (16 bit) */ +static uint8_t gsm0503_tch_afs_decode_inband(const sbit_t *cB) +{ + unsigned int id, best = 0; + unsigned int i, j, k; + + for (i = 0; i < 4; i++) { + /* FIXME: why not using remaining (16 - 8) soft-bits here? */ + for (j = 0, k = 0; j < 8; j++) + k += abs(((int)gsm0503_afs_ic_sbit[i][j]) - ((int)cB[j])); + + if (i == 0 || k < best) { + best = k; + id = i; + } + } + + return id; +} + /*! Perform channel decoding of a TCH/AFS channel according TS 05.03 * \param[out] tch_data Codec frame in RTP payload format * \param[in] bursts buffer containing the symbols of 8 bursts @@ -2157,7 +2177,7 @@ { sbit_t iB[912], cB[456], h; ubit_t d[244], p[6], conv[250]; - int i, j, k, best = 0, rv, len, steal = 0, id = -1; + int i, rv, len, steal = 0, id = -1; *n_errors = 0; *n_bits_total = 0; static ubit_t sid_first_dummy[64] = { 0 }; sbit_t sid_update_enc[256]; @@ -2236,18 +2256,8 @@ } } - for (i = 0; i < 4; i++) { - for (j = 0, k = 0; j < 8; j++) - k += abs(((int)gsm0503_afs_ic_sbit[i][j]) - ((int)cB[j])); - - if (i == 0 || k < best) { - best = k; - id = i; - } - } - - /* Check if indicated codec fits into range of codecs */ - if (id >= codecs) { + /* Parse codec ID (CMI or CMC/CMR) and check if it fits into range of codecs */ + if ((id = gsm0503_tch_afs_decode_inband(&cB[0])) >= codecs) { /* Codec mode out of range, return id */ return id; } @@ -2578,6 +2588,26 @@ return -1; } +/* TCH/AHS: parse codec ID (CMI or CMC/CMR) from coded in-band data (16 bit) */ +static uint8_t gsm0503_tch_ahs_decode_inband(const sbit_t *cB) +{ + unsigned int id, best = 0; + unsigned int i, j, k; + + for (i = 0, k = 0; i < 4; i++) { + /* FIXME: why not using remaining (16 - 4) soft-bits here? */ + for (j = 0, k = 0; j < 4; j++) + k += abs(((int)gsm0503_ahs_ic_sbit[i][j]) - ((int)cB[j])); + + if (i == 0 || k < best) { + best = k; + id = i; + } + } + + return id; +} + /*! Perform channel decoding of a TCH/AFS channel according TS 05.03 * \param[out] tch_data Codec frame in RTP payload format * \param[in] bursts buffer containing the symbols of 8 bursts @@ -2622,7 +2652,7 @@ { sbit_t iB[912], cB[456], h; ubit_t d[244], p[6], conv[135]; - int i, j, k, best = 0, rv, len, steal = 0, id = -1; + int i, rv, len, steal = 0, id = -1; static ubit_t sid_first_dummy[64] = { 0 }; /* only unmap the stealing bits */ @@ -2738,18 +2768,8 @@ } } - for (i = 0; i < 4; i++) { - for (j = 0, k = 0; j < 4; j++) - k += abs(((int)gsm0503_ahs_ic_sbit[i][j]) - ((int)cB[j])); - - if (i == 0 || k < best) { - best = k; - id = i; - } - } - - /* Check if indicated codec fits into range of codecs */ - if (id >= codecs) { + /* Parse codec ID (CMI or CMC/CMR) and check if it fits into range of codecs */ + if ((id = gsm0503_tch_ahs_decode_inband(&cB[0])) >= codecs) { /* Codec mode out of range, return id */ return id; } -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/28177 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I0106de7a7f87517006e323299b2dc08457d1c6cf Gerrit-Change-Number: 28177 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in libosmocore[master]: coding: add gsm0503_detect_a[fh]s_dtx_frame2()
by fixeria 24 May '22

24 May '22
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/28176 ) Change subject: coding: add gsm0503_detect_a[fh]s_dtx_frame2() ...................................................................... coding: add gsm0503_detect_a[fh]s_dtx_frame2() The new functions accept an additional mode_id poiner, which is currently set for the following frames: AFS_ONSET, AHS_ONSET, AHS_SID_FIRST_P2 with N * 16 - M bit pattern. Also, the new API operates on soft-bits rather than hard-bits. Converting to hard-bits is not really needed. Change-Id: Ibcac395f800bb64150c97fcdaca3523ecfc5fcee Related: OS#5570 --- M include/osmocom/coding/gsm0503_amr_dtx.h M src/coding/gsm0503_amr_dtx.c M src/coding/gsm0503_coding.c M src/coding/libosmocoding.map M tests/dtx/dtx_gsm0503_test.c M tests/dtx/dtx_gsm0503_test.ok 6 files changed, 156 insertions(+), 110 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/76/28176/1 diff --git a/include/osmocom/coding/gsm0503_amr_dtx.h b/include/osmocom/coding/gsm0503_amr_dtx.h index f048a6e..dc22ec7 100644 --- a/include/osmocom/coding/gsm0503_amr_dtx.h +++ b/include/osmocom/coding/gsm0503_amr_dtx.h @@ -34,7 +34,14 @@ return get_value_string(gsm0503_amr_dtx_frame_names, frame); } -enum gsm0503_amr_dtx_frames gsm0503_detect_afs_dtx_frame(int *n_errors, int *n_bits_total, const ubit_t *ubits); -enum gsm0503_amr_dtx_frames gsm0503_detect_ahs_dtx_frame(int *n_errors, int *n_bits_total, const ubit_t *ubits); +enum gsm0503_amr_dtx_frames gsm0503_detect_afs_dtx_frame(int *n_errors, int *n_bits_total, const ubit_t *ubits) + OSMO_DEPRECATED("Use gsm0503_detect_afs_dtx_frame2() instead"); +enum gsm0503_amr_dtx_frames gsm0503_detect_ahs_dtx_frame(int *n_errors, int *n_bits_total, const ubit_t *ubits) + OSMO_DEPRECATED("Use gsm0503_detect_ahs_dtx_frame2() instead"); + +enum gsm0503_amr_dtx_frames gsm0503_detect_afs_dtx_frame2(int *n_errors, int *n_bits_total, + int *mode_id, const sbit_t *sbits); +enum gsm0503_amr_dtx_frames gsm0503_detect_ahs_dtx_frame2(int *n_errors, int *n_bits_total, + int *mode_id, const sbit_t *sbits); /*! @} */ diff --git a/src/coding/gsm0503_amr_dtx.c b/src/coding/gsm0503_amr_dtx.c index b149330..e15d6ca 100644 --- a/src/coding/gsm0503_amr_dtx.c +++ b/src/coding/gsm0503_amr_dtx.c @@ -1,5 +1,5 @@ /* - * (C) 2020 by sysmocom - s.f.m.c. GmbH, Author: Philipp Maier + * (C) 2020-2022 by sysmocom - s.f.m.c. GmbH, Author: Philipp Maier * All Rights Reserved * * SPDX-License-Identifier: GPL-2.0+ @@ -32,6 +32,8 @@ #include <osmocom/coding/gsm0503_parity.h> #include <osmocom/gsm/gsm0503.h> +#define S2U(b) ((b) < 0) + /* See also: 3GPP TS 05.03, chapter 3.10.1.3, 3.10.5.2 Identification marker */ static const ubit_t id_marker_1[] = { 1, 0, 1, 1, 0, 0, 0, 0, 1 }; @@ -60,7 +62,7 @@ { 0, NULL } }; -static bool detect_afs_id_marker(int *n_errors, int *n_bits_total, const ubit_t * ubits, uint8_t offset, uint8_t count, +static bool detect_afs_id_marker(int *n_errors, int *n_bits_total, const sbit_t *sbits, uint8_t offset, uint8_t count, const ubit_t * id_marker, uint8_t id_marker_len) { unsigned int i, k; @@ -69,20 +71,20 @@ int bits = 0; /* Override coded in-band data */ - ubits += offset; + sbits += offset; /* Check for identification marker bits */ for (i = 0; i < count; i++) { for (k = 0; k < 4; k++) { - if (id_marker[id_bit_nr % id_marker_len] != *ubits) + if (*sbits == 0 || id_marker[id_bit_nr % id_marker_len] != S2U(*sbits)) errors++; id_bit_nr++; - ubits++; + sbits++; bits++; } /* Jump to the next block of 4 bits */ - ubits += 4; + sbits += 4; } *n_errors = errors; @@ -92,30 +94,30 @@ return *n_errors < *n_bits_total / 8; } -static bool detect_ahs_id_marker(int *n_errors, int *n_bits_total, const ubit_t * ubits, const ubit_t * id_marker) +static bool detect_ahs_id_marker(int *n_errors, int *n_bits_total, const sbit_t *sbits, const ubit_t *id_marker) { unsigned int i, k; int errors = 0; int bits = 0; /* Override coded in-band data */ - ubits += 16; + sbits += 16; /* Check first identification marker bits (23*9 bits) */ for (i = 0; i < 23; i++) { for (k = 0; k < 9; k++) { - if (id_marker[k] != *ubits) + if (*sbits == 0 || id_marker[k] != S2U(*sbits)) errors++; - ubits++; + sbits++; bits++; } } /* Check remaining identification marker bits (5 bits) */ for (k = 0; k < 5; k++) { - if (id_marker[k] != *ubits) + if (*sbits == 0 || id_marker[k] != S2U(*sbits)) errors++; - ubits++; + sbits++; bits++; } @@ -126,7 +128,7 @@ return *n_errors < *n_bits_total / 8; } -static bool detect_interleaved_ahs_id_marker(int *n_errors, int *n_bits_total, const ubit_t * ubits, uint8_t offset, +static bool detect_interleaved_ahs_id_marker(int *n_errors, int *n_bits_total, const sbit_t *sbits, uint8_t offset, uint8_t n_bits, const ubit_t * id_marker, uint8_t id_marker_len) { unsigned int i, k; @@ -136,23 +138,23 @@ uint8_t remainder = n_bits % id_marker_len; /* Override coded in-band data */ - ubits += offset; + sbits += offset; /* Check first identification marker bits (23*9 bits) */ for (i = 0; i < full_rounds; i++) { for (k = 0; k < id_marker_len; k++) { - if (id_marker[k] != *ubits) + if (*sbits == 0 || id_marker[k] != S2U(*sbits)) errors++; - ubits += 2; + sbits += 2; bits++; } } /* Check remaining identification marker bits (5 bits) */ for (k = 0; k < remainder; k++) { - if (id_marker[k] != *ubits) + if (*sbits == 0 || id_marker[k] != S2U(*sbits)) errors++; - ubits += 2; + sbits += 2; bits++; } @@ -164,125 +166,126 @@ } /* Detect an FR AMR SID_FIRST frame by its identifcation marker */ -static bool detect_afs_sid_first(int *n_errors, int *n_bits_total, const ubit_t * ubits) +static bool detect_afs_sid_first(int *n_errors, int *n_bits_total, const sbit_t *sbits) { - return detect_afs_id_marker(n_errors, n_bits_total, ubits, 32, 53, id_marker_0, 9); + return detect_afs_id_marker(n_errors, n_bits_total, sbits, 32, 53, id_marker_0, 9); } /* Detect an FR AMR SID_UPDATE frame by its identification marker */ -static bool detect_afs_sid_update(int *n_errors, int *n_bits_total, const ubit_t * ubits) +static bool detect_afs_sid_update(int *n_errors, int *n_bits_total, const sbit_t *sbits) { - return detect_afs_id_marker(n_errors, n_bits_total, ubits, 36, 53, id_marker_0, 9); + return detect_afs_id_marker(n_errors, n_bits_total, sbits, 36, 53, id_marker_0, 9); } /* Detect an FR AMR ONSET frame by its repeating coded inband data */ -static bool detect_afs_onset(int *n_errors, int *n_bits_total, const ubit_t * ubits) +static int detect_afs_onset(int *n_errors, int *n_bits_total, const sbit_t *sbits) { bool rc; - rc = detect_afs_id_marker(n_errors, n_bits_total, ubits, 4, 57, codec_mode_1_sid, 16); + rc = detect_afs_id_marker(n_errors, n_bits_total, sbits, 4, 57, codec_mode_1_sid, 16); if (rc) - return true; + return 0; - rc = detect_afs_id_marker(n_errors, n_bits_total, ubits, 4, 57, codec_mode_2_sid, 16); + rc = detect_afs_id_marker(n_errors, n_bits_total, sbits, 4, 57, codec_mode_2_sid, 16); if (rc) - return true; + return 1; - rc = detect_afs_id_marker(n_errors, n_bits_total, ubits, 4, 57, codec_mode_3_sid, 16); + rc = detect_afs_id_marker(n_errors, n_bits_total, sbits, 4, 57, codec_mode_3_sid, 16); if (rc) - return true; + return 2; - rc = detect_afs_id_marker(n_errors, n_bits_total, ubits, 4, 57, codec_mode_4_sid, 16); + rc = detect_afs_id_marker(n_errors, n_bits_total, sbits, 4, 57, codec_mode_4_sid, 16); if (rc) - return true; + return 3; - return false; + return -1; } /* Detect an HR AMR SID UPDATE frame by its identification marker */ -static bool detect_ahs_sid_update(int *n_errors, int *n_bits_total, const ubit_t * ubits) +static bool detect_ahs_sid_update(int *n_errors, int *n_bits_total, const sbit_t *sbits) { - return detect_ahs_id_marker(n_errors, n_bits_total, ubits, id_marker_1); + return detect_ahs_id_marker(n_errors, n_bits_total, sbits, id_marker_1); } /* Detect an HR AMR SID FIRST (part 1) frame by its identification marker */ -static bool detect_ahs_sid_first_p1(int *n_errors, int *n_bits_total, const ubit_t * ubits) +static bool detect_ahs_sid_first_p1(int *n_errors, int *n_bits_total, const sbit_t *sbits) { - return detect_ahs_id_marker(n_errors, n_bits_total, ubits, id_marker_0); + return detect_ahs_id_marker(n_errors, n_bits_total, sbits, id_marker_0); } /* Detect an HR AMR SID FIRST (part 2) frame by its repeating coded inband data */ -static bool detect_ahs_sid_first_p2(int *n_errors, int *n_bits_total, const ubit_t * ubits) +static int detect_ahs_sid_first_p2(int *n_errors, int *n_bits_total, const sbit_t *sbits) { bool rc; - rc = detect_interleaved_ahs_id_marker(n_errors, n_bits_total, ubits, 0, 114, codec_mode_1_sid, 16); + rc = detect_interleaved_ahs_id_marker(n_errors, n_bits_total, sbits, 0, 114, codec_mode_1_sid, 16); if (rc) - return true; + return 0; - rc = detect_interleaved_ahs_id_marker(n_errors, n_bits_total, ubits, 0, 114, codec_mode_2_sid, 16); + rc = detect_interleaved_ahs_id_marker(n_errors, n_bits_total, sbits, 0, 114, codec_mode_2_sid, 16); if (rc) - return true; + return 1; - rc = detect_interleaved_ahs_id_marker(n_errors, n_bits_total, ubits, 0, 114, codec_mode_3_sid, 16); + rc = detect_interleaved_ahs_id_marker(n_errors, n_bits_total, sbits, 0, 114, codec_mode_3_sid, 16); if (rc) - return true; + return 2; - rc = detect_interleaved_ahs_id_marker(n_errors, n_bits_total, ubits, 0, 114, codec_mode_4_sid, 16); + rc = detect_interleaved_ahs_id_marker(n_errors, n_bits_total, sbits, 0, 114, codec_mode_4_sid, 16); if (rc) - return true; + return 3; - return false; + return -1; } /* Detect an HR AMR ONSET frame by its repeating coded inband data */ -static bool detect_ahs_onset(int *n_errors, int *n_bits_total, const ubit_t * ubits) +static int detect_ahs_onset(int *n_errors, int *n_bits_total, const sbit_t *sbits) { bool rc; - rc = detect_interleaved_ahs_id_marker(n_errors, n_bits_total, ubits, 1, 114, codec_mode_1_sid, 16); + rc = detect_interleaved_ahs_id_marker(n_errors, n_bits_total, sbits, 1, 114, codec_mode_1_sid, 16); if (rc) - return true; + return 0; - rc = detect_interleaved_ahs_id_marker(n_errors, n_bits_total, ubits, 1, 114, codec_mode_2_sid, 16); + rc = detect_interleaved_ahs_id_marker(n_errors, n_bits_total, sbits, 1, 114, codec_mode_2_sid, 16); if (rc) - return true; + return 1; - rc = detect_interleaved_ahs_id_marker(n_errors, n_bits_total, ubits, 1, 114, codec_mode_3_sid, 16); + rc = detect_interleaved_ahs_id_marker(n_errors, n_bits_total, sbits, 1, 114, codec_mode_3_sid, 16); if (rc) - return true; + return 2; - rc = detect_interleaved_ahs_id_marker(n_errors, n_bits_total, ubits, 1, 114, codec_mode_4_sid, 16); + rc = detect_interleaved_ahs_id_marker(n_errors, n_bits_total, sbits, 1, 114, codec_mode_4_sid, 16); if (rc) - return true; + return 3; - return false; + return -1; } /* Detect an HR AMR SID FIRST INHIBIT frame by its identification marker */ -static bool detect_ahs_sid_first_inh(int *n_errors, int *n_bits_total, const ubit_t * ubits) +static bool detect_ahs_sid_first_inh(int *n_errors, int *n_bits_total, const sbit_t *sbits) { - return detect_interleaved_ahs_id_marker(n_errors, n_bits_total, ubits, 33, 212, id_marker_1, 9); + return detect_interleaved_ahs_id_marker(n_errors, n_bits_total, sbits, 33, 212, id_marker_1, 9); } /* Detect an HR AMR SID UPDATE INHIBIT frame by its identification marker */ -static bool detect_ahs_sid_update_inh(int *n_errors, int *n_bits_total, const ubit_t * ubits) +static bool detect_ahs_sid_update_inh(int *n_errors, int *n_bits_total, const sbit_t *sbits) { - return detect_interleaved_ahs_id_marker(n_errors, n_bits_total, ubits, 33, 212, id_marker_0, 9); + return detect_interleaved_ahs_id_marker(n_errors, n_bits_total, sbits, 33, 212, id_marker_0, 9); } /*! Detect FR AMR DTX frame in unmapped, deinterleaved frame bits. - * \param[in] ubits input bits (456 bit). * \param[out] n_errors number of errornous bits. * \param[out] n_bits_total number of checked bits. + * \param[in] sbits input soft-bits (456 bit). * \returns dtx frame type. */ -enum gsm0503_amr_dtx_frames gsm0503_detect_afs_dtx_frame(int *n_errors, int *n_bits_total, const ubit_t * ubits) +enum gsm0503_amr_dtx_frames gsm0503_detect_afs_dtx_frame2(int *n_errors, int *n_bits_total, + int *mode_id, const sbit_t *sbits) { - if (detect_afs_sid_first(n_errors, n_bits_total, ubits)) + if (detect_afs_sid_first(n_errors, n_bits_total, sbits)) return AFS_SID_FIRST; - if (detect_afs_sid_update(n_errors, n_bits_total, ubits)) + if (detect_afs_sid_update(n_errors, n_bits_total, sbits)) return AFS_SID_UPDATE; - if (detect_afs_onset(n_errors, n_bits_total, ubits)) + if ((*mode_id = detect_afs_onset(n_errors, n_bits_total, sbits)) != -1) return AFS_ONSET; *n_errors = 0; @@ -290,27 +293,61 @@ return AMR_OTHER; } -/*! Detect HR AMR DTX frame in unmapped, deinterleaved frame bits. - * \param[in] ubits input bits (456 bit). +/*! Detect FR AMR DTX frame in unmapped, deinterleaved frame bits. + * DEPRECATED: use gsm0503_detect_afs_dtx_frame2() instead. * \param[out] n_errors number of errornous bits. * \param[out] n_bits_total number of checked bits. - * \returns dtx frame type, */ -enum gsm0503_amr_dtx_frames gsm0503_detect_ahs_dtx_frame(int *n_errors, int *n_bits_total, const ubit_t * ubits) + * \param[in] ubits input bits (456 bit). + * \returns dtx frame type. */ +enum gsm0503_amr_dtx_frames gsm0503_detect_afs_dtx_frame(int *n_errors, int *n_bits_total, + const ubit_t *ubits) { - if (detect_ahs_sid_update(n_errors, n_bits_total, ubits)) + int mode_id; /* unused */ + sbit_t sbits[456]; + + osmo_ubit2sbit(&sbits[0], &ubits[0], sizeof(sbits)); + return gsm0503_detect_afs_dtx_frame2(n_errors, n_bits_total, &mode_id, &sbits[0]); +} + +/*! Detect HR AMR DTX frame in unmapped, deinterleaved frame bits. + * \param[out] n_errors number of errornous bits. + * \param[out] n_bits_total number of checked bits. + * \param[out] mode_id codec ID (CMI or CMC/CMR). + * \param[in] sbits input soft-bits (456 bit). + * \returns dtx frame type, */ +enum gsm0503_amr_dtx_frames gsm0503_detect_ahs_dtx_frame2(int *n_errors, int *n_bits_total, + int *mode_id, const sbit_t *sbits) +{ + if (detect_ahs_sid_update(n_errors, n_bits_total, sbits)) return AHS_SID_UPDATE; - if (detect_ahs_sid_first_inh(n_errors, n_bits_total, ubits)) + if (detect_ahs_sid_first_inh(n_errors, n_bits_total, sbits)) return AHS_SID_FIRST_INH; - if (detect_ahs_sid_update_inh(n_errors, n_bits_total, ubits)) + if (detect_ahs_sid_update_inh(n_errors, n_bits_total, sbits)) return AHS_SID_UPDATE_INH; - if (detect_ahs_sid_first_p1(n_errors, n_bits_total, ubits)) + if (detect_ahs_sid_first_p1(n_errors, n_bits_total, sbits)) return AHS_SID_FIRST_P1; - if (detect_ahs_sid_first_p2(n_errors, n_bits_total, ubits)) + if ((*mode_id = detect_ahs_sid_first_p2(n_errors, n_bits_total, sbits)) != -1) return AHS_SID_FIRST_P2; - if (detect_ahs_onset(n_errors, n_bits_total, ubits)) + if ((*mode_id = detect_ahs_onset(n_errors, n_bits_total, sbits)) != -1) return AHS_ONSET; *n_errors = 0; *n_bits_total = 0; return AMR_OTHER; } + +/*! Detect HR AMR DTX frame in unmapped, deinterleaved frame bits. + * DEPRECATED: use gsm0503_detect_ahs_dtx_frame2() instead. + * \param[out] n_errors number of errornous bits. + * \param[out] n_bits_total number of checked bits. + * \param[in] ubits input bits (456 bit). + * \returns dtx frame type, */ +enum gsm0503_amr_dtx_frames gsm0503_detect_ahs_dtx_frame(int *n_errors, int *n_bits_total, + const ubit_t *ubits) +{ + int mode_id; /* unused */ + sbit_t sbits[456]; + + osmo_ubit2sbit(&sbits[0], &ubits[0], sizeof(sbits)); + return gsm0503_detect_ahs_dtx_frame2(n_errors, n_bits_total, &mode_id, &sbits[0]); +} diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index 2b59b7b..168e120 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -2158,7 +2158,6 @@ sbit_t iB[912], cB[456], h; ubit_t d[244], p[6], conv[250]; int i, j, k, best = 0, rv, len, steal = 0, id = -1; - ubit_t cBd[456]; *n_errors = 0; *n_bits_total = 0; static ubit_t sid_first_dummy[64] = { 0 }; sbit_t sid_update_enc[256]; @@ -2172,7 +2171,7 @@ if (steal > 0) { /* If not NULL, dtx indicates type of previously decoded TCH/AFS frame. - * It's normally updated by gsm0503_detect_afs_dtx_frame(), which is not + * It's normally updated by gsm0503_detect_afs_dtx_frame2(), which is not * reached in case of FACCH. Reset it here to avoid FACCH/F frames being * misinterpreted as AMR's special DTX frames. */ if (dtx != NULL) @@ -2190,8 +2189,7 @@ if (dtx) { const enum gsm0503_amr_dtx_frames dtx_prev = *dtx; - osmo_sbit2ubit(cBd, cB, 456); - *dtx = gsm0503_detect_afs_dtx_frame(n_errors, n_bits_total, cBd); + *dtx = gsm0503_detect_afs_dtx_frame2(n_errors, n_bits_total, &id, cB); switch (*dtx) { case AMR_OTHER: @@ -2230,7 +2228,7 @@ len = 5; goto out; case AFS_SID_UPDATE: /* TODO: parse CMI _and_ CMC/CMR (16 + 16 bit) */ - case AFS_ONSET: /* TODO: parse CMI or CMC/CMR (N * 16 - M bit) */ + case AFS_ONSET: len = 0; goto out; default: @@ -2625,7 +2623,6 @@ sbit_t iB[912], cB[456], h; ubit_t d[244], p[6], conv[135]; int i, j, k, best = 0, rv, len, steal = 0, id = -1; - ubit_t cBd[456]; static ubit_t sid_first_dummy[64] = { 0 }; /* only unmap the stealing bits */ @@ -2643,7 +2640,7 @@ /* if we found a stole FACCH, but only at correct alignment */ if (steal > 0) { /* If not NULL, dtx indicates type of previously decoded TCH/AHS frame. - * It's normally updated by gsm0503_detect_ahs_dtx_frame(), which is not + * It's normally updated by gsm0503_detect_ahs_dtx_frame2(), which is not * reached in case of FACCH. Reset it here to avoid FACCH/H frames being * misinterpreted as AMR's special DTX frames. */ if (dtx != NULL) @@ -2682,8 +2679,7 @@ int n_bits_total_sid; int n_errors_sid; - osmo_sbit2ubit(cBd, cB, 456); - *dtx = gsm0503_detect_ahs_dtx_frame(n_errors, n_bits_total, cBd); + *dtx = gsm0503_detect_ahs_dtx_frame2(n_errors, n_bits_total, &id, cB); /* TODO: detect and handle AHS_SID_UPDATE + AHS_SID_UPDATE_INH */ switch (*dtx) { @@ -2705,7 +2701,7 @@ osmo_conv_decode_ber(&gsm0503_tch_axs_sid_update, cB + 16, conv, &n_errors_sid, &n_bits_total_sid); - /* gsm0503_detect_ahs_dtx_frame() calculates BER for the marker, + /* gsm0503_detect_ahs_dtx_frame2() calculates BER for the marker, * osmo_conv_decode_ber() calculates BER for the coded data. */ if (n_errors != NULL) *n_errors += n_errors_sid; @@ -2724,14 +2720,14 @@ tch_amr_reassemble(tch_data, conv, 39); len = 5; goto out; - case AHS_SID_FIRST_P2: /* TODO: parse CMI or CMC/CMR (N * 16 - M bit) */ + case AHS_SID_FIRST_P2: tch_amr_sid_update_append(sid_first_dummy, 0, (codec_mode_req) ? codec[*ft] : codec[id > 0 ? id : 0]); tch_amr_reassemble(tch_data, sid_first_dummy, 39); len = 5; goto out; - case AHS_ONSET: /* TODO: parse CMI or CMC/CMR (N * 16 - M bit) */ + case AHS_ONSET: case AHS_SID_FIRST_INH: /* TODO: parse CMI or CMC/CMR (16 bit) */ case AHS_SID_UPDATE_INH: /* TODO: parse CMI or CMC/CMR (16 bit) */ case AHS_SID_FIRST_P1: /* TODO: parse CMI or CMC/CMR (16 bit) */ diff --git a/src/coding/libosmocoding.map b/src/coding/libosmocoding.map index 325b6d8..b083564 100644 --- a/src/coding/libosmocoding.map +++ b/src/coding/libosmocoding.map @@ -123,6 +123,8 @@ gsm0503_amr_dtx_frame_name; gsm0503_detect_afs_dtx_frame; gsm0503_detect_ahs_dtx_frame; +gsm0503_detect_afs_dtx_frame2; +gsm0503_detect_ahs_dtx_frame2; local: *; }; diff --git a/tests/dtx/dtx_gsm0503_test.c b/tests/dtx/dtx_gsm0503_test.c index fe4577e..8cac05c 100644 --- a/tests/dtx/dtx_gsm0503_test.c +++ b/tests/dtx/dtx_gsm0503_test.c @@ -72,7 +72,7 @@ "xBxBxBxBxBxBxBxBxBxBxBxBxBxBxBxBx0x1x0x0x1x1x1x1x0x0x1x0x0x1x1x1x1x0x0x1x0x0x1x1x1x1x0x0x1x0x0x1x1x1x1x0x0x1x0x0x1x1x1x1x0x0x1x0x0x1x1x1x1x0x0x1x0x0x1x1x1x1x0x0x1x0x0x1x1x1x1x0x0x1x0x0x1x1x1x1x0x0x1x0x0x1x1x1x1x0x0x1x0x0x1x1x1x1x0x0x1x0x0x1x1x1x1x0x0x1x0x0x1x1x1x1x0x0x1x0x0x1x1x1x1x0x0x1x0x0x1x1x1x1x0x0x1x0x0x1x1x1x1x0x0x1x0x0x1x1x1x1x0x0x1x0x0x1x1x1x1x0x0x1x0x0x1x1x1x1x0x0x1x0x0x1x1x1x1x0x0x1x0x0x1x1x1x1x0x0x1x0x0x1x1x1x1x0x0x1x0x0x1x1x1x1x0x0x1x0x0x1" }; -unsigned int string_to_ubit(ubit_t * ubits, char *string) +unsigned int string_to_sbit(sbit_t *sbits, char *string) { unsigned int len; unsigned int i; @@ -80,7 +80,7 @@ len = strlen(string); for (i = 0; i < len; i++) { - ubits[i] = string[i] & 1; + sbits[i] = string[i] == '1' ? -127 : 127; } return len; @@ -88,28 +88,32 @@ void test_gsm0503_detect_afs_dtx_frame(char *string) { - ubit_t ubits[512]; + sbit_t sbits[512]; uint8_t dtx_frame_type; int n_errors; int n_bits_total; + int mode_id = -1; - string_to_ubit(ubits, string); - dtx_frame_type = gsm0503_detect_afs_dtx_frame(&n_errors, &n_bits_total, ubits); - printf(" ==> %s, n_errors=%i, n_bits_total=%i\n", gsm0503_amr_dtx_frame_name(dtx_frame_type), - n_errors, n_bits_total); + string_to_sbit(sbits, string); + dtx_frame_type = gsm0503_detect_afs_dtx_frame2(&n_errors, &n_bits_total, &mode_id, sbits); + printf(" ==> %s, n_errors=%i, n_bits_total=%i, mode_id=%i\n", + gsm0503_amr_dtx_frame_name(dtx_frame_type), + n_errors, n_bits_total, mode_id); } void test_gsm0503_detect_ahs_dtx_frame(char *string) { - ubit_t ubits[512]; + sbit_t sbits[512]; uint8_t dtx_frame_type; int n_errors; int n_bits_total; + int mode_id = -1; - string_to_ubit(ubits, string); - dtx_frame_type = gsm0503_detect_ahs_dtx_frame(&n_errors, &n_bits_total, ubits); - printf(" ==> %s, n_errors=%i, n_bits_total=%i\n", gsm0503_amr_dtx_frame_name(dtx_frame_type), - n_errors, n_bits_total); + string_to_sbit(sbits, string); + dtx_frame_type = gsm0503_detect_ahs_dtx_frame2(&n_errors, &n_bits_total, &mode_id, sbits); + printf(" ==> %s, n_errors=%i, n_bits_total=%i, mode_id=%i\n", + gsm0503_amr_dtx_frame_name(dtx_frame_type), + n_errors, n_bits_total, mode_id); } static void test_gsm0503_tch_afhs_decode_dtx(const sbit_t *bursts, size_t offset, diff --git a/tests/dtx/dtx_gsm0503_test.ok b/tests/dtx/dtx_gsm0503_test.ok index 60f3884..477d431 100644 --- a/tests/dtx/dtx_gsm0503_test.ok +++ b/tests/dtx/dtx_gsm0503_test.ok @@ -1,14 +1,14 @@ FR AMR DTX FRAMES: - ==> AFS_SID_FIRST, n_errors=0, n_bits_total=212 - ==> AFS_SID_UPDATE (marker), n_errors=0, n_bits_total=212 - ==> AFS_ONSET, n_errors=0, n_bits_total=228 + ==> AFS_SID_FIRST, n_errors=0, n_bits_total=212, mode_id=-1 + ==> AFS_SID_UPDATE (marker), n_errors=0, n_bits_total=212, mode_id=-1 + ==> AFS_ONSET, n_errors=0, n_bits_total=228, mode_id=0 HR AMR DTX FRAMES: - ==> AHS_SID_UPDATE (marker), n_errors=0, n_bits_total=212 - ==> AHS_SID_FIRST_P1, n_errors=0, n_bits_total=212 - ==> AHS_SID_FIRST_P2, n_errors=0, n_bits_total=114 - ==> AHS_ONSET, n_errors=0, n_bits_total=114 - ==> AHS_SID_FIRST_INH, n_errors=0, n_bits_total=212 - ==> AHS_SID_UPDATE_INH, n_errors=0, n_bits_total=212 + ==> AHS_SID_UPDATE (marker), n_errors=0, n_bits_total=212, mode_id=-1 + ==> AHS_SID_FIRST_P1, n_errors=0, n_bits_total=212, mode_id=-1 + ==> AHS_SID_FIRST_P2, n_errors=0, n_bits_total=114, mode_id=0 + ==> AHS_ONSET, n_errors=0, n_bits_total=114, mode_id=0 + ==> AHS_SID_FIRST_INH, n_errors=0, n_bits_total=212, mode_id=-1 + ==> AHS_SID_UPDATE_INH, n_errors=0, n_bits_total=212, mode_id=-1 Running test_gsm0503_tch_afhs_decode_dtx(at offset=0): testing detection of AFS_SID_UPDATE ==> gsm0503_tch_afs_decode_dtx() yields 'AFS_SID_UPDATE (marker)' (rc=0, BER 0/212) Running test_gsm0503_tch_afhs_decode_dtx(at offset=464): testing decoding of AFS_SID_UPDATE -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/28176 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ibcac395f800bb64150c97fcdaca3523ecfc5fcee Gerrit-Change-Number: 28176 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in libosmocore[master]: coding: do not reset codec ID on receipt of DTX frames
by fixeria 24 May '22

24 May '22
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/28175 ) Change subject: coding: do not reset codec ID on receipt of DTX frames ...................................................................... coding: do not reset codec ID on receipt of DTX frames Parsing of CMI/CMC/CMR from AMR's special DTX frames is currently not implemented. It's better to keep the old stored value rather than resetting it to 0 every time we receive such a frame. Add TODO comments for each DTX frame type. Change-Id: Ic4edbb8ab873fe0bdd69a8710803628bc4f447d0 Related: OS#5570 --- M src/coding/gsm0503_coding.c 1 file changed, 28 insertions(+), 23 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/75/28175/1 diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index 715a361..2b59b7b 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -2157,7 +2157,7 @@ { sbit_t iB[912], cB[456], h; ubit_t d[244], p[6], conv[250]; - int i, j, k, best = 0, rv, len, steal = 0, id = 0; + int i, j, k, best = 0, rv, len, steal = 0, id = -1; ubit_t cBd[456]; *n_errors = 0; *n_bits_total = 0; static ubit_t sid_first_dummy[64] = { 0 }; @@ -2202,6 +2202,7 @@ * (AFS_SID_UPDATE_CN). */ if (dtx_prev != AFS_SID_UPDATE) break; + /* TODO: parse CMI _and_ CMC/CMR (16 + 16 bit) */ *dtx = AFS_SID_UPDATE_CN; extract_afs_sid_update(sid_update_enc, cB); @@ -2217,19 +2218,19 @@ tch_amr_sid_update_append(conv, 1, (codec_mode_req) ? codec[*ft] - : codec[id]); + : codec[id > 0 ? id : 0]); tch_amr_reassemble(tch_data, conv, 39); len = 5; goto out; - case AFS_SID_FIRST: + case AFS_SID_FIRST: /* TODO: parse CMI or CMC/CMR (16 bit) */ tch_amr_sid_update_append(sid_first_dummy, 0, (codec_mode_req) ? codec[*ft] - : codec[id]); + : codec[id > 0 ? id : 0]); tch_amr_reassemble(tch_data, conv, 39); len = 5; goto out; - case AFS_SID_UPDATE: - case AFS_ONSET: + case AFS_SID_UPDATE: /* TODO: parse CMI _and_ CMC/CMR (16 + 16 bit) */ + case AFS_ONSET: /* TODO: parse CMI or CMC/CMR (N * 16 - M bit) */ len = 0; goto out; default: @@ -2399,10 +2400,12 @@ out: /* Change codec request / indication, if frame is valid */ - if (codec_mode_req) - *cmr = id; - else - *ft = id; + if (id != -1) { + if (codec_mode_req) + *cmr = id; + else + *ft = id; + } return len; } @@ -2621,7 +2624,7 @@ { sbit_t iB[912], cB[456], h; ubit_t d[244], p[6], conv[135]; - int i, j, k, best = 0, rv, len, steal = 0, id = 0; + int i, j, k, best = 0, rv, len, steal = 0, id = -1; ubit_t cBd[456]; static ubit_t sid_first_dummy[64] = { 0 }; @@ -2684,7 +2687,7 @@ /* TODO: detect and handle AHS_SID_UPDATE + AHS_SID_UPDATE_INH */ switch (*dtx) { - case AHS_SID_UPDATE: + case AHS_SID_UPDATE: /* TODO: parse CMI _and_ CMC/CMR (16 + 16 bit) */ /* cB[] contains 16 bits of coded in-band data and 212 bits containing * the identification marker. We need to unmap/deinterleave 114 odd * bits from the last two blocks, 114 even bits from the first two @@ -2717,21 +2720,21 @@ tch_amr_sid_update_append(conv, 1, (codec_mode_req) ? codec[*ft] - : codec[id]); + : codec[id > 0 ? id : 0]); tch_amr_reassemble(tch_data, conv, 39); len = 5; goto out; - case AHS_SID_FIRST_P2: + case AHS_SID_FIRST_P2: /* TODO: parse CMI or CMC/CMR (N * 16 - M bit) */ tch_amr_sid_update_append(sid_first_dummy, 0, (codec_mode_req) ? codec[*ft] - : codec[id]); + : codec[id > 0 ? id : 0]); tch_amr_reassemble(tch_data, sid_first_dummy, 39); len = 5; goto out; - case AHS_ONSET: - case AHS_SID_FIRST_INH: - case AHS_SID_UPDATE_INH: - case AHS_SID_FIRST_P1: + case AHS_ONSET: /* TODO: parse CMI or CMC/CMR (N * 16 - M bit) */ + case AHS_SID_FIRST_INH: /* TODO: parse CMI or CMC/CMR (16 bit) */ + case AHS_SID_UPDATE_INH: /* TODO: parse CMI or CMC/CMR (16 bit) */ + case AHS_SID_FIRST_P1: /* TODO: parse CMI or CMC/CMR (16 bit) */ len = 0; goto out; default: @@ -2885,10 +2888,12 @@ out: /* Change codec request / indication, if frame is valid */ - if (codec_mode_req) - *cmr = id; - else - *ft = id; + if (id != -1) { + if (codec_mode_req) + *cmr = id; + else + *ft = id; + } return len; } -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/28175 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ic4edbb8ab873fe0bdd69a8710803628bc4f447d0 Gerrit-Change-Number: 28175 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in libasn1c[master]: configure.ac: fix libtool issue with clang and sanitizer
by pespin 24 May '22

24 May '22
Attention is currently required from: Hoernchen. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libasn1c/+/28174 ) Change subject: configure.ac: fix libtool issue with clang and sanitizer ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libasn1c/+/28174 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Change-Id: Ie38fa9985187c76b4e456d8b0a83006ef341b97e Gerrit-Change-Number: 28174 Gerrit-PatchSet: 1 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de> Gerrit-Comment-Date: Tue, 24 May 2022 08:20:19 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • ...
  • 135
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.