Project

General

Profile

Bug #1801

AMR DTX: downlink logic flawed

Added by laforge over 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
08/20/2016
Due date:
% Done:

100%

Spec Reference:

Description

The AMR DTX logic operates as follows:
  • if there is an incoming downlink RTP frame in the queue for this lchan, send it
  • else, generate PH-EMPTY-FRAME.req or PH-DATA.req with SID payload, depending on time (also broken, see #1799)

This is flawed, as it assumes that the incoming RTP stream is always well-formed and -timed. It would for example also mean that a RTP stream with lots of extra SID frames (more than every 160ms) would result in all of those SID frames transmitted over the radio interface, where the spec says we should only transmit one SID_UPDATE every 160ms.

To quote a rule from IETF: we should be conservative in what we send and tolerant in what we receive.


Related issues

Related to OsmoBTS - Bug #1799: AMR DTX: last_sid should operate on codec frame intervals (20ms), not gsm frame numberClosed08/20/2016

Related to OsmoBTS - Bug #1800: AMR DTX: lchan->tch.last_sid is never populated with save_last_sid()Closed08/20/2016

Related to OsmoBTS - Bug #1803: osmo-bts-litecell15: AMR FR: some RTP buffers are never releasedClosed08/20/2016

Related to OsmoBTS - Bug #1802: AMR DTX Downlink: We are not sending ONSET ?!?Closed08/20/2016

Related to OsmoBTS - Bug #1892: AMR half rate crashes osmo-btsClosed12/20/2016

Associated revisions

Revision 70460814 (diff)
Added by max over 4 years ago

DTX: fix SID logic

Previously receiving SID via RTP always caused it's transmission to L1
regardless of the time which might have resulted in excess traffic. Fix
this by only saving SID data and transmitting it later on as necessary
according to 3GPP TS 26.093 A.5.1.1.

Change-Id: Ifcdc5c60d0238b704a94f6778d4e00f2b087b090
Fixes: OS#1801

Revision 9f9b96a6 (diff)
Added by max over 4 years ago

DTX: fix conversion from fn to ms

Previously FN was converted to millisecondss incorrectly due to wrong
conversion between FN and a number of voice samples. The conversion
should be based on following:
  • there are 12/13 useful frames for audio in TCH
  • there is 1 RTP packet per 4 frame
  • there are 160 samples per RTP packet

Fixes: OS#1801
Change-Id: I9cc70cacabde98621aa892cee74f4ac461645093

Revision ced9a5d0 (diff)
Added by max over 4 years ago

Fix DTX DL AMR SIDscheduling logic

Previously SID UPDATE was sometimes scheduled incorrectly. Fix this by:
  • avoid rounding error when computing scheduling time difference from FN
  • properly saving and updating cached SID type and FN

Change-Id: I7acffae4792e7bddc2ae19a2f04ee921dc194c36
Related: OS#1801

Revision 64a2bd72 (diff)
Added by max over 4 years ago

Add tools to check DTX operation

  • superfemto.sh can parse superfemto-compatible DSP log output to
    properly sort records into MT/MO and DL/UL parts
  • dtx_check.gawk can process output of superfemto.sh and check for
    common scheduling errors

This allows to check lc15 and sysmo for errors in DTX DL scheduling. As
dtx_check.gawk is generic it can be used with any other BTS hw (or
virtual BTS) as long as raw logs from this hw can be converted to simple
input format 'FN EVENT' per-line.

Change-Id: Ib1c70c4543b24c2a05a7df8eec5ce3f4eda2c02e
Related: OS#1801

Revision 1b76a03c (diff)
Added by max over 4 years ago

DTX DL: Add FACCH cache

When DL DTX is active and silent period is in progress dtx.cache is
populated by SID UPDATE message which about to be scheduled next. If at
that moment FACCH message arrives (which have higher priority) we have
to send ONSET message to L1 but we can't invalidate cache with SID
UPDATE as it will be used for SID FIRST message to resume silent period
after FACCH transmission is over (provided there were no incoming voice
in between). Hence the necessity for separate buffer to store content of
FACCH message while we're sending ONSET to L1 while keeping SID UPDATE
cached.

Change-Id: I316e81af893b24766bf259baaed7a0be75a11694
Related: OS#1801

Revision 10688371 (diff)
Added by max over 4 years ago

DTX DL: Add FACCH cache

When DL DTX is active and silent period is in progress dtx.cache is
populated by SID UPDATE message which about to be scheduled next. If at
that moment FACCH message arrives (which have higher priority) we have
to send ONSET message to L1 but we can't invalidate cache with SID
UPDATE as it will be used for SID FIRST message to resume silent period
after FACCH transmission is over (provided there were no incoming voice
in between). Hence the necessity for separate buffer to store content of
FACCH message while we're sending ONSET to L1 while keeping SID UPDATE
cached.

Change-Id: I316e81af893b24766bf259baaed7a0be75a11694
Related: OS#1801

Revision acfccb3f (diff)
Added by max over 4 years ago

DTX fix ONSET handling

  • re-introduce ST_ONSET_F to guard from repetitive ONSET messages in case
    multiple FACCH occur duriing DTX silence period.
  • produce ONSET event after both SID FIRST and UPDATE in case of AMR FR.
  • always dispatch E_SID_F (SID FIRST) signal if in talkspurt.
  • allow E_SID_* right after ONSET (zero-length talkspurt).
  • add missing E_ONSET signal description.
  • fix FSM transitions for AMR HR Inhibited and First P.
  • fix incorrect return from l1if_tch_encode() in ONSET FACCH with
    incoming SID UPDATE

Change-Id: I0e9033c5f169da46aed9a0d1295faff489778dcf
Related: OS#1801

Revision 55a7b074 (diff)
Added by max over 4 years ago

DTX: add explicit check if DTX enabled

Check explicitly if DTX is enabled for AMR before checking if SID frame
repetition is optional.

Change-Id: I660688d56505798cade1495c30338fd6806a3259
Related: OS#1801

Revision fed8ce3c (diff)
Added by max over 4 years ago

DTX: fix TS adjustment for ONSET

Previously timestamp was always adjusted according to FN difference. In
case of ONSET event this causes unnecessary TS gap with subsequent
speech packet. Fix this by checking Marker bit before performing
adjustment.

Change-Id: I9bf4b45aa990dd4014334dd846f43f793366056c
Related: OS#1801

Revision f9778b2a (diff)
Added by max over 4 years ago

DTX AMR HR: fix inhibition

  • Unlike in AMR FR, in AMR HR incoming ONSET have to be treated
    differently depending on whether we've recently sent SID UPDATE or
    EMPTY frame. Split ST_SID_U FSM state into 2 states to accommodate for
    that and make sure that additional states specific to AMR HR are not
    used for AMR FR.
  • Avoid sending E_VOICE and E_SID_U in corresponding states
    as those do not initiate FSM state transitions anyway. This decrease
    extra load from FSM signalling which otherwise would be triggered on
    per-frame basis.
  • Introduce separate signal for SID First P1 -> P2 transition to avoid
    confusion with E_COMPL and E_SID_U initiated transitions from P1
    state.
  • Don't init DTX FSM for SDCCH channels.

Change-Id: I229ba39a38a223fada4881fc9aca35d3639371f8
Related: OS#1801

Revision d02c8af6 (diff)
Added by jfdionne over 4 years ago

DTX: fix AMR SID-FIRST detection

Max's note: adjusted test output.

Change-Id: I46477c631bf86345cb757f31d7f2e2935b12adcc
Related: OS#1801

Revision b76043e6 (diff)
Added by jfdionne over 4 years ago

DTX: fix SID-FIRST detection

Max's note: made similar modification to osmo-bts-sysmo/tch.c

Change-Id: I76e62783b73803dfc0d32693a68020a9d89878b8
Related: OS#1801

Revision 42ffb325 (diff)
Added by jfdionne over 4 years ago

DTX: fix "unexpected burst" error

Fix error during FACCH interruption of DTX for AMR HR.

Max's note: added fix for sysmobts.

Change-Id: Ib064952331b4f89676ee68a3d8078b1d9debe570
Related: OS#1801

History

#1 Updated by laforge over 4 years ago

  • Description updated (diff)

#2 Updated by laforge over 4 years ago

  • Related to Bug #1799: AMR DTX: last_sid should operate on codec frame intervals (20ms), not gsm frame number added

#3 Updated by laforge over 4 years ago

  • Related to Bug #1800: AMR DTX: lchan->tch.last_sid is never populated with save_last_sid() added

#4 Updated by laforge over 4 years ago

#5 Updated by laforge over 4 years ago

  • Related to Bug #1803: osmo-bts-litecell15: AMR FR: some RTP buffers are never released added

#6 Updated by laforge over 4 years ago

  • Assignee changed from sysmocom to msuraev

#7 Updated by msuraev over 4 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 20

Fix available as gerrit #858.

#8 Updated by msuraev over 4 years ago

  • % Done changed from 20 to 80

Should be fixed by gerrit # 1029 and corresponding fixes from related bugs.

#9 Updated by msuraev over 4 years ago

  • Related to Bug #1802: AMR DTX Downlink: We are not sending ONSET ?!? added

#10 Updated by msuraev over 4 years ago

  • File dtx.dot added

Not sure what's the right place for .dot file so attaching current version here for the time being.

#11 Updated by msuraev over 4 years ago

AMR FR is working fine with #rtp jitter-buffer 0'.

#12 Updated by ylebel over 4 years ago

Je serai absent pour la période du 19 décembre 2016 au 3 février 2017 inclusivement. Pour toute question, contactez M. David Bourget à l'adresse . ************************************************* I'll be out of the office from December 19th 2016 to February 3rd 2017 inclusively. If you need immediate assistance, please contact Mr David Bourget at .

#13 Updated by msuraev over 4 years ago

Remaining AMR HR issues:
- FACCH insertion: proper use of SID_FIRST_INH (if SID_FIRST_P1 was used before FACCH) and SID_UPDATE_INH (if SID_UPDATE was used before FACCH)
- SID_UPDATE_INH is not sent to L1 in downlink
- SID_FIRST_INH is not sent to L1 in downlink
- Undesired speech frame during DTX seems to mess up the FSM. SID_UPDATE becomes SID_FIRST_P1

Note: this has not been re-tested with latest master yet.

#14 Updated by msuraev over 4 years ago

  • Related to Bug #1892: AMR half rate crashes osmo-bts added

#15 Updated by msuraev over 4 years ago

  • File deleted (dtx.dot)

#16 Updated by msuraev over 4 years ago

gerrit# 1508 should fix AMR HR problem with inhibition by voice frames. FACCH for AMR HR is WIP.

#17 Updated by msuraev over 4 years ago

Gerrit # 1611 should fix the issue with FACCH for AMR HR.

#18 Updated by msuraev over 4 years ago

  • Status changed from In Progress to Stalled

#19 Updated by msuraev about 4 years ago

  • Status changed from Stalled to Resolved
  • % Done changed from 80 to 100

All fixes has been merged, docs update will follow up shortly.

#20 Updated by laforge about 4 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)