media-session: add option to disable hardware volume

See #426
This commit is contained in:
Wim Taymans 2020-12-01 10:45:24 +01:00
parent d098c2ba86
commit 19a67a2da5

View file

@ -795,7 +795,7 @@ static struct device *alsa_create_device(struct impl *impl, uint32_t id,
{ {
struct device *device; struct device *device;
int res; int res;
const char *card, *factory_name; const char *str, *card, *factory_name, *name;
pw_log_debug("new device %u", id); pw_log_debug("new device %u", id);
@ -826,6 +826,12 @@ static struct device *alsa_create_device(struct impl *impl, uint32_t id,
device->pending_profile = 1; device->pending_profile = 1;
spa_list_append(&impl->device_list, &device->link); spa_list_append(&impl->device_list, &device->link);
if ((str = pw_properties_get(impl->session->props, "alsa.soft-mixer")) != NULL &&
(name = pw_properties_get(device->props, "device.name")) != NULL &&
strstr(str, name) != NULL) {
pw_properties_set(device->props, "api.alsa.soft-mixer", "true");
}
if (impl->conn && if (impl->conn &&
(card = spa_dict_lookup(info->props, SPA_KEY_API_ALSA_CARD)) != NULL) { (card = spa_dict_lookup(info->props, SPA_KEY_API_ALSA_CARD)) != NULL) {
const char *reserve; const char *reserve;