[Asterisk-Dev] Re: common infrastructure for jitter/vad/echo/freq
diff compensation on terminal/sync devices
Steve Kann
stevek at stevek.com
Mon May 9 06:36:42 MST 2005
Orehov Pasha wrote:
> Steve Kann wrote:
>
>> On May 7, 2005, at 6:04 AM, Orehov Pasha wrote:
>>
>>>
>>> Did you called from h323 g729 w VAD to alsa? Did you have long call
>>> (10+ hours (it lead to buffer overflow for me))? Was voice (and
>>> silence) smooth? It was not for me. So in my alsa-based driver I
>>> have to
>>> 1. take clock to write to device from device, not from ast_write().
>>
>>
>>
>> This would be ideal if bridged channels could do this, but it would
>> be a rather major (and complicated) change to the present design. At
>> least,
>
> why? it'l be like HEAD/iax.c/get_from_jb but scheduled by not
> ast_sched_add but poll(POLLOUT)@ast_generic_bridge. or by thread in
> chan_, which converts channel's need of data to flag "need for a voice
> frame"and chan->alertpipe signal. when
>
>
> ast_generic_bridge(){
>
> ....
> who = ast_waitfor_n(cs, 2, &to);
> peer=(who==c0)?c1:c0;
> if(who->needvoiceframe){ /*sets by channel driver (pollout thread)*/
> f=jb_get(peer);
> ast_write(who,f); /*channel who want for a packet and
> data writed to it! */
> who->needvoiceframe=0;
> }else{
> f=ast_read(who);
> if(who->manualwritetiming&& VOICE_FRAME){
> /*integrate to ast_read*/
> jb_put(who,f);
> ast_frfree(f);
> f=NULL_FRAME;
> }
> }
> /* default behavior */
> ast_write(peer,f);
(neglecting the fact that your solution doesn't check what kinds of
channels are on each side of a bridge,)
Your solution would provide jitterbuffering _only_ when channels are
bridged. You also want to have jitterbuffering when channels are in
applications.
More information about the asterisk-dev
mailing list