* amixer cget :Assertion `ctl && info && (info->id.name[0] || info->id.numid)' failed. Aborted @ 2011-10-01 3:30 Raymond Yau 2011-10-03 13:49 ` Takashi Iwai 0 siblings, 1 reply; 7+ messages in thread From: Raymond Yau @ 2011-10-01 3:30 UTC (permalink / raw) To: ALSA Development Mailing List There is assertion when specify iface=PCM or iface=PCM,name='' when using amixer -c0 cget according to the synthax [[iface=<iface>,][name='name',][index=<index>,][device=<device>,][subdevice=<subdevice>]]|[numid=<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 amixer -c0 cget Specify a full control identifier: [[iface=<iface>,][name='name',][index=<index>,][device=<device>,][subdevice=<subdevice>]]|[numid=<numid>] amixer -c0 cget iface=PCM,name='ILD' amixer: Cannot find the given element from control hw:0 amixer -c0 cget iface=PCM,name='ILD',device=2 numid=45,iface=PCM,name='ILD',device=2 ; type=INTEGER,access=rw------,values=2,min=0,max=2147483647,step=0 : values=0,0 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: amixer cget :Assertion `ctl && info && (info->id.name[0] || info->id.numid)' failed. Aborted 2011-10-01 3:30 amixer cget :Assertion `ctl && info && (info->id.name[0] || info->id.numid)' failed. Aborted Raymond Yau @ 2011-10-03 13:49 ` Takashi Iwai 2011-10-05 7:25 ` Raymond Yau 0 siblings, 1 reply; 7+ messages in thread From: Takashi Iwai @ 2011-10-03 13:49 UTC (permalink / raw) To: Raymond Yau; +Cc: ALSA Development Mailing List 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=<iface>,][name='name',][index=<index>,][device=<device>,][subdevice=<subdevice>]]|[numid=<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? thanks, Takashi ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: amixer cget :Assertion `ctl && info && (info->id.name[0] || info->id.numid)' failed. Aborted 2011-10-03 13:49 ` Takashi Iwai @ 2011-10-05 7:25 ` Raymond Yau 2011-10-05 7:46 ` Takashi Iwai 0 siblings, 1 reply; 7+ messages in thread From: Raymond Yau @ 2011-10-05 7:25 UTC (permalink / raw) To: Takashi Iwai, ALSA Development Mailing List 2011/10/3 Takashi Iwai <tiwai@suse.de>: > 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=<iface>,][name='name',][index=<index>,][device=<device>,][subdevice=<subdevice>]]|[numid=<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=<iface>,][name='name',][index=<index>,][device=<device>,][subdevice=subdevice>]]|[numid=<numid>] it should be [numid=<numid>] | [[iface=<iface>,name='name'][,index=<index>][,device=<device>]] | [[iface=<iface>,name='name'][,device=<device>][,subdevice=<subdevice>]] since you cannot specify index and subdevice at the same time ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: amixer cget :Assertion `ctl && info && (info->id.name[0] || info->id.numid)' failed. Aborted 2011-10-05 7:25 ` Raymond Yau @ 2011-10-05 7:46 ` Takashi Iwai 2011-10-05 7:59 ` Jaroslav Kysela 2011-10-10 1:12 ` Raymond Yau 0 siblings, 2 replies; 7+ messages in thread From: Takashi Iwai @ 2011-10-05 7:46 UTC (permalink / raw) To: Raymond Yau; +Cc: ALSA Development Mailing List At Wed, 5 Oct 2011 15:25:44 +0800, Raymond Yau wrote: > > 2011/10/3 Takashi Iwai <tiwai@suse.de>: > > 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=<iface>,][name='name',][index=<index>,][device=<device>,][subdevice=<subdevice>]]|[numid=<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=<iface>,][name='name',][index=<index>,][device=<device>,][subdevice=subdevice>]]|[numid=<numid>] > > > it should be > [numid=<numid>] | > [[iface=<iface>,name='name'][,index=<index>][,device=<device>]] | > [[iface=<iface>,name='name'][,device=<device>][,subdevice=<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. Takashi _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: amixer cget :Assertion `ctl && info && (info->id.name[0] || info->id.numid)' failed. Aborted 2011-10-05 7:46 ` Takashi Iwai @ 2011-10-05 7:59 ` Jaroslav Kysela 2011-10-10 1:12 ` Raymond Yau 1 sibling, 0 replies; 7+ messages in thread From: Jaroslav Kysela @ 2011-10-05 7:59 UTC (permalink / raw) To: Takashi Iwai; +Cc: Raymond Yau, ALSA Development Mailing List 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 <tiwai@suse.de>: >>> 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=<iface>,][name='name',][index=<index>,][device=<device>,][subdevice=<subdevice>]]|[numid=<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=<iface>,][name='name',][index=<index>,][device=<device>,][subdevice=subdevice>]]|[numid=<numid>] >> >> >> it should be >> [numid=<numid>] | >> [[iface=<iface>,name='name'][,index=<index>][,device=<device>]] | >> [[iface=<iface>,name='name'][,device=<device>][,subdevice=<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=<iface>,]name='name'[,index=<index>,][device=<device>,][subdevice=subdevice>]] OR numid=<numid> The name or numid is mandatory. Jaroslav -- Jaroslav Kysela <perex@perex.cz> Linux Kernel Sound Maintainer ALSA Project; Red Hat, Inc. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: amixer cget :Assertion `ctl && info && (info->id.name[0] || info->id.numid)' failed. Aborted 2011-10-05 7:46 ` Takashi Iwai 2011-10-05 7:59 ` Jaroslav Kysela @ 2011-10-10 1:12 ` Raymond Yau 2011-10-10 12:29 ` Takashi Iwai 1 sibling, 1 reply; 7+ messages in thread From: Raymond Yau @ 2011-10-10 1:12 UTC (permalink / raw) To: Takashi Iwai, Jaroslav Kysela, ALSA Development Mailing List [-- Attachment #1: Type: text/plain, Size: 1890 bytes --] 2011/10/5 Takashi Iwai <tiwai@suse.de>: > At Wed, 5 Oct 2011 15:25:44 +0800, > Raymond Yau wrote: >> >> 2011/10/3 Takashi Iwai <tiwai@suse.de>: >> > 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=<iface>,][name='name',][index=<index>,][device=<device>,][subdevice=<subdevice>]]|[numid=<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=<iface>,][name='name',][index=<index>,][device=<device>,][subdevice=subdevice>]]|[numid=<numid>] >> >> >> it should be >> [numid=<numid>] | >> [[iface=<iface>,name='name'][,index=<index>][,device=<device>]] | >> [[iface=<iface>,name='name'][,device=<device>][,subdevice=<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. > > > Takashi > Please ignore the previous patch Attach the correct patch which fix the assertion However it report error when amixer -c0 cget iface=PCM, amixer -c0 cget iface=PCM,name='ITD', [-- Attachment #2: fix_amixer_assert.patch --] [-- Type: application/octet-stream, Size: 648 bytes --] diff --git a/amixer/amixer.c b/amixer/amixer.c index 9d2855d..99160be 100644 --- a/amixer/amixer.c +++ b/amixer/amixer.c @@ -1122,6 +1122,8 @@ static int parse_control_id(const char *str, snd_ctl_elem_id_t *id) } } *ptr = '\0'; + if (ptr == buf) + return -EINVAL; snd_ctl_elem_id_set_name(id, buf); } else if (!strncasecmp(str, "index=", 6)) { str += 6; @@ -1145,7 +1147,13 @@ static int parse_control_id(const char *str, snd_ctl_elem_id_t *id) if (*str) return -EINVAL; } - } + } + if (*(str-1) == ',') + return -EINVAL; + if (numid > 0) + return 0; + if (size == 0) + return -EINVAL; return 0; } [-- Attachment #3: Type: text/plain, Size: 0 bytes --] ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: amixer cget :Assertion `ctl && info && (info->id.name[0] || info->id.numid)' failed. Aborted 2011-10-10 1:12 ` Raymond Yau @ 2011-10-10 12:29 ` Takashi Iwai 0 siblings, 0 replies; 7+ messages in thread From: Takashi Iwai @ 2011-10-10 12:29 UTC (permalink / raw) To: Raymond Yau; +Cc: ALSA Development Mailing List At Mon, 10 Oct 2011 09:12:53 +0800, Raymond Yau wrote: > > 2011/10/5 Takashi Iwai <tiwai@suse.de>: > > At Wed, 5 Oct 2011 15:25:44 +0800, > > Raymond Yau wrote: > >> > >> 2011/10/3 Takashi Iwai <tiwai@suse.de>: > >> > 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=<iface>,][name='name',][index=<index>,][device=<device>,][subdevice=<subdevice>]]|[numid=<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=<iface>,][name='name',][index=<index>,][device=<device>,][subdevice=subdevice>]]|[numid=<numid>] > >> > >> > >> it should be > >> [numid=<numid>] | > >> [[iface=<iface>,name='name'][,index=<index>][,device=<device>]] | > >> [[iface=<iface>,name='name'][,device=<device>][,subdevice=<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. > > > > > > Takashi > > > > Please ignore the previous patch > > Attach the correct patch which fix the assertion > > However it report error when > > amixer -c0 cget iface=PCM, > > amixer -c0 cget iface=PCM,name='ITD', Thanks for the patch! > diff --git a/amixer/amixer.c b/amixer/amixer.c > index 9d2855d..99160be 100644 > --- a/amixer/amixer.c > +++ b/amixer/amixer.c > @@ -1122,6 +1122,8 @@ static int parse_control_id(const char *str, snd_ctl_elem_id_t *id) > } > } > *ptr = '\0'; > + if (ptr == buf) > + return -EINVAL; > snd_ctl_elem_id_set_name(id, buf); This should be more intuitive such as if (!*buf) return -EINVAL; > @@ -1145,7 +1147,13 @@ static int parse_control_id(const char *str, snd_ctl_elem_id_t *id) > if (*str) > return -EINVAL; > } > - } > + } > + if (*(str-1) == ',') > + return -EINVAL; Maybe better to check the empty field iteself, such as @@ -1138,13 +1138,10 @@ static int parse_control_id(const char *str, snd_ctl_elem_id_t *id) snd_ctl_elem_id_set_subdevice(id, atoi(str)); while (isdigit(*str)) str++; - } - if (*str == ',') { + } else if (*str) + return -EINVAL; + if (*str == ',') str++; - } else { - if (*str) - return -EINVAL; - } } return 0; } > + if (numid > 0) > + return 0; > + if (size == 0) > + return -EINVAL; It'd be more understandable by using snd_ctl_elem_id_*() like: if (!snd_ctl_elem_id_get_numd(id) && !snd_ctl_elem_id_get_name(id)) return -EINVAL; Takashi _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-10-10 12:29 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-10-01 3:30 amixer cget :Assertion `ctl && info && (info->id.name[0] || info->id.numid)' failed. Aborted Raymond Yau 2011-10-03 13:49 ` Takashi Iwai 2011-10-05 7:25 ` Raymond Yau 2011-10-05 7:46 ` Takashi Iwai 2011-10-05 7:59 ` Jaroslav Kysela 2011-10-10 1:12 ` Raymond Yau 2011-10-10 12:29 ` Takashi Iwai
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.