[alsa-devel] [PATCH] ascenario: Add scenario support to alsa-lib

Jaroslav Kysela perex at perex.cz
Wed Oct 7 10:10:06 CEST 2009

On Tue, 6 Oct 2009, Takashi Iwai wrote:

>> binding. What's awful on this?
>> CTL{reset}="mixer"
>> CTL{name}="Master Playback Volume", CTL{value}="-21dB"
>> CTL{name}="Master Playback Switch", CTL{value}="on"
>> CTL{name}="Headphone Playback Switch", CTL{value}="on,on"
>> CTL{name}="Front Playback Volume", CTL{value}="-29dB,-29dB"
>> CTL{name}="Front Playback Switch", CTL{value}="on,on"
>> CTL{name}="PCM Playback Volume", CTL{value}="0dB,0dB"
> This is all fine, but as you wrote below:
>> Solving complex tasks requires complex description.
> This is the reality.
> The alsactl's default config shows its limit.
>> I'm open to
>> discuss things to make this udev-like syntax more nice. The most
>> irritating thing in this syntax are build-in commands for me, but having
>> another special key for these actions are not a big win, because
>> configuration writers must learn them.
> The crazy goto is also painful.  It reminds me the day of MS BASIC.

I'm going to change the CTL build-in command to something more readable 

Old syntax:

CTL{name}="Playback Volume",PROGRAM=="__ctl_search", \

New syntax:

CTL{name}="Playback Volume",CTL{do_search}=="1", \

But regarding goto, I'm really stuck. We can add some block control:

BEGIN="" .. END="" (looks like a goto anyway)

Or skip some lines:


But these solutions do not bring much readability. Another possibility 
(compromise) is to use a goto command to skip all lines to next label to 
reduce usage of named labels (which is not a big fun at least in 
init/default file):


It works without any code change in current parser.


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

More information about the Alsa-devel mailing list