[alsa-devel] amixer cget :Assertion `ctl && info && (info->id.name[0] || info->id.numid)' failed. Aborted

Raymond Yau superquad.vortex2 at gmail.com
Mon Oct 10 03:12:53 CEST 2011


2011/10/5 Takashi Iwai <tiwai at suse.de>:
> At Wed, 5 Oct 2011 15:25:44 +0800,
> Raymond Yau wrote:
>>
>> 2011/10/3 Takashi Iwai <tiwai at 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',
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix_amixer_assert.patch
Type: application/octet-stream
Size: 647 bytes
Desc: not available
Url : http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20111010/94ba5f7a/attachment.dll 


More information about the Alsa-devel mailing list