Skip to content

Commit 275353b

Browse files
takaswietiwai
authored andcommitted
ALSA: echoaudio: purge contradictions between dimension matrix members and total number of members
Currently, sound device drivers for PCI cards produced by Echo Audio support dimension parameter of element information. But the information has contradictions to the number of members of each element. I guess that this comes from the assumption that these sound cards are used only by 'echomixer' in userspace. But ideally, they should be used with usual ALSA control applications. This commit removes the contradiction. As a result, 'Monitor Mixer Volume' and 'VMixer Volume' elements are shown in usual ALSA control applications such as 'amixer' and 'alsamixer' in series. Signed-off-by: Takashi Sakamoto <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent 41e8a57 commit 275353b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sound/pci/echoaudio/echoaudio.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -1272,11 +1272,11 @@ static int snd_echo_mixer_info(struct snd_kcontrol *kcontrol,
12721272

12731273
chip = snd_kcontrol_chip(kcontrol);
12741274
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
1275-
uinfo->count = 1;
12761275
uinfo->value.integer.min = ECHOGAIN_MINOUT;
12771276
uinfo->value.integer.max = ECHOGAIN_MAXOUT;
12781277
uinfo->dimen.d[0] = num_busses_out(chip);
12791278
uinfo->dimen.d[1] = num_busses_in(chip);
1279+
uinfo->count = uinfo->dimen.d[0] * uinfo->dimen.d[1];
12801280
return 0;
12811281
}
12821282

@@ -1344,11 +1344,11 @@ static int snd_echo_vmixer_info(struct snd_kcontrol *kcontrol,
13441344

13451345
chip = snd_kcontrol_chip(kcontrol);
13461346
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
1347-
uinfo->count = 1;
13481347
uinfo->value.integer.min = ECHOGAIN_MINOUT;
13491348
uinfo->value.integer.max = ECHOGAIN_MAXOUT;
13501349
uinfo->dimen.d[0] = num_busses_out(chip);
13511350
uinfo->dimen.d[1] = num_pipes_out(chip);
1351+
uinfo->count = uinfo->dimen.d[0] * uinfo->dimen.d[1];
13521352
return 0;
13531353
}
13541354

@@ -1728,7 +1728,6 @@ static int snd_echo_vumeters_info(struct snd_kcontrol *kcontrol,
17281728
struct snd_ctl_elem_info *uinfo)
17291729
{
17301730
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
1731-
uinfo->count = 96;
17321731
uinfo->value.integer.min = ECHOGAIN_MINOUT;
17331732
uinfo->value.integer.max = 0;
17341733
#ifdef ECHOCARD_HAS_VMIXER
@@ -1738,6 +1737,7 @@ static int snd_echo_vumeters_info(struct snd_kcontrol *kcontrol,
17381737
#endif
17391738
uinfo->dimen.d[1] = 16; /* 16 channels */
17401739
uinfo->dimen.d[2] = 2; /* 0=level, 1=peak */
1740+
uinfo->count = uinfo->dimen.d[0] * uinfo->dimen.d[1] * uinfo->dimen.d[2];
17411741
return 0;
17421742
}
17431743

0 commit comments

Comments
 (0)