acp: reset soft volume

When we have accurate enough hardware volume, set the software volume to
1.0. Also fixes the issue of going to 0 volume and then staying silent
until we raise the volume above 1.0.
This commit is contained in:
Wim Taymans 2020-09-28 12:40:16 +02:00
parent 479bf3c803
commit 08438903e5
3 changed files with 17 additions and 8 deletions

View file

@ -746,7 +746,7 @@ static void on_set_soft_volume(void *data, struct acp_device *dev,
struct spa_pod_builder b = { 0 };
struct spa_pod_frame f[1];
spa_log_debug(this->log, "device %s soft volume %f", dev->name, volume[0]);
spa_log_info(this->log, "device %s soft volume %f", dev->name, volume[0]);
spa_pod_builder_init(&b, buffer, sizeof(buffer));
spa_pod_builder_push_object(&b, &f[0],
@ -772,7 +772,7 @@ static void on_set_soft_mute(void *data, struct acp_device *dev,
struct spa_pod_builder b = { 0 };
struct spa_pod_frame f[1];
spa_log_debug(this->log, "device %s soft mute %d", dev->name, mute);
spa_log_info(this->log, "device %s soft mute %d", dev->name, mute);
spa_pod_builder_init(&b, buffer, sizeof(buffer));
spa_pod_builder_push_object(&b, &f[0],