mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
echo-cancel: Play nice with module-filter-*
With automaticl filter loading by module-filter-apply, setting the virtual sink/source to have the "phone" intended role will break routing when you first connect a phone stream to an ALSA device and then turn on your Bluetooth headset. This happens because module-intended-roles doesn't move a stream if it is already on a device that provides the required role. This patch introduces a "manual_load" parameter that is meant to be used when not using module-filter-apply for loading the AEC module. If this parameter is set, the virtual devices are given the "phone" role, else we count on module-filter-heuristics to do the right thing.
This commit is contained in:
parent
87570523f8
commit
8460466f86
1 changed files with 14 additions and 2 deletions
|
|
@ -78,6 +78,7 @@ PA_MODULE_USAGE(
|
|||
"aec_method=<implementation to use> "
|
||||
"aec_args=<parameters for the AEC engine> "
|
||||
"save_aec=<save AEC data in /tmp> "
|
||||
"manual_load=<set if this module is being loaded manually> "
|
||||
));
|
||||
|
||||
/* NOTE: Make sure the enum and ec_table are maintained in the correct order */
|
||||
|
|
@ -106,6 +107,7 @@ static const pa_echo_canceller ec_table[] = {
|
|||
|
||||
#define DEFAULT_ADJUST_TIME_USEC (1*PA_USEC_PER_SEC)
|
||||
#define DEFAULT_SAVE_AEC 0
|
||||
#define DEFAULT_MANUAL_LOAD FALSE
|
||||
|
||||
#define MEMBLOCKQ_MAXLENGTH (16*1024*1024)
|
||||
|
||||
|
|
@ -156,6 +158,7 @@ struct userdata {
|
|||
pa_core *core;
|
||||
pa_module *module;
|
||||
|
||||
pa_bool_t manual_load;
|
||||
uint32_t save_aec;
|
||||
|
||||
pa_echo_canceller *ec;
|
||||
|
|
@ -210,6 +213,7 @@ static const char* const valid_modargs[] = {
|
|||
"aec_method",
|
||||
"aec_args",
|
||||
"save_aec",
|
||||
"manual_load",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
|
@ -1394,6 +1398,12 @@ int pa__init(pa_module*m) {
|
|||
goto fail;
|
||||
}
|
||||
|
||||
u->manual_load = DEFAULT_MANUAL_LOAD;
|
||||
if (pa_modargs_get_value_boolean(ma, "manual_load", &u->manual_load) < 0) {
|
||||
pa_log("Failed to parse manual_load value");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
u->asyncmsgq = pa_asyncmsgq_new(0);
|
||||
u->need_realign = TRUE;
|
||||
if (u->ec->init) {
|
||||
|
|
@ -1413,6 +1423,7 @@ int pa__init(pa_module*m) {
|
|||
pa_source_new_data_set_channel_map(&source_data, &source_map);
|
||||
pa_proplist_sets(source_data.proplist, PA_PROP_DEVICE_MASTER_DEVICE, source_master->name);
|
||||
pa_proplist_sets(source_data.proplist, PA_PROP_DEVICE_CLASS, "filter");
|
||||
if (u->manual_load)
|
||||
pa_proplist_sets(source_data.proplist, PA_PROP_DEVICE_INTENDED_ROLES, "phone");
|
||||
pa_proplist_sets(source_data.proplist, "device.echo-cancel.name", source_data.name);
|
||||
|
||||
|
|
@ -1460,6 +1471,7 @@ int pa__init(pa_module*m) {
|
|||
pa_sink_new_data_set_channel_map(&sink_data, &sink_map);
|
||||
pa_proplist_sets(sink_data.proplist, PA_PROP_DEVICE_MASTER_DEVICE, sink_master->name);
|
||||
pa_proplist_sets(sink_data.proplist, PA_PROP_DEVICE_CLASS, "filter");
|
||||
if (u->manual_load)
|
||||
pa_proplist_sets(sink_data.proplist, PA_PROP_DEVICE_INTENDED_ROLES, "phone");
|
||||
pa_proplist_sets(sink_data.proplist, "device.echo-cancel.name", sink_data.name);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue