falconia has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/32079 )
( 1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: osmo_rtp2trau() for FR & EFR: set SP=0 in DL if the frame is a SID ...................................................................... osmo_rtp2trau() for FR & EFR: set SP=0 in DL if the frame is a SID The SP bit in TRAU DL frames is supposed to be 1 for regular speech frames and 0 for SID frames. The previous code always set SP=1; the present change sets this flag per the spec (TS 48.060) using osmo_{fr,efr}_check_sid() functions from libosmocodec. The present change does not affect TRAU UL frame generation - correct generation of SID bits in the TRAU UL frame is still missing and would require further work if someone wishes to use Osmocom software to implement a new T1/E1 BTS or some other entity that needs to generate TRAU UL frames. Change-Id: I371f8072c0afedbd1b065efecfed3734fb6d31ab --- M src/Makefile.am M src/trau/trau_rtp_conv.c 2 files changed, 33 insertions(+), 7 deletions(-) Approvals: laforge: Looks good to me, approved fixeria: Looks good to me, but someone else must approve pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/src/Makefile.am b/src/Makefile.am index 2c99150..e1a3495 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -40,7 +40,7 @@ -version-info $(TRAU_LIBVERSION) \ -no-undefined \ $(NULL) -libosmotrau_la_LIBADD = $(COMMONLIBS) $(ORTP_LIBS) +libosmotrau_la_LIBADD = $(COMMONLIBS) $(LIBOSMOCODEC_LIBS) $(ORTP_LIBS) libosmotrau_la_SOURCES = trau/osmo_ortp.c \ trau/trau_frame.c \ trau/trau_pcu_ericsson.c \ diff --git a/src/trau/trau_rtp_conv.c b/src/trau/trau_rtp_conv.c index a434c2a..e08b0b9 100644 --- a/src/trau/trau_rtp_conv.c +++ b/src/trau/trau_rtp_conv.c @@ -269,8 +269,6 @@ /* FR Data Bits according to TS 48.060 Section 5.5.1.1.2 */ - /* FIXME: Generate SID frames? */ - /* set c-bits and t-bits */ if (tf->dir == OSMO_TRAU_DIR_UL) { /* C1 .. C5: FR UL */ @@ -302,14 +300,19 @@ tf->c_bits[11] = 1; /* C12: BFI */ else tf->c_bits[11] = 0; /* C12: BFI */ + /* FIXME: set C13 & C14 per GSM 06.31 section 6.1.1 */ tf->c_bits[12] = 0; /* C13: SID=0 */ tf->c_bits[13] = 0; /* C14: SID=0 */ tf->c_bits[14] = 0; /* C15: TAF (SACCH or not) */ tf->c_bits[15] = 1; /* C16: spare */ tf->c_bits[16] = 0; /* C17: DTXd not applied */ } else { - memset(&tf->c_bits[11], 1, 10); /* C12 .. C15: spare */ - tf->c_bits[15] = 1; /* C16: SP=1 */ + memset(&tf->c_bits[11], 1, 4); /* C12 .. C15: spare */ + if (data_len && osmo_fr_check_sid(data, data_len)) + tf->c_bits[15] = 0; /* C16: SP=0 */ + else + tf->c_bits[15] = 1; /* C16: SP=1 */ + tf->c_bits[16] = 1; /* C17: spare */ } memset(&tf->c_bits[17], 1, 4); /* C18 .. C21: spare */ memset(&tf->t_bits[0], 1, 4); @@ -462,7 +465,7 @@ tf->c_bits[11] = 1; /* C12: BFI=1 */ else tf->c_bits[11] = 0; /* C12: BFI=1 */ - /* FIXME: Generate SID frames? */ + /* FIXME: set C13 & C14 per GSM 06.81 section 6.1.1 */ tf->c_bits[12] = 0; /* C13: SID=0 */ tf->c_bits[13] = 0; /* C14: SID=0 */ tf->c_bits[14] = 0; /* C15: TAF (SACCH) */ @@ -471,7 +474,10 @@ } else { tf->c_bits[11] = 1; /* C12: UFE (good uplink) */ memset(&tf->c_bits[12], 1, 3); /* C13 .. C15: spare */ - tf->c_bits[15] = 1; /* C16: SP=1 */ + if (data_len && osmo_efr_check_sid(data, data_len)) + tf->c_bits[15] = 0; /* C16: SP=0 */ + else + tf->c_bits[15] = 1; /* C16: SP=1 */ tf->c_bits[16] = 1; /* C17: spare */ } memset(&tf->c_bits[17], 1, 4); /* C18 .. C21: spare */ -- To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/32079 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Change-Id: I371f8072c0afedbd1b065efecfed3734fb6d31ab Gerrit-Change-Number: 32079 Gerrit-PatchSet: 3 Gerrit-Owner: falconia <fal...@freecalypso.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: falconia <fal...@freecalypso.org> Gerrit-Reviewer: fixeria <vyanits...@sysmocom.de> Gerrit-Reviewer: laforge <lafo...@osmocom.org> Gerrit-Reviewer: pespin <pes...@sysmocom.de> Gerrit-MessageType: merged