The /var/lib/alsa/card<NUMBER>.conf.d directories should be emptied
when the card is initialized. Implement this functionality directly
to alsactl.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Take the card iterator idea from the monitor code and
use it for all card loops. It reduces the code duplications
and makes things easy to review.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
The generic initialization code returns error code 99 (-99). Take
all those codes equal or above (bellow) this value as non-fatal.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
When alsactl init is invoked and a directory path is passed to INCLUDE
command in the config file, read only *.conf files in that directory.
This will avoid reading backup files or invalid files that have been
created accidentally.
Also by using scandir() with alphasort(), alsactl reads the files in
alphabetical order. Thus it's highly recommended to use some number
prefix to the file name for assuring the order.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
If initialization file (-i option) does not exists, the free_space()
function was called with NULL pointer.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
To increase configuration readability, add CTL{do_search} and CTL{do_count}
actions. The old PROGRAM=="__ctl_search" notion is also allowed.
Add CTL{write} to XML documentation.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
The sysfsroot path is /sys/class/sound/cardX/device for recent kernels.
The ACCESS check honors the variable substutition now. Added $config{key}
substitution.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
By doing this we move them from the .data section to .rodata setion,
or from .data.rel to .data.rel.ro.
The .rodata section is mapped directly from the on-disk file, which is
always a save, while .data.rel.ro is mapped directly when using
prelink, which is a save in a lot of cases.
Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
This way the compiler can assume more information about their
interface for optimisation.
Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
Implemented CTL{values)=value to set all values at once.
Implemented CTL{enums} to match against strings in enum list.
Added 'default' (guess method) initialization configuration.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
The initialization procedure consist from default initialization and
state restoration. When restore fails for a reason or the config file
contains inaccurate information, then init is called.
Also, if something fails (init or restore), a file specified using -r
option can be created with description what failed. It can be useful
when user space decides to notify user to set the sound driver properly.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
- change SYSFS_DEVICE to CONFIG{sysfs_device}
- INCLUDE key now handles also directories
- RESULT key can assign value now
- EXIT="return" operation returns from included file immediately
Default 00main and hda configuration files changes:
- handle preinit and postinit directories
Signed-off-by: Jaroslav Kysela <perex@perex.cz>