Echo Cancellation Problem with OSLEC

I am running FreePBX Distro 3.211.63-5 and I seem to be having a problem with the echo cancellation.

I have a Digium TE121 with hardware echo cancellation.

/etc/dahdi/system.conf
# Span 1: WCT1/0 “Wildcard TE121 Card 0” (MASTER)
span=1,1,0,esf,b8zs

termtype: te

bchan=1-23
dchan=24
echocanceller=oslec,1-23

/etc/asterisk/chan_dahdi.conf
echocancel=yes
echocancelwhenbridged=no
echotraining=800

dahdi_cfg -vvv
DAHDI Tools Version - 2.6.1

DAHDI Version: 2.6.1
Echo Canceller(s): HWEC, OSLEC
Configuration

SPAN 1: ESF/B8ZS Build-out: 0 db (CSU)/0-133 feet (DSX-1)

Channel map:

Channel 01: Clear channel (Default) (Echo Canceler: oslec) (Slaves: 01)
Channel 02: Clear channel (Default) (Echo Canceler: oslec) (Slaves: 02)
Channel 03: Clear channel (Default) (Echo Canceler: oslec) (Slaves: 03)
Channel 04: Clear channel (Default) (Echo Canceler: oslec) (Slaves: 04)
Channel 05: Clear channel (Default) (Echo Canceler: oslec) (Slaves: 05)
Channel 06: Clear channel (Default) (Echo Canceler: oslec) (Slaves: 06)
Channel 07: Clear channel (Default) (Echo Canceler: oslec) (Slaves: 07)
Channel 08: Clear channel (Default) (Echo Canceler: oslec) (Slaves: 08)
Channel 09: Clear channel (Default) (Echo Canceler: oslec) (Slaves: 09)
Channel 10: Clear channel (Default) (Echo Canceler: oslec) (Slaves: 10)
Channel 11: Clear channel (Default) (Echo Canceler: oslec) (Slaves: 11)
Channel 12: Clear channel (Default) (Echo Canceler: oslec) (Slaves: 12)
Channel 13: Clear channel (Default) (Echo Canceler: oslec) (Slaves: 13)
Channel 14: Clear channel (Default) (Echo Canceler: oslec) (Slaves: 14)
Channel 15: Clear channel (Default) (Echo Canceler: oslec) (Slaves: 15)
Channel 16: Clear channel (Default) (Echo Canceler: oslec) (Slaves: 16)
Channel 17: Clear channel (Default) (Echo Canceler: oslec) (Slaves: 17)
Channel 18: Clear channel (Default) (Echo Canceler: oslec) (Slaves: 18)
Channel 19: Clear channel (Default) (Echo Canceler: oslec) (Slaves: 19)
Channel 20: Clear channel (Default) (Echo Canceler: oslec) (Slaves: 20)
Channel 21: Clear channel (Default) (Echo Canceler: oslec) (Slaves: 21)
Channel 22: Clear channel (Default) (Echo Canceler: oslec) (Slaves: 22)
Channel 23: Clear channel (Default) (Echo Canceler: oslec) (Slaves: 23)
Channel 24: D-channel (Default) (Echo Canceler: none) (Slaves: 24)

24 channels to configure.

Setting echocan for channel 1 to oslec
Setting echocan for channel 2 to oslec
Setting echocan for channel 3 to oslec
Setting echocan for channel 4 to oslec
Setting echocan for channel 5 to oslec
Setting echocan for channel 6 to oslec
Setting echocan for channel 7 to oslec
Setting echocan for channel 8 to oslec
Setting echocan for channel 9 to oslec
Setting echocan for channel 10 to oslec
Setting echocan for channel 11 to oslec
Setting echocan for channel 12 to oslec
Setting echocan for channel 13 to oslec
Setting echocan for channel 14 to oslec
Setting echocan for channel 15 to oslec
Setting echocan for channel 16 to oslec
Setting echocan for channel 17 to oslec
Setting echocan for channel 18 to oslec
Setting echocan for channel 19 to oslec
Setting echocan for channel 20 to oslec
Setting echocan for channel 21 to oslec
Setting echocan for channel 22 to oslec
Setting echocan for channel 23 to oslec
Setting echocan for channel 24 to none

From what I can tell, everything seems to be configured properly, but yet I get these log entries seemingly for all channels:

[2014-06-09 09:51:18] WARNING[1987][C-00002502] chan_dahdi.c: Unable to enable echo cancellation on channel 2 (No such device)
2014-06-09 09:52:35] WARNING[1987][C-00002504] chan_dahdi.c: Unable to enable echo cancellation on channel 5 (No such device)
[2014-06-09 09:58:05] WARNING[1987][C-00002513] chan_dahdi.c: Unable to enable echo cancellation on channel 6 (No such device)
[2014-06-09 09:58:24] WARNING[1987][C-00002515] chan_dahdi.c: Unable to enable echo cancellation on channel 1 (No such device)
[2014-06-09 10:01:12] WARNING[1987][C-0000251e] chan_dahdi.c: Unable to enable echo cancellation on channel 9 (No such device)
[2014-06-09 10:01:25] WARNING[1987][C-0000251f] chan_dahdi.c: Unable to enable echo cancellation on channel 10 (No such device)

Is there something obvious I’m missing here?

Thanks in advance!

If you have hardware echo cancellation then use “hwec” and not “oslec” in system.conf it is a more appropriate echo canceller

Thanks, dicko. That was another point I was wondering about, whether I should be using the hardware echo cancellation instead of oslec. I think by default, the FreePBX Distro set it to use oslec instead of hardware and it was never manually changed.

Is there a way to change this through the FreePBX GUI, or is changing it directly in /etc/dahdi/system.conf permanent?

I’m sorry, I have no idea, I don’t use that module, just giving you the legacy “skinny” as to how DAHDI works.

No by default we use hardware not software. You sure your card has hardware echo can.

To clarify not we…

Dahdi will use the onboard EC then fail out to the software. Your problem is probably not echo as there really is no such thing in a digital environment. Adjust the gains on tour phones.

Yes, I’m fairly certain we have the version of TE121 that includes the hardware echo cancellation. If the “dahdi_cfg -vvv” output shows “Echo Canceller(s): HWEC, OSLEC”, that should be enough to confirm it, shouldn’t it?

James, are you saying that dahdi will try to use hardware echo cancellation first even if “echocanceller=oslec,1-23” is explicitly configured in /etc/dahdi/system.conf?

Also, I’m not really understanding your statement regarding no such thing as echo in a digital environment. If that’s the case, why would the TE121 card even come with hardware echo cancellation then?

Thanks…

ISDN PRI lines (4 wires: one pair to TX, one pair to RX) should not show typical (hybrid) ECHO typically found on Analog (or ISDN BRI) PSTN lines, eventually you can still suffer of (Acoustic) ECHO but this one is generated on the phone end and not on the line (due to wires coupling) itself.

ISDN BRI lines (2 wires: just one pair to TX and RX -> wires coupling) could have (hybrid) ECHO even if this should happen rarely.

Keeping FreePBX DAHDI updated (actually it should be at 2.9.0.1) as suggested here (your FreePBX Distro is somewhat old…) could be helpful in debug any issue related to it.

Then, between FreePBX Distro 3.211.63-5 and the latest one available (Keep in mind the development in Kernel and Kernel based drivers/modules), there were big improvements (DAHDI, Digium Cards Firmware, etc.) and changes in FreePBX Modules (FreePBX DAHDI Configuration Module) and configuration files so keeping the FreePBX Distro updated will help you too.

@jfinstrom Hi James, following what you wrote: Dahdi will use the onboard EC then fail out to the software. I should expect that, in a system with one (or more) PSTN Card without any Hardware Echo Canceller Module (like the very cheap HFC ISDN PCI Cards), the FreePBX DAHDI module, once enabled and basically configured the very first time (so PSTN Cards appear and basic paramters were set, but not setting any “echocanceller” on the channels), not finding any Hardware Echo Canceller module onboard (or if the DAHDI Config -> Global Setting “Enable Echo Canceling” is set to “No” - default is “Yes” - so any Hardware Echo Canceller capability is forced to be disabled) shall fall out enabling the (default) Software Echo Canceller OSLEC (or just another compatible one)… is that assumption correct?