jolly has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/35132?usp=email )
Change subject: Transmit invalid AMR speech blocks instead of dummy FACCH ......................................................................
Transmit invalid AMR speech blocks instead of dummy FACCH
Every BTS needs to have some graceful handling for the scenario where it is time to send out a speech frame on TCH DL, but there is no frame to be sent. One possible solution is to transmit dummy FACCH, but this option is unattractive for TCH/HS where FACCH displaces two speech frames rather than one. A more elegant solution is to emit a speech frame that is bad, causing the MS receiver to declare a BFI condition to trigger substitution and muting procedure. A bad frame is generated by gsm0503_tch_{afs,ahs}_encode() by setting the playload length to 0.
Depends: libosmocore.git I82ce2adf995a4b42d1f378c5819f88d773b9104a Related: OS#6049 Change-Id: I056f379715c91ad968f198e112d363a9009dc1c3 --- M src/osmo-bts-trx/sched_lchan_tchf.c M src/osmo-bts-trx/sched_lchan_tchh.c 2 files changed, 49 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/32/35132/1
diff --git a/src/osmo-bts-trx/sched_lchan_tchf.c b/src/osmo-bts-trx/sched_lchan_tchf.c index 0138a2a..8f5a2db 100644 --- a/src/osmo-bts-trx/sched_lchan_tchf.c +++ b/src/osmo-bts-trx/sched_lchan_tchf.c @@ -538,6 +538,9 @@ /* - 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. + * - If the channel mode is AMR, transmit a dummy with speech + * block with inverted CRC6, designed to induce a BFI + * condition in the MS receiver. * - If the channel mode is one of the CSD modes, transmit an * idle frame as described in 3GPP TS 44.021, sections 8.1.6 * and 10.2.3 (all data, status and E-bits set to binary '1'). @@ -554,6 +557,18 @@ case GSM48_CMODE_DATA_3k6: case GSM48_CMODE_DATA_14k5: break; /* see below */ + case GSM48_CMODE_SPEECH_AMR: + /* the first FN 4,13,21 defines that CMI is included in frame, + * the first FN 0,8,17 defines that CMR is included in frame. + */ + gsm0503_tch_afs_encode(BUFPOS(bursts_p, 0), + NULL, 0, + !sched_tchf_dl_amr_cmi_map[br->fn % 26], + chan_state->codec, + chan_state->codecs, + chan_state->dl_ft, + chan_state->dl_cmr); + goto send_burst; case GSM48_CMODE_SPEECH_V1: case GSM48_CMODE_SPEECH_EFR: rc = gsm0503_tch_fr_encode(BUFPOS(bursts_p, 0), NULL, 0, 1); diff --git a/src/osmo-bts-trx/sched_lchan_tchh.c b/src/osmo-bts-trx/sched_lchan_tchh.c index e0d7aca..afd4eb8 100644 --- a/src/osmo-bts-trx/sched_lchan_tchh.c +++ b/src/osmo-bts-trx/sched_lchan_tchh.c @@ -451,7 +451,7 @@
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 + * with inverted CRC3 or CRC6, designed to induce a BFI condition in * the MS receiver. * - If the channel mode is one of the CSD modes, transmit an * idle frame as described in 3GPP TS 44.021, sections 8.1.6 @@ -467,6 +467,18 @@ case GSM48_CMODE_DATA_6k0: case GSM48_CMODE_DATA_3k6: break; /* see below */ + case GSM48_CMODE_SPEECH_AMR: + /* the first FN 4,13,21 or 5,14,22 defines that CMI is included + * in frame, the first FN 0,8,17 or 1,9,18 defines that CMR is + * included in frame. */ + gsm0503_tch_ahs_encode(BUFPOS(bursts_p, 0), + NULL, 0, + !sched_tchh_dl_amr_cmi_map[br->fn % 26], + chan_state->codec, + chan_state->codecs, + chan_state->dl_ft, + chan_state->dl_cmr); + goto send_burst; case GSM48_CMODE_SPEECH_V1: rc = gsm0503_tch_hr_encode(BUFPOS(bursts_p, 0), NULL, 0); if (rc == 0)