How to Basic fxotune
Product Family Cards
Hybrid echo is generated by the public switched telephone network (PSTN) through the reflection of electrical energy by a device called a hybrid (hence the term hybrid echo). Most telephone local loops are two-wire circuits while transmission facilities are four-wire circuits. Each hybrid produces echoes in both directions, though the far end echo is usually a greater problem for voiceband.
In contrast, acoustic echo is caused when audio from the speaker is fedback into the microphone on the distal end. If this happens at both ends, a feedback loop will be created, often leading to a echoing tone or squeal.
The fxotune utility is included in dahdi-tools, and is used to calibrate hybrid impedance on Digium analog cards. When audio problems are experienced on an analog connection, using fxotune should be the first troubleshooting step.
Before using fxotune, check dahdi-tools & dahdi-linux, upgrade both to the latest version. Follow the included READMEs to do this.
The link for the downloads and README is:
-‘#’ indicates a command to be entered in the bash prompt as root. Do not type the ‘#’ or the command will not execute.
– It’s best to do this during a maintanance window, as you will be using the lines and may be restarting Dahdi and Asterisk.
1) Verify that you are using the latest version of dahdi-linux and dahdi tools. If not, follow the README directions to upgrade.
-To find your Dahdi-Tools version and Dahdi-linux version, at the bash prompt enter the command:
# dahdi_cfg -v
– If dahdi doesn’t show up on this list, reboot the system and run the command again
Download and README Links:
Dahdi-Tools and Linux (Dahdi-Complete)
2) Verify the channels you are going to tune are not in use.
3) From the bash prompt enter the command:
and examine the options listed.
The most commonly used command option is ‘-i’ ‘[0-9]’ which will run fxotune on every channel from 1 to 252. Another common option is -n which will set the number to dial that cancels dialtone.
An example command that will calibrate echo settings on channels 1 through 24 is:
# fxotune -i -n 4 -b 1 -e 24 -p -vvv
The -p option is added to print the top five detected echo cancellation parameters. See the note below about detuning the fxotune output.
4) After determining what options your system needs, type the entire command at the bash prompt, formatted as the example above. Fxotune should take about a minute per channel.
5) When fxotune is complete, restart the system, or restart dahdi using
# /etc/init.d/dahdi stop
# /etc/init.d/dahdi start
# service dahdi stop
# service dahdi start
The recommend step is to restart the system. This will apply the changes to the module. If the system or dahdi isn’t restarted, then the changes are only written to /etc/fxotune.conf but not loaded onto the module.
For more detailed information about fxotune and it’s options, read the man page by entering the command:
# man fxotune
About the -p option to fxotune: this can be useful in “detuning” the hardware echo canceler, since allowing more noise into the system may allow the echo canceler to be more effective. To detune the fxotune settings, choose one of the top five scores from fxotune, select a line that does not have coefficients of all zeroes, and place this line in /etc/fxotune.conf.
Here is a simulated fxotune result, taken from fxotune -p:
Top 5 results for Acim2_tune Test
Res #1: index=15, 0, 0, 0, 0, 0, 0, 0, 0, 0: magnitude = 8, echo = -60.4568 dB
Res #2: index=9, 0,253,254, 2,255, 0, 0, 0: magnitude = 190, echo = -32.6914 dB
Res #3: index=5, 1,249,254, 4,253, 1, 0, 0: magnitude = 310, echo = -28.4269 dB
Res #4: index=5,252,250, 1, 1,254, 0,255, 0: magnitude = 403, echo = -26.1399 dB
Res #5: index=5, 3,251,250, 2,253,255,255,255: magnitude = 454, echo = -25.1064 dB
fxotune will write the following to /etc/fxotune.conf:
To detune the line, replace that line with the second result (first result without all zeroes for the from above:
Again, this was simulated, your values will be much more appropriate for your system.