<p dir="ltr">Hi Max,</p>
<p dir="ltr">Could you explain what are you trying to solve? I may be able to help, but I don't really understand what you're trying to achieve.</p>
<p dir="ltr">Your conversion to ms is wrong. Narrowband codecs have 8000 samplerate, so with 160 samples in a packet, packet duration is 160/8000 = 20ms. But I don't see why do you need this conversion? I would think that working with samples is a better approach, because you operate with integers and don't have issues associated with floating numbers (rounding issues, comparison requires epsilon, etc).</p>
<p dir="ltr">Please excuse typos. Written with a touchscreen keyboard.</p>
<p dir="ltr">--<br>
Regards,<br>
Alexander Chemeris<br>
CEO Fairwaves, Inc.<br>
<a href="https://fairwaves.co">https://fairwaves.co</a></p>
<div class="gmail_quote">On Jun 1, 2016 6:19 PM, "Max" <<a href="mailto:msuraev@sysmocom.de">msuraev@sysmocom.de</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi.<br>
<br>
Right now in osmobts when sending/receiving frames with osmo_rtp_* it's<br>
assumed that no frame is lost and timestamp is always advanced in 160ms<br>
steps. In practice (especially when DTX is in place) frames do get lost<br>
so we have to adjust the step to compensate.<br>
<br>
I've tried to do it as follows:<br>
- store frame number of last used frame on receiving/sending<br>
- check how far current frame number from old one<br>
- convert frame number delta to ms: each frame is 4.615 ms long<br>
- if delta in ms is bigger than default 160 than use it<br>
<br>
However the result sound not much better than using hardcoded value<br>
which suggest that I might be doing FN -> ms conversion (or smth else)<br>
wrong. Any ideas/advices?<br>
<br>
--<br>
Max Suraev <<a href="mailto:msuraev@sysmocom.de">msuraev@sysmocom.de</a>> <a href="http://www.sysmocom.de/" rel="noreferrer" target="_blank">http://www.sysmocom.de/</a><br>
=======================================================================<br>
* sysmocom - systems for mobile communications GmbH<br>
* Alt-Moabit 93<br>
* 10559 Berlin, Germany<br>
* Sitz / Registered office: Berlin, HRB 134158 B<br>
* Geschaeftsfuehrer / Managing Directors: Holger Freyther, Harald Welte<br>
<br>
</blockquote></div>