Skip to content

Changes

Summary

  1. {de,en}code8_hr: fix totally broken functions (details)
  2. trau_frame: fix 8k decoding (details)
  3. trau_rtp_conv: add support for HRv1 in 8k format (details)
Commit b1b2b12c4df0fcb9fc02324d892dee4f50ee7d2e by falcon
{de,en}code8_hr: fix totally broken functions

The functions decode8_hr() and encode8_hr() in trau_frame.c (encoding
and decoding HRv1 TRAU frames in 8 kbit/s format) are available via
osmo_trau_frame_decode_8k() and osmo_trau_frame_encode() public APIs,
but they are not currently used anywhere in Osmocom.  (OsmoMGW-E1 has
no working support for HR codec, and there is no support for HRv1-8k
in the TRAU<->RTP layer until next patch in this series.)  Study of
the code reveals that these functions were totally broken prior to
this change:

* The movement of Dn bits between trau_bits and fr->d_bits used wrong
  offsets for some of the bits (and even missed one group of bits
  entirely in the encoding direction), producing garbled codec frames.

* The filling of XCn bits in the encoding direction was likewise
  garbled by use of wrong offset.

* When encoding TRAU-UL frames in this format, bit C5 (odd parity)
  was set incorrectly.

* The order of bits in fr->crc_bits array (Osmocom internal) was
  opposite the order needed for osmo_crc8gen_check_bits() and
  osmo_crc8gen_set_bits() functions - contrast with HRv1-16k functions
  that use sensible bit order for this fr->crc_bits array.

Given that this HRv1-8k mode within TRAU frame encoding and decoding
API was totally broken and not used anywhere, there are no compatibility
concerns with changing aspects of this API such as CRC bit order.

Change-Id: I7cf0275f2ff212e001db38d7b090f222f292cdb0
The file was modified src/trau/trau_frame.c
Commit 86008c2d14a9859e0019f932746387c1d9f7993b by falcon
trau_frame: fix 8k decoding

osmo_trau_frame_decode_8k() API was broken for most TRAU frame types:
the processing begins with identifying the sync pattern, but the check
for the leading 8 zeros in HRv1, AMR-low and AMR-6k7 formats was
broken in that it was checking for 16 zero bits instead of 8.

While at it, fix global namespace pollution: the bit8_0[] datum
used in this logic was defined as global when it should be static.

Change-Id: Idabc1283d477473b479f2d76d783ca9aeaf0af5d
The file was modified src/trau/trau_frame.c
Commit 58419cc9c6272f30ceb78757fec97a0015c13e2e by falcon
trau_rtp_conv: add support for HRv1 in 8k format

GSM 08.61 defines two alternative Abis transport formats for
HRv1 codec, using either 16 kbit/s or 8 kbit/s submultiplexing,
as chosen by each BSS hardware manufacturer.  libosmotrau previously
supported TRAU<->RTP conversion only for 16k format - add support
for HRv1 in 8k submux format.

Change-Id: I8ee01b73360501ca380a8695cbc7070ceaaba1be
The file was modified src/trau/trau_rtp_conv.c