[Home]

Summary:DAHLIN-00048: [patch] It's necessary to have high pass filter for tx signal of DAHDI.
Reporter:Pavel Selivanov (biohumanoid)Labels:
Date Opened:2008-09-26 04:27:30Date Closed:2010-10-20 07:23:14
Priority:MajorRegression?No
Status:Closed/CompleteComponents:dahdi (the module)/NewFeature
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) dahdi_echocan_oslec.c.patch
( 1) dahdi-base.c.#2.patch
( 2) dahdi-base.c.ec.patch
( 3) dahdi-base.c.patch
( 4) kernel.c.ec.patch
( 5) kernel.h.patch
Description:It's necessary to have low frequency filter for tx signal of DAHDI.
Otherwise, low-frequency signal from IP can reach a leased line, and return back with nonlinear distortions. This will break an echo canceller.


****** ADDITIONAL INFORMATION ******

Please, add a field 'echo_can_array_hpf_tx'to 'struct dahdi_echocan'.
Thus, it will be a full-scale echocanceller interface.
Comments:By: Tzafrir Cohen (tzafrir) 2008-09-26 12:52:53

Can you suggest an implementation for the extra echo canceller method you suggest here (the one to filter the transmit path of the zaptel channel).

By: Pavel Selivanov (biohumanoid) 2008-09-27 01:50:23

<link removed>

This patch will to make OSLEC as a module (without any patches to DAHDI).



By: Russell Bryant (russell) 2008-10-01 15:37:20

We can not use code that has not been properly licensed to us for inclusion.

By: Pavel Selivanov (biohumanoid) 2008-10-01 22:37:05

I don't suggest you to include low frequency filter from OSLEC.
I remember you are limited by the licence.

That's why I suggest you to include the new callback (the callback and my patches are properly licenced).
Thus, it will be possible to include any tx HPF to DAHDI via echocanceller.

By: Tzafrir Cohen (tzafrir) 2008-10-21 15:15:03

a dahdi EC module was added . Feel free to patch vs. it.

By: Pavel Selivanov (biohumanoid) 2008-11-10 18:18:30.000-0600

Thanks. But this patch not to oslec, but to DAHDI API...
I saw the difference without hpf, and with hpf.
It's really good to have it...

By: Shaun Ruffell (sruffell) 2008-11-25 15:43:49.000-0600

Why would this be more appropriately done in the kernel as opposed to in user space?  Does the echo canceler state play into the high pass filter in any way?

By: Leif Madsen (lmadsen) 2009-02-02 16:27:03.000-0600

Pinging original reporter.

By: Pavel Selivanov (biohumanoid) 2009-02-03 01:40:47.000-0600

>Pinging original reporter.
Pong :-)

> Why would this be more appropriately done in the kernel as opposed to in user space? Does the echo canceler state play into the high pass filter in any way?

Ofcourse, The best place for HPF is user-space chan_zap (chan_dahdi).
But, what if you use hardware EC ? Maybe it already has HPF inside ?
In this case, we need one more flag for chan_dahdi (hpf=some_thresh_value or hpf=off/on).

Taking into account zaptel/asterisk have a lots of openned bugs, I think so "BIG" asterisk patch will never be included.
So, I've made a "small" patch for zaptel.

If you will include HPF on RX/TX in chan_dahdi - I'll be more than just happy.

By: Leif Madsen (lmadsen) 2009-02-03 07:41:11.000-0600

Thanks for the feedback biohumanoid. I'll see what I can do about getting this issue moved forward.

By: Pavel Selivanov (biohumanoid) 2009-06-02 02:06:38

Is there any action on including TX HPF ?

I've just updated the patches on HPF (dated by 2009-06-02) for dahdi 2.2.0-rc4.

Now, HPF take action in dahdi_chan_write. So, it will process audio data from userspace (from VoIP), and will not affect TDM to TDM data.

Please, read http://www.rowetel.com/blog/?p=33 article "Fun with Soft Phones".
If you will call from VoIP to PSTN (using OSLEC) - you will hear the problem, when you will say "pineapple".
I wonder, how do you call... HPEC isn't the only echo canceller (I think it have HPF included)...

I haven't included a new feature in dahdi_echocan_features, but it should be.

By: Pavel Selivanov (biohumanoid) 2009-06-02 05:22:13

dahdi-base.c.#2.patch
Changed the condition
(ECHO_MODE_IDLE != chan->ec_state->status.mode)
to
(ECHO_MODE_ACTIVE == chan->ec_state->status.mode)
I think we have no reason to call HPF in FAX mode.
echocanceller can read status.mode and ignore the request, but what for ?

By: Pavel Selivanov (biohumanoid) 2009-06-02 06:22:45

Can you please correct the title.
not "low frequency filter", but "high pass filter" is more correct in english (I think).

By: Shaun Ruffell (sruffell) 2009-06-04 10:55:02

biohumanoid: I'm convinced.  But, I'm wondering instead of adding the echocan_hpf_tx member, that instead echocan_process should be changed to echocan_process_tx and echocan_process_rx then dahdi_monitor could really have something to process for the pre/post streams on tx.  (unless of course that was always intended to *really* do some echocan by subtracting the received signal from the tx signal.  But that isn't my experience)

By: Shaun Ruffell (sruffell) 2009-06-04 10:57:59

This would also allow the semantics to more naturally map to "echocans can preprocess the tx audio in anyway they want to improve their operation".

By: Digium Subversion (svnbot) 2010-10-20 07:23:08

Repository: dahdi
Revision: 9442

U   linux/trunk/drivers/dahdi/dahdi-base.c
U   linux/trunk/include/dahdi/dahdi_config.h
U   linux/trunk/include/dahdi/kernel.h

------------------------------------------------------------------------
r9442 | sruffell | 2010-10-20 07:23:07 -0500 (Wed, 20 Oct 2010) | 18 lines

dahdi: Add compile time DAHDI_ECHOCAN_PROCESS_TX option.

Add optional interface to allow software echo cans to process the
transmitted samples.  Can be used for things like DC removal.

I used the following patches uploaded by biohumanoid but changed the
name of 'echocan_hpf_tx' to 'echoan_process_tx and put the changes
behind a compile time option.

(issue DAHLIN-48)
Reported by: biohumanoid
Patches:
     kernel.h.patch uploaded by biohumanoid (license 459)
     dahdi-base.c.#2.patch uploaded by biohumanoid (license 459)

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Kinsey Moore <kmoore@digium.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>
------------------------------------------------------------------------

http://svn.digium.com/view/dahdi?view=rev&revision=9442

By: Digium Subversion (svnbot) 2010-10-20 07:23:12

Repository: dahdi
Revision: 9443

U   linux/trunk/drivers/dahdi/dahdi_echocan_oslec.c

------------------------------------------------------------------------
r9443 | sruffell | 2010-10-20 07:23:11 -0500 (Wed, 20 Oct 2010) | 18 lines

dahdi_echocan_oslec: Call olsec_hpf_tx if CONFIG_DAHDI_PROCESS_ECHOCAN_TX is defined.

It can be necessary to have low frequency filter for tx signal of DAHDI.
Otherwise, low-frequency signal from IP can reach a leased line, and
return back with nonlinear distortions. This will break an echo
canceler.

(closes issue DAHLIN-48)
Reported by: biohumanoid
Patches:
     dahdi_echocan_oslec.c.patch uploaded by biohumanoid (license 459)

I slightly modified the above patch in order to use echocan_process_tx
as the interface.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Kinsey Moore <kmoore@digium.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>
------------------------------------------------------------------------

http://svn.digium.com/view/dahdi?view=rev&revision=9443