}
/*
+ * parse controls which should be run only at initial boot
+ */
+static int parse_controls_once(snd_use_case_mgr_t *uc_mgr, snd_config_t *cfg)
+{
+ int err;
+
+ if (!list_empty(&uc_mgr->once_list)) {
+ uc_error("Once list is not empty");
+ return -EINVAL;
+ }
+ err = parse_sequence(uc_mgr, &uc_mgr->once_list, cfg);
+ if (err < 0) {
+ uc_error("Unable to parse SectionOnce");
+ return err;
+ }
+
+ return 0;
+}
+
+/*
* parse controls
*/
static int parse_controls(snd_use_case_mgr_t *uc_mgr, snd_config_t *cfg)
{
int err;
-
+
if (!list_empty(&uc_mgr->default_list)) {
uc_error("Default list is not empty");
return -EINVAL;
uc_error("Unable to parse SectionDefaults");
return err;
}
-
+
return 0;
}
* CaptureCTL "hw:CARD=0"
* }
*
+ * # The initial boot (run once) configuration.
+ *
+ * SectionOnce {
+ * cset "name='Master Playback Switch',index=2 1,1"
+ * cset "name='Master Playback Volume',index=2 25,25"
+ * }
+ *
* # This file also stores the default sound card state.
*
* SectionDefaults [
- * cset "name='Master Playback Switch',index=2 1,1"
- * cset "name='Master Playback Volume',index=2 25,25"
* cset "name='Master Mono Playback',index=1 0"
* cset "name='Master Mono Playback Volume',index=1 0"
* cset "name='PCM Switch',index=2 1,1"
continue;
}
+ /* find default control values section (first boot only) */
+ if (strcmp(id, "SectionOnce") == 0) {
+ err = parse_controls_once(uc_mgr, n);
+ if (err < 0)
+ return err;
+ continue;
+ }
+
/* find default control values section and parse it */
if (strcmp(id, "SectionDefaults") == 0) {
err = parse_controls(uc_mgr, n);
/* use case verb, devices and modifier configs parsed from files */
struct list_head verb_list;
+ /* boot settings - sequence */
+ struct list_head once_list;
+
/* default settings - sequence */
struct list_head default_list;