[alsa-devel] UCM list/set/get

Jaroslav Kysela perex at perex.cz
Wed Feb 2 09:11:57 CET 2011

On Mon, 31 Jan 2011, Margarita Olaya wrote:

> On Mon, Jan 31, 2011 at 7:53 AM, Liam Girdwood <lrg at slimlogic.co.uk> wrote:
>> On Mon, 2011-01-31 at 11:22 +0000, Mark Brown wrote:
>>> On Fri, Jan 28, 2011 at 11:36:47AM -0600, pl bossart wrote:
>>>> I've been trying to figure out what exactly needs to be filled in UCM
>>>> configuration files, and so far it's been a pretty frustrating
>>>> experience with alsa-utils/alsaucm :-(
>>> CCing in Liam - please always remember to CC maintainers.
>>>> The interactive mode in alsa-utils/alsaucm is broken, I fixed a couple
>>>> of segfaults and bad output (patches attached), but so far the only
>>>> thing I can do is list the verbs...It looks like
>>>> alsa-lib/include/use-case.h and alsa-utils/alsaucm are not aligned,
>>>> whenever I query with predefined identifiers alsaucm seg faults or
>>>> provides an error message that doesn't help much. This happens with
>>>> the latest code.
>>>> [ume at plb alsaucm]$ ./alsaucm listcards
>>>>   0: AudioPC
>>>>     this is my AudioPCI card
>>>>   1: SDP4430
>>>>     this is my SDP4430 card
>>>>   2: TestHDA
>>>>     A test HDA card
>>>> [ume at plb alsaucm]$ ./alsaucm -c AudioPCI list _verbs
>>>>   0: HiFi
>>>>     Play and record HiFi quality Music.
>>>>   1: Voice
>>>>     Full duplex low-power voice call
>>>> So far so good. Now the fun begins
>>>> [ume at plb alsaucm]$ ./alsaucm -c AudioPCI list _devices
>>>> ./alsaucm: error failed to get list _devices: No such file or directory
>>>> [ume at plb alsaucm]$ ./alsaucm -c AudioPCI set _verb HiFi
>>>> ALSA lib main.c:1250:(set_verb_user) error: failed to initialize new
>>>> use case: HiFi
>>>> ./alsaucm: error failed to set _verb=HiFi: No such device
>>>> [ume at plb alsaucm]$ ./alsaucm -c AudioPCI get _verb
>>>> ./alsaucm: error failed to get _verb: No such file or directory
>> It looks like we need to improve the config file error reporting here.
>> Adding line numbers would be good.
>>>> Likewise if the .conf file contains a cset in the default values, then
>>>> the parser fails (I took the example from src/ucm/parser.c).
>>>> Commenting out the cset is the only solution. What exactly is this
>>>> index supposed to mean?
>>>> SectionDefaults [
>>>> cdev "hw:AudioPCI"
>>>> cset "name='Master Playback Switch',index=2 1,1"
>>>> ]
>> Jaroslav is probably best placed to answer about the cset syntax.
>> The "index" is not required :-
>> cset "name='Master Playback Switch' 1,1"
>>>> [ume at plb alsaucm]$ ./alsaucm -c AudioPCI list _verbs
>>>> ALSA lib main.c:302:(import_master_config) Unable to execute default sequence
>>>> ALSA lib main.c:637:(snd_use_case_mgr_open) error: failed to import
>>>> AudioPCI use case configuration -19
>>>> ./alsaucm: error failed to open sound card AudioPCI: No such device
>>>> Ideally I'd like to write an interface between PulseAudio and UCM,
>>>> there are existing modules I can reuse to set voice or hifi modes,
>>>> depending on what the client roles are. But if I can't make the
>>>> examples work I don't think this is going to go anywhere.
>>> There's some existing work going on with PulseAudio/UCM integration -
>>> Liam, I'd CC in Marga but I don't know what her new address.
>> I've CC'ed Margarita. She has started some work on PA and UCM
>> integration and has some code that can read in the UCM verbs.
>> Margarita, could you provide a link to your PA git.
> Here is the link to the  PA git, it has the code that can read the ucm verbs.
> http://git.slimlogic.co.uk/cgi-bin/cgit.cgi/pulseaudio.git/?h=9.20-ucm
> If the following ucm command works then you will not have issues with the patch
> $ alsaucm YOUR_CARD listv
> Regards,
> Margarita

This patch does not use the released UCM API in alsa-lib. Also, more work 
is required to separate ALSA card from UCM card (to support virtual or 
mixed "soundcards").


Jaroslav Kysela <perex at perex.cz>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.

More information about the Alsa-devel mailing list