falconia has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/39477?usp=email )
Change subject: E1: replace idle_tf_efr[] with a better version ......................................................................
E1: replace idle_tf_efr[] with a better version
The only truly correct way to pass FR/HR/EFR traffic from an incoming RTP stream to TRAU-DL frames is to apply the transform of TS 28.062 section C.3.2.1.1, originally specified for TFO but also necessary in the non-3GPP-specified case of GSM TrFO as it happens here. However, no FOSS or even published-source implementation of TFO transform for EFR exists at the present time (no implementations at all are known outside of TRAU DSP firmware), hence the general architectural approach of OsmoMGW-E1, flawed as it is, has to remain for now. This flawed architecture consists of passing through unaltered all valid codec frames that are received in RTP, and inserting fixed dummy TRAU-DL frames when no RTP-derived ones are available.
The original dummy TRAU-DL frame for EFR exhibited the following defects:
* D1 bit was set to 0, even though TS 48.060 section 5.5.1.1.2 states it shall be 1;
* All 5 EFR frame CRCs were invalid: each 3-bit CRC was 000, even though the correct TS 48.060 section 5.5.1.1.2 CRC from an all-zeros payload would be 111;
* Even if the 5 CRCs were fixed, transmitting an EFR frame of all zero bits to the MS won't produce good results - it is a bad choice of dummy filler;
* The setting of C-bits (defined in TS 48.060 section 5.5.1.1.1) was a mish-mash between TRAU-UL and TRAU-DL frame formats, thereby not matching the standard TRAU-DL C-bits fill produced by osmo_rtp2trau().
The replacement fill frame introduced here differs as follows:
* The payload bit content is the decoder homing frame (DHF) of TS 46.060 section 8.2 Table 7 - the best we can do in the absence of a proper TFO transform for EFR;
* The full TRAU-DL frame (C-bits, CRC etc) was generated by passing said EFR DHF through osmo_rtp2trau(), using this ad hoc tool:
https://gitea.osmocom.org/themwi/dummy-dl-frames
Change-Id: I5a33a1c9ddf1372f91870d61b5eafac4729ee458 --- M src/libosmo-mgcp/mgcp_e1.c 1 file changed, 32 insertions(+), 27 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/77/39477/1
diff --git a/src/libosmo-mgcp/mgcp_e1.c b/src/libosmo-mgcp/mgcp_e1.c index 7d5a4fb..f3471fb 100644 --- a/src/libosmo-mgcp/mgcp_e1.c +++ b/src/libosmo-mgcp/mgcp_e1.c @@ -56,47 +56,52 @@ .sign_link = NULL, };
-/* EFR idle frame */ +/* The following EFR TRAU-DL frame is a dummy to be transmitted in the absence + * of RTP-derived TRAU-DL frames. The payload bit content here is the decoder + * homing frame (DHF) of TS 46.060 section 8.2 Table 7 - the best we can do + * in the absence of a proper TFO transform for EFR - while the full TRAU-DL + * frame was generated by passing said EFR DHF through osmo_rtp2trau(). + */ static const ubit_t idle_tf_efr[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 1, 1, 1, 1, + 1, 1, 0, 0, 0, 0, 1, 0, + 0, 0, 0, 1, 0, 1, 1, 1, + 1, 1, 0, 1, 0, 1, 1, 0, + 1, 0, 0, 1, 0, 0, 1, 0, + 1, 0, 0, 0, 1, 1, 1, 1, + 1, 0, 0, 1, 0, 1, 0, 1, + 1, 0, 1, 0, 1, 1, 0, 1, + 0, 1, 1, 0, 0, 0, 0, 0, + 1, 0, 0, 1, 1, 1, 1, 1, + 0, 0, 0, 1, 1, 1, 0, 1, + 1, 0, 0, 0, 0, 1, 1, 0, + 0, 0, 0, 1, 1, 0, 0, 0, + 1, 0, 0, 0, 1, 1, 1, 1, + 0, 1, 1, 0, 1, 1, 0, 0, + 1, 0, 0, 1, 1, 0, 0, 0, + 1, 0, 0, 0, 0, 1, 0, 1, + 1, 1, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 1, 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0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