It seems that users are confused when the UCM configuration
is not ready for the particular hardware. Actually, we don't
allow a fine grained message classification in alsa-lib and
UCM API. Allow suppression of this specific type of messages
on the application request (typically alsactl).
BugLink: https://github.com/alsa-project/alsa-utils/issues/111
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
INIT_LIST_HEAD(&mgr->variable_list);
pthread_mutex_init(&mgr->mutex, NULL);
+ if (card_name && *card_name == '-') {
+ card_name++;
+ mgr->suppress_nodev_errors = 1;
+ }
+
err = uc_mgr_card_open(mgr);
if (err < 0) {
uc_mgr_free(mgr);
/* get info on use_cases and verify against card */
err = import_master_config(mgr);
if (err < 0) {
+ if (err == -ENXIO && mgr->suppress_nodev_errors)
+ goto _err;
uc_error("error: failed to import %s use case configuration %d",
card_name, err);
goto _err;
uc_error("error: failed to get Error string");
return err;
}
- uc_error("%s", s);
+ if (!uc_mgr->suppress_nodev_errors)
+ uc_error("%s", s);
free(s);
return -ENXIO;
}
char *comment;
int conf_format;
unsigned int ucm_card_number;
+ int suppress_nodev_errors;
/* UCM cards list */
struct list_head cards_list;