aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/dtx_dl_amr_fsm.c
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2016-10-26 17:28:42 +0200
committerHarald Welte <laforge@gnumonks.org>2016-10-28 13:42:29 +0000
commitbce25a60f4bbd798b98727e66b25bf343031f7bc (patch)
tree5e71659c7f73d6db41f4897098fd6860c0957422 /src/common/dtx_dl_amr_fsm.c
parentefb4a4baeb8ecd13ff41f25d61fd91a1162e6fa9 (diff)
DTX DL: split ONSET state handling
Handle ONSET cause by Voice and FACCH separately. In case of Voice we have RTP payload which we have to cache and send later on in next response to L1 RTS. FACCH have higher priority so it preempts both voice and silence alike - hence we can send ONSET immediately but still have to track previous state in order to get back to it gracefully. This affects lc15 and sysmo hw as there's no FSM-based DTX implementation for other models yet. Note: this requires patch for OpenBSC which adds FACCH buffer to tch.dtx struct. Change-Id: Idba14dcd0cb12cd7aee86391fcc152c49fcd7052 Related: OS#1802
Diffstat (limited to 'src/common/dtx_dl_amr_fsm.c')
-rw-r--r--src/common/dtx_dl_amr_fsm.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/common/dtx_dl_amr_fsm.c b/src/common/dtx_dl_amr_fsm.c
index b110cf21..a75fd00e 100644
--- a/src/common/dtx_dl_amr_fsm.c
+++ b/src/common/dtx_dl_amr_fsm.c
@@ -53,7 +53,7 @@ void dtx_fsm_sid_f1(struct osmo_fsm_inst *fi, uint32_t event, void *data)
osmo_fsm_inst_state_chg(fi, ST_VOICE, 0, 0);
break;
case E_FACCH:
- osmo_fsm_inst_state_chg(fi, ST_ONSET_F, 0, 0);
+ osmo_fsm_inst_state_chg(fi, ST_FACCH, 0, 0);
break;
case E_COMPL:
osmo_fsm_inst_state_chg(fi, ST_SID_F2, 0, 0);
@@ -81,7 +81,7 @@ void dtx_fsm_sid_f2(struct osmo_fsm_inst *fi, uint32_t event, void *data)
osmo_fsm_inst_state_chg(fi, ST_VOICE, 0, 0);
break;
case E_FACCH:
- osmo_fsm_inst_state_chg(fi, ST_ONSET_F, 0, 0);
+ osmo_fsm_inst_state_chg(fi, ST_FACCH, 0, 0);
break;
default:
LOGP(DL1P, LOGL_ERROR, "Unexpected event %d\n", event);
@@ -97,7 +97,7 @@ void dtx_fsm_f1_inh(struct osmo_fsm_inst *fi, uint32_t event, void *data)
osmo_fsm_inst_state_chg(fi, ST_ONSET_V, 0, 0);
break;
case E_FACCH:
- osmo_fsm_inst_state_chg(fi, ST_ONSET_F, 0, 0);
+ osmo_fsm_inst_state_chg(fi, ST_FACCH, 0, 0);
break;
default:
LOGP(DL1P, LOGL_ERROR, "Unexpected event %d\n", event);
@@ -113,7 +113,7 @@ void dtx_fsm_u_inh(struct osmo_fsm_inst *fi, uint32_t event, void *data)
osmo_fsm_inst_state_chg(fi, ST_ONSET_V, 0, 0);
break;
case E_FACCH:
- osmo_fsm_inst_state_chg(fi, ST_ONSET_F, 0, 0);
+ osmo_fsm_inst_state_chg(fi, ST_FACCH, 0, 0);
break;
default:
LOGP(DL1P, LOGL_ERROR, "Unexpected event %d\n", event);
@@ -126,7 +126,7 @@ void dtx_fsm_sid_upd(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
switch (event) {
case E_FACCH:
- osmo_fsm_inst_state_chg(fi, ST_ONSET_F, 0, 0);
+ osmo_fsm_inst_state_chg(fi, ST_FACCH, 0, 0);
break;
case E_VOICE:
osmo_fsm_inst_state_chg(fi, ST_VOICE, 0, 0);
@@ -234,7 +234,7 @@ static struct osmo_fsm_state dtx_dl_amr_fsm_states[] = {
start of silence period (might be interrupted in case of AMR HR) */
[ST_SID_F1]= {
.in_event_mask = X(E_SID_F) | X(E_SID_U) | X(E_VOICE) | X(E_FACCH) | X(E_COMPL) | X(E_INHIB) | X(E_ONSET),
- .out_state_mask = X(ST_SID_U) | X(ST_VOICE) | X(ST_ONSET_F) | X(ST_SID_F2) | X(ST_F1_INH) | X(ST_ONSET_V),
+ .out_state_mask = X(ST_SID_U) | X(ST_VOICE) | X(ST_FACCH) | X(ST_SID_F2) | X(ST_F1_INH) | X(ST_ONSET_V),
.name = "SID-FIRST (P1)",
.action = dtx_fsm_sid_f1,
},
@@ -242,7 +242,7 @@ static struct osmo_fsm_state dtx_dl_amr_fsm_states[] = {
actual start of silence period in case of AMR HR*/
[ST_SID_F2]= {
.in_event_mask = X(E_SID_U) | X(E_VOICE) | X(E_FACCH),
- .out_state_mask = X(ST_SID_U) | X(ST_VOICE) | X(ST_ONSET_F),
+ .out_state_mask = X(ST_SID_U) | X(ST_VOICE) | X(ST_FACCH),
.name = "SID-FIRST (P2)",
.action = dtx_fsm_sid_f2,
},
@@ -265,7 +265,7 @@ static struct osmo_fsm_state dtx_dl_amr_fsm_states[] = {
/* Silence period with periodic comfort noise data updates */
[ST_SID_U]= {
.in_event_mask = X(E_FACCH) | X(E_VOICE) | X(E_INHIB) | X(E_SID_U) | X(E_SID_F) | X(E_ONSET),
- .out_state_mask = X(ST_ONSET_F) | X(ST_VOICE) | X(ST_U_INH) | X(ST_SID_U) | X(ST_ONSET_V),
+ .out_state_mask = X(ST_FACCH) | X(ST_VOICE) | X(ST_U_INH) | X(ST_SID_U) | X(ST_ONSET_V),
.name = "SID-UPDATE",
.action = dtx_fsm_sid_upd,
},
@@ -276,13 +276,6 @@ static struct osmo_fsm_state dtx_dl_amr_fsm_states[] = {
.name = "ONSET (SPEECH)",
.action = dtx_fsm_onset_v,
},
- /* ONSET - end of silent period due to incoming FACCH frame */
- [ST_ONSET_F]= {
- .in_event_mask = X(E_VOICE) | X(E_FACCH) | X(E_SID_U),
- .out_state_mask = X(ST_VOICE) | X(ST_FACCH),
- .name = "ONSET (FACCH)",
- .action = dtx_fsm_onset_f,
- },
/* FACCH sending state: SPEECH was observed before so once we're done
FSM should get back to VOICE state */
[ST_FACCH_V]= {