#ifdef HAVE_ALSA_USE_CASE_H
{ 'D', "ucm-defaults", "execute also the UCM 'defaults' section" },
{ 'U', "no-ucm", "don't init with UCM" },
+#if SND_LIB_VER(1, 2, 5) < SND_LIB_VERSION
+{ 'X', "ucm-nodev", "show UCM no device errors" },
+#endif
#endif
{ HEADER, NULL, "Available commands:" },
{ CARDCMD, "store", "save current driver setup for one or each soundcards" },
struct option *long_option;
char *short_option;
+#if SND_LIB_VER(1, 2, 5) >= SND_LIB_VERSION
+ initflags |= FLAG_UCM_NODEV;
+#endif
long_option = calloc(ARRAY_SIZE(args), sizeof(struct option));
if (long_option == NULL)
exit(EXIT_FAILURE);
case 'U':
initflags |= FLAG_UCM_DISABLED;
break;
+ case 'X':
+ initflags |= FLAG_UCM_NODEV;
+ break;
case 'r':
statefile = optarg;
break;
#define FLAG_UCM_FBOOT (1<<1)
#define FLAG_UCM_BOOT (1<<2)
#define FLAG_UCM_DEFAULTS (1<<3)
+#define FLAG_UCM_NODEV (1<<4)
void snd_card_iterator_init(struct snd_card_iterator *iter, int cardno);
int snd_card_iterator_sinit(struct snd_card_iterator *iter, const char *cardname);
int init_ucm(int flags, int cardno)
{
snd_use_case_mgr_t *uc_mgr;
- char id[32];
+ char id[32], *nodev;
int err;
if (flags & FLAG_UCM_DISABLED)
return -ENXIO;
- snprintf(id, sizeof(id), "hw:%d", cardno);
+ nodev = (flags & FLAG_UCM_NODEV) ? "" : "-";
+ snprintf(id, sizeof(id), "%shw:%d", nodev, cardno);
err = snd_use_case_mgr_open(&uc_mgr, id);
if (err < 0)
return err;