Attention is currently required from: jolly, pespin.
falconia has posted comments on this change by falconia. ( https://gerrit.osmocom.org/c/libosmo-netif/+/39280?usp=email )
Change subject: bring twjit into libosmo-netif
......................................................................
Patch Set 5:
(2 comments)
File src/twjit.c:
https://gerrit.osmocom.org/c/libosmo-netif/+/39280/comment/a5813703_ff54ac7… :
PS2, Line 504: rtph = osmo_rtp_get_hdr(msg);
> > this smooth packet flow will be delivered to the fixed timing application perfectly in order, with […]
The problem with your argument is that it violates the fundamental model of how twrtp+twjit solution is intended to be used. Please see my other reply to jolly's comment: the intended application of this library is to emulate, as faithfully as possible, what would happen if this RTP link were replaced with a true circuit-switched TDM connection. There are no marker bits in TDM, just a stream of G.711/CLEARMODE octets or Abis/Ater TRAU frames; presence of details such as comfort noise is an aspect of byte/frame stream content that is of no relevance to the transport mechanism, content which the transport mechanism is not allowed to mess with. In TDM-based GSM, if one BSS endpoint emits some number of gap-in-reception BFI frames in between valid speech frames, that gap MUST be delivered to the other end without any artificially induced phase shifts - while your obeyance to marker bits would cause said impermissible distortion.
But since neither of us will ever change the other's mind, it seems, I just started working on separating the "true" version of twrtp+twjit, the one intended for use in future ThemWi CN software (beyond currently deployed prototype) and in `tw-e1abis-mgw`, from the Osmocom submission version being considered here. Once all ThemWi software can safely use a version of twrtp+twjit over which I exercise sole authority, the purpose scope of the present `libosmo-netif` patches will be reduced to just providing something that OsmoBTS will be able to use. I will then be more amenable to implementing the option you insist on, as long as it can be disabled in ThemWi deployments.
File src/twjit.c:
https://gerrit.osmocom.org/c/libosmo-netif/+/39280/comment/adee7280_ccf9f3c… :
PS5, Line 486: msgb_free(new_msg);
> Is there a twjit instance for every payload type or one for the complete RTP connection?
The latter.
> telephone-event payload may (and will) have equal timestamps as the audio payload.
>
> There are codecs that split frames over several RTP packets. The sequence number increases, but the timestamp does not. (video codecs)
Both applications you are describing (telephone-event and video codecs) are explicitly, per design intent, outside the scope of application for ThemWi RTP endpoint library. This library is intended for those who have **no** love for packet world or for IETF inventions, who would not use RTP or any form of packet transport and would instead use only physical TDM circuits if one were infinitely rich, and who only do use RTP out of economic necessity.
A circuit-switched connection carried via RTP using twrtp library is meant to emulate, as faithfully as possible, how that connection would work in a true circuit-switched architecture: either a 64 kbit/s channel carrying G.711 or ISDN data, or a submultiplexed channel carrying Abis/Ater. When either of these two types of circuit-switched connection is represented in RTP (using TW-TS-001 and TW-TS-002 to represent classic Abis/Ater, or using standard PCMU, PCMA or CLEARMODE payload formats for 64 kbit/s realm), the stream is expected to be perfectly smooth and continuous, with every emitted packet showing a timestamp increment of 160 units without fail. Shenanigans like you just described cannot occur in this environment.
If the next objection is going to be along the lines of "that mentality does not belong in Osmocom", my response is: the whole reason why I seek to merge some version of twrtp into `libosmo*` is to make it possible (as an option) to use twrtp+twjit in OsmoBTS, instead of Belledonne ortp. I operate a production network where the BTS end of Abis RTP links is OsmoBTS, while the CN end (where Abis has conceptually turned into Ater) is Themyscira Wireless CN software using an external, not Osmo-incorporated, version of twrtp+twjit. Thus for UL traffic flowing from OsmoBTS to CN, the jitter buffer algorithm is mine, which is what I want. Now I seek to be able to use the same jitter buffer algorithm for the opposite traffic direction on the same link, as opposed to the mystery black box algorithm of Belledonne ortp - hence a need to be able to use the same jitter buffer algorithm in OsmoBTS.
P.S. Ater is the not-quite-standardized name used by some vendors of TDM-based GSM BSS for the interface between the BSC and the MSC-colocated TRAU bank, carrying the same formats as Abis, but sharing the hierarchical position of A rather than Abis. In the context of Osmocom+ThemWi, when AoIP interface has been modified to use TW-TS formats, it effectively becomes Ater over IP.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/39280?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Ia3be5834571ca18b68939abbcf1ce3a879156658
Gerrit-Change-Number: 39280
Gerrit-PatchSet: 5
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: jolly <andreas(a)eversberg.eu>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 19 Aug 2025 19:18:46 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: jolly <andreas(a)eversberg.eu>
Comment-In-Reply-To: falconia <falcon(a)freecalypso.org>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Attention is currently required from: jolly.
laforge has posted comments on this change by jolly. ( https://gerrit.osmocom.org/c/libosmocore/+/40854?usp=email )
Change subject: osmo_io: Add unit test to verify segmentation process
......................................................................
Patch Set 3: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/40854?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I7d8feba9c8e8386c9fd144669f6ccd01d6bbbabb
Gerrit-Change-Number: 40854
Gerrit-PatchSet: 3
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
Gerrit-Comment-Date: Tue, 19 Aug 2025 15:23:47 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: falconia.
pespin has posted comments on this change by falconia. ( https://gerrit.osmocom.org/c/libosmo-netif/+/39280?usp=email )
Change subject: bring twjit into libosmo-netif
......................................................................
Patch Set 5:
(1 comment)
File src/twjit.c:
https://gerrit.osmocom.org/c/libosmo-netif/+/39280/comment/ca883c9f_1e2fa7d… :
PS2, Line 504: rtph = osmo_rtp_get_hdr(msg);
> this smooth packet flow will be delivered to the fixed timing application perfectly in order, without any disruptions - and I argue that this behavior is the best
In here you are assuming that with an M bit set and no gap in the timestamp sequence means the data just be placed in sequence, which doesn't need to be necessarily the case. IMHO it makes more sense to apply handover since the newer flow after the M bit is the current one, which should take precedence over the old one. Otherwise it's like keep playing soft noise or music while there's already talk waiting to be played.
> With my current algorithm, the duration of the gap delivered to the fixed timing application will be exactly what the RTP sender indicated in its timestamps
No, it won't, because iiuc, due to the M bit, the timestamps before and after it are non-related. The fact that they may have some gap or not may be totally circumstantial.
So to me you are treating the case where the new supposedly randomly taken tiemstamp (due to M bit) is in the 160-sequence different than the other 159 cases.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/39280?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Ia3be5834571ca18b68939abbcf1ce3a879156658
Gerrit-Change-Number: 39280
Gerrit-PatchSet: 5
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: jolly <andreas(a)eversberg.eu>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: falconia <falcon(a)freecalypso.org>
Gerrit-Comment-Date: Tue, 19 Aug 2025 14:17:47 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: falconia <falcon(a)freecalypso.org>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Attention is currently required from: falconia, pespin.
jolly has posted comments on this change by falconia. ( https://gerrit.osmocom.org/c/libosmo-netif/+/39280?usp=email )
Change subject: bring twjit into libosmo-netif
......................................................................
Patch Set 5:
(1 comment)
File src/twjit.c:
https://gerrit.osmocom.org/c/libosmo-netif/+/39280/comment/489ebdbb_3dbbe7b… :
PS5, Line 486: msgb_free(new_msg);
Is there a twjit instance for every payload type or one for the complete RTP connection?
telephone-event payload may (and will) have equal timestamps as the audio payload.
There are codecs that split frames over several RTP packets. The sequence number increases, but the timestamp does not. (video codecs)
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/39280?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Ia3be5834571ca18b68939abbcf1ce3a879156658
Gerrit-Change-Number: 39280
Gerrit-PatchSet: 5
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: jolly <andreas(a)eversberg.eu>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: falconia <falcon(a)freecalypso.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 19 Aug 2025 13:56:26 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: pespin.
falconia has posted comments on this change by falconia. ( https://gerrit.osmocom.org/c/libosmo-netif/+/39280?usp=email )
Change subject: bring twjit into libosmo-netif
......................................................................
Patch Set 5:
(1 comment)
File src/twjit.c:
https://gerrit.osmocom.org/c/libosmo-netif/+/39280/comment/62e74621_c69d26c… :
PS2, Line 504: rtph = osmo_rtp_get_hdr(msg);
> Thanks. After having read your document: […]
I still disagree. To see why, let us consider a scenario in which you (presumably) believe checking M bit would make a difference. This purported scenario would have to have these two properties:
* SSRC stays the same, or else twjit would consider it a handover;
* All timestamp increments are integral multiples of 160, for the same reason;
* Sequence number does not matter at all, as twjit does not look at it except for staff-oriented counters and RTCP-mandated analytics - it does not affect any of twjit's actual decisions.
With the above prerequisites established, the next question is: gap or no gap? Consider the no-gap case first: there is a perfectly smooth, uninterrupted flow of RTP packets, but one of them has M bit set. With current code, this smooth packet flow will be delivered to the fixed timing application perfectly in order, without any disruptions - and I argue that this behavior is the best. Your proposal of treating M bit as handover would cause twjit state transition to HANDOVER, which would result either in some packets before the handover event being dropped if the new flow becomes ready (flow start criteria) soon enough, or in a gap (not present in the incoming stream) being fed to the output if the old flow underruns before the new one is ready. How would such behavior be any better than what I have currently?
Now consider M bit preceded by a gap: some packets omitted, then an RTP packet with M bit set. Here the question becomes: underrun or no underrun? If the gap is long enough for twjit to experience an underrun before the flow resumes, then it makes no difference whether the flow-resuming packet has M bit set or not: twjit is starting from EMPTY state in this case. Now consider the no-underrun case: the configured buffer depth is high enough, and the gap short enough, to where the flow-resuming packet arrives before the buffer underruns. With my current algorithm, the duration of the gap delivered to the fixed timing application will be exactly what the RTP sender indicated in its timestamps; with your proposed modification, the gap would be unpredictably lengthened or shortened based on how long it takes for the post-handover flow to reach ready state. How is your way any better?
In summary, I still fail to see *even one* scenario in which your proposed modification to my core algorithm would make an improvement.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/39280?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Ia3be5834571ca18b68939abbcf1ce3a879156658
Gerrit-Change-Number: 39280
Gerrit-PatchSet: 5
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 18 Aug 2025 17:58:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: falconia <falcon(a)freecalypso.org>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>