aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2022-03-17 18:46:46 +0300
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2022-03-18 03:53:08 +0300
commit35e601a3223be1b5b6616479c95f77c263afbbc7 (patch)
tree51509a2589590f383cd2b46f8f0f1e56bdc94d05
parent523598e655dca76da1adcd79d58a54f9b6df8a07 (diff)
osmo-bts-trx: rx_tchh_fn(): use proper meas averaging mode
Compared to TCH/F, TCH/H is a bit special in a way that: * speech frames are interleaved over 4 consecutive bursts, * while FACCH frames are interleaved over 6 consecutive bursts. This is why in rx_tchh_fn() we allocate a buffer large enough to store up to 6 bursts. Let's say we have that buffer filled up completely with all 6 bursts (from 'a' to 'f'). Now attempting to decode them may yield either a speech frame or a FACCH frame: +---+---+---+---+---+---+ | a | b | c | d | e | f | Burst 'a' received first, 'f' last +---+---+---+---+---+---+ ^^^^^^^^^^^^^^^ Speech frame (bursts 'a' .. 'd') ^^^^^^^^^^^^^^^^^^^^^^^ FACCH frame (bursts 'a' .. 'f') For FACCH we use measurement averaging mode SCHED_MEAS_AVG_M_S6N6, so that 6 last samples are averaged - so far so good. For speech we use SCHED_MEAS_AVG_M_S4N4, so that 4 last samples corresponding to bursts 'c', 'd', 'e', 'f' are averaged - this is wrong. We actually need to average the *first* 4 samples corresponding to bursts 'a', 'b', 'c', 'd' in the case of speech. Let's add and use a new averaging mode SCHED_MEAS_AVG_M_S6N4 for that. Change-Id: Iea6f4e5471550f4c2b57aaebeac83c80e879489d
-rw-r--r--include/osmo-bts/scheduler.h4
-rw-r--r--src/osmo-bts-trx/sched_lchan_tchh.c2
-rw-r--r--src/osmo-bts-trx/scheduler_trx.c1
3 files changed, 5 insertions, 2 deletions
diff --git a/include/osmo-bts/scheduler.h b/include/osmo-bts/scheduler.h
index 8643edd6..1e1a2d72 100644
--- a/include/osmo-bts/scheduler.h
+++ b/include/osmo-bts/scheduler.h
@@ -306,10 +306,12 @@ int trx_sched_ul_burst(struct l1sched_ts *l1ts, struct trx_ul_burst_ind *bi);
/* Averaging mode for trx_sched_meas_avg() */
enum sched_meas_avg_mode {
- /* last 4 bursts (default for xCCH, TCH/H, PTCCH and PDTCH) */
+ /* last 4 bursts (default for xCCH, PTCCH and PDTCH) */
SCHED_MEAS_AVG_M_S4N4,
/* last 8 bursts (default for TCH/F and FACCH/F) */
SCHED_MEAS_AVG_M_S8N8,
+ /* first 4 of last 6 bursts (default for TCH/H) */
+ SCHED_MEAS_AVG_M_S6N4,
/* last 6 bursts (default for FACCH/H) */
SCHED_MEAS_AVG_M_S6N6,
/* first 4 of last 8 bursts */
diff --git a/src/osmo-bts-trx/sched_lchan_tchh.c b/src/osmo-bts-trx/sched_lchan_tchh.c
index 82641631..edbb5669 100644
--- a/src/osmo-bts-trx/sched_lchan_tchh.c
+++ b/src/osmo-bts-trx/sched_lchan_tchh.c
@@ -64,7 +64,7 @@ int rx_tchh_fn(struct l1sched_ts *l1ts, const struct trx_ul_burst_ind *bi)
* Even FN ending at: 10,11,19,20,2,3
*/
int fn_is_odd = (((bi->fn + 26 - 10) % 26) >> 2) & 1;
- enum sched_meas_avg_mode meas_avg_mode = SCHED_MEAS_AVG_M_S4N4;
+ enum sched_meas_avg_mode meas_avg_mode = SCHED_MEAS_AVG_M_S6N4;
struct l1sched_meas_set meas_avg;
unsigned int fn_begin;
unsigned int fn_tch_end;
diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c
index 78c7b4ae..6ce5a9a7 100644
--- a/src/osmo-bts-trx/scheduler_trx.c
+++ b/src/osmo-bts-trx/scheduler_trx.c
@@ -635,6 +635,7 @@ void trx_sched_meas_push(struct l1sched_chan_state *chan_state,
static const uint8_t trx_sched_meas_modeset[][2] = {
[SCHED_MEAS_AVG_M_S4N4] = { 4, 4 },
[SCHED_MEAS_AVG_M_S8N8] = { 8, 8 },
+ [SCHED_MEAS_AVG_M_S6N4] = { 6, 4 },
[SCHED_MEAS_AVG_M_S6N6] = { 6, 6 },
[SCHED_MEAS_AVG_M_S8N4] = { 8, 4 },
[SCHED_MEAS_AVG_M_S6N2] = { 6, 2 },