[Asterisk-Users] Echo cancellation

Steve Kann stevek at stevek.com
Wed Nov 26 15:53:21 MST 2003


On Nov 26, 2003, at 10:34 AM, Peter Zeltins wrote:

>>> I'm interested. I'm running chan_capi 0.3.0 with Fritz PCI ISDN card.
> Using
>>> DIAX as softphone and dialing out to PSTN generally results in good
> sound
>>> quality at softphone end (no echo), but PSTN end experiences quite a 
>>> bit
> of
>>> echo. I have enabled echosquelch in capi.conf, but it does not seem 
>>> to
> help
>>
>> Then my idea is not your solution, nor is echosquelch, I guess.  Yes, 
>> it
>> would be possible to kludge chan_capi to alleviate your problem; no, I
>> do not think it would be the right solution.  If the far end hears 
>> echo,
>> it's coming from the near end, that is from your softphone.  You could
>> try to use something else to confirm that (a hardphone?).  I suggest
>> that you play with the mixer settings on your own machine, because 
>> it's
>> your sound card that's recording the far end's voice!
>
> I do not have a hardphone to play around with, but the echo is there 
> both
> with built-in audio card (SigmaTel) and Bluetooth headset. There are no
> mixer settings than I can adjust as well. I'll try disabling AGC and/or
> lowering mike sensitivity.

DIAX is built on my iaxclient library, and the library itself should 
not produce echo, although echo can be produced either by misconfigured 
Windows sound mixer settings (in some cases, the drivers don't make it 
possible to configure them to _not_ mix outbound audio back in with 
inbound), or acoustic echo.

The library has several DSP features, including AGC, denoising, and 
echo cancellation.  These are all provided via integration with 
preprocessing from the SPEEX library.  I don't know if DAN allows you 
to turn on/off echo cancellation or not.  However, the echo 
cancellation code from speex is still very immature, and not quite 
there yet.  In particular, it is almost completely ineffective is AGC 
is also being used, because the echo canceller leaves a smaller 
residual echo in the signal, and the AGC then boosts up the residual 
echo to full volume.

I've also tried integrating the various echo cancellers from asterisk 
into the code, but they are even less effective when used with the long 
echo tails seen in a VoIP client.

One thing you can do if you can't configure your card properly is use a 
"push to talk" feature.  This would need to be implemented in DIAX, 
although example code exists in other clients.  Basically, this looks 
for the user to press some "hotkey" before speaking (like a 
walkie-talkie"), and keeps audio muted unless the key is pressed.

-SteveK





More information about the asterisk-users mailing list