acp: compare the HW volume against stored HW volume

When we store the real_volume we get a hardware_volume as stored
in the mixer and a residual software_volume.

When we read the volume from the card, we need to compare this against
the hardware_volume we stored to check if something changed, not
against the real_volume that also contains the leftover software_volume.
This commit is contained in:
Wim Taymans 2021-08-09 14:13:51 +02:00
parent 03a4c0100a
commit 35d7ad5529

View file

@ -1047,10 +1047,10 @@ static int read_volume(pa_alsa_device *dev)
/* Shift down by the base volume, so that 0dB becomes maximum volume */
pa_sw_cvolume_multiply_scalar(&r, &r, dev->base_volume);
if (pa_cvolume_equal(&dev->real_volume, &r))
if (pa_cvolume_equal(&dev->hardware_volume, &r))
return 0;
dev->real_volume = r;
dev->real_volume = dev->hardware_volume = r;
pa_log_info("New hardware volume: min:%d max:%d",
pa_cvolume_min(&r), pa_cvolume_max(&r));