mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
alsa: rework UCM open
Use _alibpref to check if a device needs a UCM local config. Mark the device as such and use this to set the OPEN_UCM property on the device. Open the UCM for a card when the device has the property set. Use the same logic for loading the UCM as the acp code. See #1251
This commit is contained in:
parent
58d0e44664
commit
35e81fbfdc
8 changed files with 61 additions and 18 deletions
|
|
@ -241,8 +241,20 @@ static void init_device(pa_card *impl, pa_alsa_device *dev, pa_alsa_direction_t
|
|||
|
||||
dev->ports = pa_hashmap_new(pa_idxset_string_hash_func,
|
||||
pa_idxset_string_compare_func);
|
||||
if (m->ucm_context.ucm)
|
||||
if (m->ucm_context.ucm) {
|
||||
const char *alibpref;
|
||||
dev->ucm_context = &m->ucm_context;
|
||||
if ((snd_use_case_get(impl->ucm.ucm_mgr, "_alibpref", &alibpref) == 0)) {
|
||||
char **d;
|
||||
for (d = m->device_strings; *d; d++) {
|
||||
if (pa_startswith(*d, alibpref)) {
|
||||
dev->device.flags |= ACP_DEVICE_UCM_DEVICE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
free((void*)alibpref);
|
||||
}
|
||||
}
|
||||
pa_dynarray_init(&dev->port_array, NULL);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -204,6 +204,7 @@ struct acp_device {
|
|||
#define ACP_DEVICE_ACTIVE (1<<0)
|
||||
#define ACP_DEVICE_HW_VOLUME (1<<1)
|
||||
#define ACP_DEVICE_HW_MUTE (1<<2)
|
||||
#define ACP_DEVICE_UCM_DEVICE (1<<3)
|
||||
uint32_t flags;
|
||||
|
||||
const char *name;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue