diff -uN --recursive alsa-utils-1.0.15.orig/alsamixer/alsamixer.c alsa-utils-1.0.15/alsamixer/alsamixer.c --- alsa-utils-1.0.15.orig/alsamixer/alsamixer.c 2008-06-09 20:48:16.000000000 -0700 +++ alsa-utils-1.0.15/alsamixer/alsamixer.c 2008-06-09 20:48:30.000000000 -0700 @@ -126,6 +126,9 @@ #include #include "aconfig.h" +int pages = 255; +#include "elementpage.h" + /* example compilation commandline: * clear; gcc -Wall -pipe -O2 alsamixer.c -o alsamixer -lasound -lncurses */ @@ -500,7 +503,14 @@ if (type != MIXER_ELEM_CAPTURE) snd_mixer_selem_get_playback_volume_range(elem, &min, &max); else + { snd_mixer_selem_get_capture_volume_range(elem, &min, &max); + +// long dmin=0, dmax=0; + // int rc = snd_mixer_selem_get_capture_dB_range(elem,&dmin,&dmax); +// printf("dB %d %ld %ld\n", rc, dmin, dmax); + + } vol1 = (vol < 0) ? -vol : vol; if (vol1 > 0) { if (vol1 > 100) @@ -1693,14 +1703,16 @@ mixer_sid = malloc(snd_mixer_selem_id_sizeof() * selem_count); if (mixer_sid == NULL) mixer_abort (ERR_FCN, "malloc", 0); - + int z=0; mixer_n_selems = 0; for (elem = snd_mixer_first_elem(mixer_handle); elem; elem = snd_mixer_elem_next(elem)) { sid = (snd_mixer_selem_id_t *)(((char *)mixer_sid) + snd_mixer_selem_id_sizeof() * mixer_n_selems); if (mixer_changed_state) goto __again; if (!snd_mixer_selem_is_active(elem)) - continue; + continue; + if((pages & elementPage[z++]) == 0) + continue; snd_mixer_selem_get_id(elem, sid); mixer_n_selems++; } @@ -2292,13 +2304,13 @@ */ do { - opt = getopt (argc, argv, "c:D:shgV:a:"); + opt = getopt (argc, argv, "p:c:D:shgV:a:"); switch (opt) { case '?': case 'h': printf ("%s v%s\n", PRGNAME_UPPER, VERSION); - printf ("Usage: %s [-h] [-c ] [-D ] [-g] [-s] [-V ] [-a ]\n", PRGNAME); + printf ("Usage: %s [-h] [-c ] [-D ] [-g] [-s] [-V ] [-a ] [-p ]\n", PRGNAME); return 1; case 'c': { @@ -2341,6 +2353,9 @@ mixer_abort (ERR_NONE, "", 0); } break; + case 'p': + pages = atoi(optarg); + break; } } while (opt > 0); diff -uN --recursive alsa-utils-1.0.15.orig/alsamixer/elementpage.h alsa-utils-1.0.15/alsamixer/elementpage.h --- alsa-utils-1.0.15.orig/alsamixer/elementpage.h 1969-12-31 16:00:00.000000000 -0800 +++ alsa-utils-1.0.15/alsamixer/elementpage.h 2008-06-09 20:48:23.000000000 -0700 @@ -0,0 +1,105 @@ +/* + This file defines a "page" for each mixer element. Page 1 has the main + "level" controls. Page 2 has the main "switch" controls. Page 4 has + "advanced" controls. Page 8 has "unlikely" controls (not connected, or + not normally changed). Yes, some of these classifications are subjective. + + For Openmoko Neo1973 (GTA01). +*/ + +const int elementPage[] = { + 1, //headphone + 8, //hp pb zc + 4, //bass + 4, // bass boost + 4, // bass filter + 4, // treble + 4, // treble cutoff + 1, // pcm + 1, // sidetone; sidetone capture + 2, // line left mux + 2, // line mixer + 2, // line mono mux + 2, // line right mux + 2, // mic sel mux + 2, // mic sidetone mux + 1, // mic1 + 1, // mic2 + 1, // mono + 8, // mono 2 mux + 1, // mono bypass + 2, // mono mixer bypass playback sw + 2, // mono mixer left + 2, // mono mixer right playback sw + 2, // mono mixer sidetone playback sw + 2, // mono mixer voice playback sw + 8, // mono playback zc + 1, // mono sidetone + 1, // mono voice + 2, // playback 6db attenuate + 2, // playback mixer left capture sw + 2, // playback mixer right capture sw + 2, // playback mixer voice capture sw + 2, // playback mono mix + 2, // playback phase + 1, // capture + 2, // capture 6db atten + 4, // capture filter + 4, // capture filter cutoff + 4, // capture filter select + 2, // capture left mixer + 2, // capture left mux + 2, // capture right mixer + 2, // capture right mux + 8, // capture zc + 4, // 3D + 4, // 3d function + 4, // 3d lower + 4, // 3d upper + 1, // adc + 2, // adc data select + 4, // alc capture attack time + 4, // alc capture decay time + 4, // alc capture function + 4, // alc capture hold time + 4, // alc capture max + 4, // alc capture ng + 4, // alc capture ng threshold + 4, // alc capture ng type + 4, // alc capture target + 8, // alc capture zc + 2, // alc mixer line + 2, // alc mixer mic1 + 2, // alc mixer mic2 + 2, // alc mixer rx + 2, // amp earpiece 6db + 8, // amp fast wakeup + 4, // amp hp 3d + 1, // amp left + 2, // amp mode + 8, // amp mono + 1, // amp right + 4, // amp spk 3d + 1, // bypass + 2, // dai mode + 4, // de-emphasis + 2, // left mixer bypass playback sw + 2, // left mixer left + 2, // left mixer sidetone playback sw + 2, // left mixer voice playback sw + 2, // neo mode + 8, // out3 mux + 8, // out4 mux + 8, // rout2 phase + 2, // right mixer bypass playback sw + 2, // right mixer right playback sw + 2, // right mixer sidetone playback sw + 2, // right mixer voice playback sw + 2, // rx mixer + 8, // speaker + 8, // speaker playback zc + 1, // voice + 1, // voice sidetone + 0 +}; +