Change mod_skypopen ptime to 10ms?
Hi, I am using mod_skypopen to connect Skype to FreeSWITCH. I then tried to use CELT@48000h for incoming Skype calls and routing calls to a second FreeSWITCH box. I am aware that G722@16000h would be sufficient as the audio stream from Skype seems to be only 16kHz anyway (although Skype itself indicates it uses 24kHz), but my goal is to have two FreeSWITCH boxes connected using 48kHz audio, because I can :-). And I might add clients later using CELT. Anyway, when trying to connect a call, FreeSWITCH logs the following line and eventually ends up using G722@16000@20i (even though CELT has a higher preference). 2010-11-17 16:59:49.009646 [WARNING] sofia_glue.c:213 Codec CELT payload 98 added to sdp wanting ptime 10 but it's already 20 (L16:10:20), disabling ptime. Going through the source code of mod_skypopen I could see that it uses 20ms buffers (if I understand the source code correctly), and it calls "skypopen_codec()" with the parameter codec_ms equal to 20ms. So my question is: Is there any way to make FreeSWITCH use CELT@48000h@10i when handling a call coming from mod_skypopen? Would I need to change mod_skypopen to use 10ms buffers? Or is there a specific reason that mod_skypopen is using 20ms? Any help is greatly appreciated. Regards, Roman -- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/Change-mod-skypopen-ptime-to-1... Sent from the freeswitch-users mailing list archive at Nabble.com.
On Thu, Nov 18, 2010 at 4:48 AM, Roman_ <lists@ione.ch> wrote:
FreeSWITCH box. I am aware that G722@16000h would be sufficient as the audio stream from Skype seems to be only 16kHz anyway (although Skype itself indicates it uses 24kHz), but my goal is to have two FreeSWITCH boxes connected using 48kHz audio, because I can :-).
hehehe, I like your attitude! So, do it, hack the code until it works perfect (not only in this case, also in the default case) then contribute a patch. -giovanni -- Sincerely, Giovanni Maruzzelli Cell : +39-347-2665618
Giovanni Maruzzelli-2 wrote:
So, do it, hack the code until it works perfect (not only in this case, also in the default case) then contribute a patch.
Fair enough :-). I gave it a try and made the frame size in milliseconds a compile-time option (i.e., adding some #defines). Both 20ms and 10ms seem to work flawlessly so far. Concerning the sampling frequency, the Skype API states that connecting through the API will only support 16kHz anyway, even if the call itself uses 24kHz, so there is no point in changing the sampling frequency in mod_skypopen. Nevertheless, after having made the changes to support 10ms frame size, I figured out that FreeSWITCH will in fact happily convert between 20ms and 10ms frame size if needed by using a write buffer. So, strictly speaking, my patch would not be necessary. As I understand it, however, using 10ms instead of 20ms should reduce the total latency by up to 10ms, so there might still be some justification to using 10ms. So, to summarize, I got mod_skypopen to work with 10ms, but the only benefit currently seems to be that it could reduce the total latency a bit. As such I am not sure that the patch is of general interest, but if anyone would like to give it a try or finds it useful for other reasons I would be happy to provide a patch. Regards, Roman -- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/Change-mod-skypopen-ptime-to-1... Sent from the freeswitch-users mailing list archive at Nabble.com.
However, 10ms shouldn't be a noticable amount and it'll increase the bandwidth required by doubling the overhead. On a slow link that could actually lead to dropped packets and worse quality. :o) -Steve On 21 November 2010 05:54, Roman_ <lists@ione.ch> wrote:
Giovanni Maruzzelli-2 wrote:
So, do it, hack the code until it works perfect (not only in this case, also in the default case) then contribute a patch.
Fair enough :-). I gave it a try and made the frame size in milliseconds a compile-time option (i.e., adding some #defines). Both 20ms and 10ms seem to work flawlessly so far.
Concerning the sampling frequency, the Skype API states that connecting through the API will only support 16kHz anyway, even if the call itself uses 24kHz, so there is no point in changing the sampling frequency in mod_skypopen.
Nevertheless, after having made the changes to support 10ms frame size, I figured out that FreeSWITCH will in fact happily convert between 20ms and 10ms frame size if needed by using a write buffer. So, strictly speaking, my patch would not be necessary. As I understand it, however, using 10ms instead of 20ms should reduce the total latency by up to 10ms, so there might still be some justification to using 10ms.
So, to summarize, I got mod_skypopen to work with 10ms, but the only benefit currently seems to be that it could reduce the total latency a bit. As such I am not sure that the patch is of general interest, but if anyone would like to give it a try or finds it useful for other reasons I would be happy to provide a patch.
Regards,
Roman
-- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/Change-mod-skypopen-ptime-to-1... Sent from the freeswitch-users mailing list archive at Nabble.com.
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (3)
-
Giovanni Maruzzelli
-
Roman_
-
Steven Ayre