alsa: add option to skip the busy check

Makes the card exposed even if some of the pcms are busy.

Fixes #3914
This commit is contained in:
Wim Taymans 2024-03-22 12:42:48 +01:00
parent e2ad924cbb
commit 4db0811878
2 changed files with 9 additions and 0 deletions

View file

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