From e063cc38a97e949e654a1be71c2b3e7578517649 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 12 Oct 2023 18:41:37 +0200 Subject: [PATCH] alsa: add alsa.deny to fail init of the PCM Handy to block audacity from probing the hardware. --- pipewire-alsa/alsa-plugins/pcm_pipewire.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pipewire-alsa/alsa-plugins/pcm_pipewire.c b/pipewire-alsa/alsa-plugins/pcm_pipewire.c index 29846d476..45b0e8aa7 100644 --- a/pipewire-alsa/alsa-plugins/pcm_pipewire.c +++ b/pipewire-alsa/alsa-plugins/pcm_pipewire.c @@ -1238,6 +1238,12 @@ static int snd_pcm_pipewire_open(snd_pcm_t **pcmp, if (str != NULL) pw_properties_update_string(pw->props, str, strlen(str)); + if ((str = pw_properties_get(pw->props, "alsa.deny")) != NULL && + spa_atob(str)) { + err = -EACCES; + goto error; + } + str = getenv("PIPEWIRE_NODE"); if (str != NULL && str[0]) pw_properties_set(pw->props, PW_KEY_TARGET_OBJECT, str);