aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMychaela N. Falconia <falcon@freecalypso.org>2023-05-31 17:40:43 +0000
committerMychaela N. Falconia <falcon@freecalypso.org>2023-05-31 17:40:43 +0000
commit592030eee7dd0a7bcd234b71c7e55ccea9839750 (patch)
treeba5c4ddfb91956ff22d691b25257725a52a34dfb
parent3302d4adfe7c01923657284f35527871852b83fe (diff)
trx TCH DL: transmit invalid speech blocks instead of dummy FACCH
In speech TCH operation, there will always be times when a speech frame needs to be transmitted on the downlink, but there is no frame available to transmit (gap in the incoming RTP stream), or the logic of DTXd says that no frame shall be transmitted at this FN, but we are not doing physical DTXd. Previous osmo-bts-trx code sent dummy FACCH during such conditions, but this approach is bad for TCH/HS where we would like to transmit good speech frames or speech frame gaps one 20 ms frame at a time, rather than take out pairs of frames for dummy FACCH/H. Other BTS models (sysmoBTS PHY) send out invalid speech blocks with inverted CRC3 under the conditions in question - do the same in osmo-bts-trx. The present change modifies osmo-bts-trx TCH DL frame gap behavior only for TCH/FS, TCH/HS and TCH/EFS; for all other channel modes, including AMR speech, the previous behavior of sending dummy FACCH is left unchanged. Depends: Iade3310e16b906efb6892d28f474a0d15204e861 (libosmocore) Change-Id: I78106802a0aa4af39859c75d29fe0e77037899fe
-rw-r--r--src/osmo-bts-trx/sched_lchan_tchf.c23
-rw-r--r--src/osmo-bts-trx/sched_lchan_tchh.c15
2 files changed, 36 insertions, 2 deletions
diff --git a/src/osmo-bts-trx/sched_lchan_tchf.c b/src/osmo-bts-trx/sched_lchan_tchf.c
index f0658038..0188d859 100644
--- a/src/osmo-bts-trx/sched_lchan_tchf.c
+++ b/src/osmo-bts-trx/sched_lchan_tchf.c
@@ -472,10 +472,29 @@ int tx_tchf_fn(struct l1sched_ts *l1ts, struct trx_dl_burst_req *br)
0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b,
0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b,
};
+ int rc;
LOGL1SB(DL1P, LOGL_DEBUG, l1ts, br, "No TCH or FACCH prim for transmit.\n");
- gsm0503_tch_fr_encode(bursts_p, dummy, sizeof(dummy), 1);
- chan_state->dl_facch_bursts = 8;
+ /* If the channel mode is TCH/FS or TCH/EFS, transmit a dummy
+ * speech block with inverted CRC3, designed to induce a BFI
+ * condition in the MS receiver. In all other channel modes,
+ * transmit dummy FACCH like we always did before.
+ *
+ * FIXME: someone who knows AMR needs to look at this problem
+ * and decide what is the correct BTS Tx behavior for frame
+ * gaps in TCH/AFS. See OS#6049.
+ */
+ switch (tch_mode) {
+ case GSM48_CMODE_SPEECH_V1:
+ case GSM48_CMODE_SPEECH_EFR:
+ rc = gsm0503_tch_fr_encode(bursts_p, NULL, 0, 1);
+ if (rc == 0)
+ break;
+ /* fall-through */
+ default:
+ gsm0503_tch_fr_encode(bursts_p, dummy, sizeof(dummy), 1);
+ chan_state->dl_facch_bursts = 8;
+ }
goto send_burst;
}
diff --git a/src/osmo-bts-trx/sched_lchan_tchh.c b/src/osmo-bts-trx/sched_lchan_tchh.c
index 5772e9f4..2f1194ae 100644
--- a/src/osmo-bts-trx/sched_lchan_tchh.c
+++ b/src/osmo-bts-trx/sched_lchan_tchh.c
@@ -385,8 +385,23 @@ int tx_tchh_fn(struct l1sched_ts *l1ts, struct trx_dl_burst_req *br)
0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b,
0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b,
};
+ int rc;
LOGL1SB(DL1P, LOGL_INFO, l1ts, br, "No TCH or FACCH prim for transmit.\n");
+ /* If the channel mode is TCH/HS, transmit a dummy speech block
+ * with inverted CRC3, designed to induce a BFI condition in
+ * the MS receiver. In all other channel modes, transmit
+ * dummy FACCH like we always did before.
+ *
+ * FIXME: someone who knows AMR needs to look at this problem
+ * and decide what is the correct BTS Tx behavior for frame
+ * gaps in TCH/AHS. See OS#6049.
+ */
+ if (tch_mode == GSM48_CMODE_SPEECH_V1) {
+ rc = gsm0503_tch_hr_encode(bursts_p, NULL, 0);
+ if (rc == 0)
+ goto send_burst;
+ }
/* FACCH/H can only be scheduled at specific TDMA offset */
if (!sched_tchh_dl_facch_map[br->fn % 26]) {