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.
This commit is contained in:
Geoffrey D. Bennett
2023-11-30 00:42:58 +10:30
parent 80cd0ebc4d
commit 22fdbaad41

View File

@@ -101,8 +101,11 @@ int get_max_elem_by_name(GArray *elems, char *prefix, char *needle) {
// S/PDIF Output xx Playback Enum // S/PDIF Output xx Playback Enum
// ADAT Output xx Playback Enum // ADAT Output xx Playback Enum
int is_elem_routing_snk(struct alsa_elem *elem) { int is_elem_routing_snk(struct alsa_elem *elem) {
if (strstr(elem->name, "Capture Enum") && if (strstr(elem->name, "Capture Enum") && (
!strstr(elem->name, "Level")) strncmp(elem->name, "PCM ", 4) == 0 ||
strncmp(elem->name, "Mixer Input ", 12) == 0 ||
strncmp(elem->name, "DSP Input ", 10) == 0
))
return 1; return 1;
if (strstr(elem->name, "Output") && if (strstr(elem->name, "Output") &&
strstr(elem->name, "Playback Enum")) strstr(elem->name, "Playback Enum"))