From a8b9ce2050dfb3f91c19061562d0a161117c3ab8 Mon Sep 17 00:00:00 2001 From: Julian Bouzas Date: Wed, 2 Jul 2025 08:09:54 -0400 Subject: [PATCH] alsa: add option to disable pro-audio profiles Some devices might have nonfunctional 'Pro Audio' sound. This patch adds a new 'api.acp.disable-pro-audio' option to disable pro-audio profile entirely. --- spa/plugins/alsa/acp/acp.c | 5 ++++- spa/plugins/alsa/acp/card.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/spa/plugins/alsa/acp/acp.c b/spa/plugins/alsa/acp/acp.c index 5b3de930b..ecb017a9f 100644 --- a/spa/plugins/alsa/acp/acp.c +++ b/spa/plugins/alsa/acp/acp.c @@ -522,7 +522,8 @@ static void add_profiles(pa_card *impl) ap->profile.flags = ACP_PROFILE_OFF; pa_hashmap_put(impl->profiles, ap->name, ap); - add_pro_profile(impl, impl->card.index); + if (!impl->disable_pro_audio) + add_pro_profile(impl, impl->card.index); PA_HASHMAP_FOREACH(ap, impl->profile_set->profiles, state) { pa_alsa_mapping *m; @@ -1860,6 +1861,8 @@ struct acp_card *acp_card_new(uint32_t index, const struct acp_dict *props) impl->pro_channels = atoi(s); if ((s = acp_dict_lookup(props, "api.alsa.split-enable")) != NULL) impl->ucm.split_enable = spa_atob(s); + if ((s = acp_dict_lookup(props, "api.acp.disable-pro-audio")) != NULL) + impl->disable_pro_audio = spa_atob(s); } #if SND_LIB_VERSION < 0x10207 diff --git a/spa/plugins/alsa/acp/card.h b/spa/plugins/alsa/acp/card.h index 814e3c6ef..0ef1a1ce1 100644 --- a/spa/plugins/alsa/acp/card.h +++ b/spa/plugins/alsa/acp/card.h @@ -48,6 +48,7 @@ struct pa_card { bool auto_profile; bool auto_port; bool ignore_dB; + bool disable_pro_audio; uint32_t rate; uint32_t pro_channels;