mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
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:
parent
30f01b117e
commit
cc8b88cb51
2 changed files with 9 additions and 0 deletions
|
|
@ -202,6 +202,10 @@ UNDOCUMENTED
|
||||||
@PAR@ device-param alsa.use-acp # boolean
|
@PAR@ device-param alsa.use-acp # boolean
|
||||||
Use \ref device-param__alsa_card_profiles "ALSA Card Profiles" (ACP) for device configuration.
|
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
|
## Device properties
|
||||||
|
|
||||||
@PAR@ device-param api.alsa.path # string
|
@PAR@ device-param api.alsa.path # string
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,7 @@ struct impl {
|
||||||
struct spa_source source;
|
struct spa_source source;
|
||||||
struct spa_source notify;
|
struct spa_source notify;
|
||||||
unsigned int use_acp:1;
|
unsigned int use_acp:1;
|
||||||
|
unsigned int expose_busy:1;
|
||||||
};
|
};
|
||||||
|
|
||||||
static int impl_udev_open(struct impl *this)
|
static int impl_udev_open(struct impl *this)
|
||||||
|
|
@ -381,6 +382,8 @@ static int check_pcm_device_availability(struct impl *this, struct card *card,
|
||||||
*/
|
*/
|
||||||
|
|
||||||
res = 0;
|
res = 0;
|
||||||
|
if (this->expose_busy)
|
||||||
|
return res;
|
||||||
|
|
||||||
spa_scnprintf(path, sizeof(path), "/proc/asound/card%u", card->card_nr);
|
spa_scnprintf(path, sizeof(path), "/proc/asound/card%u", card->card_nr);
|
||||||
|
|
||||||
|
|
@ -1141,6 +1144,8 @@ impl_init(const struct spa_handle_factory *factory,
|
||||||
if (info) {
|
if (info) {
|
||||||
if ((str = spa_dict_lookup(info, "alsa.use-acp")) != NULL)
|
if ((str = spa_dict_lookup(info, "alsa.use-acp")) != NULL)
|
||||||
this->use_acp = spa_atob(str);
|
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;
|
return 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue