From 8b83a4a70f6b2c1170d3895935031b02d4f1d7d2 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Wed, 20 Apr 2022 15:26:11 +0300 Subject: [PATCH] osmo-bts-trx: amr_loop: do not miss C/I samples Keep collecting C/I samples even if the MS has not yet applied previously requested codec mode. The C/I ratio is expected to stay more or less the same, no matter which codec mode is used. Change-Id: Ieb5473ead7200f652b5d0e339e4e252d6567482d Related: SYS#5917, OS#4984 --- src/osmo-bts-trx/amr_loop.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/osmo-bts-trx/amr_loop.c b/src/osmo-bts-trx/amr_loop.c index 1771d7a37..ce89091ab 100644 --- a/src/osmo-bts-trx/amr_loop.c +++ b/src/osmo-bts-trx/amr_loop.c @@ -44,10 +44,6 @@ void trx_loop_amr_input(struct l1sched_chan_state *chan_state, if (!chan_state->amr_loop) return; - /* wait for MS to use the requested codec */ - if (mi != chan_state->dl_cmr) - return; - /* count per-block C/I samples for further averaging */ if (lchan->type == GSM_LCHAN_TCH_H) { chan_state->lqual_cb_num += 2; @@ -57,6 +53,10 @@ void trx_loop_amr_input(struct l1sched_chan_state *chan_state, chan_state->lqual_cb_sum += lqual_cb; } + /* wait for MS to use the requested codec */ + if (mi != chan_state->dl_cmr) + return; + /* count frames */ if (chan_state->lqual_cb_num < 48) return;