diff --git a/spa/plugins/alsa/alsa-udev.c b/spa/plugins/alsa/alsa-udev.c index 33b262cad..878b5a337 100644 --- a/spa/plugins/alsa/alsa-udev.c +++ b/spa/plugins/alsa/alsa-udev.c @@ -241,8 +241,8 @@ static int emit_object_info(struct impl *this, struct device *device) struct udev_device *dev = device->dev; snd_ctl_t *ctl_hndl; const char *str; - char path[32]; - struct spa_dict_item items[23]; + char path[32], *cn = NULL, *cln = NULL; + struct spa_dict_item items[25]; uint32_t n_items = 0; int res, pcm; @@ -287,6 +287,10 @@ static int emit_object_info(struct impl *this, struct device *device) items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_MEDIA_CLASS, "Audio/Device"); items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_API_ALSA_PATH, path); items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_API_ALSA_CARD, path+3); + if (snd_card_get_name(id, &cn) >= 0) + items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_API_ALSA_CARD_NAME, cn); + if (snd_card_get_longname(id, &cln) >= 0) + items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_API_ALSA_CARD_LONGNAME, cln); if ((str = udev_device_get_property_value(dev, "ACP_NAME")) && *str) items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_NAME, str); @@ -362,6 +366,8 @@ static int emit_object_info(struct impl *this, struct device *device) spa_device_emit_object_info(&this->hooks, id, &info); device->emited = true; + free(cn); + free(cln); return 1; } diff --git a/src/examples/media-session/alsa-monitor.c b/src/examples/media-session/alsa-monitor.c index dcaf6205c..c7c2c58e8 100644 --- a/src/examples/media-session/alsa-monitor.c +++ b/src/examples/media-session/alsa-monitor.c @@ -212,6 +212,8 @@ static struct node *alsa_create_node(struct device *device, uint32_t id, int i, priority; pw_log_debug("new node %u", id); + if (pw_log_level_enabled(SPA_LOG_LEVEL_DEBUG)) + spa_debug_dict(0, info->props); if (strcmp(info->type, SPA_TYPE_INTERFACE_Node) != 0) { errno = EINVAL; @@ -846,6 +848,8 @@ static struct device *alsa_create_device(struct impl *impl, uint32_t id, const char *str, *card, *rules; pw_log_debug("new device %u", id); + if (pw_log_level_enabled(SPA_LOG_LEVEL_DEBUG)) + spa_debug_dict(0, info->props); if (strcmp(info->type, SPA_TYPE_INTERFACE_Device) != 0) { errno = EINVAL;