Project

General

Profile

Bug #2439

Updated by pespin over 6 years ago

* 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: 

 # A received -> added to the batch. 
 # D received (out of order) -> a gap is detected, so A is cloned into B and C. 
 # B received -> it is found in the batch, so it's discarded. 
 # 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: 

 # A received -> added to the batch. 
 # D received (out of order) -> a gap is detected, so A is cloned into B and C. 
 # 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. 
 # 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: 
 <pre> 
 <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 
 </pre> 


 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.

Back

Add picture from clipboard (Maximum size: 48.8 MB)