From 22fdbaad4152b93670839f2c5ad6b7386af44ff2 Mon Sep 17 00:00:00 2001 From: "Geoffrey D. Bennett" Date: Thu, 30 Nov 2023 00:42:58 +1030 Subject: [PATCH] Fix is_elem_routing_snk() for Gen 4 The search for routing sink ALSA elements should only include PCM, Mixer, and DSP Capture Enums. The previous search for Capture Enum excluding Line In Level Capture Enums is too broad for Gen 4 as the Air control is a Capture Enum as well. --- src/alsa.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/alsa.c b/src/alsa.c index 4b64d95..3ca72aa 100644 --- a/src/alsa.c +++ b/src/alsa.c @@ -101,8 +101,11 @@ int get_max_elem_by_name(GArray *elems, char *prefix, char *needle) { // S/PDIF Output xx Playback Enum // ADAT Output xx Playback Enum int is_elem_routing_snk(struct alsa_elem *elem) { - if (strstr(elem->name, "Capture Enum") && - !strstr(elem->name, "Level")) + if (strstr(elem->name, "Capture Enum") && ( + strncmp(elem->name, "PCM ", 4) == 0 || + strncmp(elem->name, "Mixer Input ", 12) == 0 || + strncmp(elem->name, "DSP Input ", 10) == 0 + )) return 1; if (strstr(elem->name, "Output") && strstr(elem->name, "Playback Enum"))