]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commitdiff
ALSA: scarlett2: Fix DSP filter control array handling
authorGeoffrey D. Bennett <g@b4.vu>
Fri, 20 Feb 2026 11:28:48 +0000 (21:58 +1030)
committerTakashi Iwai <tiwai@suse.de>
Mon, 23 Feb 2026 08:51:55 +0000 (09:51 +0100)
scarlett2_add_dsp_ctls() was incorrectly storing the precomp and PEQ
filter coefficient control pointers into the precomp_flt_switch_ctls
and peq_flt_switch_ctls arrays instead of the intended targets
precomp_flt_ctls and peq_flt_ctls. Pass NULL instead, as the filter
coefficient control pointers are not used, and remove the unused
precomp_flt_ctls and peq_flt_ctls arrays from struct scarlett2_data.

Additionally, scarlett2_update_filter_values() was reading
dsp_input_count * peq_flt_count values for
SCARLETT2_CONFIG_PEQ_FLT_SWITCH, but the peq_flt_switch array is
indexed only by dsp_input_count (one switch per DSP input, not per
filter). Fix the read count.

Fixes: b64678eb4e70 ("ALSA: scarlett2: Add DSP controls")
Signed-off-by: Geoffrey D. Bennett <g@b4.vu>
Link: https://patch.msgid.link/86497b71db060677d97c38a6ce5f89bb3b25361b.1771581197.git.g@b4.vu
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/mixer_scarlett2.c

index 85a0316889d4ccae608485fc1d3e138c62c8a56e..ef3150581eabdf92865c5e9f72b2e8acae813834 100644 (file)
@@ -1328,8 +1328,6 @@ struct scarlett2_data {
        struct snd_kcontrol *mux_ctls[SCARLETT2_MUX_MAX];
        struct snd_kcontrol *mix_ctls[SCARLETT2_MIX_MAX];
        struct snd_kcontrol *compressor_ctls[SCARLETT2_COMPRESSOR_CTLS_MAX];
-       struct snd_kcontrol *precomp_flt_ctls[SCARLETT2_PRECOMP_FLT_CTLS_MAX];
-       struct snd_kcontrol *peq_flt_ctls[SCARLETT2_PEQ_FLT_CTLS_MAX];
        struct snd_kcontrol *precomp_flt_switch_ctls[SCARLETT2_DSP_SWITCH_MAX];
        struct snd_kcontrol *peq_flt_switch_ctls[SCARLETT2_DSP_SWITCH_MAX];
        struct snd_kcontrol *direct_monitor_ctl;
@@ -3447,7 +3445,6 @@ static int scarlett2_update_autogain(struct usb_mixer_interface *mixer)
                        private->autogain_status[i] =
                                private->num_autogain_status_texts - 1;
 
-
        for (i = 0; i < SCARLETT2_AG_TARGET_COUNT; i++)
                if (scarlett2_has_config_item(private,
                                              scarlett2_ag_target_configs[i])) {
@@ -5372,8 +5369,7 @@ static int scarlett2_update_filter_values(struct usb_mixer_interface *mixer)
 
        err = scarlett2_usb_get_config(
                mixer, SCARLETT2_CONFIG_PEQ_FLT_SWITCH,
-               info->dsp_input_count * info->peq_flt_count,
-               private->peq_flt_switch);
+               info->dsp_input_count, private->peq_flt_switch);
        if (err < 0)
                return err;
 
@@ -6546,7 +6542,7 @@ static int scarlett2_add_dsp_ctls(struct usb_mixer_interface *mixer, int i)
                err = scarlett2_add_new_ctl(
                        mixer, &scarlett2_precomp_flt_ctl,
                        i * info->precomp_flt_count + j,
-                       1, s, &private->precomp_flt_switch_ctls[j]);
+                       1, s, NULL);
                if (err < 0)
                        return err;
        }
@@ -6556,7 +6552,7 @@ static int scarlett2_add_dsp_ctls(struct usb_mixer_interface *mixer, int i)
                err = scarlett2_add_new_ctl(
                        mixer, &scarlett2_peq_flt_ctl,
                        i * info->peq_flt_count + j,
-                       1, s, &private->peq_flt_switch_ctls[j]);
+                       1, s, NULL);
                if (err < 0)
                        return err;
        }