mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-19 07:00:03 -05:00
Split the enable-lfe-remixing setting into two
remixing-produce-lfe controls upmixing, and remixing-consume-lfe controls downmixing. The motivation is that a user might want to synthesize LFE while playing stereo audio on his/her 5.1 speakers, but at the same time follow the industry recommendation to omit the LFE channel when producting a stereo downmix (e.g. for headphones) from 5.1 content. Or the other way round. Fixes: #753.
This commit is contained in:
parent
b94dba9daf
commit
464828faf2
12 changed files with 101 additions and 26 deletions
|
|
@ -84,7 +84,8 @@ static const pa_daemon_conf default_conf = {
|
|||
.avoid_resampling = false,
|
||||
.disable_remixing = false,
|
||||
.remixing_use_all_sink_channels = true,
|
||||
.disable_lfe_remixing = true,
|
||||
.remixing_produce_lfe = false,
|
||||
.remixing_consume_lfe = false,
|
||||
.lfe_crossover_freq = 0,
|
||||
.config_file = NULL,
|
||||
.use_pid_file = true,
|
||||
|
|
@ -496,6 +497,48 @@ static int parse_rtprio(pa_config_parser_state *state) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int parse_disable_lfe_remix(pa_config_parser_state *state) {
|
||||
pa_daemon_conf *c;
|
||||
int k;
|
||||
|
||||
pa_assert(state);
|
||||
c = state->data;
|
||||
|
||||
if ((k = pa_parse_boolean(state->rvalue)) < 0) {
|
||||
pa_log("[%s:%u] Failed to parse boolean value: %s", state->filename, state->lineno, state->rvalue);
|
||||
return -1;
|
||||
}
|
||||
|
||||
c->remixing_produce_lfe = c->remixing_consume_lfe = !k;
|
||||
|
||||
pa_log("[%s:%u] Deprecated option 'disable-lfe-remixing' found.", state->filename, state->lineno);
|
||||
pa_log("[%s:%u] Please migrate to 'remixing-produce-lfe' and 'remixing-consume-lfe', set both to '%s'.",
|
||||
state->filename, state->lineno, pa_yes_no(c->remixing_produce_lfe));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int parse_enable_lfe_remix(pa_config_parser_state *state) {
|
||||
pa_daemon_conf *c;
|
||||
int k;
|
||||
|
||||
pa_assert(state);
|
||||
c = state->data;
|
||||
|
||||
if ((k = pa_parse_boolean(state->rvalue)) < 0) {
|
||||
pa_log("[%s:%u] Failed to parse boolean value: %s", state->filename, state->lineno, state->rvalue);
|
||||
return -1;
|
||||
}
|
||||
|
||||
c->remixing_produce_lfe = c->remixing_consume_lfe = k;
|
||||
|
||||
pa_log("[%s:%u] Deprecated option 'enable-lfe-remixing' found.", state->filename, state->lineno);
|
||||
pa_log("[%s:%u] Please migrate to 'remixing-produce-lfe' and 'remixing-consume-lfe', set both to '%s'.",
|
||||
state->filename, state->lineno, pa_yes_no(c->remixing_produce_lfe));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef HAVE_DBUS
|
||||
static int parse_server_type(pa_config_parser_state *state) {
|
||||
pa_daemon_conf *c;
|
||||
|
|
@ -565,8 +608,10 @@ int pa_daemon_conf_load(pa_daemon_conf *c, const char *filename) {
|
|||
{ "enable-remixing", pa_config_parse_not_bool, &c->disable_remixing, NULL },
|
||||
{ "remixing-use-all-sink-channels",
|
||||
pa_config_parse_bool, &c->remixing_use_all_sink_channels, 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 },
|
||||
{ "disable-lfe-remixing", parse_disable_lfe_remix, c, NULL },
|
||||
{ "enable-lfe-remixing", parse_enable_lfe_remix, c, NULL },
|
||||
{ "remixing-produce-lfe", pa_config_parse_bool, &c->remixing_produce_lfe, NULL },
|
||||
{ "remixing-consume-lfe", pa_config_parse_bool, &c->remixing_consume_lfe, 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 },
|
||||
|
|
@ -761,7 +806,8 @@ char *pa_daemon_conf_dump(pa_daemon_conf *c) {
|
|||
pa_strbuf_printf(s, "avoid-resampling = %s\n", pa_yes_no(c->avoid_resampling));
|
||||
pa_strbuf_printf(s, "enable-remixing = %s\n", pa_yes_no(!c->disable_remixing));
|
||||
pa_strbuf_printf(s, "remixing-use-all-sink-channels = %s\n", pa_yes_no(c->remixing_use_all_sink_channels));
|
||||
pa_strbuf_printf(s, "enable-lfe-remixing = %s\n", pa_yes_no(!c->disable_lfe_remixing));
|
||||
pa_strbuf_printf(s, "remixing-produce-lfe = %s\n", pa_yes_no(c->remixing_produce_lfe));
|
||||
pa_strbuf_printf(s, "remixing-consume-lfe = %s\n", pa_yes_no(c->remixing_consume_lfe));
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -70,7 +70,8 @@ typedef struct pa_daemon_conf {
|
|||
avoid_resampling,
|
||||
disable_remixing,
|
||||
remixing_use_all_sink_channels,
|
||||
disable_lfe_remixing,
|
||||
remixing_produce_lfe,
|
||||
remixing_consume_lfe,
|
||||
load_default_script_file,
|
||||
disallow_exit,
|
||||
log_meta,
|
||||
|
|
|
|||
|
|
@ -57,7 +57,8 @@ ifelse(@HAVE_DBUS@, 1, [dnl
|
|||
; avoid-resampling = false
|
||||
; enable-remixing = yes
|
||||
; remixing-use-all-sink-channels = yes
|
||||
; enable-lfe-remixing = no
|
||||
; remixing-produce-lfe = no
|
||||
; remixing-consume-lfe = no
|
||||
; lfe-crossover-freq = 0
|
||||
|
||||
; flat-volumes = no
|
||||
|
|
|
|||
|
|
@ -1056,7 +1056,8 @@ int main(int argc, char *argv[]) {
|
|||
c->avoid_resampling = conf->avoid_resampling;
|
||||
c->disable_remixing = conf->disable_remixing;
|
||||
c->remixing_use_all_sink_channels = conf->remixing_use_all_sink_channels;
|
||||
c->disable_lfe_remixing = conf->disable_lfe_remixing;
|
||||
c->remixing_produce_lfe = conf->remixing_produce_lfe;
|
||||
c->remixing_consume_lfe = conf->remixing_consume_lfe;
|
||||
c->deferred_volume = conf->deferred_volume;
|
||||
c->running_as_daemon = conf->daemonize;
|
||||
c->disallow_exit = conf->disallow_exit;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue