laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1d/+/27837 )
Change subject: octoi: slip frames if RIFO runs empty in IP->E1 direction
......................................................................
octoi: slip frames if RIFO runs empty in IP->E1 direction
If the RIFO runs dry, it means somehow the E1 side is pulling frames
faster than the IP side delivers them, and we need to insert/invent
frames to re-gain sync and avoid a situation where we perpetually
substitute frames.
There is some danger in doing this as there are two situations where
this can arise:
1) clock drift as explained above
2) packet loss > RIFO depth _without loss of sync_. In this case
the clocks run at the same speed, but more 100ms of packets were
lost.
As we unconditionally assume '1', we damage our clock sync in '2'. This
probably needs some additional analysis, i.e. look at the current rate
of frames inserted into the FIFO to differentiate '1' from '2'.
Change-Id: Ic2a714fedb9a0698c17ef22447904a803c26ebfc
---
M src/octoi/e1oip.c
M src/octoi/e1oip.h
M src/octoi/frame_rifo.c
M src/octoi/octoi.c
4 files changed, 19 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/37/27837/1
diff --git a/src/octoi/e1oip.c b/src/octoi/e1oip.c
index 6a5a240..38a22b5 100644
--- a/src/octoi/e1oip.c
+++ b/src/octoi/e1oip.c
@@ -44,7 +44,8 @@
#include "e1oip.h"
static const struct rate_ctr_desc iline_ctr_description[] = {
- [LINE_CTR_E1oIP_UNDERRUN] = { "e1oip:underrun", "Frames missing/substituted in IP->E1 direction"},
+ [LINE_CTR_E1oIP_UNDERRUN] = { "e1oip:underrun", "Frames underrun / slipped in IP->E1 direction"},
+ [LINE_CTR_E1oIP_SUBSTITUTED] = { "e1oip:substituted", "Frames substituted in IP->E1 direction"},
[LINE_CTR_E1oIP_OVERFLOW] = { "e1oip:overflow", "Frames overflowed in IP->E1 direction"},
[LINE_CTR_E1oIP_RX_OUT_OF_ORDER] = { "e1oip:rx:pkt_out_of_order", "Packets out-of-order in IP->E1 direction"},
[LINE_CTR_E1oIP_RX_OUT_OF_WIN] = { "e1oip:rx:pkt_out_of_win", "Packets out-of-rx-window in IP->E1 direction"},
diff --git a/src/octoi/e1oip.h b/src/octoi/e1oip.h
index 1a184d2..c0d3ed3 100644
--- a/src/octoi/e1oip.h
+++ b/src/octoi/e1oip.h
@@ -15,6 +15,7 @@
enum e1oip_line_ctr {
LINE_CTR_E1oIP_UNDERRUN,
+ LINE_CTR_E1oIP_SUBSTITUTED,
LINE_CTR_E1oIP_OVERFLOW,
LINE_CTR_E1oIP_RX_OUT_OF_ORDER,
LINE_CTR_E1oIP_RX_OUT_OF_WIN,
diff --git a/src/octoi/frame_rifo.c b/src/octoi/frame_rifo.c
index 94758e9..effe78d 100644
--- a/src/octoi/frame_rifo.c
+++ b/src/octoi/frame_rifo.c
@@ -131,13 +131,22 @@
/*! pull one frames out of the RIFO.
* \param rifo The RIFO from which we want to pull frames
* \param out Caller-allocated output buffer
- * \returns 0 on success; -1 on error (no frame available) */
+ * \returns 0 on success; -1 if no frame available; -2 if RIFO depth == 0 */
int frame_rifo_out(struct frame_rifo *rifo, uint8_t *out)
{
uint32_t next_out_bucket = (rifo->next_out - rifo->buf) / BYTES_PER_FRAME;
bool bucket_bit = bucket_bit_get(rifo, next_out_bucket);
int rc = 0;
+ if (frame_rifo_depth(rifo) == 0) {
+ /* if we don't have any RIFO depth at all, our jitter buffer has
+ * run empty and most likely there is some fundamental clock sync problem
+ * somewhere. In order to prevent perpetual substitution of frames from
+ * now onwards, we slip/insert one frame here by _not_ advancing next_out
+ * or next_out_fn and telling the caller to insert a frame */
+ return -2;
+ }
+
if (!bucket_bit) {
/* caller is supposed to copy/duplicate previous frame */
rc = -1;
diff --git a/src/octoi/octoi.c b/src/octoi/octoi.c
index 8585f0d..5f4c2f9 100644
--- a/src/octoi/octoi.c
+++ b/src/octoi/octoi.c
@@ -127,10 +127,14 @@
for (int i = 0; i < fts; i++) {
uint8_t *cur = buf + BYTES_PER_FRAME*i;
rc = frame_rifo_out(&iline->e1t.rifo, cur);
- if (rc < 0) {
- iline_ctr_add(iline, LINE_CTR_E1oIP_UNDERRUN, 1);
+ if (rc == -1) {
+ iline_ctr_add(iline, LINE_CTR_E1oIP_SUBSTITUTED, 1);
/* substitute with last received frame */
memcpy(cur, iline->e1t.last_frame, BYTES_PER_FRAME);
+ } else if (rc == -2) {
+ iline_ctr_add(iline, LINE_CTR_E1oIP_UNDERRUN, 1);
+ /* substitute with all-FF frame */
+ memset(cur, 0xff, BYTES_PER_FRAME);
}
}
iline_stat_set(iline, LINE_STAT_E1oIP_E1T_FIFO, frame_rifo_depth(&iline->e1t.rifo));
--
To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/27837
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-e1d
Gerrit-Branch: master
Gerrit-Change-Id: Ic2a714fedb9a0698c17ef22447904a803c26ebfc
Gerrit-Change-Number: 27837
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
Attention is currently required from: pespin.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-bts/+/27836
to look at the new patch set (#2).
Change subject: osmo-bts-trx: check if scheduling of [dummy] FACCH/H is allowed
......................................................................
osmo-bts-trx: check if scheduling of [dummy] FACCH/H is allowed
Currently (without this patch) if tch_dl_dequeue() yields nothing we're
scheduling dummy FACCH/H *regardless* if it's permitted to start at the
given TDMA FN or not. This may result in misaligned FACCH transmission,
so the MS will not able to decode anything and will report BER>0.
With this patch applied we a) schedule FACCH if it's allowed to start at
the current TDMA FN; b) send whatever was in the burst buffer (garbage)
if FACCH/H is not permitted. This is the best we can do without
introducing additional complexity. Ideally the upper layers should
guarantee that the queue is never empty, but currently this is not the
case.
Change-Id: I6f8af140a6ccf3d5fd7b98f6cb5c18e2c5e2f61b
Related: SYS#5919, OS#4823
---
M src/common/scheduler.c
M src/osmo-bts-trx/sched_lchan_tchh.c
2 files changed, 9 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/36/27836/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/27836
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I6f8af140a6ccf3d5fd7b98f6cb5c18e2c5e2f61b
Gerrit-Change-Number: 27836
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newpatchset
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-dev/+/27831 )
Change subject: osmo-add-gerrit-hooks.sh: do not use ssh host alias 'go'
......................................................................
osmo-add-gerrit-hooks.sh: do not use ssh host alias 'go'
... because it may not be defined. Specify the address explicitly.
Change-Id: I55c1501de61fe6b63be12b8e138742bd4b8baf64
---
M src/osmo-add-gerrit-hooks.sh
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
pespin: Looks good to me, but someone else must approve
fixeria: Looks good to me, approved; Verified
diff --git a/src/osmo-add-gerrit-hooks.sh b/src/osmo-add-gerrit-hooks.sh
index 1fbba38..05f1b90 100755
--- a/src/osmo-add-gerrit-hooks.sh
+++ b/src/osmo-add-gerrit-hooks.sh
@@ -13,7 +13,7 @@
for r in $(find . -maxdepth 2 -name '.git'); do
cd "$base/$r"
if [ ! -f "hooks/commit-msg" ]; then
- scp go:hooks/commit-msg hooks/
+ scp -P 29418 gerrit.osmocom.org:hooks/commit-msg hooks/
fi
sed -i 's/if (unprinted /if (0 \&\& unprinted /' hooks/commit-msg
done
--
To view, visit https://gerrit.osmocom.org/c/osmo-dev/+/27831
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-dev
Gerrit-Branch: master
Gerrit-Change-Id: I55c1501de61fe6b63be12b8e138742bd4b8baf64
Gerrit-Change-Number: 27831
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-dev/+/27831 )
Change subject: osmo-add-gerrit-hooks.sh: do not use ssh host alias 'go'
......................................................................
Patch Set 1: Verified+1 Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-dev/+/27831
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-dev
Gerrit-Branch: master
Gerrit-Change-Id: I55c1501de61fe6b63be12b8e138742bd4b8baf64
Gerrit-Change-Number: 27831
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 19 Apr 2022 20:39:26 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: pespin.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/27836 )
Change subject: osmo-bts-trx: check if scheduling of [dummy] FACCH/H is allowed
......................................................................
Patch Set 1:
(1 comment)
File src/osmo-bts-trx/sched_lchan_tchh.c:
https://gerrit.osmocom.org/c/osmo-bts/+/27836/comment/6a31ff75_9b743ebe
PS1, Line 414: if (!sched_tchh_dl_facch_map[br->fn % 26])
> I'm a bit lost here. […]
"Why first try to send dummy stuff" - where? This is not the case. Currently (without this patch) if tch_dl_dequeue() yields nothing we're scheduling dummy FACCH *regardless* if it's permitted to start at the given TDMA FN or not. This may result in misaligned FACCH transmission, so the MS will not able to decode anything and will report BER>0.
With this patch applied we a) schedule FACCH if it's allowed to start at the current TDMA FN; b) send whatever was in the burst buffer (garbage) if FACCH is not permitted. This is the best we can do without introducing additional complexity. Ideally the upper layers should guarantee that the queue is never empty, but currently this is not the case.
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/27836
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I6f8af140a6ccf3d5fd7b98f6cb5c18e2c5e2f61b
Gerrit-Change-Number: 27836
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 19 Apr 2022 20:35:27 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: pespin.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/27835 )
Change subject: osmo-bts-trx: tx_tchh_fn(): make handling of FACCH/H cleaner
......................................................................
Patch Set 1:
(1 comment)
File src/osmo-bts-trx/sched_lchan_tchh.c:
https://gerrit.osmocom.org/c/osmo-bts/+/27835/comment/ac4502e5_59716e7f
PS1, Line 395: msgb_free(msg); /* steal 2nd speech frame */
> by steal you mean drop here?
Ack, I can update the comment if you find it cleaner.
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/27835
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ib923b8f5cc1063e9fc18acd2bdd003fd09f4b70f
Gerrit-Change-Number: 27835
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 19 Apr 2022 19:20:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: fixeria.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/27836 )
Change subject: osmo-bts-trx: check if scheduling of [dummy] FACCH/H is allowed
......................................................................
Patch Set 1:
(1 comment)
File src/osmo-bts-trx/sched_lchan_tchh.c:
https://gerrit.osmocom.org/c/osmo-bts/+/27836/comment/848efed4_f05c2fd4
PS1, Line 414: if (!sched_tchh_dl_facch_map[br->fn % 26])
I'm a bit lost here. Why first try to send dummy stuff and later on check if it's time to send it? doesn't make more sense to directly first check if it's time to send it, and only then, try to send something?
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/27836
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I6f8af140a6ccf3d5fd7b98f6cb5c18e2c5e2f61b
Gerrit-Change-Number: 27836
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-CC: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 19 Apr 2022 19:13:28 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: fixeria.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/27835 )
Change subject: osmo-bts-trx: tx_tchh_fn(): make handling of FACCH/H cleaner
......................................................................
Patch Set 1:
(1 comment)
File src/osmo-bts-trx/sched_lchan_tchh.c:
https://gerrit.osmocom.org/c/osmo-bts/+/27835/comment/70434d2f_6dae4abb
PS1, Line 395: msgb_free(msg); /* steal 2nd speech frame */
by steal you mean drop here?
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/27835
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ib923b8f5cc1063e9fc18acd2bdd003fd09f4b70f
Gerrit-Change-Number: 27835
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-CC: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 19 Apr 2022 19:10:00 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment