Use "defaults.pcm.file_format" for the default file format of
file plugin. It's set to "raw" as default for compatibility.
defaults.pcm.modem.card defaults.pcm.card
defaults.pcm.modem.device defaults.pcm.device
# truncate files via file or tee PCM
+defaults.pcm.file_format "raw"
defaults.pcm.file_truncate true
defaults.rawmidi.card 0
defaults.rawmidi.device 0
}
@args.FORMAT {
type string
- default raw
+ default {
+ @func refer
+ name defaults.pcm.file_format
+ }
}
type file
slave.pcm $SLAVE
}
@args.FORMAT {
type string
- default raw
+ default {
+ @func refer
+ name defaults.pcm.file_format
+ }
}
type file
slave.pcm null
SNDERR("Unknown field %s", id);
return -EINVAL;
}
+ if (!format) {
+ snd_config_t *n;
+ /* read defaults */
+ if (snd_config_search(root, "defaults.pcm.file_format", &n) >= 0) {
+ err = snd_config_get_string(n, &format);
+ if (err < 0) {
+ SNDERR("Invalid file format");
+ return -EINVAL;
+ }
+ }
+ }
if (!slave) {
SNDERR("slave is not defined");
return -EINVAL;