Project

General

Profile

Actions

Bug #6027

closed

FR ECU implementation is very poor

Added by falconia about 1 year ago. Updated about 1 year ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
libosmocodec
Target version:
-
Start date:
05/09/2023
Due date:
% Done:

100%

Spec Reference:
TS 46.011

Description

The current implementation of ECU for the FR codec in libosmocodec exhibits the following serious defects:

  • If right after osmo_ecu_init() the application calls the frame_out() method, without first feeding in a good frame with frame_in(), the output from the ECU will be a bogus RTP payload with the signature nibble set to 0 instead of D. This scenario will occur all the time in real world usage, when initial reception on a freshly activated channel picks up radio noise rather than valid codec frames.
  • The muting procedure specified in TS 46.011 is implemented incorrectly. When block magnitude Xmaxc reaches 0, the ECU is supposed to emit silence frames, and the specific silence frame to be emitted is listed in Table 1 at the end of the spec. However, the implemented ECU emits a frame of all zero bits, which is wrong - a frame of all zero bits is a SID frame, meaning a request for the DTX handler on the receiving end to initiate comfort noise generation, not a silence frame per GSM 06.11 or its 3GPP successor.
  • If a received good frame passed to frame_in() is a SID frame, that SID gets cached and never expires - if the application keeps calling frame_out(), receiving only radio noise, that cached SID will continue to be output forever. Per GSM 06.31 and 06.11 specs, this cached SID should be treated as expired after 960 ms have passed without any new valid frames being received, and comfort noise muting (or SID muting, in the case of a "pure" ECU without a directly coupled CN generator) should be initiated.
  • The case of ECU input being an invalid SID, or a valid SID with one errored bit in the SID field, is not handled at all.

Correct FR codec ECU functionality, coupled with comfort noise generation, is implemented in Themyscira libgsmfrp version 1.0.1:

https://www.freecalypso.org/hg/gsm-codec-lib/

Fortunately, it is also possible to implement a more correct ECU for FR that would fit into the generic ECU abstraction layer in libosmocodec - a patch will be coming soon.

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)