diff --git a/doc/dox/config/pipewire-devices.7.md b/doc/dox/config/pipewire-devices.7.md index 21762bece..d2e878579 100644 --- a/doc/dox/config/pipewire-devices.7.md +++ b/doc/dox/config/pipewire-devices.7.md @@ -218,6 +218,10 @@ UNDOCUMENTED @PAR@ device-param alsa.use-acp # boolean Use \ref device-param__alsa_card_profiles "ALSA Card Profiles" (ACP) for device configuration. +@PAR@ device-param alsa.udev.expose-busy # boolean +Expose the ALSA card even if it is busy/in use. Default false. This can be useful when some +of the PCMs are in use by other applications but the other free PCMs should still be exposed. + ## Device properties @PAR@ device-param api.alsa.path # string diff --git a/spa/plugins/alsa/alsa-udev.c b/spa/plugins/alsa/alsa-udev.c index 06ad891fd..9420401f0 100644 --- a/spa/plugins/alsa/alsa-udev.c +++ b/spa/plugins/alsa/alsa-udev.c @@ -93,6 +93,7 @@ struct impl { struct spa_source source; struct spa_source notify; unsigned int use_acp:1; + unsigned int expose_busy:1; }; static int impl_udev_open(struct impl *this) @@ -382,6 +383,8 @@ static int check_pcm_device_availability(struct impl *this, struct card *card, */ res = 0; + if (this->expose_busy) + return res; spa_scnprintf(path, sizeof(path), "/proc/asound/card%u", card->card_nr); @@ -1126,6 +1129,8 @@ impl_init(const struct spa_handle_factory *factory, if (info) { if ((str = spa_dict_lookup(info, "alsa.use-acp")) != NULL) this->use_acp = spa_atob(str); + else if ((str = spa_dict_lookup(info, "alsa.udev.expose-busy")) != NULL) + this->expose_busy = spa_atob(str); } return 0;