[svn-commits] sruffell: linux/trunk r6589 - in /linux/trunk/drivers/dahdi: voicebus/ wctdm2...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon May 11 12:48:47 CDT 2009


Author: sruffell
Date: Mon May 11 12:48:43 2009
New Revision: 6589

URL: http://svn.asterisk.org/svn-view/dahdi?view=rev&rev=6589
Log:
voicebus: Update the default vpmadt032 parameters.

Move the echo can channel parameters into a common location for both the
wcte12xp and wctdm24xxp drivers that use the voicebus module. This is intended
to make it clearer which differences are required between the clients.
Additionally, update the default parameters to the new recommended values.
VPMADT032-37

Modified:
    linux/trunk/drivers/dahdi/voicebus/GpakApi.h
    linux/trunk/drivers/dahdi/voicebus/GpakCust.c
    linux/trunk/drivers/dahdi/voicebus/GpakCust.h
    linux/trunk/drivers/dahdi/wctdm24xxp/base.c
    linux/trunk/drivers/dahdi/wcte12xp/base.c

Modified: linux/trunk/drivers/dahdi/voicebus/GpakApi.h
URL: http://svn.asterisk.org/svn-view/dahdi/linux/trunk/drivers/dahdi/voicebus/GpakApi.h?view=diff&rev=6589&r1=6588&r2=6589
==============================================================================
--- linux/trunk/drivers/dahdi/voicebus/GpakApi.h (original)
+++ linux/trunk/drivers/dahdi/voicebus/GpakApi.h Mon May 11 12:48:43 2009
@@ -43,7 +43,7 @@
 } GpakAsyncEventData_t;
 
 /* Definition of an Echo Canceller Parameters information structure. */
-typedef struct
+typedef struct GpakEcanParms
 {
     short int EcanTapLength;       // Echo Can Num Taps (tail length) 
     short int EcanNlpType;         // Echo Can NLP Type 

Modified: linux/trunk/drivers/dahdi/voicebus/GpakCust.c
URL: http://svn.asterisk.org/svn-view/dahdi/linux/trunk/drivers/dahdi/voicebus/GpakCust.c?view=diff&rev=6589&r1=6588&r2=6589
==============================================================================
--- linux/trunk/drivers/dahdi/voicebus/GpakCust.c (original)
+++ linux/trunk/drivers/dahdi/voicebus/GpakCust.c Mon May 11 12:48:43 2009
@@ -395,9 +395,8 @@
 
 	/* Add a little extra to store the wq_name. */
 	vpm = kzalloc(sizeof(*vpm) + length, GFP_KERNEL);
-	if (!vpm) {
+	if (!vpm)
 		return NULL;
-	}
 
 	strcpy(vpm->wq_name, board_name);
 	strcat(vpm->wq_name, suffix);
@@ -545,6 +544,30 @@
 }
 EXPORT_SYMBOL(vpmadt032_init);
 
+void vpmadt032_get_default_parameters(struct GpakEcanParms *p)
+{
+	memset(p, 0, sizeof(*p));
+
+	p->EcanTapLength = 1024;
+	p->EcanNlpType = DEFAULT_NLPTYPE;
+	p->EcanAdaptEnable = 1;
+	p->EcanG165DetEnable = 1;
+	p->EcanDblTalkThresh = 6;
+	p->EcanMaxDoubleTalkThres = 40;
+	p->EcanNlpThreshold = DEFAULT_NLPTHRESH;
+	p->EcanNlpConv = 0;
+	p->EcanNlpUnConv = 12;
+	p->EcanNlpMaxSuppress = DEFAULT_NLPMAXSUPP;
+	p->EcanCngThreshold = 43;
+	p->EcanAdaptLimit = 50;
+	p->EcanCrossCorrLimit = 15;
+	p->EcanNumFirSegments = 3;
+	p->EcanFirSegmentLen = 48;
+	p->EcanReconvergenceCheckEnable = 2;
+	p->EcanTandemOperationEnable = 0;
+	p->EcanMixedFourWireMode = 0;
+}
+EXPORT_SYMBOL(vpmadt032_get_default_parameters);
 
 void vpmadt032_free(struct vpmadt032 *vpm)
 {

Modified: linux/trunk/drivers/dahdi/voicebus/GpakCust.h
URL: http://svn.asterisk.org/svn-view/dahdi/linux/trunk/drivers/dahdi/voicebus/GpakCust.h?view=diff&rev=6589&r1=6588&r2=6589
==============================================================================
--- linux/trunk/drivers/dahdi/voicebus/GpakCust.h (original)
+++ linux/trunk/drivers/dahdi/voicebus/GpakCust.h Mon May 11 12:48:43 2009
@@ -77,10 +77,13 @@
 #define NLPTYPE_RANDOM_NOISE 	2
 #define HOTH_NOISE_NLPTYPE 	3
 #define NLPTYPE_SUPPRESS	4
-#define DEFAULT_NLPTYPE 	NLPTYPE_SUPPRESS
+#define NLPTYPE_RESERVED	5
+#define NLPTYPE_AUTOSUPPRESS	6
+#define DEFAULT_NLPTYPE 	NLPTYPE_AUTOSUPPRESS
 
 /* This is the threshold (in dB) for enabling and disabling of the NLP */
-#define DEFAULT_NLPTHRESH		24
+#define DEFAULT_NLPTHRESH		22
+#define DEFAULT_NLPMAXSUPP		10
 
 struct vpmadt032_cmd {
 	struct list_head node;
@@ -145,6 +148,9 @@
 void vpmadt032_echocan_free(struct vpmadt032 *vpm, struct dahdi_chan *chan,
 	struct dahdi_echocan_state *ec);
 
+struct GpakEcanParms;
+void vpmadt032_get_default_parameters(struct GpakEcanParms *p);
+
 /* If there is a command ready to go to the VPMADT032, return it, otherwise NULL */
 static inline struct vpmadt032_cmd *vpmadt032_get_ready_cmd(struct vpmadt032 *vpm)
 {

Modified: linux/trunk/drivers/dahdi/wctdm24xxp/base.c
URL: http://svn.asterisk.org/svn-view/dahdi/linux/trunk/drivers/dahdi/wctdm24xxp/base.c?view=diff&rev=6589&r1=6588&r2=6589
==============================================================================
--- linux/trunk/drivers/dahdi/wctdm24xxp/base.c (original)
+++ linux/trunk/drivers/dahdi/wctdm24xxp/base.c Mon May 11 12:48:43 2009
@@ -215,7 +215,7 @@
 
 static int vpmnlptype = DEFAULT_NLPTYPE;
 static int vpmnlpthresh = DEFAULT_NLPTHRESH;
-static int vpmnlpmaxsupp = DEFAULT_NLPTHRESH;
+static int vpmnlpmaxsupp = DEFAULT_NLPMAXSUPP;
 
 static int echocan_create(struct dahdi_chan *chan, struct dahdi_echocanparams *ecp,
 			   struct dahdi_echocanparam *p, struct dahdi_echocan_state **ec);
@@ -288,6 +288,7 @@
 void setchanconfig_from_state(struct vpmadt032 *vpm, int channel, GpakChannelConfig_t *chanconfig)
 {
 	const struct vpmadt032_options *options;
+	GpakEcanParms_t *p;
 
 	BUG_ON(!vpm);
 
@@ -323,20 +324,13 @@
 	}
 		
 	chanconfig->FrameRate = rate2ms;
-	chanconfig->EcanParametersA.EcanTapLength = 1024;
-	chanconfig->EcanParametersA.EcanNlpType = vpm->curecstate[channel].nlp_type;
-	chanconfig->EcanParametersA.EcanAdaptEnable = 1;
-	chanconfig->EcanParametersA.EcanG165DetEnable = 1;
-	chanconfig->EcanParametersA.EcanDblTalkThresh = 6;
-	chanconfig->EcanParametersA.EcanNlpThreshold = vpm->curecstate[channel].nlp_threshold;
-	chanconfig->EcanParametersA.EcanNlpConv = 0;
-	chanconfig->EcanParametersA.EcanNlpUnConv = 0;
-	chanconfig->EcanParametersA.EcanNlpMaxSuppress = vpm->curecstate[channel].nlp_max_suppress;
-	chanconfig->EcanParametersA.EcanCngThreshold = 43;
-	chanconfig->EcanParametersA.EcanAdaptLimit = 50;
-	chanconfig->EcanParametersA.EcanCrossCorrLimit = 15;
-	chanconfig->EcanParametersA.EcanNumFirSegments = 3;
-	chanconfig->EcanParametersA.EcanFirSegmentLen = 48;
+	p = &chanconfig->EcanParametersA;
+
+	vpmadt032_get_default_parameters(p);
+
+	p->EcanNlpType = vpm->curecstate[channel].nlp_type;
+	p->EcanNlpThreshold = vpm->curecstate[channel].nlp_threshold;
+	p->EcanNlpMaxSuppress = vpm->curecstate[channel].nlp_max_suppress;
 
 	memcpy(&chanconfig->EcanParametersB,
 		&chanconfig->EcanParametersA,

Modified: linux/trunk/drivers/dahdi/wcte12xp/base.c
URL: http://svn.asterisk.org/svn-view/dahdi/linux/trunk/drivers/dahdi/wcte12xp/base.c?view=diff&rev=6589&r1=6588&r2=6589
==============================================================================
--- linux/trunk/drivers/dahdi/wcte12xp/base.c (original)
+++ linux/trunk/drivers/dahdi/wcte12xp/base.c Mon May 11 12:48:43 2009
@@ -63,7 +63,7 @@
 
 int vpmnlptype = DEFAULT_NLPTYPE;
 int vpmnlpthresh = DEFAULT_NLPTHRESH;
-int vpmnlpmaxsupp = DEFAULT_NLPTHRESH;
+int vpmnlpmaxsupp = DEFAULT_NLPMAXSUPP;
 
 static int echocan_create(struct dahdi_chan *chan, struct dahdi_echocanparams *ecp,
 			   struct dahdi_echocanparam *p, struct dahdi_echocan_state **ec);
@@ -1291,6 +1291,7 @@
 static void setchanconfig_from_state(struct vpmadt032 *vpm, int channel, GpakChannelConfig_t *chanconfig)
 {
 	const struct vpmadt032_options *options;
+	GpakEcanParms_t *p;
 
 	BUG_ON(!vpm);
 
@@ -1316,25 +1317,14 @@
 	chanconfig->SoftwareCompand = cmpPCMU;
 
 	chanconfig->FrameRate = rate10ms;
-	chanconfig->EcanParametersA.EcanTapLength = 1024;
-	chanconfig->EcanParametersA.EcanNlpType = vpm->curecstate[channel].nlp_type;
-	chanconfig->EcanParametersA.EcanAdaptEnable = 1;
-	chanconfig->EcanParametersA.EcanG165DetEnable = 1;
-	chanconfig->EcanParametersA.EcanDblTalkThresh = 6;
-	chanconfig->EcanParametersA.EcanMaxDoubleTalkThres = 40;
-	chanconfig->EcanParametersA.EcanNlpThreshold = vpm->curecstate[channel].nlp_threshold;
-	chanconfig->EcanParametersA.EcanNlpConv = 0;
-	chanconfig->EcanParametersA.EcanNlpUnConv = 12;
-	chanconfig->EcanParametersA.EcanNlpMaxSuppress = vpm->curecstate[channel].nlp_max_suppress;
-	chanconfig->EcanParametersA.EcanCngThreshold = 43;
-	chanconfig->EcanParametersA.EcanAdaptLimit = 50;
-	chanconfig->EcanParametersA.EcanCrossCorrLimit = 15;
-	chanconfig->EcanParametersA.EcanNumFirSegments = 3;
-	chanconfig->EcanParametersA.EcanFirSegmentLen = 48;
-	chanconfig->EcanParametersA.EcanReconvergenceCheckEnable = 1;
-	chanconfig->EcanParametersA.EcanTandemOperationEnable = 1;
-	chanconfig->EcanParametersA.EcanMixedFourWireMode = 1;
-
+
+	p = &chanconfig->EcanParametersA;
+
+	vpmadt032_get_default_parameters(p);
+
+	p->EcanNlpType = vpm->curecstate[channel].nlp_type;
+	p->EcanNlpThreshold = vpm->curecstate[channel].nlp_threshold;
+	p->EcanNlpMaxSuppress = vpm->curecstate[channel].nlp_max_suppress;
 
 	memcpy(&chanconfig->EcanParametersB,
 		&chanconfig->EcanParametersA,




More information about the svn-commits mailing list