[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Linphone-developers] Implementing sound support for non-standard ha
Daniel Kabs [ML]
Re: [Linphone-developers] Implementing sound support for non-standard hardware
Wed, 22 Dec 2004 18:56:15 +0100
On Tue, 21 Dec 2004, Simon Morlat <address@hidden> wrote:
> > I am still pondering how this filter-fifo-queueing works,
> > when every 20ms there is an input of 256 samples
> > (512 bytes from the soundcard),
> > but only 160 samples are output through the RTP packet.
> No: you miss that 256 samples are outputed only when
> returns true, so that normally we never exceed 8000 samples per
> seconds on average.
I think it's rather the read() that blocks and enforces the samplerate
because snd_card_has_data() returns even if there is only one byte
ready to be read. the problem with my "test implementation" was that it
just zeroed the buffer instead of reading from the sound card. So it
did not hang in the read() as it would normally do.
> What I don't like in the current implementation is that
> snd_card_has_data() can return true but you don't know
> how much bytes are really available without blocking.
That's exactly what happens when I do read from the soundcard and thus
I got a "jerky" output. I think it's because of the following:
Every 20ms the soundcard is read, as snd_card_has_data() always returns
true (because there are always some bytes to ready). But then read()
wants to get 256 samples (512 bytes) and hangs in the driver until the
requested number of samples have been digitized.
My solution to this problem is to
set r->gran = 160 * 2
in msossread.c::ms_oss_read_start(). (See my other posting).
I don't know why it works with OSS and ALSA cards, though. :-)
Cheers and Merry Christmas
Re: [Linphone-developers] Implementing sound support for non-standard hardware, Daniel Kabs [ML], 2004/12/15