Add support for new 4th Gen control names

The 4th Gen driver has renamed "Line" to "Analogue" and removed
"Input" and "Output" in cases like "Mixer Input", "DSP Input", and
"Analogue Output". Some numbers are no longer zero-padded.
This commit is contained in:
Geoffrey D. Bennett
2025-02-20 23:50:15 +10:30
parent 18841b2a45
commit f1f085abcf
3 changed files with 12 additions and 6 deletions

View File

@@ -597,14 +597,14 @@ static void get_routing_snks(struct alsa_card *card) {
elem->is_routing_snk = 1;
if (strncmp(elem->name, "Mixer Input", 11) == 0 ||
if (strncmp(elem->name, "Mixer", 5) == 0 ||
strncmp(elem->name, "Matrix", 6) == 0) {
elem->port_category = PC_MIX;
if (!alsa_get_elem_writable(elem))
card->has_fixed_mixer_inputs = 1;
} else if (strncmp(elem->name, "DSP Input", 9) == 0) {
} else if (strncmp(elem->name, "DSP", 3) == 0) {
elem->port_category = PC_DSP;
} else if (strncmp(elem->name, "PCM", 3) == 0 ||
strncmp(elem->name, "Input Source", 12) == 0) {
@@ -664,10 +664,12 @@ void alsa_get_routing_controls(struct alsa_card *card) {
// check that we can find a routing control
card->sample_capture_elem =
get_elem_by_name(card->elems, "PCM 01 Capture Enum");
if (!card->sample_capture_elem) {
if (!card->sample_capture_elem)
card->sample_capture_elem =
get_elem_by_name(card->elems, "PCM 1 Capture Enum");
if (!card->sample_capture_elem)
card->sample_capture_elem =
get_elem_by_name(card->elems, "Input Source 01 Capture Route");
}
if (!card->sample_capture_elem) {
fprintf(

View File

@@ -813,7 +813,8 @@ static void create_output_controls(
gtk_grid_attach(GTK_GRID(output_grid), w, 0, 1, 1, 1);
} else if (strncmp(elem->name, "Line", 4) == 0 ||
strncmp(elem->name, "Master", 4) == 0) {
strncmp(elem->name, "Master", 4) == 0 ||
strncmp(elem->name, "Analogue", 8) == 0) {
if (strstr(elem->name, "Playback Volume")) {
w = make_gain_alsa_elem(elem, 1, WIDGET_GAIN_TAPER_LOG, 1);
@@ -966,6 +967,9 @@ static GtkWidget *create_main_window_controls(struct alsa_card *card) {
if (!output_count)
output_count =
get_max_elem_by_name(card->elems, "Master", "Playback Volume") * 2;
if (!output_count)
output_count =
get_max_elem_by_name(card->elems, "Analogue", "Playback Volume");
create_global_controls(card, top, &x);
create_input_controls(card, top, &x, input_count);

View File

@@ -853,7 +853,7 @@ static void make_routing_alsa_elem(struct routing_snk *r_snk) {
0, elem->port_num + 1, 1, 1
);
// "* Output X Playback Enum" controls go along the right, in
// "* X Playback Enum" controls go along the right, in
// card->routing_hw_out_grid
} else if (elem->port_category == PC_HW) {