From 7f7a8ccc88c20af0e3b7c100907cfb738e566cfa Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 3 Aug 2020 17:08:46 +0200 Subject: [PATCH] acp: use some existing keys and add some new ones --- spa/include/spa/utils/keys.h | 2 ++ spa/plugins/alsa/acp/acp.c | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/spa/include/spa/utils/keys.h b/spa/include/spa/utils/keys.h index 3b0d78e69..eef74fa19 100644 --- a/spa/include/spa/utils/keys.h +++ b/spa/include/spa/utils/keys.h @@ -50,6 +50,8 @@ extern "C" { * used in snd_pcm_open() and * snd_ctl_open(). */ #define SPA_KEY_API_ALSA_CARD "api.alsa.card" /**< alsa card number */ +#define SPA_KEY_API_ALSA_USE_UCM "api.alsa.use-ucm" /**< if UCM should be used */ +#define SPA_KEY_API_ALSA_IGNORE_DB "api.alsa.ignore-dB" /**< if decibel info should be ignored */ /** info from alsa card_info */ #define SPA_KEY_API_ALSA_CARD_ID "api.alsa.card.id" /**< id from card_info */ diff --git a/spa/plugins/alsa/acp/acp.c b/spa/plugins/alsa/acp/acp.c index 2aeb4021e..cd33296d1 100644 --- a/spa/plugins/alsa/acp/acp.c +++ b/spa/plugins/alsa/acp/acp.c @@ -1111,13 +1111,13 @@ struct acp_card *acp_card_new(uint32_t index, const struct acp_dict *props) impl->use_ucm = true; if (props) { - if ((s = acp_dict_lookup(props, "use-ucm")) != NULL) + if ((s = acp_dict_lookup(props, "api.alsa.use-ucm")) != NULL) impl->use_ucm = (strcmp(s, "true") == 0 || atoi(s) == 1); - if ((s = acp_dict_lookup(props, "profile-set")) != NULL) - profile_set = s; - if ((s = acp_dict_lookup(props, "ignore-dB")) != NULL) + if ((s = acp_dict_lookup(props, "api.alsa.ignore-dB")) != NULL) ignore_dB = (strcmp(s, "true") == 0 || atoi(s) == 1); - if ((s = acp_dict_lookup(props, "profile")) != NULL) + if ((s = acp_dict_lookup(props, "device.profile-set")) != NULL) + profile_set = s; + if ((s = acp_dict_lookup(props, "device.profile")) != NULL) profile = s; }