From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jaroslav Kysela Subject: Re: amixer cget :Assertion `ctl && info && (info->id.name[0] || info->id.numid)' failed. Aborted Date: Wed, 05 Oct 2011 09:59:42 +0200 Message-ID: <4E8C0E6E.2000700@perex.cz> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail1.perex.cz (unknown [77.48.224.245]) by alsa0.perex.cz (Postfix) with ESMTP id 9EB091038BB for ; Wed, 5 Oct 2011 09:59:44 +0200 (CEST) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Takashi Iwai Cc: Raymond Yau , ALSA Development Mailing List List-Id: alsa-devel@alsa-project.org Date 5.10.2011 09:46, Takashi Iwai wrote: > At Wed, 5 Oct 2011 15:25:44 +0800, > Raymond Yau wrote: >> >> 2011/10/3 Takashi Iwai : >>> At Sat, 1 Oct 2011 11:30:44 +0800, >>> Raymond Yau wrote: >>>> >>>> There is assertion when specify iface=PCM or iface=PCM,name='' when >>>> using amixer -c0 cget >>>> >>>> according to the synthax >>>> >>>> [[iface=,][name='name',][index=,][device=,][subdevice=]]|[numid=] >>>> >>>> >>>> amixer -c0 cget iface=PCM >>>> amixer: control.c:258: snd_ctl_elem_info: Assertion `ctl && info && >>>> (info->id.name[0] || info->id.numid)' failed. >>>> Aborted >>>> >>>> amixer -c0 cget iface=PCM,name='' >>>> amixer: control.c:258: snd_ctl_elem_info: Assertion `ctl && info && >>>> (info->id.name[0] || info->id.numid)' failed. >>>> Aborted >>> >>> So, the empty string isn't checked before assert(). It's bad. >>> It must be easy to fix. Care to create and send a patch? >>> >>> >> >> The syntax seem also wrong. >> >> [[iface=,][name='name',][index=,][device=,][subdevice=subdevice>]]|[numid=] >> >> >> it should be >> [numid=] | >> [[iface=,name='name'][,index=][,device=]] | >> [[iface=,name='name'][,device=][,subdevice=]] >> >> since you cannot specify index and subdevice at the same time > > The index and subdevice are different things. > Typically, the index is set > 0 when multiple elements with the same > iface and name are present. The subdevice is rather specification of > the device itself, e.g. PCM substream number. The correct syntax should be: [[iface=,]name='name'[,index=,][device=,][subdevice=subdevice>]] OR numid= The name or numid is mandatory. Jaroslav -- Jaroslav Kysela Linux Kernel Sound Maintainer ALSA Project; Red Hat, Inc.