summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorArun Raghavan <arun.raghavan@collabora.co.uk>2011-07-09 12:55:18 -0700
committerArun Raghavan <arun.raghavan@collabora.co.uk>2011-07-09 12:59:11 -0700
commit0f91e43d99bcddaa5eb7714eb3342899bee615cd (patch)
tree240146eabba87be568fd89a34d5e35df54939c42 /src
parented0e879cd999750d06e189953319786e5178cf27 (diff)
echo-cancel: Set sane defaults for module initialisation
This picks sane defaults for the sample spec used (32 kHz, mono) and preprocessing (on by default). This should make it unncessary to provide additional parameters in the default desktop case. The main exception would be decreasing the sample rate for hardware with limited processing power (can bring it down to 16 or 8 kHz).
Diffstat (limited to 'src')
-rw-r--r--src/modules/echo-cancel/module-echo-cancel.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/modules/echo-cancel/module-echo-cancel.c b/src/modules/echo-cancel/module-echo-cancel.c
index b84bf1db..a03fa820 100644
--- a/src/modules/echo-cancel/module-echo-cancel.c
+++ b/src/modules/echo-cancel/module-echo-cancel.c
@@ -105,10 +105,12 @@ static const pa_echo_canceller ec_table[] = {
},
};
+#define DEFAULT_RATE 32000
+#define DEFAULT_CHANNELS 1
#define DEFAULT_ADJUST_TIME_USEC (1*PA_USEC_PER_SEC)
-#define DEFAULT_AGC_ENABLED FALSE
-#define DEFAULT_DENOISE_ENABLED FALSE
-#define DEFAULT_ECHO_SUPPRESS_ENABLED FALSE
+#define DEFAULT_AGC_ENABLED TRUE
+#define DEFAULT_DENOISE_ENABLED TRUE
+#define DEFAULT_ECHO_SUPPRESS_ENABLED TRUE
#define DEFAULT_ECHO_SUPPRESS_ATTENUATION 0
#define DEFAULT_SAVE_AEC 0
#define DEFAULT_AUTOLOADED FALSE
@@ -1359,7 +1361,9 @@ int pa__init(pa_module*m) {
pa_assert(sink_master);
source_ss = source_master->sample_spec;
- source_map = source_master->channel_map;
+ source_ss.rate = DEFAULT_RATE;
+ source_ss.channels = DEFAULT_CHANNELS;
+ pa_channel_map_init_auto(&source_map, source_ss.channels, PA_CHANNEL_MAP_DEFAULT);
if (pa_modargs_get_sample_spec_and_channel_map(ma, &source_ss, &source_map, PA_CHANNEL_MAP_DEFAULT) < 0) {
pa_log("Invalid sample format specification or channel map");
goto fail;