Project

General

Profile

Actions

Bug #2439

open

Osmux: overwrite duplicated RTP packets instead of dropping them

Added by pespin over 6 years ago. Updated over 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
08/14/2017
Due date:
% Done:

0%

Spec Reference:

Description

  • There's a check in osmux.c osmux_batch_add() which checks if the RTP packet arriving is already in the Osmux batch (by comparing seq num), and in case it's found, the newly arrived packet is discarded.
  • In osmux there code too to re-create lost RTP packets by detecting gaps and cloning the last received RTP packet.

Both statements don't play well together, because this means a lot of times we have unordered packet, eg. A, B, C, D:

  1. A received -> added to the batch.
  2. D received (out of order) -> a gap is detected, so A is cloned into B and C.
  3. B received -> it is found in the batch, so it's discarded.
  4. C received -> it is found in the batch, so it's discarded.

Which means we end up with payload AAAD instead of ABCD we could easily have by overwriting the received payload in the batch, eg. same scenario:

  1. A received -> added to the batch.
  2. D received (out of order) -> a gap is detected, so A is cloned into B and C.
  3. B received -> it is found in the batch, so previous B (cloned A) is freed and new B payload is put instead in its position.
  4. C received -> it is found in the batch, so previous C (cloned A) is freed and new C payload is put instead in its position.

I can see this in an environment I have set up with osmo-bsc_mgcp and osmo-bsc_nat:

<0023> /home/data/pespin/bin/../git/libosmo-netif/src/osmux.c:513 adding cloned RTP
<0023> /home/data/pespin/bin/../git/libosmo-netif/src/osmux.c:513 adding cloned RTP
<0023> /home/data/pespin/bin/../git/libosmo-netif/src/osmux.c:513 adding cloned RTP
<0023> /home/data/pespin/bin/../git/libosmo-netif/src/osmux.c:513 adding cloned RTP
<0023> /home/data/pespin/bin/../git/libosmo-netif/src/osmux.c:619 already exists message with seq=36463, skip it
<0023> /home/data/pespin/bin/../git/libosmo-netif/src/osmux.c:619 already exists message with seq=17, skip it
<0023> /home/data/pespin/bin/../git/libosmo-netif/src/osmux.c:226 too many messages for this RTP ssrc=37798033
...
<0023> /home/data/pespin/bin/../git/libosmo-netif/src/osmux.c:513 adding cloned RTP
<0023> /home/data/pespin/bin/../git/libosmo-netif/src/osmux.c:513 adding cloned RTP
<0023> /home/data/pespin/bin/../git/libosmo-netif/src/osmux.c:619 already exists message with seq=22128, skip it
<0023> /home/data/pespin/bin/../git/libosmo-netif/src/osmux.c:619 already exists message with seq=51217, skip it

I plan to work on this once I am done with a change to improve the code handling lost packets (patch is done but I'm facing some issues).

Fixing this issue I think would improve audio noise during the calls.


Related issues

Blocked by libosmo-netif - Bug #2440: Osmux: Improve lost packet recreation mechanismNew08/14/2017

Actions
Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)