ALSA: scarlett2: Remap Level Meter values
authorGeoffrey D. Bennett <g@b4.vu>
Thu, 26 Oct 2023 18:08:26 +0000 (04:38 +1030)
committerTakashi Iwai <tiwai@suse.de>
Fri, 27 Oct 2023 09:23:03 +0000 (11:23 +0200)
commit3473185f31df29ac572be94fdb87ad8267108bec
tree22ed0983f4b7fd68c4f7195d247f15456c9d098c
parent2190b9aea4eb92ccf3176e35c17c959e40f1a81b
ALSA: scarlett2: Remap Level Meter values

The values previously returned by the Level Meter control were passed
through from the interface without interpretation, but it has been
discovered that the order of the values matches the mux assignment
order (which is not presented to userspace). In addition, the values
for disabled mux outputs, and mux outputs which share a source are
invalid.

This patch adds a per-device meter_map[], and a dynamic
meter_level_map[] which is updated on routing changes. The meter level
map gets used by scarlett2_meter_ctl_get() to both present the values
in a standard order, and to fix up the invalid values by zeroing them
(for disabled outputs) and copying them (for mux outputs which share a
source).

Signed-off-by: Geoffrey D. Bennett <g@b4.vu>
Link: https://lore.kernel.org/r/d437ace603eff685d2e0c3d0960589d7a09dd647.1698342632.git.g@b4.vu
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/mixer_scarlett2.c