diff --git a/spa/include/spa/param/param.h b/spa/include/spa/param/param.h index 28c845ae6..105d63512 100644 --- a/spa/include/spa/param/param.h +++ b/spa/include/spa/param/param.h @@ -155,6 +155,7 @@ enum spa_param_route { SPA_PARAM_ROUTE_profiles, /**< associated profile indexes (Array of Int) */ SPA_PARAM_ROUTE_props, /**< properties SPA_TYPE_OBJECT_Props */ SPA_PARAM_ROUTE_devices, /**< associated device indexes (Array of Int) */ + SPA_PARAM_ROUTE_profile, /**< profile id (Int) */ }; diff --git a/spa/include/spa/param/type-info.h b/spa/include/spa/param/type-info.h index 18863864a..2262b7257 100644 --- a/spa/include/spa/param/type-info.h +++ b/spa/include/spa/param/type-info.h @@ -336,6 +336,7 @@ static const struct spa_type_info spa_type_param_route[] = { { SPA_PARAM_ROUTE_profiles, SPA_TYPE_Array, SPA_TYPE_INFO_PARAM_ROUTE_BASE "profiles", NULL, }, { SPA_PARAM_ROUTE_props, SPA_TYPE_Object, SPA_TYPE_INFO_PARAM_ROUTE_BASE "props", NULL, }, { SPA_PARAM_ROUTE_devices, SPA_TYPE_Array, SPA_TYPE_INFO_PARAM_ROUTE_BASE "devices", NULL, }, + { SPA_PARAM_ROUTE_profile, SPA_TYPE_Int, SPA_TYPE_INFO_PARAM_ROUTE_BASE "profile", NULL, }, { 0, 0, NULL, NULL }, }; diff --git a/spa/plugins/alsa/alsa-acp-device.c b/spa/plugins/alsa/alsa-acp-device.c index 249384886..20cf7ce6d 100644 --- a/spa/plugins/alsa/alsa-acp-device.c +++ b/spa/plugins/alsa/alsa-acp-device.c @@ -304,7 +304,7 @@ static struct spa_pod *build_profile(struct spa_pod_builder *b, uint32_t id, } static struct spa_pod *build_route(struct spa_pod_builder *b, uint32_t id, - struct acp_port *p, struct acp_device *dev) + struct acp_port *p, struct acp_device *dev, uint32_t profile) { struct spa_pod_frame f[2]; const struct acp_dict_item *item; @@ -385,6 +385,11 @@ static struct spa_pod *build_route(struct spa_pod_builder *b, uint32_t id, for (i = 0; i < p->n_devices; i++) spa_pod_builder_int(b, p->devices[i]->index); spa_pod_builder_pop(b, &f[1]); + + if (profile != SPA_ID_INVALID) { + spa_pod_builder_prop(b, SPA_PARAM_ROUTE_profile, 0); + spa_pod_builder_int(b, profile); + } return spa_pod_builder_pop(b, &f[0]); } @@ -448,7 +453,7 @@ static int impl_enum_params(void *object, int seq, return 0; p = card->ports[result.index]; - param = build_route(&b, id, p, NULL); + param = build_route(&b, id, p, NULL, SPA_ID_INVALID); break; case SPA_PARAM_Route: @@ -466,7 +471,7 @@ static int impl_enum_params(void *object, int seq, if (p == NULL) return 0; result.next = result.index + 1; - param = build_route(&b, id, p, dev); + param = build_route(&b, id, p, dev, card->active_profile_index); if (param == NULL) return -errno; break;