laforge submitted this change.

View Change

Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved pespin: Looks good to me, but someone else must approve
coding: properly handle AFS_SID_UPDATE frames in DTX mode

There are two similar values in enum gsm0503_amr_dtx_frames:

* AFS_SID_UPDATE - precursor of SID UPDATE,
* AFS_SID_UPDATE_CN - the actual SID UPDATE.

The former is internally used by libosmocoding to mark the current
frame as a precursor of the actual SID UPDATE frame - the later.

+---+---+---+---+---+---+---+---+
| _ | _ | _ | _ | a | b | c | d | AFS_SID_UPDATE
+---+---+---+---+---+---+---+---+
| a | b | c | d | _ | _ | _ | _ | AFS_SID_UPDATE_CN
+---+---+---+---+---+---+---+---+

This is required because function gsm0503_tch_afs_decode_dtx() is
invoked by TDMA scheduler on every 4th received burst, while the
burst buffer is 8 bursts wide.

Currently, whenever gsm0503_detect_afs_dtx_frame() detects an
AFS_SID_UPDATE frame, we still attempt to decode it as a speech
or data below in gsm0503_tch_afs_decode_dtx(). This is indeed
a bug, which results in unexpected BER values:

* expected BER 0/212,
* actual BER 252/448.

We should return immediately once we have detected an AFS_SID_UPDATE.
This patch fixes unexpected BER-SUB values during DTXu silence periods.

Change-Id: I813081a4c0865958eee2496fe251ae17235ac842
Related: SYS#5853
---
M src/coding/gsm0503_coding.c
1 file changed, 1 insertion(+), 0 deletions(-)

diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c
index 6f19ed9..98439e3 100644
--- a/src/coding/gsm0503_coding.c
+++ b/src/coding/gsm0503_coding.c
@@ -2222,6 +2222,7 @@
tch_amr_reassemble(tch_data, conv, 39);
len = 5;
goto out;
+ case AFS_SID_UPDATE:
case AFS_ONSET:
len = 0;
goto out;

To view, visit change 28122. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I813081a4c0865958eee2496fe251ae17235ac842
Gerrit-Change-Number: 28122
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>
Gerrit-MessageType: merged