[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Linphone-developers] sound card block size different.
From: |
Kosta Welke |
Subject: |
Re: [Linphone-developers] sound card block size different. |
Date: |
Wed, 08 Mar 2006 21:25:57 +0100 |
User-agent: |
Thunderbird 1.5 (X11/20060113) |
Simon Morlat wrote:
Yes, this big 8192 size is the reason of the sound delay, that may also cause
echo and feedback.
Its due to the core_api/linphonecore.c, line 1346. By removing this
check, I was able to playback sound perfectly. It seems my system simply
lies about its blocksize.
Moreover, it seems that on my embedded system, the timestamp generation
is broken. Attached is a patch that works flawlessly on my system, while
the default behavior is broken. However, I didnt try it on my PC, yet.
If you are interested in this patch, please let me know, I can make a
diff against CVS, do a command line switch, or something like that.
HTH,
Kosta
--- linphone-ori/mediastreamer/msrtpsend.c 2005-11-14 13:10:21.000000000
+0100
+++ linphone/mediastreamer/msrtpsend.c 2006-03-08 21:02:01.000000000 +0100
@@ -83,20 +83,23 @@
guint32 get_new_timestamp(MSRtpSend *r,guint32 synctime)
{
- guint32 clockts;
+ guint32 clockts, mints, oldclock;
+ oldclock = r->ts;
/* use the sync system time to compute a timestamp */
PayloadType
*pt=rtp_profile_get_payload(r->rtpsession->profile,r->rtpsession->send_pt);
g_return_val_if_fail(pt!=NULL,0);
clockts=(guint32)(((double)synctime * (double)pt->clock_rate)/1000.0);
+ mints = r->ts + (r->ts_inc / 4);
ms_trace("ms_rtp_send_process: sync->time=%i
clock=%i",synctime,clockts);
if (r->flags & RTPSEND_CONFIGURED){
- if
(RTP_TIMESTAMP_IS_STRICTLY_NEWER_THAN(clockts,r->ts+(2*r->ts_inc) )){
- r->ts=clockts;
- }
- else r->ts+=r->ts_inc;
+ if (RTP_TIMESTAMP_IS_STRICTLY_NEWER_THAN(clockts, mints)){ /*
kosta */
+ r->ts = clockts;
+ }
+ else r->ts = mints;
}else{
r->ts=clockts;
}
+ //fprintf(stderr, "inc: %i\n", r->ts - oldclock);
return r->ts;
}