diff --git a/spa/plugins/alsa/alsa-acp-device.c b/spa/plugins/alsa/alsa-acp-device.c index f432dbedc..5237d3388 100644 --- a/spa/plugins/alsa/alsa-acp-device.c +++ b/spa/plugins/alsa/alsa-acp-device.c @@ -910,6 +910,10 @@ impl_init(const struct spa_handle_factory *factory, if (info) { if ((str = spa_dict_lookup(info, SPA_KEY_API_ALSA_PATH)) != NULL) snprintf(this->props.device, sizeof(this->props.device)-1, "%s", str); + if ((str = spa_dict_lookup(info, "api.acp.auto-port")) != NULL) + this->props.auto_port = strcmp(str, "true") == 0 || atoi(str) != 0; + if ((str = spa_dict_lookup(info, "api.acp.auto-profile")) != NULL) + this->props.auto_profile = strcmp(str, "true") == 0 || atoi(str) != 0; items = alloca((info->n_items) * sizeof(*items)); spa_dict_for_each(it, info) diff --git a/src/examples/media-session/alsa-monitor.c b/src/examples/media-session/alsa-monitor.c index 3d5352117..67de02438 100644 --- a/src/examples/media-session/alsa-monitor.c +++ b/src/examples/media-session/alsa-monitor.c @@ -826,12 +826,23 @@ static struct device *alsa_create_device(struct impl *impl, uint32_t id, device->pending_profile = 1; spa_list_append(&impl->device_list, &device->link); + name = pw_properties_get(device->props, "device.name"); + if ((str = pw_properties_get(impl->session->props, "alsa.soft-mixer")) != NULL && (strcmp(str, "*") == 0 || - ((name = pw_properties_get(device->props, "device.name")) != NULL && - strstr(str, name) != NULL))) { + (name != NULL && strstr(str, name) != NULL))) { pw_properties_set(device->props, "api.alsa.soft-mixer", "true"); } + if ((str = pw_properties_get(impl->session->props, "alsa.auto-port")) != NULL && + (strcmp(str, "*") == 0 || + (name != NULL && strstr(str, name) != NULL))) { + pw_properties_set(device->props, "api.acp.auto-port", "true"); + } + if ((str = pw_properties_get(impl->session->props, "alsa.auto-profile")) != NULL && + (strcmp(str, "*") == 0 || + (name != NULL && strstr(str, name) != NULL))) { + pw_properties_set(device->props, "api.acp.auto-profile", "true"); + } if (impl->conn && (card = spa_dict_lookup(info->props, SPA_KEY_API_ALSA_CARD)) != NULL) {