linphone-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Linphone-developers] question about rtp packets


From: meng hongling
Subject: Re: [Linphone-developers] question about rtp packets
Date: Wed, 22 Mar 2006 22:37:40 +0800

first,thank you for your patience,Kosta.


Hmmm, maybe there is also a problem somewhere else. Is the sound
scrambled on both sides of the call?
Also, do you mean by 'chopped' that the sound has 'holes' in it? Like
when you say "aaaaaaaaaa" into the phone, the other end plays "a-a-a-a-a"?
Also, are you making stereo sound out of your incoming mono packets?

My experiment environment is one desktop PC and an embedded developing board based on intel PXA250.I made modification on both oss_card_read and oss_card_write of course.At first,the sound heared from embedded board is clear with a little delay that nearly can't be distinguished,while the sound heared from my pc is not good.it is discontinuous. it sounds like that the speaker on the other part is a stutter :),your example is exactly right.So I guess there is something wrong with the read part of my board.
my osscard.c is like this:
int oss_card_read()
.....
if(size<bsize)(here my bsize is 8192)
{
gint canread=MIN(bsize-obj->readpos,size);
if(obj->readpos==0){
/* added by meng*/
char buf2[bsize*2];
int err2=read(obj->fd,buf2,bsize*2);
err=err2/2;
if(err2>0){
for(int j=0;j<err;j=j+2){
 obj->readbuf[j]=buf2[2*j];
 obj->readbuf[j+1]=buf2[2*j+1];
  }
}
/**added end**/
.........

and today,I modified my sound card fragmentsize,I set it = 512,
and do the same modification in oss_card_read function in if(size<bsize){}

else{
/*added by meng*/
......
/*end  */
}
and it works,the sound delay is still here about 0.5s on pc,but it is continous sound. and if I do not change the sound card driver,but just set bsize=512 in oss_card_read function by myself,the sound is also good.I don't know why.what is the effect of if(size<bsize),{.....}?


If it is constantly around 100 milliseconds, your system is fast enough.
If it was too slow, the value would increase during the phone call.
This seems to be a scheduling problem. Take a look at
ms_timer_synchronize() in mediastreamer/mstimer.c. Maybe do some debug
output to see how often he's in the loop. If he uses the loop at all,
select() or gettimeofday() could be inaccurate on your platform.
A quick hack could be to simply sleep for a shorter amount of time :)

I'll try this tomorrow.:)

HTH,
Kosta

_________________________________________________________________
免费下载 MSN Explorer: http://explorer.msn.com/lccn/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]