Grandstream GXP-2000 - Solving Echo Problems

Image

Grandstream GXP-2000 - Solving Echo Problems

written by thetatag on 12/16/2005

What follows is a message sent as part of ongoing communications between myself and Grandstream and is the result of exhaustive testing on my part. A summary appears at the bottom for those who want to skip the subtle technical details and information on how this conclusion was reached. As this information is being reviewed by Grandstream engineers, I would greatly appreciate any comments or testimonials as to the effectiveness of this technique in your own systems. Thank you. - thetatag


Here is what I can tell you about the echo problem commonly noticed in the GXP-2000, and one of the worst problems noted. Some background is needed, so please bear with me.

I have a PRI being delivered over hDSL from the local telephone company. It is attached to Digium hardware in my Asterisk PBX. The Asterisk PBX connects to a 10/100 Ethernet switch which then connects to several GXP-2000's. (It is rare to see more than four in use at one time, though.) No other Ethernet traffic except NTP hosted by the Asterisk server exists on that private LAN.

Because the PRI is delivered via hDSL, which is becoming quite popular when the termination point is within engineered range of the wire center, the PRI signals are generated only three of four feet from the Asterisk PBX. (Yes, this is very important.) This produces a virtually 0dB loss in each direction on the PRI circuit, and the hDSL circuit is not subject to loss along its data path.

Having said that, the Asterisk PBX was originally configured with a 0dB loss between itself and the telco, which is correct. The receive and transmit gains were set to 0.0 as well within Asterisk. Through extensive testing with the telco's 1008Hz milliwatt tone and a loopback into Asterisk's similar tone, the 0.0 receive and transmit gains were determined empirically to be optimal. The echo cancellers worked perfectly when we used POTS analog phones connected to a Digium FXS card.

The only problem occurred when the GXP-2000 was used. And this was not consistent. Some calls would have terrible echo, and on others, the echo would be minimal. I went though no small amount of work tweaking every conceivable option on both the Asterisk SIP and Zaptel channel drivers and the GXP-2000 (excluding configuration options that just HAD to be a certain way for our use, of course). Nothing worked, although some changes mitigated the situation.

Time passes.

We have been comparatively echo-free for a few days now. As I studied more and more the problems the echo cancellers on Asterisk were having with calls originating on your phones (understanding that the echo cancellers are pointed towards the telephone lines and are not available on the SIP channels), I decided to try another tweak. I ignored empirical test data on appropriate receive and transmit gains and set them as follows: Receive gain was set to -6.0 and Transmit gain was set to -15.0. Keep in mind that this is on the Zaptel (telephone line) channel. The transmit gain is how much gain the voice coming from the GXP-2000-initiated call receives as it is passed to the PRI, and the receive gain is how much gain the signal FROM the PRI is given prior to being passed over the SIP channel to the GXP-2000. (I believe these are scaled in decibels, but I have not verified that.)

With our configuration, a -6.0 receive gain and a -15.0 transmit gain is rather huge, as again, both should be set to 0.0 due to a lack of virtually any line loss. Once the outbound audio was no longer clipping and the signal was in the appropriate range, the echo cancellers could do their job (quite well) and our echo virtually disappeared. However, at the same time, our non-SIP phones attached to the Digium FXS card had to have their configuration altered to compensate for these gain changes, or else the conversations on calls over the PRI would sound extremely quiet in them.

What this tells me is this: The gain is too high on the GXP-2000 causing a myriad of echo problems on many production environments that rely on any sort of echo cancellation (which does not work with a clipping or distorted audio signal). Ideally, I should be able to correctly set my PRI channel gains to 0.0 and not have the GXP-2000 peg the VU meter when I talk at a normal phone volume (and I'm not a loud speaker on the phone).

The reason, in my opinion, that the echo initially did not occur on some calls and was overpowering on others is that there should be no echo (except, perhaps, acoustic) on a digital line. So our calls to other digital lines would not produce a clipped and mildly distorted echo that could not be compensated for by the echo cancellers.

In my understanding, there is no way to control the microphone gain (or audio level in subsequent digital processing that is then sent digitally) on the GXP-2000. Rumor online has held that the speaker/handset volume control also adjusts the microphone gain, but I have not tested that, and it would seem to be a thoroughly bad idea. A configuration option to adjust gain would be useful, but the current system seems to have the gain locked at a non-optimal level.

What follows are some suggestions that may help or eliminate the echo problem:

  • Reduce the microphone gain by about 6dB or, better yet, make it adjustable from the web configuration and possibly on-screen display.

  • Implement a slow-tracking microphone AGC or compressor with a narrow gain range to limit microphone audio gain to the optimal level.

  • As part of the last item, detect audio clipping conditions and round out distorted waveforms. (Implemented correctly, this should have minimal processor overhead.)

- thetatag


SUMMARY

This information is useful only for eliminating echo with the GXP-2000 and does not cover techniques for eliminating telco-circuit or acoustic echo.


Extensive testing has indicated that the worst echo problems with the GXP-2000 are associated with an excessive gain level within the phone itself, creating overmodulated, clipped, and mildly distorted audio waveforms that inhibit the correct functioning of software echo cancellers.

What follows are some suggestions to mitigate this problem while Grandstream works on correcting the problem in the phone or its firmware.

  • Set up the optimal rxgain and txgain for your Zaptel channels. See Asterisk zapata gain adjustment for more information. Important: Use the first method presented for the most accuracy. Call your telco if you need the 1000Hz milliwatt test number.

  • Set up your echo canceller. You can find information on how to do this at Asterisk echo cancellation. Personally, I have had excellent success with the MG2 echo canceller (#define ECHO_CAN_MG2 in Zaptel's zconfig.h). In Asterisk's zapata.conf file, I am using echocancel=256 (although 128 would probably suffice for most installations), echocancelwhenbridged=yes and echotraining=800 (although somewhat less may work in most cases).

  • Make test calls and observe the echo. Call local, long distance, international, cell phones, digital lines, POTS lines, etc. See how the echo behaves.

  • Edit zapata.conf and drop the rxgain down by 6 and the txgain down by 15 from whatever their existing numbers. (If you have POTS phones attached to your system, you may need to compensate on those channels, keeping in mind that extension-to-extension calls will be effected.)

  • Make more test calls after you reload the Zap channel driver and see if the echo problem has been reduced or eliminated. If it still exists, follow the advice in The Hitchhiker's Guide to Asterisk - Echo Cancellation Issues for subjective adjustment to the channel gains.

Needless to say, throwing the gains around on the telco connection is a hack to get around gain issues with the GXP-2000. And one can immediately see how it could have negative effects on extension-to-extension (POTS to POTS or SIP to POTS) calls. Still, for anyone who has experienced the infamous GXP-2000 echo problems, these gain adjustments are many times better than living with the echo.

- thetatag

Please enter feedback and comments below.


References:




See also:




Where to buy



Image

Grandstream GXP-2000 - Solving Echo Problems

written by thetatag on 12/16/2005

What follows is a message sent as part of ongoing communications between myself and Grandstream and is the result of exhaustive testing on my part. A summary appears at the bottom for those who want to skip the subtle technical details and information on how this conclusion was reached. As this information is being reviewed by Grandstream engineers, I would greatly appreciate any comments or testimonials as to the effectiveness of this technique in your own systems. Thank you. - thetatag


Here is what I can tell you about the echo problem commonly noticed in the GXP-2000, and one of the worst problems noted. Some background is needed, so please bear with me.

I have a PRI being delivered over hDSL from the local telephone company. It is attached to Digium hardware in my Asterisk PBX. The Asterisk PBX connects to a 10/100 Ethernet switch which then connects to several GXP-2000's. (It is rare to see more than four in use at one time, though.) No other Ethernet traffic except NTP hosted by the Asterisk server exists on that private LAN.

Because the PRI is delivered via hDSL, which is becoming quite popular when the termination point is within engineered range of the wire center, the PRI signals are generated only three of four feet from the Asterisk PBX. (Yes, this is very important.) This produces a virtually 0dB loss in each direction on the PRI circuit, and the hDSL circuit is not subject to loss along its data path.

Having said that, the Asterisk PBX was originally configured with a 0dB loss between itself and the telco, which is correct. The receive and transmit gains were set to 0.0 as well within Asterisk. Through extensive testing with the telco's 1008Hz milliwatt tone and a loopback into Asterisk's similar tone, the 0.0 receive and transmit gains were determined empirically to be optimal. The echo cancellers worked perfectly when we used POTS analog phones connected to a Digium FXS card.

The only problem occurred when the GXP-2000 was used. And this was not consistent. Some calls would have terrible echo, and on others, the echo would be minimal. I went though no small amount of work tweaking every conceivable option on both the Asterisk SIP and Zaptel channel drivers and the GXP-2000 (excluding configuration options that just HAD to be a certain way for our use, of course). Nothing worked, although some changes mitigated the situation.

Time passes.

We have been comparatively echo-free for a few days now. As I studied more and more the problems the echo cancellers on Asterisk were having with calls originating on your phones (understanding that the echo cancellers are pointed towards the telephone lines and are not available on the SIP channels), I decided to try another tweak. I ignored empirical test data on appropriate receive and transmit gains and set them as follows: Receive gain was set to -6.0 and Transmit gain was set to -15.0. Keep in mind that this is on the Zaptel (telephone line) channel. The transmit gain is how much gain the voice coming from the GXP-2000-initiated call receives as it is passed to the PRI, and the receive gain is how much gain the signal FROM the PRI is given prior to being passed over the SIP channel to the GXP-2000. (I believe these are scaled in decibels, but I have not verified that.)

With our configuration, a -6.0 receive gain and a -15.0 transmit gain is rather huge, as again, both should be set to 0.0 due to a lack of virtually any line loss. Once the outbound audio was no longer clipping and the signal was in the appropriate range, the echo cancellers could do their job (quite well) and our echo virtually disappeared. However, at the same time, our non-SIP phones attached to the Digium FXS card had to have their configuration altered to compensate for these gain changes, or else the conversations on calls over the PRI would sound extremely quiet in them.

What this tells me is this: The gain is too high on the GXP-2000 causing a myriad of echo problems on many production environments that rely on any sort of echo cancellation (which does not work with a clipping or distorted audio signal). Ideally, I should be able to correctly set my PRI channel gains to 0.0 and not have the GXP-2000 peg the VU meter when I talk at a normal phone volume (and I'm not a loud speaker on the phone).

The reason, in my opinion, that the echo initially did not occur on some calls and was overpowering on others is that there should be no echo (except, perhaps, acoustic) on a digital line. So our calls to other digital lines would not produce a clipped and mildly distorted echo that could not be compensated for by the echo cancellers.

In my understanding, there is no way to control the microphone gain (or audio level in subsequent digital processing that is then sent digitally) on the GXP-2000. Rumor online has held that the speaker/handset volume control also adjusts the microphone gain, but I have not tested that, and it would seem to be a thoroughly bad idea. A configuration option to adjust gain would be useful, but the current system seems to have the gain locked at a non-optimal level.

What follows are some suggestions that may help or eliminate the echo problem:

  • Reduce the microphone gain by about 6dB or, better yet, make it adjustable from the web configuration and possibly on-screen display.

  • Implement a slow-tracking microphone AGC or compressor with a narrow gain range to limit microphone audio gain to the optimal level.

  • As part of the last item, detect audio clipping conditions and round out distorted waveforms. (Implemented correctly, this should have minimal processor overhead.)

- thetatag


SUMMARY

This information is useful only for eliminating echo with the GXP-2000 and does not cover techniques for eliminating telco-circuit or acoustic echo.


Extensive testing has indicated that the worst echo problems with the GXP-2000 are associated with an excessive gain level within the phone itself, creating overmodulated, clipped, and mildly distorted audio waveforms that inhibit the correct functioning of software echo cancellers.

What follows are some suggestions to mitigate this problem while Grandstream works on correcting the problem in the phone or its firmware.

  • Set up the optimal rxgain and txgain for your Zaptel channels. See Asterisk zapata gain adjustment for more information. Important: Use the first method presented for the most accuracy. Call your telco if you need the 1000Hz milliwatt test number.

  • Set up your echo canceller. You can find information on how to do this at Asterisk echo cancellation. Personally, I have had excellent success with the MG2 echo canceller (#define ECHO_CAN_MG2 in Zaptel's zconfig.h). In Asterisk's zapata.conf file, I am using echocancel=256 (although 128 would probably suffice for most installations), echocancelwhenbridged=yes and echotraining=800 (although somewhat less may work in most cases).

  • Make test calls and observe the echo. Call local, long distance, international, cell phones, digital lines, POTS lines, etc. See how the echo behaves.

  • Edit zapata.conf and drop the rxgain down by 6 and the txgain down by 15 from whatever their existing numbers. (If you have POTS phones attached to your system, you may need to compensate on those channels, keeping in mind that extension-to-extension calls will be effected.)

  • Make more test calls after you reload the Zap channel driver and see if the echo problem has been reduced or eliminated. If it still exists, follow the advice in The Hitchhiker's Guide to Asterisk - Echo Cancellation Issues for subjective adjustment to the channel gains.

Needless to say, throwing the gains around on the telco connection is a hack to get around gain issues with the GXP-2000. And one can immediately see how it could have negative effects on extension-to-extension (POTS to POTS or SIP to POTS) calls. Still, for anyone who has experienced the infamous GXP-2000 echo problems, these gain adjustments are many times better than living with the echo.

- thetatag

Please enter feedback and comments below.


References:




See also:




Where to buy



Created by: thetatag, Last modification: Wed 29 of Dec, 2010 (13:27 UTC) by omarelf
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+