From patchwork Tue Aug 29 20:36:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hills X-Patchwork-Id: 9928261 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9FA356022E for ; Tue, 29 Aug 2017 20:36:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8F91B28A5A for ; Tue, 29 Aug 2017 20:36:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8204528A61; Tue, 29 Aug 2017 20:36:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4DE4D28A5A for ; Tue, 29 Aug 2017 20:36:54 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id EA1BD266FBD; Tue, 29 Aug 2017 22:36:51 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id A5335266FD0; Tue, 29 Aug 2017 22:36:50 +0200 (CEST) Received: from jazz.pogo.org.uk (jazz.pogo.org.uk [213.138.114.167]) by alsa0.perex.cz (Postfix) with ESMTP id D9BED266E37 for ; Tue, 29 Aug 2017 22:36:46 +0200 (CEST) Received: from cpc93782-hari17-2-0-cust701.20-2.cable.virginm.net ([82.34.66.190] helo=stax.localdomain) by jazz.pogo.org.uk with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89 (FreeBSD)) (envelope-from ) id 1dmnFb-000HHY-Ee; Tue, 29 Aug 2017 21:36:43 +0100 Received: from mark (helo=localhost) by stax.localdomain with local-esmtp (Exim 4.84) (envelope-from ) id 1dmnFc-0007QY-72; Tue, 29 Aug 2017 21:36:44 +0100 Date: Tue, 29 Aug 2017 21:36:44 +0100 (BST) From: Mark Hills To: Takashi Sakamoto , "S. Christian Collins" In-Reply-To: <1fa01cef-7159-b1b2-8ec6-5eab7f2a7e29@sakamocchi.jp> Message-ID: <1708292129400.21841@stax.localdomain> References: <1fa01cef-7159-b1b2-8ec6-5eab7f2a7e29@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel Subject: Re: [alsa-devel] "alsactl store" fails to save Echo Gina3G mixer X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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 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; }