diff --git a/src/examples/media-session/policy-node.c b/src/examples/media-session/policy-node.c index 72fd8a3a1..1ef56b70d 100644 --- a/src/examples/media-session/policy-node.c +++ b/src/examples/media-session/policy-node.c @@ -287,7 +287,7 @@ handle_node(struct impl *impl, struct sm_object *object) else return 0; - if (strcmp(media_class, "Sink") == 0) + if (strcmp(media_class, "Sink") == 0 || strcmp(media_class, "Duplex") == 0) direction = PW_DIRECTION_INPUT; else if (strcmp(media_class, "Source") == 0) direction = PW_DIRECTION_OUTPUT; diff --git a/src/modules/module-adapter/adapter.c b/src/modules/module-adapter/adapter.c index 73dc421e0..fc6c3292d 100644 --- a/src/modules/module-adapter/adapter.c +++ b/src/modules/module-adapter/adapter.c @@ -89,7 +89,7 @@ static void node_port_init(void *data, struct pw_impl_port *port) struct pw_properties *new; const char *str, *path, *node_name, *media_class; char position[8], *prefix; - bool is_monitor, is_device; + bool is_monitor, is_device, is_duplex; direction = pw_impl_port_get_direction(port); @@ -111,9 +111,11 @@ static void node_port_init(void *data, struct pw_impl_port *port) else is_device = false; + is_duplex = media_class != NULL &&strstr(media_class, "Duplex") != NULL; + new = pw_properties_new(NULL, NULL); - if (is_monitor) + if (is_monitor && !is_duplex) prefix = "monitor"; else if (is_device) prefix = direction == PW_DIRECTION_INPUT ? diff --git a/src/modules/module-protocol-pulse/collect.c b/src/modules/module-protocol-pulse/collect.c index 39901d5d6..4d8d0f210 100644 --- a/src/modules/module-protocol-pulse/collect.c +++ b/src/modules/module-protocol-pulse/collect.c @@ -49,7 +49,7 @@ static bool object_is_sink(struct pw_manager_object *o) strcmp(o->type, PW_TYPE_INTERFACE_Node) == 0 && o->props != NULL && (str = pw_properties_get(o->props, PW_KEY_MEDIA_CLASS)) != NULL && - (strcmp(str, "Audio/Sink") == 0 || strcmp(str, "Audio/Sink/Virtual") == 0); + (strcmp(str, "Audio/Sink") == 0 || strcmp(str, "Audio/Duplex") == 0); } static bool object_is_source(struct pw_manager_object *o) @@ -59,12 +59,21 @@ static bool object_is_source(struct pw_manager_object *o) strcmp(o->type, PW_TYPE_INTERFACE_Node) == 0 && o->props != NULL && (str = pw_properties_get(o->props, PW_KEY_MEDIA_CLASS)) != NULL && - strcmp(str, "Audio/Source") == 0; + (strcmp(str, "Audio/Source") == 0 || strcmp(str, "Audio/Duplex") == 0); +} + +static bool object_is_monitor(struct pw_manager_object *o) +{ + const char *str; + return strcmp(o->type, PW_TYPE_INTERFACE_Node) == 0 && + o->props != NULL && + (str = pw_properties_get(o->props, PW_KEY_MEDIA_CLASS)) != NULL && + (strcmp(str, "Audio/Sink") == 0); } static bool object_is_source_or_monitor(struct pw_manager_object *o) { - return object_is_source(o) || object_is_sink(o); + return object_is_source(o) || object_is_monitor(o); } static bool object_is_sink_input(struct pw_manager_object *o) diff --git a/src/modules/module-protocol-pulse/pulse-server.c b/src/modules/module-protocol-pulse/pulse-server.c index 78eb80f47..b6113f604 100644 --- a/src/modules/module-protocol-pulse/pulse-server.c +++ b/src/modules/module-protocol-pulse/pulse-server.c @@ -3523,7 +3523,7 @@ static int fill_source_info(struct client *client, struct message *m, struct card_info card_info = CARD_INFO_INIT; struct device_info dev_info = DEVICE_INFO_INIT(PW_DIRECTION_INPUT); - is_monitor = object_is_sink(o); + is_monitor = object_is_monitor(o); if ((!object_is_source(o) && !is_monitor) || info == NULL || info->props == NULL) return -ENOENT;