[Freeswitch-dev] question about CNG on late packages
Hey all, Inside code switch_rtp.c file: static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_type, switch_frame_flag_t *flags, switch_io_flag_t io_flags) ................ if (check || (bytes && !switch_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER))) { if (!bytes && switch_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER)) { /* We're late! We're Late! */ if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_NOBLOCK) && status == SWITCH_STATUS_BREAK) { switch_cond_next(); continue; } return_cng_frame(); <------- this lane to return cng frame if late. } } Could someone explain why we want to return cng frame when package is late? this is caused for me to hear very bad noise audio. Can I disable return CNG frame? Cheers
Because if a RTP packet is due and hasn't arrived yet you need something to play. Audio isn't like TCP where you dropped packets can be retransmitted, if it hasn't arrived by the time you want to play it it's too late and you have to play silence to handle it. Your audio problems are more likely due to packet loss or jitter which is why the RTP packet is overdue, not the CNG itself. It jitter's the problem enabling the jitterbuffer might help (at the expense of increased lag). If loss is the problem there's no way to handle that except as silence for the missing interval, you need to fix whatever is causing the loss. -Steve On 5 February 2013 10:23, Xijing Dai <dxj19831029@gmail.com> wrote:
Hey all,
Inside code
switch_rtp.c file:
static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_type, switch_frame_flag_t *flags, switch_io_flag_t io_flags) ................ if (check || (bytes && !switch_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER))) { if (!bytes && switch_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER)) { /* We're late! We're Late! */ if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_NOBLOCK) && status == SWITCH_STATUS_BREAK) { switch_cond_next(); continue; }
return_cng_frame(); <------- this lane to return cng frame if late. } }
Could someone explain why we want to return cng frame when package is late? this is caused for me to hear very bad noise audio.
Can I disable return CNG frame?
Cheers
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
Don't negotiate CNG in the SDP and it won't use it or disable it with suppress_cng=true in your channel or global vars. On Tue, Feb 5, 2013 at 4:32 AM, Steven Ayre <steveayre@gmail.com> wrote:
Because if a RTP packet is due and hasn't arrived yet you need something to play. Audio isn't like TCP where you dropped packets can be retransmitted, if it hasn't arrived by the time you want to play it it's too late and you have to play silence to handle it.
Your audio problems are more likely due to packet loss or jitter which is why the RTP packet is overdue, not the CNG itself.
It jitter's the problem enabling the jitterbuffer might help (at the expense of increased lag). If loss is the problem there's no way to handle that except as silence for the missing interval, you need to fix whatever is causing the loss.
-Steve
On 5 February 2013 10:23, Xijing Dai <dxj19831029@gmail.com> wrote:
Hey all,
Inside code
switch_rtp.c file:
static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_type, switch_frame_flag_t *flags, switch_io_flag_t io_flags) ................ if (check || (bytes && !switch_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER))) { if (!bytes && switch_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER)) { /* We're late! We're Late! */ if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_NOBLOCK) && status == SWITCH_STATUS_BREAK) { switch_cond_next(); continue; }
return_cng_frame(); <------- this lane to return cng frame if late. } }
Could someone explain why we want to return cng frame when package is late? this is caused for me to hear very bad noise audio.
Can I disable return CNG frame?
Cheers
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org googletalk:conf+888@conference.freeswitch.org pstn:+19193869900
I see. I did set it suppress_cng=true, and it did not help. No difference at all. This happens inside LAN. When talking about the jitter buffer, we want to enable it on client, and disable it inside freeswitch. Therefore, in this case, should freeswitch do nothing? Cheers On Tue, Feb 5, 2013 at 11:35 PM, Anthony Minessale < anthony.minessale@gmail.com> wrote:
Don't negotiate CNG in the SDP and it won't use it or disable it with suppress_cng=true in your channel or global vars.
On Tue, Feb 5, 2013 at 4:32 AM, Steven Ayre <steveayre@gmail.com> wrote:
Because if a RTP packet is due and hasn't arrived yet you need something to play. Audio isn't like TCP where you dropped packets can be retransmitted, if it hasn't arrived by the time you want to play it it's too late and you have to play silence to handle it.
Your audio problems are more likely due to packet loss or jitter which is why the RTP packet is overdue, not the CNG itself.
It jitter's the problem enabling the jitterbuffer might help (at the expense of increased lag). If loss is the problem there's no way to handle that except as silence for the missing interval, you need to fix whatever is causing the loss.
-Steve
On 5 February 2013 10:23, Xijing Dai <dxj19831029@gmail.com> wrote:
Hey all,
Inside code
switch_rtp.c file:
static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_type, switch_frame_flag_t *flags, switch_io_flag_t io_flags) ................ if (check || (bytes && !switch_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER))) { if (!bytes && switch_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER)) { /* We're late! We're Late! */ if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_NOBLOCK) && status == SWITCH_STATUS_BREAK) { switch_cond_next(); continue; }
return_cng_frame(); <------- this lane to return cng frame if late. } }
Could someone explain why we want to return cng frame when package is late? this is caused for me to hear very bad noise audio.
Can I disable return CNG frame?
Cheers
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire
AIM: anthm MSN:anthony_minessale@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org googletalk:conf+888@conference.freeswitch.org pstn:+19193869900
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
by the way, what is the latency in ms to determine if a packet is late? Our ptime is 10ms, and the sender always sends packets in 8-12ms. And I did use wireshark to capture packets on freeswitch server, no lost packet is found before reaching freeswitch. When our ptime is 20ms, it gets better, but still has CN. When we are using proxy/proxy media, every thing works great. when sample rate is 16000, the quality of call is worst. 8000 gets better. Any other suggestions? On Wed, Feb 6, 2013 at 12:32 AM, Xijing Dai <dxj19831029@gmail.com> wrote:
I see.
I did set it suppress_cng=true, and it did not help. No difference at all.
This happens inside LAN.
When talking about the jitter buffer, we want to enable it on client, and disable it inside freeswitch. Therefore, in this case, should freeswitch do nothing?
Cheers
On Tue, Feb 5, 2013 at 11:35 PM, Anthony Minessale < anthony.minessale@gmail.com> wrote:
Don't negotiate CNG in the SDP and it won't use it or disable it with suppress_cng=true in your channel or global vars.
On Tue, Feb 5, 2013 at 4:32 AM, Steven Ayre <steveayre@gmail.com> wrote:
Because if a RTP packet is due and hasn't arrived yet you need something to play. Audio isn't like TCP where you dropped packets can be retransmitted, if it hasn't arrived by the time you want to play it it's too late and you have to play silence to handle it.
Your audio problems are more likely due to packet loss or jitter which is why the RTP packet is overdue, not the CNG itself.
It jitter's the problem enabling the jitterbuffer might help (at the expense of increased lag). If loss is the problem there's no way to handle that except as silence for the missing interval, you need to fix whatever is causing the loss.
-Steve
On 5 February 2013 10:23, Xijing Dai <dxj19831029@gmail.com> wrote:
Hey all,
Inside code
switch_rtp.c file:
static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_type, switch_frame_flag_t *flags, switch_io_flag_t io_flags) ................ if (check || (bytes && !switch_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER))) { if (!bytes && switch_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER)) { /* We're late! We're Late! */ if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_NOBLOCK) && status == SWITCH_STATUS_BREAK) { switch_cond_next(); continue; }
return_cng_frame(); <------- this lane to return cng frame if late. } }
Could someone explain why we want to return cng frame when package is late? this is caused for me to hear very bad noise audio.
Can I disable return CNG frame?
Cheers
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire
AIM: anthm MSN:anthony_minessale@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org googletalk:conf+888@conference.freeswitch.org pstn:+19193869900
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
There are lots of probable causes to this. First of all, the timing in your server might be bad. What does timer_test return? Is this a real machine, or is it a virtual one? I agree with the others saying that the CNG itself is probably not a problem. However, I know a minor changes was made some months back (in head) that made sure not to cause holes after a CNG frame was handled (I know, since I was the one reporting the issue - and it was fixed by Tony). But this problem didn't really cause bad audio, it made the audio disappear for a few seconds. First of all, make sure you are using a current version, and not something from way back. If the issue still exist, and the timing on the machine seems ok, and you are not on a virtual server, please add logs and pcaps to a Jira issue. You might also need to enable some extra RTP debugging features in the RTP stack to get all logs needed. /Peter ________________________________ Från: freeswitch-dev-bounces@lists.freeswitch.org [freeswitch-dev-bounces@lists.freeswitch.org] för Xijing Dai [dxj19831029@gmail.com] Skickat: den 5 februari 2013 17:48 Till: freeswitch-dev@lists.freeswitch.org Ämne: Re: [Freeswitch-dev] question about CNG on late packages by the way, what is the latency in ms to determine if a packet is late? Our ptime is 10ms, and the sender always sends packets in 8-12ms. And I did use wireshark to capture packets on freeswitch server, no lost packet is found before reaching freeswitch. When our ptime is 20ms, it gets better, but still has CN. When we are using proxy/proxy media, every thing works great. when sample rate is 16000, the quality of call is worst. 8000 gets better. Any other suggestions? On Wed, Feb 6, 2013 at 12:32 AM, Xijing Dai <dxj19831029@gmail.com<mailto:dxj19831029@gmail.com>> wrote: I see. I did set it suppress_cng=true, and it did not help. No difference at all. This happens inside LAN. When talking about the jitter buffer, we want to enable it on client, and disable it inside freeswitch. Therefore, in this case, should freeswitch do nothing? Cheers On Tue, Feb 5, 2013 at 11:35 PM, Anthony Minessale <anthony.minessale@gmail.com<mailto:anthony.minessale@gmail.com>> wrote: Don't negotiate CNG in the SDP and it won't use it or disable it with suppress_cng=true in your channel or global vars. On Tue, Feb 5, 2013 at 4:32 AM, Steven Ayre <steveayre@gmail.com<mailto:steveayre@gmail.com>> wrote: Because if a RTP packet is due and hasn't arrived yet you need something to play. Audio isn't like TCP where you dropped packets can be retransmitted, if it hasn't arrived by the time you want to play it it's too late and you have to play silence to handle it. Your audio problems are more likely due to packet loss or jitter which is why the RTP packet is overdue, not the CNG itself. It jitter's the problem enabling the jitterbuffer might help (at the expense of increased lag). If loss is the problem there's no way to handle that except as silence for the missing interval, you need to fix whatever is causing the loss. -Steve On 5 February 2013 10:23, Xijing Dai <dxj19831029@gmail.com<mailto:dxj19831029@gmail.com>> wrote: Hey all, Inside code switch_rtp.c file: static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_type, switch_frame_flag_t *flags, switch_io_flag_t io_flags) ................ if (check || (bytes && !switch_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER))) { if (!bytes && switch_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER)) { /* We're late! We're Late! */ if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_NOBLOCK) && status == SWITCH_STATUS_BREAK) { switch_cond_next(); continue; } return_cng_frame(); <------- this lane to return cng frame if late. } } Could someone explain why we want to return cng frame when package is late? this is caused for me to hear very bad noise audio. Can I disable return CNG frame? Cheers _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org<mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org<mailto:FreeSWITCH-dev@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org<mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org<mailto:FreeSWITCH-dev@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org -- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com<mailto:MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<mailto:PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net<http://irc.freenode.net> #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org<mailto:sip%3A888@conference.freeswitch.org> googletalk:conf+888@conference.freeswitch.org<mailto:googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:+19193869900<tel:%2B19193869900> _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org<mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org<mailto:FreeSWITCH-dev@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org !DSPAM:511134c132767372939513!
In my experience suppress_cng did work but only prevented sending CNG packet. freeswitch would ignore the late packets because it thought the cng packet had been sent out. it makes a hole in the seq number in B-leg. So later I modified the switch_rtp.c to change this mechanism. On Tue, Feb 5, 2013 at 11:32 AM, Xijing Dai <dxj19831029@gmail.com> wrote:
I see.
I did set it suppress_cng=true, and it did not help. No difference at all.
This happens inside LAN.
When talking about the jitter buffer, we want to enable it on client, and disable it inside freeswitch. Therefore, in this case, should freeswitch do nothing?
Cheers
On Tue, Feb 5, 2013 at 11:35 PM, Anthony Minessale < anthony.minessale@gmail.com> wrote:
Don't negotiate CNG in the SDP and it won't use it or disable it with suppress_cng=true in your channel or global vars.
On Tue, Feb 5, 2013 at 4:32 AM, Steven Ayre <steveayre@gmail.com> wrote:
Because if a RTP packet is due and hasn't arrived yet you need something to play. Audio isn't like TCP where you dropped packets can be retransmitted, if it hasn't arrived by the time you want to play it it's too late and you have to play silence to handle it.
Your audio problems are more likely due to packet loss or jitter which is why the RTP packet is overdue, not the CNG itself.
It jitter's the problem enabling the jitterbuffer might help (at the expense of increased lag). If loss is the problem there's no way to handle that except as silence for the missing interval, you need to fix whatever is causing the loss.
-Steve
On 5 February 2013 10:23, Xijing Dai <dxj19831029@gmail.com> wrote:
Hey all,
Inside code
switch_rtp.c file:
static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_type, switch_frame_flag_t *flags, switch_io_flag_t io_flags) ................ if (check || (bytes && !switch_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER))) { if (!bytes && switch_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER)) { /* We're late! We're Late! */ if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_NOBLOCK) && status == SWITCH_STATUS_BREAK) { switch_cond_next(); continue; }
return_cng_frame(); <------- this lane to return cng frame if late. } }
Could someone explain why we want to return cng frame when package is late? this is caused for me to hear very bad noise audio.
Can I disable return CNG frame?
Cheers
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire
AIM: anthm MSN:anthony_minessale@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org googletalk:conf+888@conference.freeswitch.org pstn:+19193869900
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
How to let freeswitch send late packets? I tried in following way, but the call is missing ACK in freeswitch end when the client sent 200 OK back. Any suggestions? The changed code is: (I simply go to sleep 1ms and then try to read again) if (check || (bytes && !switch_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER))) { if (!bytes && switch_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER)) { /* We're late! We're Late! */ if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_NOBLOCK) && status == SWITCH_STATUS_BREAK) { switch_cond_next(); continue; } //return_cng_frame(); <------- comment this lane and directly go to sleep and read again goto do_continue; } } On Wed, Feb 6, 2013 at 12:52 AM, Bing LI <enst.bupt@gmail.com> wrote:
In my experience suppress_cng did work but only prevented sending CNG packet. freeswitch would ignore the late packets because it thought the cng packet had been sent out. it makes a hole in the seq number in B-leg.
So later I modified the switch_rtp.c to change this mechanism.
On Tue, Feb 5, 2013 at 11:32 AM, Xijing Dai <dxj19831029@gmail.com> wrote:
I see.
I did set it suppress_cng=true, and it did not help. No difference at all.
This happens inside LAN.
When talking about the jitter buffer, we want to enable it on client, and disable it inside freeswitch. Therefore, in this case, should freeswitch do nothing?
Cheers
On Tue, Feb 5, 2013 at 11:35 PM, Anthony Minessale < anthony.minessale@gmail.com> wrote:
Don't negotiate CNG in the SDP and it won't use it or disable it with suppress_cng=true in your channel or global vars.
On Tue, Feb 5, 2013 at 4:32 AM, Steven Ayre <steveayre@gmail.com> wrote:
Because if a RTP packet is due and hasn't arrived yet you need something to play. Audio isn't like TCP where you dropped packets can be retransmitted, if it hasn't arrived by the time you want to play it it's too late and you have to play silence to handle it.
Your audio problems are more likely due to packet loss or jitter which is why the RTP packet is overdue, not the CNG itself.
It jitter's the problem enabling the jitterbuffer might help (at the expense of increased lag). If loss is the problem there's no way to handle that except as silence for the missing interval, you need to fix whatever is causing the loss.
-Steve
On 5 February 2013 10:23, Xijing Dai <dxj19831029@gmail.com> wrote:
Hey all,
Inside code
switch_rtp.c file:
static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_type, switch_frame_flag_t *flags, switch_io_flag_t io_flags) ................ if (check || (bytes && !switch_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER))) { if (!bytes && switch_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER)) { /* We're late! We're Late! */ if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_NOBLOCK) && status == SWITCH_STATUS_BREAK) { switch_cond_next(); continue; }
return_cng_frame(); <------- this lane to return cng frame if late. } }
Could someone explain why we want to return cng frame when package is late? this is caused for me to hear very bad noise audio.
Can I disable return CNG frame?
Cheers
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire
AIM: anthm MSN:anthony_minessale@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org googletalk:conf+888@conference.freeswitch.org pstn:+19193869900
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
participants (5)
-
Anthony Minessale
-
Bing LI
-
Peter Olsson
-
Steven Ayre
-
Xijing Dai