summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2020-08-03 17:08:46 +0200
committerWim Taymans <wtaymans@redhat.com>2020-08-03 17:08:46 +0200
commit7f7a8ccc88c20af0e3b7c100907cfb738e566cfa (patch)
tree37b18de0edefac8c18211cbb0bc5b0503a90fe40
parent79937676a4fc1556e6ba2bc981ea996bca2e041d (diff)
acp: use some existing keys and add some new ones
-rw-r--r--spa/include/spa/utils/keys.h2
-rw-r--r--spa/plugins/alsa/acp/acp.c10
2 files changed, 7 insertions, 5 deletions
diff --git a/spa/include/spa/utils/keys.h b/spa/include/spa/utils/keys.h
index 3b0d78e6..eef74fa1 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 2aeb4021..cd33296d 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;
}