diff options
author | Max <msuraev@sysmocom.de> | 2016-09-17 14:15:03 +0200 |
---|---|---|
committer | Max <msuraev@sysmocom.de> | 2016-09-24 15:09:31 +0200 |
commit | 654175f33bd412671e3ef8cdd65c0689d10f278c (patch) | |
tree | 9861adb1bf44de4ff5edf02025e7fc7795f33218 /src/osmo-bts-sysmo | |
parent | eb08a87be52bf55a78c12689f1e5c7cff627cbbc (diff) |
DTX: check Marker bit to send ONSET to L1
If Marker bit is set than it's a talkspurt which we have to explicitly
indicate to L1 by first sending ONSET message and than actual voice
data in a separate message.
This change affect sysmobts and LC15 hw.
Change-Id: I88c41568bcb0d82699f617adc4ad192603dd1bb6
Related: OS#1750
Diffstat (limited to 'src/osmo-bts-sysmo')
-rw-r--r-- | src/osmo-bts-sysmo/l1_if.c | 8 | ||||
-rw-r--r-- | src/osmo-bts-sysmo/l1_if.h | 3 | ||||
-rw-r--r-- | src/osmo-bts-sysmo/tch.c | 31 |
3 files changed, 33 insertions, 9 deletions
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 41b09a1c..3c6db43d 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -462,7 +462,8 @@ static int ph_tch_req(struct gsm_bts_trx *trx, struct msgb *msg, if (!l1if_tch_encode(lchan, l1p->u.phDataReq.msgUnitParam.u8Buffer, &l1p->u.phDataReq.msgUnitParam.u8Size, - msg->data, msg->len, u32Fn)) { + msg->data, msg->len, u32Fn, + l1sap->u.tch.marker)) { msgb_free(nmsg); nmsg = NULL; } @@ -496,6 +497,11 @@ static int ph_tch_req(struct gsm_bts_trx *trx, struct msgb *msg, /* send message to DSP's queue */ osmo_wqueue_enqueue(&fl1->write_q[MQ_L1_WRITE], nmsg); + if (l1sap->u.tch.marker) { /* Send voice after ONSET was sent */ + l1sap->u.tch.marker = 0; + return ph_tch_req(trx, l1sap->oph.msg, l1sap); + } + return 0; } diff --git a/src/osmo-bts-sysmo/l1_if.h b/src/osmo-bts-sysmo/l1_if.h index 49b7e677..a90c39b2 100644 --- a/src/osmo-bts-sysmo/l1_if.h +++ b/src/osmo-bts-sysmo/l1_if.h @@ -110,7 +110,8 @@ struct gsm_lchan *l1if_hLayer_to_lchan(struct gsm_bts_trx *trx, uint32_t hLayer) /* tch.c */ bool l1if_tch_encode(struct gsm_lchan *lchan, uint8_t *data, uint8_t *len, - const uint8_t *rtp_pl, unsigned int rtp_pl_len, uint32_t fn); + const uint8_t *rtp_pl, unsigned int rtp_pl_len, uint32_t fn, + bool marker); int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg); int l1if_tch_fill(struct gsm_lchan *lchan, uint8_t *l1_buffer); struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan, uint32_t fn); diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index 745923c0..b1ab0866 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -319,6 +319,9 @@ static int rtppayload_to_l1_amr(uint8_t *l1_payload, const uint8_t *rtp_payload, cmi = ft; LOGP(DRTP, LOGL_DEBUG, "SPEECH frame with CMI %u\n", cmi); break; + case AMR_NO_DATA: + LOGP(DRTP, LOGL_DEBUG, "SPEECH frame AMR NO_DATA\n"); + break; case AMR_SID: LOGP(DRTP, LOGL_DEBUG, "SID %s frame with CMI %u\n", sti ? "UPDATE" : "FIRST", cmi); @@ -380,6 +383,7 @@ static int rtppayload_to_l1_amr(uint8_t *l1_payload, const uint8_t *rtp_payload, /*! \brief function for incoming RTP via TCH.req * \param[in] rtp_pl buffer containing RTP payload * \param[in] rtp_pl_len length of \a rtp_pl + * \param[in] marker RTP header Marker bit (indicates speech onset) * \returns true if encoding result can be sent further to L1, false otherwise * * This function prepares a msgb with a L1 PH-DATA.req primitive and @@ -390,10 +394,13 @@ static int rtppayload_to_l1_amr(uint8_t *l1_payload, const uint8_t *rtp_payload, * pre-fill the primtive. */ bool l1if_tch_encode(struct gsm_lchan *lchan, uint8_t *data, uint8_t *len, - const uint8_t *rtp_pl, unsigned int rtp_pl_len, uint32_t fn) + const uint8_t *rtp_pl, unsigned int rtp_pl_len, uint32_t fn, bool marker) { uint8_t *payload_type; - uint8_t *l1_payload; + uint8_t *l1_payload, cmr; + enum osmo_amr_type ft; + enum osmo_amr_quality bfi; + int8_t sti, cmi; int rc; DEBUGP(DRTP, "%s RTP IN: %s\n", gsm_lchan_name(lchan), @@ -422,11 +429,21 @@ bool l1if_tch_encode(struct gsm_lchan *lchan, uint8_t *data, uint8_t *len, break; #endif case GSM48_CMODE_SPEECH_AMR: - *payload_type = GsmL1_TchPlType_Amr; - rc = rtppayload_to_l1_amr(l1_payload, rtp_pl, - rtp_pl_len, lchan, fn); - if (-EALREADY == rc) - return false; + if (marker) { + *payload_type = GsmL1_TchPlType_Amr_Onset; + rc = 0; + osmo_amr_rtp_dec(rtp_pl, rtp_pl_len, &cmr, &cmi, &ft, + &bfi, &sti); + LOGP(DRTP, LOGL_ERROR, "Marker SPEECH frame AMR %s\n", + get_value_string(osmo_amr_type_names, ft)); + } + else { + *payload_type = GsmL1_TchPlType_Amr; + rc = rtppayload_to_l1_amr(l1_payload, rtp_pl, + rtp_pl_len, lchan, fn); + if (-EALREADY == rc) + return false; + } break; default: /* we don't support CSD modes */ |