[Asterisk-Users] chan_capi-cm-0.5 release announcement

Armin Schindler armin at melware.de
Thu Jun 23 08:10:55 MST 2005


On Thu, 23 Jun 2005, Klaus-Peter Junghanns wrote:
> Am Donnerstag, den 23.06.2005, 12:41 +0200 schrieb Armin Schindler:
> 
> > > I strongly disagree. :-) You dont want to do echo cancelation in
> > > userspace. Especially not on a non-realtime operating system.
> > > To make echo cancelation work it has to be as close to the line
> > > interface as possible. Also the frames have to be as small
> > > as possible. This rules out capi pretty much.
> > 
> > If you don't want echo-canceling in user-space, then neither Asterisk nor
> > any chan_* plugin should do it.
> > 
> > I don't know the zap channel code, but does the zap echo-cancel-code is 
> > inside a kernel module?
> 
> Yes, sir.
> 
> > If yes, then I have to disagree here. Something like 'playing' with 
> > audio-data is nothing the kernel should be concerned with.
> > This belongs in user-space and if you need realtime, then you should use a 
> > realtime OS or use RT-scheduling. Just putting such a code into kernelspace 
> > is a bad idea.
> 
> What is so bad about "playing" with audio-data in kernel space?

Besides preemption or RT-patches, it is not easy (and noboady does it)
to be 'nice' and have a fair scheduling. With such work in kernel, you just
say "I'm at the highest priority, I don't care about others". And that's 
just wrong in the kernel.
Normaly, the kernel just should provide access to the hardware 
and basic functions for interaction with the hardware.

> If you "play" with echo cancelation in user space you will need
> to de-jitter the audio first introducing more and more latency, so
> your echo cancelation becomes way more computationally expensive.

That depends on what scheduling priority this task runs. If you don't want 
to get interrupted by other tasks, then you need a higher priority. 
 
> > So the correct way is either the hardware supports it or the 
> > application knows what to do with the data received, like DTMF.
> > 
> 
> Why should the application have to worry about things like echo
> cancelation?

In the case of Asterisk and echo-cancel, this application is the
position where is makes sense. Otherwise you need a copy of the echo-cancel 
code in each channel driver.

> Zaptel is not only used by Asterisk but also by other
> projects. With EC in kernel space (which gets switched on and off
> by userspace) there is no need to reinvent the EC-wheel for every
> project.

Okay, from that point of view it makes sense. On the other hand, something 
like echo-cancel and DTMF is not channel specific and therefore should not 
be part of that. Or would you add additional codecs into the channel driver?

Armin



More information about the asterisk-users mailing list