falconia has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/32110 )
Change subject: common+trx: add rtp ecu-downstream vty option ...................................................................... common+trx: add rtp ecu-downstream vty option Current osmo-bts-trx includes a provision for invoking ECUs from libosmocodec in the UL path from the channel decoder to the RTP output; no other models currently do likewise, but there is no particular reason why this ECU invokation couldn't be moved into model-independent code. However, there are some network configurations in which this in-BTS ECU invokation is undesirable, and the desire is to disable or suppress it no matter which BTS model is used, rather than extend the feature to BTS models which currently don't support it. Usually the reason for wishing to suppress the ECU currently provided by osmo-bts-trx is that another network element somewhere downstream in RTP implements either a better ECU than what libosmocore provides or a more complete Rx DTX handler of which the ECU is just one part. The new rtp ecu-downstream vty option disables libosmocodec ECU invokation in OsmoBTS. The intended usage model is that this option will be used together with rtp continuous-streaming, but in the strict sense the two options are orthogonal. Related: OS#5975 Change-Id: I0acca9c6d7da966a623287563e0789db9e0fae8e --- M include/osmo-bts/bts.h M src/common/vty.c M src/osmo-bts-trx/l1_if.c M tests/osmo-bts.vty 4 files changed, 70 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/10/32110/1 diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h index 56bf289..add2825 100644 --- a/include/osmo-bts/bts.h +++ b/include/osmo-bts/bts.h @@ -316,6 +316,7 @@ bool rtp_nogaps_mode; /* emit RTP stream without any gaps */ bool rtp_themyscira_ext; /* Themyscira extension for FR/EFR BFI */ + bool rtp_ecu_downstream; /* ECU present downstream, don't apply our own */ struct { uint8_t ciphers; /* flags A5/1==0x1, A5/2==0x2, A5/3==0x4 */ diff --git a/src/common/vty.c b/src/common/vty.c index 8a51170..bf25727 100644 --- a/src/common/vty.c +++ b/src/common/vty.c @@ -428,6 +428,8 @@ vty_out(vty, " themyscira-bfi"); vty_out(vty, "%s", VTY_NEWLINE); } + if (bts->rtp_ecu_downstream) + vty_out(vty, " rtp ecu-downstream%s", VTY_NEWLINE); vty_out(vty, " paging queue-size %u%s", paging_get_queue_max(bts->paging_state), VTY_NEWLINE); vty_out(vty, " paging lifetime %u%s", paging_get_lifetime(bts->paging_state), @@ -815,6 +817,28 @@ return CMD_SUCCESS; } +DEFUN(cfg_bts_rtp_ecu_downstream, + cfg_bts_rtp_ecu_downstream_cmd, + "rtp ecu-downstream", + RTP_STR "Rely on a downstream ECU instead of providing one in the BTS\n") +{ + struct gsm_bts *bts = vty->index; + + bts->rtp_ecu_downstream = true; + return CMD_SUCCESS; +} + +DEFUN(cfg_bts_no_rtp_ecu_downstream, + cfg_bts_no_rtp_ecu_downstream_cmd, + "no rtp ecu-downstream", + NO_STR RTP_STR "Rely on a downstream ECU instead of providing one in the BTS\n") +{ + struct gsm_bts *bts = vty->index; + + bts->rtp_ecu_downstream = false; + return CMD_SUCCESS; +} + #define PAG_STR "Paging related parameters\n" DEFUN_ATTR(cfg_bts_paging_queue_size, @@ -2717,6 +2741,8 @@ install_element(BTS_NODE, &cfg_bts_rtp_priority_cmd); install_element(BTS_NODE, &cfg_bts_rtp_cont_stream_cmd); install_element(BTS_NODE, &cfg_bts_no_rtp_cont_stream_cmd); + install_element(BTS_NODE, &cfg_bts_rtp_ecu_downstream_cmd); + install_element(BTS_NODE, &cfg_bts_no_rtp_ecu_downstream_cmd); install_element(BTS_NODE, &cfg_bts_band_cmd); install_element(BTS_NODE, &cfg_description_cmd); install_element(BTS_NODE, &cfg_no_description_cmd); diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index 2ed1868..caba9e1 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -439,8 +439,13 @@ break; } - /* attempt to allocate an Error Concealment Unit instance, if available */ - lchan->ecu_state = osmo_ecu_init(trx, lchan2ecu_codec(lchan)); + /* Attempt to allocate an Error Concealment Unit + * instance, if available, unless it is disabled by the + * rtp ecu-downstream option in vty config. */ + if (!trx->bts->rtp_ecu_downstream) + lchan->ecu_state = osmo_ecu_init(trx, lchan2ecu_codec(lchan)); + else + lchan->ecu_state = NULL; /* activate dedicated channel */ trx_sched_set_lchan(lchan, chan_nr, LID_DEDIC, true); @@ -473,7 +478,10 @@ /* ECU for possibly new codec */ if (lchan->ecu_state) osmo_ecu_destroy(lchan->ecu_state); - lchan->ecu_state = osmo_ecu_init(trx, lchan2ecu_codec(lchan)); + if (!trx->bts->rtp_ecu_downstream) + lchan->ecu_state = osmo_ecu_init(trx, lchan2ecu_codec(lchan)); + else + lchan->ecu_state = NULL; /* change mode */ trx_sched_set_mode(lchan->ts, chan_nr, lchan->rsl_cmode, lchan->tch_mode, diff --git a/tests/osmo-bts.vty b/tests/osmo-bts.vty index 6613f41..450d6ad 100644 --- a/tests/osmo-bts.vty +++ b/tests/osmo-bts.vty @@ -235,6 +235,8 @@ rtp socket-priority <0-255> rtp continuous-streaming [themyscira-bfi] no rtp continuous-streaming + rtp ecu-downstream + no rtp ecu-downstream band (450|GSM450|480|GSM480|750|GSM750|810|GSM810|850|GSM850|900|GSM900|1800|DCS1800|1900|PCS1900) description .TEXT no description -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/32110 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I0acca9c6d7da966a623287563e0789db9e0fae8e Gerrit-Change-Number: 32110 Gerrit-PatchSet: 1 Gerrit-Owner: falconia <fal...@freecalypso.org> Gerrit-MessageType: newchange