Tech Notes

Tech Note #20140001

If you wish to take advantage of the superior echo cancellation provided by OSLEC, and you install the echo canceller as one of your DAHDI drivers, according to the instructions provided on the OSLEC Web site, you may experience problems loading the echo canceller because the symbols exported in the echo kernel driver are not visible.

Problem Description:

The echo cancellation properties of OSLEC are purported to be superior to the other echo cancellers provided with DAHDI. Unfortunately, this echo canceller is not included along with the other DAHDI drivers because it is supposed to be provided by the kernel (kernel 2.6.28 has it in the staging area). However, this is no help for the 2.6.18 kernel employed by RedHat 5.x/CentOS 5.x so an install procedure that allows the DAHDI build to build and install the staged kernel echo cancellation driver, along with a shim that passes the DAHDI echo cancellation requests on to kernel driver, is described on the OSLEC Web site.

The build procedure produces the kernel driver and shim correctly (echo.ko and dahdi_echocan_oslec.ko). But, upon loading DAHDI, the following errors can occur:


modprobe: FATAL: Error inserting dahdi_echocan_oslec (/lib/modules/\
  2.6.18-194.11.1.el5/dahdi/dahdi_echocan_oslec.ko): Unknown symbol in \
  module, or unknown parameter (see dmesg)
kernel: dahdi_echocan_oslec: Unknown symbol oslec_create
kernel: dahdi_echocan_oslec: Unknown symbol oslec_update
kernel: dahdi_echocan_oslec: Unknown symbol oslec_free
kernel: dahdi_echocan_oslec: Unknown symbol oslec_hpf_tx

Either the echo.ko echo cancellation kernel driver did not get installed properly by the DAHDI build, the dependancy between dahdi_echocan_oslec.ko and echo.ko did not get defined properly, the echo.ko module failed to load or was not loaded, or the symbols in echo.ko were not exposed properly. One way or another dahdi_echocan_oslec.ko is not finding the routines that it needs in echo.ko or vice versa.

The dahdi_echocan_oslec.ko shim may begin working with later versions of the kernel, when oslec is actually built into it, but in the meantime DAHDI users who are not running on the latest version of Linux (for whatever reason) may not be able to take advantage of OSLEC.

Problem Resolution:

The code for the OSLEC kernel echo canceller has been rolled in to the DAHDI OSLEC shim to create a single module that does echo cancellation just like the other DAHDI echo cancellers do. No need to download and build staged kernel source. The dahdi_echocan_oslec.ko built from this source simply loads and provides the Open Source Line Echo Canceller.

The source code that was previously described by Tech_20100001 and which was intended to be built under dahdi-linux-complete-2.3.0.1+2.3.0 has been updated to build under dahdi-linux-complete-2.5.1+2.5.1 and other versions of DAHDI circa its timeframe and is now packaged in a new tarball that can be downloaded here.

To install the OSLEC source, untar it and copy the files in the subdirectory to your DAHDI build tree (note that the version number of the OSLEC tarball implies that it works with the DAHDI source that matches that version but, as we noted above, you may be able to apply it to other versions of DAHDI circa the dahdi-linux-complete-2.5.1+2.5.1 timeframe as well):


cd .../asterisk
tar -xvzf dahdi-linux-oslec-2.5.1+2.5.1.tar.gz
cp dahdi-linux-oslec-2.5.1+2.5.1/* dahdi-linux-complete-2.5.1+2.5.1/\
                                   linux/drivers/dahdi

Now, edit dahdi-linux-complete-2.5.1+2.5.1/linux/drivers/dahdi/Kbuild and comment the first, third and fourth of the four lines related to oslec.. You should do something like this:


     .
     .
     .
# If you want to build OSLEC, include the code in the standard location:
# drivers/staging/echo . The DAHDI OSLEC echo canceller will be built as
# well:
#ifneq (,$(wildcard $(src)/../staging/echo/echo.c))
obj-m += dahdi_echocan_oslec.o
#obj-m += ../staging/echo/echo.o
#endif
     .
     .
     .

Be sure not to uncomment the third line in Kbuild that adds ../staging/echo/echo.o to the build list. The build for echo.ko is no longer required, since the source from echo.c has been rolled in to dahdi_echocan_oslec.c.

When DAHDI is built, the OSLEC echo canceller should be built too. The install will install it in the kernel tree and it should now be available for use by DAHDI-defined lines.

If you have an earlier version of DAHDI than dahdi-linux-complete-2.5.1+2.5.1, you may have more success with the version of oslec that is described by Tech_20100001.