Hello, I wrote a patch this morning that lets the user define limits on the number of controls envy24control should display to the user. This is useful on cards like the Delta44, which only has 4x4 channels - it provides a cleaner interface in that case. The patch is included below, and is downloadable from: http://poplar.seitz.com/~ross/envy24control/envy24control-control-limit.diff The changes introduce two new command line options: -i, --inputs: Use this to define how many HW In channels you'd like -o, --outputs: Use this to define how many PCM Out channels you'd like So for my Delta44, I now use 'envy24control -i 4 -o 4' to only see the channels I physically have. That's about all there is to it. It seems to correctly handle limiting to fewer channels than physically present as well. Hopefully this can help out some others as well. I'm not subscribed to alsa-devel, so please CC me on any replies from that list. Thanks! -- Ross Vandegrift ross@xxxxxxxxxxxxxxxx A Pope has a Water Cannon. It is a Water Cannon. He fires Holy-Water from it. It is a Holy-Water Cannon. He Blesses it. It is a Holy Holy-Water Cannon. He Blesses the Hell out of it. It is a Wholly Holy Holy-Water Cannon. He has it pierced. It is a Holey Wholly Holy Holy-Water Cannon. He makes it official. It is a Canon Holey Wholly Holy Holy-Water Cannon. Batman and Robin arrive. He shoots them. diff -u alsa-tools-0.9.3/envy24control/envy24control.c alsa-tools-hack/envy24control/envy24control.c --- alsa-tools-0.9.3/envy24control/envy24control.c 2003-03-25 12:32:21.000000000 -0500 +++ alsa-tools-hack/envy24control/envy24control.c 2003-05-24 09:43:55.000000000 -0400 @@ -24,6 +24,7 @@ #define _GNU_SOURCE #include <getopt.h> +int input_channels, output_channels; ice1712_eeprom_t card_eeprom; snd_ctl_t *ctl; @@ -115,6 +116,7 @@ GtkWidget *label; GtkWidget *toggle; char str[64], drawname[32]; + static int widget_count = 0; if (stream <= 10) { sprintf(str, "PCM Out %i", stream); @@ -329,8 +331,11 @@ gtk_widget_show(hbox); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 0); - - for (stream = 1; stream <= 20; stream++) + for(stream = 1; stream <= output_channels; stream ++) + create_mixer_frame(hbox, stream); + for(stream = 11; stream <= input_channels + 10; stream ++) + create_mixer_frame(hbox, stream); + for(stream = 19; stream <= 20; stream ++) create_mixer_frame(hbox, stream); } @@ -420,7 +425,7 @@ gtk_box_pack_start(GTK_BOX(vbox), hseparator, FALSE, TRUE, 0); - for(idx = 0; idx < 10; idx++) { + for(idx = 0; idx < input_channels + 2; idx++) { radiobutton = gtk_radio_button_new_with_label(group, table[idx]); router_radio[stream-1][2+idx] = radiobutton; group = gtk_radio_button_group(GTK_RADIO_BUTTON(radiobutton)); @@ -1360,7 +1365,11 @@ static void usage(void) { - fprintf(stderr, "usage: envy24control [-c card#] [-D control-name]\n"); + fprintf(stderr, "usage: envy24control [-c card#] [-D control-name] [-o num-outputs] [-i num-inputs]\n"); + fprintf(stderr, "\t-c, --card\tAlsa card number to control\n"); + fprintf(stderr, "\t-D, --device\tcontrol-name\n"); + fprintf(stderr, "\t-o, --outputs\tLimit number of outputs to display\n"); + fprintf(stderr, "\t-i, --input\tLimit number of inputs to display\n"); } int main(int argc, char **argv) @@ -1376,6 +1385,8 @@ static struct option long_options[] = { {"device", 1, 0, 'D'}, {"card", 1, 0, 'c'}, + {"inputs", 1, 0, 'i'}, + {"outputs", 1, 0, 'o'} }; @@ -1386,7 +1397,9 @@ gtk_init(&argc, &argv); name = "hw:0"; - while ((c = getopt_long(argc, argv, "D:c:", long_options, NULL)) != -1) { + input_channels = 8; + output_channels = 10; + while ((c = getopt_long(argc, argv, "D:c:i:o:", long_options, NULL)) != -1) { switch (c) { case 'c': i = atoi(optarg); @@ -1400,6 +1413,12 @@ case 'D': name = optarg; break; + case 'i': + input_channels = atoi(optarg); + break; + case 'o': + output_channels = atoi(optarg); + break; default: usage(); exit(1); Only in alsa-tools-hack/envy24control/: envy24control.c.rej Only in alsa-tools-hack/envy24control/: envy24control.c~ diff -u alsa-tools-0.9.3/envy24control/levelmeters.c alsa-tools-hack/envy24control/levelmeters.c --- alsa-tools-0.9.3/envy24control/levelmeters.c 2001-06-06 09:58:01.000000000 -0400 +++ alsa-tools-hack/envy24control/levelmeters.c 2003-05-24 09:39:37.000000000 -0400 @@ -28,6 +28,8 @@ static GdkPixmap *pixmap[21] = { NULL, }; static snd_ctl_elem_value_t *peaks; +extern int input_channels, output_channels; + static void update_peak_switch(void) { int err; @@ -195,7 +197,20 @@ int idx, l1, l2; update_peak_switch(); - for (idx = 0; idx <= 20; idx++) { + for (idx = 0; idx < output_channels; idx++) { + get_levels(idx, &l1, &l2); + widget = idx == 0 ? mixer_mix_drawing : mixer_drawing[idx-1]; + if (!GTK_WIDGET_VISIBLE(widget)) + continue; + redraw_meters(idx, widget->allocation.width, widget->allocation.height, l1, l2); + gdk_draw_pixmap(widget->window, + widget->style->black_gc, + pixmap[idx], + 0, 0, + 0, 0, + widget->allocation.width, widget->allocation.height); + } + for (idx = 10; idx < input_channels; idx++) { get_levels(idx, &l1, &l2); widget = idx == 0 ? mixer_mix_drawing : mixer_drawing[idx-1]; if (!GTK_WIDGET_VISIBLE(widget)) diff -u alsa-tools-0.9.3/envy24control/mixer.c alsa-tools-hack/envy24control/mixer.c --- alsa-tools-0.9.3/envy24control/mixer.c 2001-06-13 14:41:38.000000000 -0400 +++ alsa-tools-hack/envy24control/mixer.c 2003-05-24 09:39:37.000000000 -0400 @@ -22,6 +22,8 @@ #define toggle_set(widget, state) \ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), state); +extern int input_channels, output_channels; + static int is_active(GtkWidget *widget) { return GTK_TOGGLE_BUTTON(widget)->active ? 1 : 0; @@ -153,6 +155,10 @@ { int stream; - for (stream = 1; stream <= 20; stream++) + for (stream = 1; stream <= output_channels; stream++) + mixer_update_stream(stream, 1, 1); + for (stream = 11; stream <= input_channels + 8; stream++) + mixer_update_stream(stream, 1, 1); + for (stream = 19; stream <= 20; stream++) mixer_update_stream(stream, 1, 1); } diff -u alsa-tools-0.9.3/envy24control/patchbay.c alsa-tools-hack/envy24control/patchbay.c --- alsa-tools-0.9.3/envy24control/patchbay.c 2001-06-13 14:41:38.000000000 -0400 +++ alsa-tools-hack/envy24control/patchbay.c 2003-05-24 09:39:37.000000000 -0400 @@ -26,6 +26,7 @@ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), state); static int stream_active[10]; +extern int output_channels; static int is_active(GtkWidget *widget) { @@ -69,7 +70,7 @@ { int stream, tidx; - for (stream = 1; stream <= 10; stream++) { + for (stream = 1; stream <= output_channels; stream++) { if (stream_active[stream - 1]) { tidx = get_toggle_index(stream); toggle_set(router_radio[stream - 1][tidx], TRUE); diff -u alsa-tools-0.9.3/envy24control/volume.c alsa-tools-hack/envy24control/volume.c --- alsa-tools-0.9.3/envy24control/volume.c 2002-12-07 04:44:27.000000000 -0500 +++ alsa-tools-hack/envy24control/volume.c 2003-05-24 09:39:37.000000000 -0400 @@ -41,6 +41,7 @@ static int adc_sense_items; static char *dac_sense_name[4]; static char *adc_sense_name[4]; +extern int input_channels, output_channels; int envy_dac_volumes(void) { @@ -310,7 +311,11 @@ break; dac_max = snd_ctl_elem_info_get_max(info); } - dac_volumes = i; + if (i < output_channels - 1) + dac_volumes = i; + else + dac_volumes = input_channels; + snd_ctl_elem_info_set_name(info, DAC_SENSE_NAME); for (i = 0; i < dac_volumes; i++) { snd_ctl_elem_info_set_numid(info, 0); @@ -338,7 +343,10 @@ if (snd_ctl_elem_info(ctl, info) < 0) break; } - adc_volumes = i; + if (i < input_channels - 1) + adc_volumes = i; + else + adc_volumes = input_channels; snd_ctl_elem_info_set_name(info, ADC_SENSE_NAME); for (i = 0; i < adc_volumes; i++) { snd_ctl_elem_info_set_numid(info, 0); @@ -366,7 +374,10 @@ if (snd_ctl_elem_info(ctl, info) < 0) break; } - ipga_volumes = i; + if (i < input_channels - 1) + ipga_volumes = i; + else + ipga_volumes = input_channels; } void analog_volume_postinit(void)