monitor & softdsp: fix alsa property names and api string

The alsa.pcm devices currently use "device.api" = "alsa:pcm"
but then the node overrides this later to just "alsa", which
is confusing. For now, let's match "alsa:pcm" in the monitor,
even though this does not appear on the node later.

This commit fixes device preferences in wireplumber.conf,
which were broken because the alsa endpoint names were empty
of info about the alsa device
This commit is contained in:
George Kiagiadakis 2019-10-15 00:12:17 +03:00
parent 5a70ed31a8
commit 5de6364ae7
2 changed files with 7 additions and 6 deletions

View file

@ -149,7 +149,7 @@ setup_node_props (WpMonitor *self, WpProperties *dev_props,
description = name;
/* set ALSA specific properties */
if (!g_strcmp0 (api, "alsa")) {
if (!g_strcmp0 (api, "alsa:pcm")) {
const gchar *str;
/* compose the node name */

View file

@ -18,6 +18,7 @@
#include <spa/param/audio/format-utils.h>
#include <spa/pod/builder.h>
#include <spa/param/props.h>
#include <spa/utils/keys.h>
#include "audio-softdsp-endpoint/stream.h"
#include "audio-softdsp-endpoint/adapter.h"
@ -178,12 +179,12 @@ on_audio_adapter_created(GObject *initable, GAsyncResult *res,
props = wp_proxy_node_get_properties (self->proxy_node);
/* Give a proper name to this endpoint based on adapter properties */
if (0 == g_strcmp0(wp_properties_get (props, "device.api"), "alsa")) {
if (0 == g_strcmp0(wp_properties_get (props, SPA_KEY_DEVICE_API), "alsa")) {
name = g_strdup_printf ("%s on %s (%s / node %s)",
wp_properties_get (props, "api.alsa.pcm.name"),
wp_properties_get (props, "api.alsa.card.name"),
wp_properties_get (props, "api.alsa.path"),
wp_properties_get (props, PW_KEY_NODE_ID));
wp_properties_get (props, SPA_KEY_API_ALSA_PCM_NAME),
wp_properties_get (props, SPA_KEY_API_ALSA_CARD_NAME),
wp_properties_get (props, SPA_KEY_API_ALSA_PATH),
wp_properties_get (props, PW_KEY_OBJECT_ID));
g_object_set (self, "name", name, NULL);
}