aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2016-12-16 12:47:32 +0100
committerMax <msuraev@sysmocom.de>2016-12-16 14:04:50 +0100
commitfbe655f3202d6968c24abbddc46bff499bfeda5e (patch)
tree3b461e8f635e2daa146b50ab2fea6a0794ab98c5
parentfed8ce3c5ab740f3a02831e0b00a400e7bbc0e69 (diff)
Optionally use adaptive RTP jitter buffering
* add vty option to manually enable adaptive RTP jitter buffering (disabled by default) on per-bts level * use this setting on per-lchan level when setting jitter parameters via vty at runtime * check and log result of osmo_rtp_socket_set_param() * note: older libosmo-abis will ignore this setting which will be properly detected via return value * if jitter buffer is disabled by configuring "rtp jitter-buffer 0" than adaptive buffering is disabled as well but it will be used if jitter buffer is set to different value for a givel lchan via vty Change-Id: I489f3c419039f40b57c2ef0641c176478b8d3566
-rw-r--r--include/osmo-bts/gsm_data.h1
-rw-r--r--src/common/bts.c1
-rw-r--r--src/common/rsl.c16
-rw-r--r--src/common/vty.c25
4 files changed, 34 insertions, 9 deletions
diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h
index f1c9601..772a705 100644
--- a/include/osmo-bts/gsm_data.h
+++ b/include/osmo-bts/gsm_data.h
@@ -86,6 +86,7 @@ struct gsm_bts_role_bts {
char *bsc_oml_host;
struct llist_head oml_queue;
unsigned int rtp_jitter_buf_ms;
+ bool rtp_jitter_adaptive;
struct {
uint8_t ciphers; /* flags A5/1==0x1, A5/2==0x2, A5/3==0x4 */
} support;
diff --git a/src/common/bts.c b/src/common/bts.c
index 2005e42..9c2f0e0 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -109,6 +109,7 @@ int bts_init(struct gsm_bts *bts)
/* configurable via VTY */
btsb->paging_state = paging_init(btsb, 200, 0);
btsb->ul_power_target = -75; /* dBm default */
+ btsb->rtp_jitter_adaptive = false;
/* configurable via OML */
btsb->load.ccch.load_ind_period = 112;
diff --git a/src/common/rsl.c b/src/common/rsl.c
index 8d1175d..9e9cbb6 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -1652,9 +1652,19 @@ static int rsl_rx_ipac_XXcx(struct msgb *msg)
return tx_ipac_XXcx_nack(lchan, RSL_ERR_RES_UNAVAIL,
inc_ip_port, dch->c.msg_type);
}
- osmo_rtp_socket_set_param(lchan->abis_ip.rtp_socket,
- OSMO_RTP_P_JITBUF,
- btsb->rtp_jitter_buf_ms);
+ rc = osmo_rtp_socket_set_param(lchan->abis_ip.rtp_socket,
+ btsb->rtp_jitter_adaptive ?
+ OSMO_RTP_P_JIT_ADAP :
+ OSMO_RTP_P_JITBUF,
+ btsb->rtp_jitter_buf_ms);
+ if (rc < 0)
+ LOGP(DRSL, LOGL_ERROR,
+ "%s IPAC Failed to set RTP socket parameters: %s\n",
+ gsm_lchan_name(lchan), strerror(-rc));
+ else
+ LOGP(DRSL, LOGL_INFO,
+ "%s IPAC set RTP socket parameters: %d\n",
+ gsm_lchan_name(lchan), rc);
lchan->abis_ip.rtp_socket->priv = lchan;
lchan->abis_ip.rtp_socket->rx_cb = &l1sap_rtp_rx_cb;
diff --git a/src/common/vty.c b/src/common/vty.c
index 0fffca0..b48afa4 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -276,8 +276,10 @@ static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts)
vty_out(vty, " ipa unit-id %u %u%s",
bts->ip_access.site_id, bts->ip_access.bts_id, VTY_NEWLINE);
vty_out(vty, " oml remote-ip %s%s", btsb->bsc_oml_host, VTY_NEWLINE);
- vty_out(vty, " rtp jitter-buffer %u%s", btsb->rtp_jitter_buf_ms,
- VTY_NEWLINE);
+ vty_out(vty, " rtp jitter-buffer %u", btsb->rtp_jitter_buf_ms);
+ if (btsb->rtp_jitter_adaptive)
+ vty_out(vty, " adaptive");
+ vty_out(vty, "%s", VTY_NEWLINE);
vty_out(vty, " paging queue-size %u%s", paging_get_queue_max(btsb->paging_state),
VTY_NEWLINE);
vty_out(vty, " paging lifetime %u%s", paging_get_lifetime(btsb->paging_state),
@@ -487,13 +489,15 @@ DEFUN_HIDDEN(cfg_bts_rtp_bind_ip,
DEFUN(cfg_bts_rtp_jitbuf,
cfg_bts_rtp_jitbuf_cmd,
- "rtp jitter-buffer <0-10000>",
+ "rtp jitter-buffer <0-10000> [adaptive]",
RTP_STR "RTP jitter buffer\n" "jitter buffer in ms\n")
{
struct gsm_bts *bts = vty->index;
struct gsm_bts_role_bts *btsb = bts_role_bts(bts);
btsb->rtp_jitter_buf_ms = atoi(argv[0]);
+ if (argc > 1)
+ btsb->rtp_jitter_adaptive = true;
return CMD_SUCCESS;
}
@@ -1003,7 +1007,8 @@ DEFUN(bts_t_t_l_jitter_buf,
{
struct gsm_network *net = gsmnet_from_vty(vty);
struct gsm_lchan *lchan;
- int jitbuf_ms = atoi(argv[4]);
+ struct gsm_bts_role_bts *btsb;
+ int jitbuf_ms = atoi(argv[4]), rc;
lchan = resolve_lchan(net, argv, 0);
if (!lchan) {
@@ -1015,8 +1020,16 @@ DEFUN(bts_t_t_l_jitter_buf,
VTY_NEWLINE);
return CMD_WARNING;
}
- osmo_rtp_socket_set_param(lchan->abis_ip.rtp_socket,
- OSMO_RTP_P_JITBUF, jitbuf_ms);
+ btsb = bts_role_bts(lchan->ts->trx->bts);
+ rc = osmo_rtp_socket_set_param(lchan->abis_ip.rtp_socket,
+ btsb->rtp_jitter_adaptive ?
+ OSMO_RTP_P_JIT_ADAP : OSMO_RTP_P_JITBUF,
+ jitbuf_ms);
+ if (rc < 0)
+ vty_out(vty, "%% error setting jitter parameters: %s%s",
+ strerror(-rc), VTY_NEWLINE);
+ else
+ vty_out(vty, "%% jitter parameters set: %d%s", rc, VTY_NEWLINE);
return CMD_SUCCESS;
}