osmo-bts-trx: amr_loop: trigger the loop unconditionally

The logic responsible for enabling and disabling the loop appears
to be broken: during my experiments trx_loop_amr_set() was never
called with loop=1.  It's not clear what's the motivation behind
this breaker, so I propose to rip it out for now.  This patch
finally makes the loop work (confirmed with a TEMS phone).

Related: SYS#5917, OS#4984
Change-Id: I09b649973d4269c4082a4fafa493c37825f95a9c
(cherry picked from commit 541b7525ae)
This commit is contained in:
Vadim Yanitskiy 2022-04-14 01:19:43 +03:00
parent 2baf54dd46
commit 016c8b616d
3 changed files with 1 additions and 30 deletions

View File

@ -119,7 +119,6 @@ struct l1sched_chan_state {
uint8_t dl_ft; /* current downlink FT index */
uint8_t ul_cmr; /* current uplink CMR index */
uint8_t dl_cmr; /* current downlink CMR index */
uint8_t amr_loop; /* if AMR loop is enabled */
uint8_t amr_last_dtx; /* last received dtx frame type */
/* TCH/H */

View File

@ -40,10 +40,6 @@ void trx_loop_amr_input(struct l1sched_chan_state *chan_state,
const uint8_t mi = chan_state->ul_ft; /* mode index 0..3 */
int lqual_cb = meas_set->ci_cb; /* cB (centibel) */
/* check if loop is enabled */
if (!chan_state->amr_loop)
return;
/* count per-block C/I samples for further averaging */
if (lchan->type == GSM_LCHAN_TCH_H) {
chan_state->lqual_cb_num += 2;
@ -109,16 +105,3 @@ void trx_loop_amr_input(struct l1sched_chan_state *chan_state,
LOGPLCHAN(lchan, DLOOP, LOGL_DEBUG, "Keeping the current AMR codec "
"mode[%u]=%u\n", mi, cfg->mode[mi].mode);
}
void trx_loop_amr_set(struct l1sched_chan_state *chan_state, int loop)
{
if (chan_state->amr_loop == loop)
return;
if (!chan_state->amr_loop) {
/* reset the link quality measurements */
chan_state->lqual_cb_num = 0;
chan_state->lqual_cb_sum = 0;
}
chan_state->amr_loop = loop;
}

View File

@ -384,7 +384,7 @@ struct msgb *tch_dl_dequeue(struct l1sched_ts *l1ts, struct trx_dl_burst_req *br
if (msg_tch) {
int len;
uint8_t cmr_codec;
int cmr, ft, i;
int ft, i;
enum osmo_amr_type ft_codec;
enum osmo_amr_quality bfi;
int8_t sti, cmi;
@ -416,22 +416,11 @@ struct msgb *tch_dl_dequeue(struct l1sched_ts *l1ts, struct trx_dl_burst_req *br
LOGL1SB(DL1P, LOGL_ERROR, l1ts, br, "Cannot send invalid AMR payload\n");
goto free_bad_msg;
}
cmr = -1;
ft = -1;
for (i = 0; i < chan_state->codecs; i++) {
if (chan_state->codec[i] == cmr_codec)
cmr = i;
if (chan_state->codec[i] == ft_codec)
ft = i;
}
if (cmr >= 0) { /* new request */
chan_state->dl_cmr = cmr;
/* disable AMR loop */
trx_loop_amr_set(chan_state, 0);
} else {
/* enable AMR loop */
trx_loop_amr_set(chan_state, 1);
}
if (ft < 0) {
LOGL1SB(DL1P, LOGL_ERROR, l1ts, br,
"Codec (FT = %d) of RTP frame not in list\n", ft_codec);