Hi Max,
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.
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).
Please excuse typos. Written with a touchscreen keyboard.
--
Regards,
Alexander Chemeris
CEO Fairwaves, Inc.
https://fairwaves.co
Hi.
Right now in osmobts when sending/receiving frames with osmo_rtp_* it's
assumed that no frame is lost and timestamp is always advanced in 160ms
steps. In practice (especially when DTX is in place) frames do get lost
so we have to adjust the step to compensate.
I've tried to do it as follows:
- store frame number of last used frame on receiving/sending
- check how far current frame number from old one
- convert frame number delta to ms: each frame is 4.615 ms long
- if delta in ms is bigger than default 160 than use it
However the result sound not much better than using hardcoded value
which suggest that I might be doing FN -> ms conversion (or smth else)
wrong. Any ideas/advices?
--
Max Suraev <msuraev@sysmocom.de> http://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschaeftsfuehrer / Managing Directors: Holger Freyther, Harald Welte