</option>
<option>
- <p><opt>enable-lfe-remixing=</opt> If disabled when upmixing or
- downmixing ignore LFE channels. When this option is disabled the
- output LFE channel will only get a signal when an input LFE
- channel is available as well. If no input LFE channel is
- available the output LFE channel will always be 0. If no output
- LFE channel is available the signal on the input LFE channel
- will be ignored. Defaults to <opt>no</opt>.</p>
+ <p><opt>enable-lfe-remixing=</opt> This is a way to set
+ <opt>remixing-produce-lfe</opt> and <opt>remixing-consume-lfe</opt>
+ to the same value at once. This option only exists for backward
+ compatibility and may be removed in a future version of PulseAudio.</p>
+ </option>
+
+ <option>
+ <p><opt>remixing-produce-lfe=</opt> If enabled, and the sink input
+ does not have the LFE channel, synthesize the output LFE channel
+ as a (lowpass-filtered, if <opt>lfe-crossover-freq</opt> is not 0)
+ average of all input channels. Also, when <opt>lfe-crossover-freq</opt>
+ is not 0, filter out low frequencies from other channels while
+ producing a synthetic LFE output. If disabled, the output LFE channel
+ will only get a signal when an input LFE channel is available as well.
+ Defaults to <opt>no</opt>.</p>
+ </option>
+
+ <option>
+ <p><opt>remixing-consume-lfe=</opt> If enabled, and the sink does not
+ have an LFE channel, redirect the input LFE channel (if any) to other
+ channels. If disabled, the input LFE channel will remain unused unless
+ the sink has the LFE channel as well. Defaults to <opt>no</opt>.</p>
</option>
<option>
.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,
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;
{ "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 },
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);
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,
; 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
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;
c->realtime_priority = 5;
c->disable_remixing = false;
c->remixing_use_all_sink_channels = true;
- c->disable_lfe_remixing = true;
+ c->remixing_produce_lfe = false;
+ c->remixing_consume_lfe = false;
c->lfe_crossover_freq = 0;
c->deferred_volume = true;
c->resample_method = PA_RESAMPLER_SPEEX_FLOAT_BASE + 1;
bool avoid_resampling:1;
bool disable_remixing:1;
bool remixing_use_all_sink_channels:1;
- bool disable_lfe_remixing:1;
+ bool remixing_produce_lfe:1;
+ bool remixing_consume_lfe:1;
bool deferred_volume:1;
pa_resample_method_t resample_method;
* right input channel. Something is really wrong in this
* case anyway. */
- } else if (on_lfe(b) && !(r->flags & PA_RESAMPLER_NO_LFE)) {
+ } else if (on_lfe(b) && (r->flags & PA_RESAMPLER_PRODUCE_LFE)) {
/* We are not connected and an LFE. Let's average all
* channels for LFE. */
m->map_table_f[oc][ic] = (1.f/9.f) / (float) ic_unconnected_center;
ic_unconnected_center_mixed_in = true;
- } else if (on_lfe(a) && !(r->flags & PA_RESAMPLER_NO_LFE))
+ } else if (on_lfe(a) && (r->flags & PA_RESAMPLER_CONSUME_LFE))
m->map_table_f[oc][ic] = .375f / (float) ic_unconnected_lfe;
}
}
PA_RESAMPLER_VARIABLE_RATE = 0x0001U,
PA_RESAMPLER_NO_REMAP = 0x0002U, /* implies NO_REMIX */
PA_RESAMPLER_NO_REMIX = 0x0004U,
- PA_RESAMPLER_NO_LFE = 0x0008U,
PA_RESAMPLER_NO_FILL_SINK = 0x0010U,
+ PA_RESAMPLER_PRODUCE_LFE = 0x0020U,
+ PA_RESAMPLER_CONSUME_LFE = 0x0040U,
} pa_resample_flags_t;
struct pa_resampler {
((data->flags & PA_SINK_INPUT_NO_REMAP) ? PA_RESAMPLER_NO_REMAP : 0) |
(core->disable_remixing || (data->flags & PA_SINK_INPUT_NO_REMIX) ? PA_RESAMPLER_NO_REMIX : 0) |
(core->remixing_use_all_sink_channels ? 0 : PA_RESAMPLER_NO_FILL_SINK) |
- (core->disable_lfe_remixing ? PA_RESAMPLER_NO_LFE : 0)))) {
+ (core->remixing_produce_lfe ? PA_RESAMPLER_PRODUCE_LFE : 0) |
+ (core->remixing_consume_lfe ? PA_RESAMPLER_CONSUME_LFE : 0)))) {
pa_log_warn("Unsupported resampling operation.");
return -PA_ERR_NOTSUPPORTED;
}
((i->flags & PA_SINK_INPUT_NO_REMAP) ? PA_RESAMPLER_NO_REMAP : 0) |
(i->core->disable_remixing || (i->flags & PA_SINK_INPUT_NO_REMIX) ? PA_RESAMPLER_NO_REMIX : 0) |
(i->core->remixing_use_all_sink_channels ? 0 : PA_RESAMPLER_NO_FILL_SINK) |
- (i->core->disable_lfe_remixing ? PA_RESAMPLER_NO_LFE : 0));
+ (i->core->remixing_produce_lfe ? PA_RESAMPLER_PRODUCE_LFE : 0) |
+ (i->core->remixing_consume_lfe ? PA_RESAMPLER_CONSUME_LFE : 0));
if (!new_resampler) {
pa_log_warn("Unsupported resampling operation.");
((data->flags & PA_SOURCE_OUTPUT_NO_REMAP) ? PA_RESAMPLER_NO_REMAP : 0) |
(core->disable_remixing || (data->flags & PA_SOURCE_OUTPUT_NO_REMIX) ? PA_RESAMPLER_NO_REMIX : 0) |
(core->remixing_use_all_sink_channels ? 0 : PA_RESAMPLER_NO_FILL_SINK) |
- (core->disable_lfe_remixing ? PA_RESAMPLER_NO_LFE : 0)))) {
+ (core->remixing_produce_lfe ? PA_RESAMPLER_PRODUCE_LFE : 0) |
+ (core->remixing_consume_lfe ? PA_RESAMPLER_CONSUME_LFE : 0)))) {
pa_log_warn("Unsupported resampling operation.");
return -PA_ERR_NOTSUPPORTED;
}
((o->flags & PA_SOURCE_OUTPUT_NO_REMAP) ? PA_RESAMPLER_NO_REMAP : 0) |
(o->core->disable_remixing || (o->flags & PA_SOURCE_OUTPUT_NO_REMIX) ? PA_RESAMPLER_NO_REMIX : 0) |
(o->core->remixing_use_all_sink_channels ? 0 : PA_RESAMPLER_NO_FILL_SINK) |
- (o->core->disable_lfe_remixing ? PA_RESAMPLER_NO_LFE : 0));
+ (o->core->remixing_produce_lfe ? PA_RESAMPLER_PRODUCE_LFE : 0) |
+ (o->core->remixing_consume_lfe ? PA_RESAMPLER_CONSUME_LFE : 0));
if (!new_resampler) {
pa_log_warn("Unsupported resampling operation.");
};
/* Call like this to get an initializer for struct resample_flags:
- * RESAMPLE_FLAGS(PA_RESAMPLER_NO_LFE)
+ * RESAMPLE_FLAGS(PA_RESAMPLER_PRODUCE_LFE)
*/
#define RESAMPLE_FLAGS(flags) { .str = #flags, .value = (flags) }
RESAMPLE_FLAGS(0),
RESAMPLE_FLAGS(PA_RESAMPLER_NO_REMAP),
RESAMPLE_FLAGS(PA_RESAMPLER_NO_REMIX),
- RESAMPLE_FLAGS(PA_RESAMPLER_NO_LFE),
+ RESAMPLE_FLAGS(PA_RESAMPLER_PRODUCE_LFE),
RESAMPLE_FLAGS(PA_RESAMPLER_NO_FILL_SINK),
- RESAMPLE_FLAGS(PA_RESAMPLER_NO_LFE | PA_RESAMPLER_NO_FILL_SINK),
+ RESAMPLE_FLAGS(PA_RESAMPLER_PRODUCE_LFE | PA_RESAMPLER_NO_FILL_SINK),
+ RESAMPLE_FLAGS(PA_RESAMPLER_CONSUME_LFE),
+ RESAMPLE_FLAGS(PA_RESAMPLER_CONSUME_LFE | PA_RESAMPLER_NO_FILL_SINK),
+ RESAMPLE_FLAGS(PA_RESAMPLER_PRODUCE_LFE | PA_RESAMPLER_CONSUME_LFE),
+ RESAMPLE_FLAGS(PA_RESAMPLER_PRODUCE_LFE | PA_RESAMPLER_CONSUME_LFE | PA_RESAMPLER_NO_FILL_SINK),
{ .str = NULL, .value = 0 },
};