[dahdi-commits] sruffell: linux/trunk r9442 - in /linux/trunk: drivers/dahdi/ include/dahdi/
SVN commits to the DAHDI project
dahdi-commits at lists.digium.com
Wed Oct 20 07:23:10 CDT 2010
Author: sruffell
Date: Wed Oct 20 07:23:06 2010
New Revision: 9442
URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9442
Log:
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 #13562)
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 at digium.com>
Acked-by: Kinsey Moore <kmoore at digium.com>
Acked-by: Russ Meyerriecks <rmeyerriecks at digium.com>
Modified:
linux/trunk/drivers/dahdi/dahdi-base.c
linux/trunk/include/dahdi/dahdi_config.h
linux/trunk/include/dahdi/kernel.h
Modified: linux/trunk/drivers/dahdi/dahdi-base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/dahdi-base.c?view=diff&rev=9442&r1=9441&r2=9442
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi-base.c (original)
+++ linux/trunk/drivers/dahdi/dahdi-base.c Wed Oct 20 07:23:06 2010
@@ -2330,6 +2330,21 @@
}
chan->writen[res] = amnt;
}
+#ifdef CONFIG_DAHDI_ECHOCAN_PROCESS_TX
+ if ((chan->ec_state) &&
+ (ECHO_MODE_ACTIVE == chan->ec_state->status.mode) &&
+ (chan->ec_state->ops->echocan_process_tx)) {
+ struct ec_state *const ec_state = chan->ec_state;
+ for (x = 0; x < chan->writen[res]; ++x) {
+ short tx;
+ tx = DAHDI_XLAW(chan->writebuf[res][x], chan);
+ ec_state->ops->echocan_process_tx(ec_state,
+ &tx, 1);
+ chan->writebuf[res][x] = DAHDI_LIN2X((int) tx,
+ chan);
+ }
+ }
+#endif
chan->writeidx[res] = 0;
if (chan->flags & DAHDI_FLAG_FCS)
calc_fcs(chan, res);
Modified: linux/trunk/include/dahdi/dahdi_config.h
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/include/dahdi/dahdi_config.h?view=diff&rev=9442&r1=9441&r2=9442
==============================================================================
--- linux/trunk/include/dahdi/dahdi_config.h (original)
+++ linux/trunk/include/dahdi/dahdi_config.h Wed Oct 20 07:23:06 2010
@@ -126,6 +126,13 @@
*/
/* #define CONFIG_DAHDI_NO_ECHOCAN_DISABLE */
+/*
+ * Define if you would like to allow software echocans to process the tx audio
+ * in addition to the rx audio. Used for things like DC removal.
+ *
+ */
+/* #define CONFIG_DAHDI_ECHOCAN_PROCESS_TX */
+
/*
* Uncomment if you happen have an early TDM400P Rev H which
* sometimes forgets its PCI ID to have wcfxs match essentially all
Modified: linux/trunk/include/dahdi/kernel.h
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/include/dahdi/kernel.h?view=diff&rev=9442&r1=9441&r2=9442
==============================================================================
--- linux/trunk/include/dahdi/kernel.h (original)
+++ linux/trunk/include/dahdi/kernel.h Wed Oct 20 07:23:06 2010
@@ -257,6 +257,15 @@
* \return Nothing.
*/
void (*echocan_NLP_toggle)(struct dahdi_echocan_state *ec, unsigned int enable);
+
+#ifdef CONFIG_DAHDI_ECHOCAN_PROCESS_TX
+ /*! \brief Process an array of TX audio samples.
+ *
+ * \return Nothing.
+ */
+ void (*echocan_process_tx)(struct dahdi_echocan_state *ec,
+ short *tx, u32 size);
+#endif
};
/*! A factory for creating instances of software echo cancelers to be used on DAHDI channels. */
More information about the dahdi-commits
mailing list