fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/30484 )
Change subject: firmware: remove TCH/F specific bit re-ordering
......................................................................
firmware: remove TCH/F specific bit re-ordering
This is a partial revert of d49a748cbbf7d7b5bb77f3d906179da9b462e6d1.
The GAPK based audio I/O implementation of the mobile app is now capable
of handling TI's specific TCH frame format, which can be configured via
the VTY interface ('io-tch-format ti'). Thus there is no need to have
the conversion logic in the firmware anymore.
This patch also fixes the layer1 firmware, so it does not hang on
receipt of Uplink TCH frames anymore when compiled with recent
arm-none-eabi toolchain (v12.2.0 on my machine).
Change-Id: I5afd4e4ddd9c06d32768d01bc1e3e18d476706fb
Related: OS#3400
---
M src/target/firmware/Makefile
M src/target/firmware/layer1/prim_tch.c
2 files changed, 1 insertion(+), 55 deletions(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
osmith: Looks good to me, but someone else must approve
fixeria: Looks good to me, approved
diff --git a/src/target/firmware/Makefile b/src/target/firmware/Makefile
index 104ddac..d1ab0c6 100644
--- a/src/target/firmware/Makefile
+++ b/src/target/firmware/Makefile
@@ -126,8 +126,7 @@
comm/libcomm.a \
tiffs/libtiffs.a \
../../shared/libosmocore/build-target/src/.libs/libosmocore.a \
- ../../shared/libosmocore/build-target/src/gsm/.libs/libosmogsm.a \
- ../../shared/libosmocore/build-target/src/codec/.libs/libosmocodec.a
+ ../../shared/libosmocore/build-target/src/gsm/.libs/libosmogsm.a
#
diff --git a/src/target/firmware/layer1/prim_tch.c b/src/target/firmware/layer1/prim_tch.c
index 0542e82..56c32fb 100644
--- a/src/target/firmware/layer1/prim_tch.c
+++ b/src/target/firmware/layer1/prim_tch.c
@@ -28,7 +28,6 @@
#include <byteorder.h>
#include <osmocom/gsm/gsm_utils.h>
#include <osmocom/gsm/protocol/gsm_04_08.h>
-#include <osmocom/codec/codec.h>
#include <osmocom/core/msgb.h>
#include <calypso/dsp_api.h>
#include <calypso/irq.h>
@@ -52,45 +51,6 @@
#include <l1ctl_proto.h>
-static inline int msb_get_bit(uint8_t *buf, int bn)
-{
- int pos_byte = bn >> 3;
- int pos_bit = 7 - (bn & 7);
-
- return (buf[pos_byte] >> pos_bit) & 1;
-}
-
-static inline void msb_set_bit(uint8_t *buf, int bn, int bit)
-{
- int pos_byte = bn >> 3;
- int pos_bit = 7 - (bn & 7);
-
- buf[pos_byte] |= (bit << pos_bit);
-}
-
-static void tch_fr_bit_magic(uint8_t *frame, int dl)
-{
- uint8_t fr[33];
- int i, di, si;
-
- memset(fr, 0x00, 33);
-
- if (dl)
- fr[0] = 0xd0;
-
- for (i = 0; i < 260; i++) {
- di = gsm610_bitorder[i];
- si = (i > 181) ? i + 4 : i;
-
- if (dl)
- msb_set_bit(fr, 4 + di, msb_get_bit(frame, si));
- else
- msb_set_bit(fr, si, msb_get_bit(frame, 4 + di));
- }
-
- memcpy(frame, fr, 33);
-}
-
/* This computes various parameters both for the DSP and for
* our logic. Not all are used all the time, but it's easier
* to build all in one place */
@@ -351,12 +311,6 @@
/* Copy actual data, skipping the information block [0,1,2] */
dsp_memcpy_from_api(payload, &traffic_buf[3], 33, 1);
- /**
- * Perform some bit conversations
- * FIXME: what about other (than FR) codecs?
- */
- tch_fr_bit_magic(payload, 1);
-
/* Give message to up layer */
l1_queue_for_l2(msg);
}
@@ -483,13 +437,6 @@
/* Pull Traffic data (if any) */
msg = msgb_dequeue(&l1s.tx_queue[L1S_CHAN_TRAFFIC]);
- /**
- * Perform some bit conversations
- * FIXME: what about other (than FR) codecs?
- */
- if (msg)
- tch_fr_bit_magic(msg->l2h, 0);
-
/* Copy actual data, skipping the information block [0,1,2] */
if (msg) {
data = msg->l2h;
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/30484
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I5afd4e4ddd9c06d32768d01bc1e3e18d476706fb
Gerrit-Change-Number: 30484
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
Attention is currently required from: fixeria.
osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/30483 )
Change subject: mobile: do not enforce RTP format for Uplink TCH frames
......................................................................
Patch Set 2: Code-Review+2
(1 comment)
Patchset:
PS2:
> Yes, the checking logic would be different. […]
as discussed: better to make it consistent and omit the check IMHO - so keeping the patch as-is
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/30483
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I6113ba443e65ddaae091b643af54c873b7da4de8
Gerrit-Change-Number: 30483
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 09 Dec 2022 11:44:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: osmith <osmith(a)sysmocom.de>
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: comment
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/30454 )
Change subject: mobile: clean up GAPK I/O state on channel release
......................................................................
mobile: clean up GAPK I/O state on channel release
Do not assert() in gsm_recv_voice(), because channel release does
not happen immediately and the PHY may be still sending TCH frames.
Change-Id: I8943ee9bd46afc96e6d7cfd52c95c34fd311ce11
Related: OS#3400
---
M src/host/layer23/src/mobile/gsm48_rr.c
M src/host/layer23/src/mobile/voice.c
2 files changed, 8 insertions(+), 4 deletions(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
osmith: Looks good to me, but someone else must approve
fixeria: Looks good to me, approved
diff --git a/src/host/layer23/src/mobile/gsm48_rr.c b/src/host/layer23/src/mobile/gsm48_rr.c
index 610242c..4ecbcff 100644
--- a/src/host/layer23/src/mobile/gsm48_rr.c
+++ b/src/host/layer23/src/mobile/gsm48_rr.c
@@ -397,6 +397,10 @@
memset(&rr->cd_now, 0, sizeof(rr->cd_now));
/* reset ciphering */
rr->cipher_on = 0;
+#ifdef WITH_GAPK_IO
+ /* clean-up GAPK state */
+ gapk_io_clean_up_ms(rr->ms);
+#endif
/* reset audio mode */
/* tell cell selection process to return to idle mode
* NOTE: this must be sent unbuffered, because it will
diff --git a/src/host/layer23/src/mobile/voice.c b/src/host/layer23/src/mobile/voice.c
index c3c6a6a..260e1d2 100644
--- a/src/host/layer23/src/mobile/voice.c
+++ b/src/host/layer23/src/mobile/voice.c
@@ -82,11 +82,11 @@
return gsm_forward_mncc(ms, msg);
case AUDIO_IOH_GAPK:
#ifdef WITH_GAPK_IO
- /* Prevent null pointer dereference */
- OSMO_ASSERT(ms->gapk_io != NULL);
-
/* Enqueue a frame to the DL TCH buffer */
- gapk_io_enqueue_dl(ms->gapk_io, msg);
+ if (ms->gapk_io != NULL)
+ gapk_io_enqueue_dl(ms->gapk_io, msg);
+ else
+ msgb_free(msg);
break;
#endif
case AUDIO_IOH_L1PHY:
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/30454
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I8943ee9bd46afc96e6d7cfd52c95c34fd311ce11
Gerrit-Change-Number: 30454
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
Attention is currently required from: osmith.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/30483 )
Change subject: mobile: do not enforce RTP format for Uplink TCH frames
......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS2:
> So, checking the TI specific TCH frame format isn't feasible / useful here?
Yes, the checking logic would be different. I could actually check the configured format and only execute voice_frame_verify() if it's RTP. What do you think?
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/30483
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I6113ba443e65ddaae091b643af54c873b7da4de8
Gerrit-Change-Number: 30483
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 09 Dec 2022 11:34:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: comment