"alsactl store" fails to save Echo Gina3G mixer
diff mbox

Message ID 1708292129400.21841@stax.localdomain
State New
Headers show

Commit Message

Mark Hills Aug. 29, 2017, 8:36 p.m. UTC
On Tue, 29 Aug 2017, Takashi Sakamoto wrote:

> On Aug 29 2017 00:34, S. Christian Collins wrote:
> > However, when I try to save the Gina3G mixer:
> > 
> >    alsactl -f ~/asound1.state store 1
> > 
> > ...I get the following error:
> > 
> > alsactl: control.c:2513: snd_ctl_elem_value_get_integer: Assertion `idx <
> > sizeof(obj->value.integer.value) / sizeof(obj->value.integer.value[0])'
> > failed.
> > Aborted
> > 
> > I have tried to find any info on this error online, but to no avail. Does
> > anybody know what is going on here?
> 
> The value of 'sizeof(obj->value.integer.value) /
> sizeof(obj->value.integer.value[0])' has fixed value (=128), therefore the
> value of 'idx' is greater than 128, against expectation.
> 
> Would you get output from below command line for your Gina 3G?
> 
> $ amixer scontrols
> 
> And typically state data is stored into '/var/lib/alsa/asound.state' as a
> default. For my information, could you disclose it if possible?

I think you're suffering the same problem I am with my Echo Layla 3G. Does 
'echomixer' work?

For some time now I have been running with commit 275353bb6 (copied below) 
reverted.

I did my most recent tests on kernel 4.10.3, resulting in the revert of 
that commit. I with the reverted commit. I recall that alsactl, alsamier 
were also affected.

I have been intending to make a 'proper' report to the list, or even 
investigate more myself. But priorities did not permit that yet. I also 
wasn't able to find information on what these fields actually mean. As far 
as I could tell, some of these attributes are unique to the echo3g and 
echomixer.

Thanks

Comments

S. Christian Collins Aug. 30, 2017, 2:17 p.m. UTC | #1
On 08/29/2017 03:36 PM, Mark Hills wrote:
> I think you're suffering the same problem I am with my Echo Layla 3G. Does
> 'echomixer' work?

Yes, 'echomixer' works fine for me. I have to launch it on occasion to 
properly set my audio output level (just launching it restores the 
correct level). I didn't have to do this in the past, so I'm guessing 
it's probably related to the problem with 'alsactl store' not working 
anymore for the card.

> I have been intending to make a 'proper' report to the list, or even
> investigate more myself. But priorities did not permit that yet. I also
> wasn't able to find information on what these fields actually mean. As far
> as I could tell, some of these attributes are unique to the echo3g and
> echomixer.

Yeah, I've never seen a mixer quite like this one. Using 'alsamixer' to 
adjust my Echo3G is almost pointless, since it is impossible to tell 
what is what.

-~Chris

Patch
diff mbox

diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c
index 1cb85aeb0cea..3a8e8d5a5617 100644
--- a/sound/pci/echoaudio/echoaudio.c
+++ b/sound/pci/echoaudio/echoaudio.c
@@ -1272,11 +1272,11 @@  static int snd_echo_mixer_info(struct snd_kcontrol *kcontrol,
 
 	chip = snd_kcontrol_chip(kcontrol);
 	uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
-	uinfo->count = 1;
 	uinfo->value.integer.min = ECHOGAIN_MINOUT;
 	uinfo->value.integer.max = ECHOGAIN_MAXOUT;
 	uinfo->dimen.d[0] = num_busses_out(chip);
 	uinfo->dimen.d[1] = num_busses_in(chip);
+	uinfo->count = uinfo->dimen.d[0] * uinfo->dimen.d[1];
 	return 0;
 }
 
@@ -1344,11 +1344,11 @@  static int snd_echo_vmixer_info(struct snd_kcontrol *kcontrol,
 
 	chip = snd_kcontrol_chip(kcontrol);
 	uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
-	uinfo->count = 1;
 	uinfo->value.integer.min = ECHOGAIN_MINOUT;
 	uinfo->value.integer.max = ECHOGAIN_MAXOUT;
 	uinfo->dimen.d[0] = num_busses_out(chip);
 	uinfo->dimen.d[1] = num_pipes_out(chip);
+	uinfo->count = uinfo->dimen.d[0] * uinfo->dimen.d[1];
 	return 0;
 }
 
@@ -1728,7 +1728,6 @@  static int snd_echo_vumeters_info(struct snd_kcontrol *kcontrol,
 				  struct snd_ctl_elem_info *uinfo)
 {
 	uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
-	uinfo->count = 96;
 	uinfo->value.integer.min = ECHOGAIN_MINOUT;
 	uinfo->value.integer.max = 0;
 #ifdef ECHOCARD_HAS_VMIXER
@@ -1738,6 +1737,7 @@  static int snd_echo_vumeters_info(struct snd_kcontrol *kcontrol,
 #endif
 	uinfo->dimen.d[1] = 16;	/* 16 channels */
 	uinfo->dimen.d[2] = 2;	/* 0=level, 1=peak */
+	uinfo->count = uinfo->dimen.d[0] * uinfo->dimen.d[1] * uinfo->dimen.d[2];
 	return 0;
 }