osmo-bts-trx: rx_tchh_fn(): fix HR SID detection (wrong offset)

According to RFC5993, which is referenced by 3GPP TS 48.103, the
complete RTP HR payload consists of a Table-of-Contents (ToC) byte
followed by the 14 bytes of the HR codec frame.  See section 5.2.

gsm0503_tch_hr_decode() outputs frames in the RTP format with
length of 15 bytes (120 bits): 1 (ToC) + 14 (HR frame):

  +-------------+-------------------------
  | ToC section | HR codec frame ...
  +-------------+-------------------------

osmo_hr_check_sid() expects a HR codec frame of 14 bytes (112 bits)
as the input, so we should skip the ToC section when calling it.

Change-Id: Ie5fa776dcb2b2203a97aed56ecbf2450af7d87c1
Related: SYS#5853
This commit is contained in:
Vadim Yanitskiy 2022-03-10 14:31:33 +03:00
parent d32cf22fbc
commit eb8059b615
1 changed files with 4 additions and 2 deletions

View File

@ -147,8 +147,10 @@ int rx_tchh_fn(struct l1sched_ts *l1ts, const struct trx_ul_burst_ind *bi)
*/
rc = gsm0503_tch_hr_decode(tch_data, *bursts_p,
fn_is_odd, &n_errors, &n_bits_total);
if (rc == (GSM_HR_BYTES + 1)) /* only for valid *speech* frames */
lchan_set_marker(osmo_hr_check_sid(tch_data, rc), lchan); /* DTXu */
if (rc == (GSM_HR_BYTES + 1)) { /* only for valid *speech* frames */
/* gsm0503_tch_hr_decode() prepends a ToC octet (see RFC5993), skip it */
lchan_set_marker(osmo_hr_check_sid(&tch_data[1], GSM_HR_BYTES), lchan); /* DTXu */
}
break;
case GSM48_CMODE_SPEECH_AMR: /* AMR */
/* the first FN 0,8,17 or 1,9,18 defines that CMI is included