[Top][All Lists]

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

Re: [Linphone-developers] Oss driver support

From: Safiudeen
Subject: Re: [Linphone-developers] Oss driver support
Date: Thu, 31 Mar 2005 17:00:01 +0600

For 8000 Hz sampling with 16 but size,for every 20ms the read function need to read 320 bytes,
For PC to PC with oss driver works fine without any modification in r->gran(=(512*r->freq)/8000 )
But only think I had to trigger sound card to using  dummy read call in oss_open function , I mean I added the following line at the end of oss_open
After this oss_card_can_read function worked properly for my sound card driver (in pc  via82xx, in db1100  au1000 both are oss based)
now the PC works fine with oss driver and linphone,
In DB1100 ,When r->gran is 512*r->freq)/8000  ( = 512) ,read function is called to read 512 bytes, but it returns with some number of bytes less than 512.
When I change r->gran = 160 * 2 ,it work with some noise 1 to 2 sec delay.
In this case oss_card_read function read 512 and return only requested 160 * 2 )value and return remaining in the next read call,here  
In this case , driver  read linphone higher layer receive 320 bytes first and 192 bytes in second attempt,since the second one can not be processes it read again, in this way it give much delay I guess.
But I set r->gran =  160 * 2 ; and in oss_card_read function I forced to read 320(=size) instead of reading bsize(=512) of bytes
Now linphone works fine without delay or noise in DB1100 board over Ethernet.
Now it is created the problem ,when I terminate the call after longtime kept connected,it give segmentation error at mediastreamer library.
Is this because of the changes in osscard.c file or for some other reason ?

Re: [Linphone-developers] Oss driver support

From: Daniel Kabs [ML]
Subject: Re: [Linphone-developers] Oss driver support
Date: Tue, 29 Mar 2005 11:43:57 +0200

On Mon, 28 Mar 2005 <address@hidden> wrote:
>I modyfied msossread.c (r-gran= 160 * 2; in "ms_oss_read_start")
>2) What is the  impact on changing  r->gran=(512*r->freq)/8000 ; to
>r->gran= 160 * 2; ?
>  are there any other value  for  "r->gran=" that can be better ?

For me, it made the whole thing work :-)

I can only tell about 0.12.2 because I havend tried the 1.0 yet:

Every 20ms the soundcard is read, as snd_card_has_data() always returns
true (because there are always some samples digitized and ready to be
read - but you don't know how many). The read() wants to get 256
samples (512 bytes=r->gran) and hangs in the driver until the requested
number of samples have been digitized.  Thus I got a "jerky" output.

Reducing r->gran to 160*2, this way the one end of the fifo reads as
many bytes from the soundcard as the other end of the fifo writes to
the network.

I don't know why the original code works with OSS and ALSA cards,
though. :-)

Daniel Kabs

reply via email to

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