summaryrefslogtreecommitdiff
path: root/src/daemon
diff options
context:
space:
mode:
authorHui Wang <hui.wang@canonical.com>2015-03-24 10:29:16 +0100
committerDavid Henningsson <david.henningsson@canonical.com>2015-03-30 10:52:30 +0200
commitc36e191ce5d38173424c3db9ba06638fd6b8408e (patch)
tree5629e6d88727f7c6e1898b176f104e3893560731 /src/daemon
parent3538e6636edc1ba0b75e7409db618dbb7fe79d3e (diff)
lfe-filter: change the crossover frequency as a parameter
Add a user defined parameter lfe-crossover-freq for the lfe-filter, to pass this parameter to the lfe-filter, we need to change the pa_resampler_new() API as well. Signed-off-by: Hui Wang <hui.wang@canonical.com>
Diffstat (limited to 'src/daemon')
-rw-r--r--src/daemon/daemon-conf.c3
-rw-r--r--src/daemon/daemon-conf.h1
-rw-r--r--src/daemon/daemon.conf.in1
-rw-r--r--src/daemon/main.c1
4 files changed, 6 insertions, 0 deletions
diff --git a/src/daemon/daemon-conf.c b/src/daemon/daemon-conf.c
index 6e9d3778d..82df0ea9e 100644
--- a/src/daemon/daemon-conf.c
+++ b/src/daemon/daemon-conf.c
@@ -83,6 +83,7 @@ static const pa_daemon_conf default_conf = {
.resample_method = PA_RESAMPLER_AUTO,
.disable_remixing = false,
.disable_lfe_remixing = true,
+ .lfe_crossover_freq = 120,
.config_file = NULL,
.use_pid_file = true,
.system_instance = false,
@@ -553,6 +554,7 @@ int pa_daemon_conf_load(pa_daemon_conf *c, const char *filename) {
{ "enable-remixing", pa_config_parse_not_bool, &c->disable_remixing, NULL },
{ "disable-lfe-remixing", pa_config_parse_bool, &c->disable_lfe_remixing, NULL },
{ "enable-lfe-remixing", pa_config_parse_not_bool, &c->disable_lfe_remixing, NULL },
+ { "lfe-crossover-freq", pa_config_parse_unsigned, &c->lfe_crossover_freq, NULL },
{ "load-default-script-file", pa_config_parse_bool, &c->load_default_script_file, NULL },
{ "shm-size-bytes", pa_config_parse_size, &c->shm_size, NULL },
{ "log-meta", pa_config_parse_bool, &c->log_meta, NULL },
@@ -745,6 +747,7 @@ char *pa_daemon_conf_dump(pa_daemon_conf *c) {
pa_strbuf_printf(s, "resample-method = %s\n", pa_resample_method_to_string(c->resample_method));
pa_strbuf_printf(s, "enable-remixing = %s\n", pa_yes_no(!c->disable_remixing));
pa_strbuf_printf(s, "enable-lfe-remixing = %s\n", pa_yes_no(!c->disable_lfe_remixing));
+ pa_strbuf_printf(s, "lfe-crossover-freq = %u\n", c->lfe_crossover_freq);
pa_strbuf_printf(s, "default-sample-format = %s\n", pa_sample_format_to_string(c->default_sample_spec.format));
pa_strbuf_printf(s, "default-sample-rate = %u\n", c->default_sample_spec.rate);
pa_strbuf_printf(s, "alternate-sample-rate = %u\n", c->alternate_sample_rate);
diff --git a/src/daemon/daemon-conf.h b/src/daemon/daemon-conf.h
index 62587b2e5..458784c98 100644
--- a/src/daemon/daemon-conf.h
+++ b/src/daemon/daemon-conf.h
@@ -127,6 +127,7 @@ typedef struct pa_daemon_conf {
unsigned default_n_fragments, default_fragment_size_msec;
unsigned deferred_volume_safety_margin_usec;
int deferred_volume_extra_delay_usec;
+ unsigned lfe_crossover_freq;
pa_sample_spec default_sample_spec;
uint32_t alternate_sample_rate;
pa_channel_map default_channel_map;
diff --git a/src/daemon/daemon.conf.in b/src/daemon/daemon.conf.in
index 067738dac..61df20a98 100644
--- a/src/daemon/daemon.conf.in
+++ b/src/daemon/daemon.conf.in
@@ -55,6 +55,7 @@ ifelse(@HAVE_DBUS@, 1, [dnl
; resample-method = speex-float-1
; enable-remixing = yes
; enable-lfe-remixing = no
+; lfe-crossover-freq = 120
; flat-volumes = yes
diff --git a/src/daemon/main.c b/src/daemon/main.c
index 68ed3830d..deb1e43c2 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
@@ -1029,6 +1029,7 @@ int main(int argc, char *argv[]) {
c->default_fragment_size_msec = conf->default_fragment_size_msec;
c->deferred_volume_safety_margin_usec = conf->deferred_volume_safety_margin_usec;
c->deferred_volume_extra_delay_usec = conf->deferred_volume_extra_delay_usec;
+ c->lfe_crossover_freq = conf->lfe_crossover_freq;
c->exit_idle_time = conf->exit_idle_time;
c->scache_idle_time = conf->scache_idle_time;
c->resample_method = conf->resample_method;