diff --git a/src/alsa-sim.c b/src/alsa-sim.c index 5af315b..f9f65f5 100644 --- a/src/alsa-sim.c +++ b/src/alsa-sim.c @@ -249,12 +249,13 @@ static int alsa_config_to_new_elem( } } - // check iface value; only interested in MIXER and PCM + // check iface value; only interested in CARD, MIXER, and PCM if (!iface) { printf("missing iface node in control id %d\n", id); goto fail; } - if (strcmp(iface, "MIXER") != 0 && + if (strcmp(iface, "CARD") != 0 && + strcmp(iface, "MIXER") != 0 && strcmp(iface, "PCM") != 0) goto fail; diff --git a/src/alsa.c b/src/alsa.c index 3ca72aa..5133dac 100644 --- a/src/alsa.c +++ b/src/alsa.c @@ -473,14 +473,6 @@ static void alsa_add_card_callback(struct alsa_card *card) { ); } -static void alsa_get_firmware_version(struct alsa_card *card) { - struct alsa_elem *elem = get_elem_by_name(card->elems, "Firmware Version"); - - if (!elem) - return; - card->firmware_version = alsa_get_elem_value(elem); -} - static void alsa_subscribe(struct alsa_card *card) { int count = snd_ctl_poll_descriptors_count(card->handle); @@ -535,7 +527,6 @@ void alsa_scan_cards(void) { card->handle = ctl; alsa_get_elem_list(card); - alsa_get_firmware_version(card); alsa_subscribe(card); create_card_window(card); diff --git a/src/alsa.h b/src/alsa.h index c0d58c6..6c46145 100644 --- a/src/alsa.h +++ b/src/alsa.h @@ -145,7 +145,6 @@ struct alsa_card { char *name; snd_ctl_t *handle; struct pollfd pfd; - int firmware_version; GArray *elems; struct alsa_elem *sample_capture_elem; struct alsa_elem *level_meter_elem; diff --git a/src/menu.c b/src/menu.c index 354a4ab..8b07e36 100644 --- a/src/menu.c +++ b/src/menu.c @@ -210,7 +210,10 @@ void add_mixer_action_map(struct alsa_card *card) { card ); - if (card->firmware_version) { + // Hide the levels menu item if there is no "Firmware Version" + // control (working kernel support for level meters was added in the + // same version as the "Firmware Version" control) + if (get_elem_by_name(card->elems, "Firmware Version")) { g_action_map_add_action_entries( G_ACTION_MAP(card->window_main), levels_entries,