Skip to content
Success

Changes

Summary

  1. osmo_trau_frame_encode(): reduce space requirement in common case (details)
Commit 23341cd5ee4d28e9015d73b9283b2bdba1f375c0 by falcon
osmo_trau_frame_encode(): reduce space requirement in common case

Since its introduction in 2020, osmo_trau_frame_encode() API has had
the ability to emit TRAU-DL frames that are either lengthened or
shortened for timing adjustment, like real TRAUs do.  However, this
capability was never exercised in OsmoMGW-E1, nor is it used in the
new tw-e1abis-mgw: given the constraint of having to submit 160-byte
blocks to the E1 stack every 20 ms, it is not really feasible for
our current sw-only implementation to achieve the same 125 us timing
optimizations that are possible and desirable in a hardware or FPGA
implementation.

Since all current users of osmo_trau_frame_encode() API call it with
fr->dl_ta_usec set to 0, the doubled output space requirement imposed
by the function becomes an unnecessary burden and an API design bug
in need of fixing.  Solution: check fr->dir and fr->dl_ta_usec to see
if frame output lengthening is actually possible for each given
invocation of this function, and require doubled output space only
in those cases.

Change-Id: I9f3541b0618ebef26e53b69041e5b74abefd3b85
The file was modifiedsrc/trau/trau_frame.c