<p style="white-space: pre-wrap; word-wrap: break-word;">I think we have it now. We can detect DTX frames and get an n_errors/n_bits_total rating for detected frames. If we do not detect a DTX frame the code assumes that the frame is a normal speech frame and everything continues as normal.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/17095">View Change</a></p><p>23 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/17095/2//COMMIT_MSG">Commit Message:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/17095/2//COMMIT_MSG@12">Patch Set #2, Line 12:</a> <code style="font-family:monospace,monospace">caller can be informed about this</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">about this? "this" means that the decoder is not able to handle dtx frames? or that it now supports  […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">I am not there yet, it is correct that the decoder can not decode the DTX frames yet. However, we only need to decode SID_UPDATE frames, all other frames do not contain audio information, they just tell us if DTX is switched on or off. However, the upper layers must know that those frames are present to compute the measurement results correctly. I will get back to this commit message when the patch is done.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/17095/5/include/osmocom/coding/gsm0503_amr_dtx.h">File include/osmocom/coding/gsm0503_amr_dtx.h:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/17095/5/include/osmocom/coding/gsm0503_amr_dtx.h@30">Patch Set #5, Line 30:</a> <code style="font-family:monospace,monospace">static inline const char *gsm0503_amr_dtx_frame_name(uint8_t frame)</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">not uint8_t, but enum gsm0503_amr_dtx_frames</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/17095/2/include/osmocom/coding/gsm0503_amr_dtx.h">File include/osmocom/coding/gsm0503_amr_dtx.h:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/17095/2/include/osmocom/coding/gsm0503_amr_dtx.h@35">Patch Set #2, Line 35:</a> <code style="font-family:monospace,monospace">uint8_t gsm0503_detect_afs_dtx_frame(ubit_t * ubits);</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">we usually use "*ubits", not "* ubits"</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/17095/2/include/osmocom/coding/gsm0503_coding.h">File include/osmocom/coding/gsm0503_coding.h:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/17095/2/include/osmocom/coding/gsm0503_coding.h@70">Patch Set #2, Line 70:</a> <code style="font-family:monospace,monospace">int gsm0503_tch_ahs_decode_dtx(uint8_t *tch_data, const sbit_t *bursts, int odd,</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">int odd probably means true/false, so it can be a bool?</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">gsm0503_tch_ahs_decode_dtx is a new variant of gsm0503_tch_ahs_decode, The int odd variable is part of the existing API, changing this would be out of the scope of this patch.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/17095/2/src/coding/gsm0503_amr_dtx.c">File src/coding/gsm0503_amr_dtx.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/17095/2/src/coding/gsm0503_amr_dtx.c@44">Patch Set #2, Line 44:</a> <code style="font-family:monospace,monospace">ubit_t</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">const</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/17095/2/src/coding/gsm0503_amr_dtx.c@47">Patch Set #2, Line 47:</a> <code style="font-family:monospace,monospace">        ubit_t id_marker[] = { 0, 1, 0, 0, 1, 1, 1, 1, 0 };</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">static const</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/17095/2/src/coding/gsm0503_amr_dtx.c@60">Patch Set #2, Line 60:</a> <code style="font-family:monospace,monospace">                 ubits++;</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">you are ncreasing ubits 4 times +1 here, and later on you increase it 4 times afterwards. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Yes it is correct. The id_marker appears for 4 bits, then there are 4 bits uninteresting bits which need to be jumped over and then there are again 4 bits of id_marker and so on. So it is correct.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/17095/2/src/coding/gsm0503_amr_dtx.c@68">Patch Set #2, Line 68:</a> <code style="font-family:monospace,monospace"> if (errors < count * 4 / 8)</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">return (errors < count * 4 / 8);</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/17095/2/src/coding/gsm0503_amr_dtx.c@73">Patch Set #2, Line 73:</a> <code style="font-family:monospace,monospace">static bool detect_ahs_id_marker(ubit_t * ubits, ubit_t * id_marker)</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Same kind of comments apply for other functions in this file.</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/17095/2/src/coding/gsm0503_amr_dtx.c@73">Patch Set #2, Line 73:</a> <code style="font-family:monospace,monospace">ubit_t</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">const</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/17095/2/src/coding/gsm0503_amr_dtx.c@96">Patch Set #2, Line 96:</a> <code style="font-family:monospace,monospace">static bool detect_interleaved_ahs_id_marker(ubit_t * ubits, ubit_t * id_marker)</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">const uibt_t *id_marker.</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/17095/2/src/coding/gsm0503_amr_dtx.c@122">Patch Set #2, Line 122:</a> <code style="font-family:monospace,monospace">ubit_t</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">const</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/17095/2/src/coding/gsm0503_amr_dtx.c@125">Patch Set #2, Line 125:</a> <code style="font-family:monospace,monospace">{ 0, 0, 0, 0 };</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">could be just ... […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/17095/2/src/coding/gsm0503_amr_dtx.c@147">Patch Set #2, Line 147:</a> <code style="font-family:monospace,monospace">ubit_t</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">const</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/17095/2/src/coding/gsm0503_amr_dtx.c@151">Patch Set #2, Line 151:</a> <code style="font-family:monospace,monospace">{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">could be just ... […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/17095/2/src/coding/gsm0503_amr_dtx.c@211">Patch Set #2, Line 211:</a> <code style="font-family:monospace,monospace">   ubit_t id_marker[] = { 0, 1, 0, 0, 1, 1, 1, 1, 0 };</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Ack</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/17095/2/src/coding/gsm0503_amr_dtx.c@252">Patch Set #2, Line 252:</a> <code style="font-family:monospace,monospace">uint8_t gsm0503_detect_afs_dtx_frame(ubit_t * ubits)</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">return is of type enum gsm0503_amr_dtx_frames</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/17095/2/src/coding/gsm0503_amr_dtx.c@266">Patch Set #2, Line 266:</a> <code style="font-family:monospace,monospace">uint8_t gsm0503_detect_ahs_dtx_frame(ubit_t * ubits)</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">return is of type enum gsm0503_amr_dtx_frames</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/17095/5/src/coding/gsm0503_amr_dtx.c">File src/coding/gsm0503_amr_dtx.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/17095/5/src/coding/gsm0503_amr_dtx.c@34">Patch Set #5, Line 34:</a> <code style="font-family:monospace,monospace">        { AFS_SID_FIRST, "AFS_SID_FIRST" },</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">If possible please align the strings.</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/17095/5/src/coding/gsm0503_amr_dtx.c@138">Patch Set #5, Line 138:</a> <code style="font-family:monospace,monospace">14 - ones[k]</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">each ones item (onces[k]) is increased at most 14 times by previous loops, and each time += ubits[k] […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/17095/5/src/coding/gsm0503_amr_dtx.c@157">Patch Set #5, Line 157:</a> <code style="font-family:monospace,monospace">                    ones[k] += ubits[0];</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">shouldn't this be ubits[k] perhaps?</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">This is indeed a bit irretating. I need to access every 2nd ubit, this is done by incrementing the ubits pointer by two every time and accessing always the first element. I have now changed it a bit to make it more clear.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/17095/2/src/coding/gsm0503_coding.c">File src/coding/gsm0503_coding.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/17095/2/src/coding/gsm0503_coding.c@2098">Patch Set #2, Line 2098:</a> <code style="font-family:monospace,monospace">*  \param[out] dtx DTX frame type</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">This looks wrong, gsm0503_tch_afs_decode() has no such parameter.</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/17095/2/src/coding/gsm0503_coding.c@2166">Patch Set #2, Line 2166:</a> <code style="font-family:monospace,monospace">                  printf("%u", cBd[i]);</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">I'm sure that shouldn't be there.</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/17095">change 17095</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/libosmocore/+/17095"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I2bbdb39ea20461ca08b2e6f1a33532cb55cd5195 </div>
<div style="display:none"> Gerrit-Change-Number: 17095 </div>
<div style="display:none"> Gerrit-PatchSet: 10 </div>
<div style="display:none"> Gerrit-Owner: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Tue, 17 Mar 2020 12:36:56 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Comment-In-Reply-To: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Comment-In-Reply-To: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: comment </div>