From 654175f33bd412671e3ef8cdd65c0689d10f278c Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 17 Sep 2016 14:15:03 +0200 Subject: 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 --- src/osmo-bts-litecell15/tch.c | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) (limited to 'src/osmo-bts-litecell15/tch.c') diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index 3c6ee25f..e06c4cf8 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -26,7 +26,7 @@ #include #include #include - +#include #include #include @@ -222,6 +222,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); @@ -283,6 +286,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 @@ -293,10 +297,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), @@ -323,11 +330,21 @@ bool l1if_tch_encode(struct gsm_lchan *lchan, uint8_t *data, uint8_t *len, rtp_pl_len); break; 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 */ -- cgit v1.2.3