https://osmocom.org/https://osmocom.org/favicon.ico?16647414092018-07-25T23:02:47ZOpen Source Mobile CommunicationsOsmocomBB - Feature #3419: TCH/H logical channel is not implementedhttps://osmocom.org/issues/3419?journal_id=104712018-07-25T23:02:47Zfixeria
<ul><li><strong>Blocks</strong> <i><a class="issue tracker-1 status-3 priority-2 priority-default closed" href="/issues/3256">Bug #3256</a>: BTS_Tests.ttcn: Encryption + RLL tests not executed on Lm channels (TCH/H)</i> added</li></ul> OsmocomBB - Feature #3419: TCH/H logical channel is not implementedhttps://osmocom.org/issues/3419?journal_id=107242018-08-11T12:00:59Zlaforge
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>In Progress</i></li><li><strong>Assignee</strong> changed from <i>fixeria</i> to <i>laforge</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>10</i></li></ul><p>I've more or less tried a 1:1 port from osmo-bts-trx but currently it's not working yet.</p>
<p>All received blocks cannot be decoded correctly yet:</p>
<pre>
<0006> sched_lchan_tchh.c:156 Received bad TCH frame ending at fn=692685 for TCH/H(0)
<0006> sched_lchan_tchh.c:156 Received bad TCH frame ending at fn=692689 for TCH/H(0)
<0006> sched_lchan_tchh.c:156 Received bad TCH frame ending at fn=692694 for TCH/H(0)
<0006> sched_lchan_tchh.c:156 Received bad TCH frame ending at fn=692698 for TCH/H(0)
<0006> sched_lchan_tchh.c:156 Received bad TCH frame ending at fn=692702 for TCH/H(0)
<0006> sched_lchan_tchh.c:156 Received bad TCH frame ending at fn=692707 for TCH/H(0)
<0006> sched_lchan_tchh.c:156 Received bad TCH frame ending at fn=692711 for TCH/H(0)
<0006> sched_lchan_tchh.c:156 Received bad TCH frame ending at fn=692715 for TCH/H(0)
<0006> sched_lchan_tchh.c:156 Received bad TCH frame ending at fn=692720 for TCH/H(0)
<0006> sched_lchan_tchh.c:156 Received bad TCH frame ending at fn=692724 for TCH/H(0)
<0006> sched_lchan_tchh.c:156 Received bad TCH frame ending at fn=692728 for TCH/H(0)
</pre> OsmocomBB - Feature #3419: TCH/H logical channel is not implementedhttps://osmocom.org/issues/3419?journal_id=107262018-08-11T13:52:32Zlaforge
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Stalled</i></li><li><strong>Assignee</strong> changed from <i>laforge</i> to <i>fixeria</i></li></ul><p>my code is in <code>laforge/trxcon-tchh</code> branch, and I'm currently a bit at a loss why it wouldn't work at all in either UL or DL.</p> OsmocomBB - Feature #3419: TCH/H logical channel is not implementedhttps://osmocom.org/issues/3419?journal_id=107272018-08-11T22:38:16Zfixeria
<ul><li><strong>Status</strong> changed from <i>Stalled</i> to <i>In Progress</i></li><li><strong>% Done</strong> changed from <i>10</i> to <i>30</i></li></ul><p>It seems, the answer is in GSM 05.02, clause 7 table 1/9:</p>
<ul>
<li>Unlike TCH/F, where a FACCH/F frame can be transmitted just by replacing any speech frame,<br /> transmission of a FACCH/H frame can only be initiated on particular frame numbers. We do know this.</li>
</ul>
<ul>
<li>The rules, which define frame numbers applicable for initiation of FACCH/H, <strong>are different for both DL and UL</strong>.<br /> This is why TCH/H <strong>implementation from <a class="wiki-page" href="https://osmocom.org/projects/osmobts/wiki">OsmoBTS</a> can not be used as-is</strong> in trxcon.</li>
</ul>
<p>Mapping of logical channels onto physical channels:</p>
<ul>
<li>FACCH/F:</li>
</ul>
<pre>
both UL/DL: B0(0...7), B1(4...11), B2(8...11,0...3)
</pre>
<ul>
<li>FACCH/H:</li>
</ul>
<pre>
FACCH/H0_UL: B0(0,2,4,6,8,10) B1(8,10,13,15,17,19) B2(17,19,21,23,0,2)
FACCH/H0_DL: B0(4,6,8,10,13,15) B1(13,15,17,19,21,23) B2(21,23,0,2,4,6)
FACCH/H1_UL: B0(1,3,5,7,9,11) B1(9,11,14,16,18,20) B2(18,20,22,24,1,3)
FACCH/H1_DL: B0(5,7,9,11,14,16) B1(14,16,18,20,22,24) B2(22,24,1,3,5,7)
</pre>
<p>I just hacked the code a bit (for sure, this is not the final solution):</p>
<pre>
diff --git a/src/host/trxcon/sched_lchan_tchh.c b/src/host/trxcon/sched_lchan_tchh.c
index 3823a5b3..45fc1633 100644
--- a/src/host/trxcon/sched_lchan_tchh.c
+++ b/src/host/trxcon/sched_lchan_tchh.c
@@ -60,7 +60,7 @@ int rx_tchh_fn(struct trx_instance *trx, struct trx_ts *ts,
* TCH/FACCH frame, because our burst buffer carries 6 bursts.
* Even FN ending at: 10,11,19,20,2,3
*/
- int fn_is_odd = (((fn + 26 - 10) % 26) >> 2) & 1;
+ int fn_is_odd = !((((fn + 26 - 10) % 26) >> 2) & 1);
/* Set up pointers */
lchan_desc = &trx_lchan_desc[lchan->type];
</pre>
<p>so now there are no Downlink decoding errors anymore, and I see LAPDm fill frames being decoded.</p> OsmocomBB - Feature #3419: TCH/H logical channel is not implementedhttps://osmocom.org/issues/3419?journal_id=107282018-08-12T09:10:07Zlaforge
<ul></ul><p>Hi Vadim,</p>
<p>thanks a lot for digging deeper and for finding another piece of the puzzle!</p>
<p>On Sat, Aug 11, 2018 at 10:38:17PM +0000, fixeria [REDMINE] wrote:</p>
<blockquote>
<p>so now there are no Downlink decoding errors anymore, and I see LAPDm fill frames being decoded.</p>
</blockquote>
<p>With the change of inverting fn_is_odd, I still get</p>
<p><0006> sched_lchan_tchh.c:160 Received bad TCH frame ending at fn=3317 for TCH/H(0): -1<br /><0006> sched_lchan_tchh.c:160 Received bad TCH frame ending at fn=3321 for TCH/H(0): -1<br /><0006> sched_lchan_tchh.c:160 Received bad TCH frame ending at fn=3325 for TCH/H(0): -1<br /><0006> sched_lchan_tchh.c:160 Received bad TCH frame ending at fn=3330 for TCH/H(0): -1<br /><0006> sched_lchan_tchh.c:160 Received bad TCH frame ending at fn=3334 for TCH/H(0): -1<br /><0006> sched_lchan_tchh.c:160 Received bad TCH frame ending at fn=3338 for TCH/H(0): -1<br /><0006> sched_lchan_tchh.c:160 Received bad TCH frame ending at fn=3343 for TCH/H(0): -1<br /><0006> sched_lchan_tchh.c:160 Received bad TCH frame ending at fn=3347 for TCH/H(0): -1<br /><0006> sched_lchan_tchh.c:160 Received bad TCH frame ending at fn=3351 for TCH/H(0): -1<br /><0006> sched_lchan_tchh.c:160 Received bad TCH frame ending at fn=3356 for TCH/H(0): -1<br /><0006> sched_lchan_tchh.c:160 Received bad TCH frame ending at fn=3360 for TCH/H(0): -1<br /><0006> sched_lchan_tchh.c:160 Received bad TCH frame ending at fn=3364 for TCH/H(0): -1<br /><0006> sched_lchan_xcch.c:106 Received bad data frame at fn=3288 (64/104) for SACCH/<abbr title="0">TH</abbr></p> OsmocomBB - Feature #3419: TCH/H logical channel is not implementedhttps://osmocom.org/issues/3419?journal_id=107292018-08-12T12:55:46Zfixeria
<ul></ul><p>Hi Harald,</p>
<blockquote>
<p>With the change of inverting fn_is_odd, I still get</p>
</blockquote>
<p>Yep, it was just a quick hack. It should facilitate decoding of some<br />Downlink frames, but not solve the problem at all.</p>
<p>I have been reading (and still reading) both GSM 05.02 and 05.03, and found some more important details:</p>
<ul>
<li>228 coded bits of <strong>a TCH/H speech frame are mapped on 4 consecutive bursts</strong>,<br />using the even numbered bits of the first 2 bursts and the odd numbered bits<br />of the last two bursts (see 3.2.3). So, every single burst carries 57 bits<br />of one coded speech frame, and 57 bits of another speech frame. This is<br />also called "diagonal interleaving".</li>
</ul>
<ul>
<li>456 coded bits of <strong>a FACCH/H frame are mapped on 6 consecutive bursts</strong>,<br />by stealing even bits of the first 2 bursts (hu=1), all bits of the middle 2 bursts<br />(both hu=1 and hl=1), and odd bits of the last 2 bursts (hl=1) (see 4.3.5).</li>
</ul>
<ul>
<li><strong>Two full consecutive speech frames are stolen</strong> by a FACCH/H frame (see 4.3.5).</li>
</ul>
<p>Now I need to understand how this is implemented in libosmocoding...</p> OsmocomBB - Feature #3419: TCH/H logical channel is not implementedhttps://osmocom.org/issues/3419?journal_id=107312018-08-12T21:38:16Zfixeria
<ul><li><strong>% Done</strong> changed from <i>30</i> to <i>80</i></li></ul><p>Good news!</p>
<p>I've managed to make TCH/H Uplink transmission work. A call was successfully established, so<br />at least signalling works now. Still need to clean up some parts of the Downlink implementation.</p>
<p>The world of the Half Rate is full of difficulties ;)<br />I will upload rebased changes to Gerrit soon...</p> OsmocomBB - Feature #3419: TCH/H logical channel is not implementedhttps://osmocom.org/issues/3419?journal_id=107662018-08-15T02:59:05Zfixeria
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Stalled</i></li><li><strong>% Done</strong> changed from <i>80</i> to <i>90</i></li></ul><p>I have uploaded a change set: <a class="external" href="https://gerrit.osmocom.org/10460/">https://gerrit.osmocom.org/10460/</a></p>
<p>I didn't tested the speech yet, but the signalling should work. The downlink part<br />of TCH/H implementation needs some additional modifications, in particular:</p>
<ul>
<li>the measurements should be calculated for all bursts carrying a frame,<br />i.e. 4 bursts for a speech frame, and 6 bursts for a FACCH/H frame;</li>
</ul>
<ul>
<li>the TDMA frame number calculation also should be done properly.</li>
</ul>
<p>So, let's keep the tip of this patch set WIP for now...</p> OsmocomBB - Feature #3419: TCH/H logical channel is not implementedhttps://osmocom.org/issues/3419?journal_id=110882018-08-30T20:03:40Zfixeria
<ul><li><strong>Status</strong> changed from <i>Stalled</i> to <i>In Progress</i></li></ul><p>Good news: speech on both DL and UL directions is working like a charm.<br />I am working on DL measurements and TDMA frame calculation now...</p> OsmocomBB - Feature #3419: TCH/H logical channel is not implementedhttps://osmocom.org/issues/3419?journal_id=111122018-09-02T18:35:29Zfixeria
<ul><li><strong>Target version</strong> set to <i>Improvement of the higher layers of OsmocomBB</i></li></ul> OsmocomBB - Feature #3419: TCH/H logical channel is not implementedhttps://osmocom.org/issues/3419?journal_id=113352018-09-13T17:10:18Zfixeria
<ul></ul><p>An updated patch set has been sent for review:</p>
<p>New Changes:<br /> <a class="external" href="https://gerrit.osmocom.org/10941">https://gerrit.osmocom.org/10941</a> trxcon/scheduler: fix: don't send BFI in GSM48_CMODE_SIGN mode<br /> <a class="external" href="https://gerrit.osmocom.org/10942">https://gerrit.osmocom.org/10942</a> trxcon/scheduler: introduce TDMA frame math helpers</p>
<p>Updated Changes:<br /> <a class="external" href="https://gerrit.osmocom.org/10459">https://gerrit.osmocom.org/10459</a> trxcon/scheduler: introduce TCH/H TDMA frame mapping helpres [WIP]<br /> <a class="external" href="https://gerrit.osmocom.org/10460">https://gerrit.osmocom.org/10460</a> trxcon/scheduler: add TCH/H channel support [WIP]</p>
<p>The problem with calculating the correct first frame number is solved,<br />while the measurements are still incorrect (can be fixed later).</p> OsmocomBB - Feature #3419: TCH/H logical channel is not implementedhttps://osmocom.org/issues/3419?journal_id=113362018-09-13T17:13:22Zfixeria
<ul></ul><p>There are also some decoding errors when changing the TCH mode:</p>
<pre>
<0005> sched_trx.c:263 (Re)configure TDMA timeslot #2 as TCH/H+SACCH
<0005> sched_trx.c:420 Activating lchan=TCH/H(0) on ts=2
<0005> sched_trx.c:420 Activating lchan=SACCH/TH(0) on ts=2
<0006> sched_lchan_xcch.c:96 Received incomplete data frame at fn=0 (0/104) for SACCH/TH(0)
<0006> sched_lchan_xcch.c:106 Received bad data frame at fn=0 (0/104) for SACCH/TH(0)
<0005> sched_clck.c:138 Clock indication: fn=22389
<0005> sched_clck.c:138 Clock indication: fn=22440
<0001> l1ctl.c:695 Received L1CTL_TCH_MODE_REQ (tch_mode=1, audio_mode=10)
<0005> sched_clck.c:138 Clock indication: fn=22491
<0006> sched_lchan_tchh.c:305 Received bad TCH frame ending at fn=22513 on TCH/H(0) (rc=-1)
<0006> sched_lchan_tchh.c:305 Received bad TCH frame ending at fn=22518 on TCH/H(0) (rc=-1)
<0006> sched_lchan_tchh.c:305 Received bad TCH frame ending at fn=22522 on TCH/H(0) (rc=-1)
<0006> sched_lchan_tchh.c:305 Received bad TCH frame ending at fn=22526 on TCH/H(0) (rc=-1)
<0005> sched_clck.c:138 Clock indication: fn=22542
<0005> sched_clck.c:138 Clock indication: fn=22593
<0005> sched_clck.c:138 Clock indication: fn=22644
<0005> sched_clck.c:138 Clock indication: fn=22695
<0005> sched_clck.c:138 Clock indication: fn=22746
<0005> sched_clck.c:138 Clock indication: fn=22797
</pre> OsmocomBB - Feature #3419: TCH/H logical channel is not implementedhttps://osmocom.org/issues/3419?journal_id=113712018-09-16T09:53:34Zfixeria
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Resolved</i></li><li><strong>% Done</strong> changed from <i>90</i> to <i>100</i></li></ul><p>Changes have been merged. Both traffic and FACCH/H are working.</p> OsmocomBB - Feature #3419: TCH/H logical channel is not implementedhttps://osmocom.org/issues/3419?journal_id=149202019-06-21T11:56:35Zptrkrysik
<ul><li><strong>Target version</strong> deleted (<del><i>Improvement of the higher layers of OsmocomBB</i></del>)</li></ul>