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.
This commit is contained in:
Julian Bouzas 2025-07-02 08:09:54 -04:00
parent 653e1578a1
commit a8b9ce2050
2 changed files with 5 additions and 1 deletions

View file

@ -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

View file

@ -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;