NetBSD Problem Report #15441
Received: (qmail 27026 invoked from network); 31 Jan 2002 10:48:01 -0000
Message-Id: <200201311047.g0VAltRv013473@isabase.philol.msu.ru>
Date: Thu, 31 Jan 2002 13:47:55 +0300 (MSK)
From: svs@ropnet.ru
To: gnats-bugs@gnats.netbsd.org
Subject: uaudio mixer devices are not recognized by ossaudio(3)
X-Send-Pr-Version: 3.95
>Number: 15441
>Category: kern
>Synopsis: uaudio mixer devices are not recognized by ossaudio(3)
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: kent
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Jan 31 10:49:00 +0000 2002
>Closed-Date: Sat Dec 04 04:35:25 +0000 2004
>Last-Modified: Sat Dec 04 04:35:25 +0000 2004
>Originator: Sergey Svishchev
>Release: 1.5ZA
>Organization:
>Environment:
System: NetBSD masked 1.5ZA NetBSD 1.5ZA (masked) #25: Wed Jan 30 08:17:25 MSK 2002 svs@masked:/home/svs/build/sys/masked i386
Architecture: i386
Machine: i386
>Description:
Mixer device labels generated by uaudio(4) are unlike those generated by
other audio drivers. ossaudio compatibility code in kernel (and libossaudio)
thus returns empty device masks (SOUND_MIXER_DEVMASK, SOUND_MIXER_RECMASK).
>How-To-Repeat:
Try to adjust volume of uaudio device (Altec Lansing ADA70) output from
RealPlayer, or from libossaudio-using app (wmsmixer). Lose.
>Fix:
RCS file: /cvsroot/basesrc/lib/libossaudio/ossaudio.c,v
--- ossaudio.c 2001/12/24 00:10:46 1.16
+++ ossaudio.c 2002/01/29 23:45:46
@@ -567,9 +567,15 @@
break;
switch(mi.type) {
case AUDIO_MIXER_VALUE:
- for(dp = devs; dp->name; dp++)
- if (strcmp(dp->name, mi.label.name) == 0)
+ for(dp = devs; dp->name; dp++) {
+ if (strcmp(dp->name, mi.label.name) == 0)
break;
+ if (strncmp(mi.label.name, "fea", 3) == 0) { /* uaudio(4) mixer */
+ char *r = strrchr(mi.label.name, '-');
+ if (r && (strcmp(++r, dp->name) == 0))
+ break;
+ }
+ }
if (dp->code >= 0) {
di->devmap[dp->code] = i;
di->rdevmap[i] = dp->code;
RCS file: /cvsroot/syssrc/sys/compat/ossaudio/ossaudio.c,v
--- ossaudio.c 2001/12/24 00:10:49 1.39
+++ ossaudio.c 2002/01/30 04:37:38
@@ -661,9 +661,15 @@
break;
switch(mi.type) {
case AUDIO_MIXER_VALUE:
- for(dp = devs; dp->name; dp++)
- if (strcmp(dp->name, mi.label.name) == 0)
+ for(dp = devs; dp->name; dp++) {
+ if (strcmp(dp->name, mi.label.name) == 0)
break;
+ if (strncmp(mi.label.name, "fea", 3) == 0) { /* uaudio(4) mixer */
+ char *r = strrchr(mi.label.name, '-');
+ if (r && (strcmp(++r, dp->name) == 0))
+ break;
+ }
+ }
if (dp->code >= 0) {
di->devmap[dp->code] = i;
di->rdevmap[i] = dp->code;
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: kern-bug-people->jdolecek
Responsible-Changed-By: jdolecek
Responsible-Changed-When: Thu Jan 31 10:58:02 PST 2002
Responsible-Changed-Why:
Cool, thanks! I've been going to look at this as well. I'll take
care to integrate the code.
From: Lennart Augustsson <lennart@augustsson.net>
To: svs@ropnet.ru
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: kern/15441: uaudio mixer devices are not recognized by ossaudio(3)
Date: Thu, 31 Jan 2002 21:38:43 +0100
I'm afraid the right way to fix this problem isn't that easy.
The uaudio mixers can be quite complex and you need to
find the right control mappings. Your suggestion would only
work for a few mixers.
-- Lennart
Responsible-Changed-From-To: jdolecek->kern-bug-people
Responsible-Changed-By: jdolecek
Responsible-Changed-When: Thu Mar 21 12:11:35 PST 2002
Responsible-Changed-Why:
I don't have time currently to deal with this.
From: Kazuhito HONDA <kazuhito@ph.noda.tus.ac.jp>
To: gnats-bugs@netbsd.org
Cc: kazuhito@ph.noda.tus.ac.jp
Subject: Re: kern/15441
Date: Fri, 17 Oct 2003 03:00:17 +0900 (JST)
Release: -current 20031010
Environment:
NetBSD kaoru 1.6ZC NetBSD 1.6ZC (KAORU.1.6ZC) #96: Fri Oct 17 02:04:30 JST 2003 root@kaoru:/sys/arch/i386/compile/KAORU.1.6ZC i386
I have a patch for this problem kern/15441.
This patch recognizes input and output terminal types
connected to units (feature etc.),
analyzes that, and names feature units.
In the case of `Sound Blaster Digital Music', for example,
`mixerctl -a` outputs
outputs.master.mute=off
outputs.speaker.mute=off
outputs.master=0,0
outputs.speaker=0,0
record.mic.mute=off
record.mic=2
record.mic.agc=off
record.line.mute=off
record.line=2,2
record.aux.mute=off
inputs.mic.mute=off
inputs.mic=192
inputs.line.mute=on
inputs.line=192,192
I could try this patch on Sound Blaster Digital Music only.
So I had to make this system for unit included in this
(input and output terminal, feature, selector, and mixer unit),
and for feature controls (mute, volume, agc) only.
But I believe that it is easy
to improve this for other units and controls.
--- src/sys/dev/usb/uaudio.c.orig 2003-10-03 00:20:14.000000000 +0900
+++ src/sys/dev/usb/uaudio.c 2003-10-16 17:07:57.000000000 +0900
@@ -187,15 +187,26 @@
char sc_dying;
};
+struct uaudio_io_trmnl {
+ int in_tml;
+ int **input;
+ int *output;
+};
+
#define UAC_OUTPUT 0
#define UAC_INPUT 1
#define UAC_EQUAL 2
-#define UAC_NCLASSES 3
+#define UAC_RECORD 3
+#define UAC_NCLASSES 4
Static usbd_status uaudio_identify_ac(struct uaudio_softc *sc,
usb_config_descriptor_t *cdesc);
Static usbd_status uaudio_identify_as(struct uaudio_softc *sc,
usb_config_descriptor_t *cdesc);
+Static int *uaudio_merge_terminal_list(struct uaudio_io_trmnl * iot);
+Static int *uaudio_io_terminaltype(int outtype, int id,
+ struct uaudio_io_trmnl ** iot,
+ usb_descriptor_t * v, usb_descriptor_t ** dps);
Static usbd_status uaudio_process_as(struct uaudio_softc *sc,
char *buf, int *offsp, int size,
usb_interface_descriptor_t *id);
@@ -222,8 +233,11 @@
usb_descriptor_t *v, usb_descriptor_t **dps);
Static void uaudio_add_selector(struct uaudio_softc *sc,
usb_descriptor_t *v, usb_descriptor_t **dps);
-Static void uaudio_add_feature(struct uaudio_softc *sc,
- usb_descriptor_t *v, usb_descriptor_t **dps);
+Static char *uaudio_feature_name(struct uaudio_io_trmnl * iot,
+ struct mixerctl * mix);
+Static void uaudio_add_feature(struct uaudio_softc * sc,
+ usb_descriptor_t * v, usb_descriptor_t ** dps,
+ struct uaudio_io_trmnl * iotrm, int master_flag);
Static void uaudio_add_processing_updown(struct uaudio_softc *sc,
usb_descriptor_t *v, usb_descriptor_t **dps);
Static void uaudio_add_processing(struct uaudio_softc *sc,
@@ -808,9 +822,125 @@
printf("uaudio_add_selector: NOT IMPLEMENTED\n");
}
+char *
+uaudio_feature_name(struct uaudio_io_trmnl * iot, struct mixerctl * mix)
+{
+ int terminal_type = 0;
+
+ if (iot == NULL) {
+ mix->class = UAC_OUTPUT;
+ return (AudioNmaster);
+ }
+ if (iot->output != NULL) {
+ if (iot->output[0] == 1) {
+ terminal_type = iot->output[1];
+ mix->class = UAC_OUTPUT;
+ }
+ }
+ if (iot->input != NULL) {
+ if (iot->input[0] != NULL) {
+ if (iot->input[0][0] == 1) {
+ if ((terminal_type & 0xff00) == (UAT_UNDEFINED & 0xff00))
+ mix->class = UAC_RECORD;
+ else
+ mix->class = UAC_INPUT;
+ terminal_type = iot->input[0][1];
+ }
+ }
+ }
+ if (terminal_type == 0)
+ mix->class = UAC_OUTPUT;
+ switch (terminal_type) {
+ case UAT_STREAM:
+ return (AudioNdac);
+ break;
+ case UATI_MICROPHONE:
+ case UATI_DESKMICROPHONE:
+ case UATI_PERSONALMICROPHONE:
+ case UATI_OMNIMICROPHONE:
+ case UATI_MICROPHONEARRAY:
+ case UATI_PROCMICROPHONEARR:
+ return (AudioNmicrophone);
+ break;
+ case UATO_SPEAKER:
+ case UATO_DESKTOPSPEAKER:
+ case UATO_ROOMSPEAKER:
+ case UATO_COMMSPEAKER:
+ return (AudioNspeaker);
+ break;
+ case UATO_HEADPHONES:
+ return (AudioNheadphone);
+ break;
+ case UATE_ANALOGCONN:
+ case UATE_LINECONN:
+ case UATE_LEGACYCONN:
+ return (AudioNline);
+ break;
+ case UATE_DIGITALAUIFC:
+ case UATE_SPDIF:
+ case UATE_1394DA:
+ case UATE_1394DV:
+ return (AudioNaux);
+ break;
+ case UATF_CDPLAYER:
+ return (AudioNcd);
+ break;
+ case UATF_SYNTHESIZER:
+ return (AudioNfmsynth);
+ break;
+ case UATF_VIDEODISCAUDIO:
+ case UATF_DVDAUDIO:
+ case UATF_TVTUNERAUDIO:
+ return (AudioNvideo);
+ break;
+ case UAT_UNDEFINED:
+ case UAT_VENDOR:
+ case UATI_UNDEFINED:
+/* output terminal types */
+ case UATO_UNDEFINED:
+ case UATO_DISPLAYAUDIO:
+ case UATO_SUBWOOFER:
+/* bidir terminal types */
+ case UATB_UNDEFINED:
+ case UATB_HANDSET:
+ case UATB_HEADSET:
+ case UATB_SPEAKERPHONE:
+ case UATB_SPEAKERPHONEESUP:
+ case UATB_SPEAKERPHONEECANC:
+/* telephony terminal types */
+ case UATT_UNDEFINED:
+ case UATT_PHONELINE:
+ case UATT_TELEPHONE:
+ case UATT_DOWNLINEPHONE:
+/* external terminal types */
+ case UATE_UNDEFINED:
+/* embedded function terminal types */
+ case UATF_UNDEFINED:
+ case UATF_CALIBNOISE:
+ case UATF_EQUNOISE:
+ case UATF_DAT:
+ case UATF_DCC:
+ case UATF_MINIDISK:
+ case UATF_ANALOGTAPE:
+ case UATF_PHONOGRAPH:
+ case UATF_VCRAUDIO:
+ case UATF_SATELLITE:
+ case UATF_CABLETUNER:
+ case UATF_DSS:
+ case UATF_RADIORECV:
+ case UATF_RADIOXMIT:
+ case UATF_MULTITRACK:
+ case 0xffff:
+ default:
+ return (AudioNmaster);
+ break;
+ }
+ return (AudioNmaster);
+}
+
void
-uaudio_add_feature(struct uaudio_softc *sc, usb_descriptor_t *v,
- usb_descriptor_t **dps)
+uaudio_add_feature(struct uaudio_softc * sc, usb_descriptor_t * v,
+ usb_descriptor_t ** dps, struct uaudio_io_trmnl * iotrm, int master_flag)
{
struct usb_audio_feature_unit *d = (struct usb_audio_feature_unit *)v;
uByte *ctls = d->bmaControls;
@@ -820,6 +950,7 @@
u_int fumask, mmask, cmask;
struct mixerctl mix;
int chan, ctl, i, unit;
+ char *mixername;
#define GET(i) (ctls[(i)*ctlsize] | \
(ctlsize > 1 ? ctls[(i)*ctlsize+1] << 8 : 0))
@@ -859,23 +990,36 @@
continue;
}
#undef GET
- mix.class = UAC_OUTPUT; /* XXX we don't really know this */
+ mixername = uaudio_feature_name(iotrm, &mix);
switch (ctl) {
case MUTE_CONTROL:
mix.type = MIX_ON_OFF;
mix.ctlunit = "";
- uaudio_mixer_alias_ctl(sc, &mix, AudioNmute);
+#ifdef UAUDIO_DEBUG
sprintf(mix.ctlname, "fea%d-%s-%s", unit,
uaudio_id_name(sc, dps, srcId),
AudioNmute);
+ uaudio_mixer_add_ctl(sc, &mix);
+#endif
+ if (master_flag == 1) {
+ sprintf(mix.ctlname, "%s.%s", AudioNmaster, AudioNmute);
+ uaudio_mixer_add_ctl(sc, &mix);
+ }
+ sprintf(mix.ctlname, "%s.%s", mixername, AudioNmute);
break;
case VOLUME_CONTROL:
mix.type = MIX_SIGNED_16;
mix.ctlunit = AudioNvolume;
- uaudio_mixer_alias_ctl(sc, &mix, AudioNmaster);
+#ifdef UAUDIO_DEBUG
sprintf(mix.ctlname, "fea%d-%s-%s", unit,
uaudio_id_name(sc, dps, srcId),
AudioNmaster);
+ uaudio_mixer_add_ctl(sc, &mix);
+#endif
+ if (master_flag == 1) {
+ uaudio_mixer_alias_ctl(sc, &mix, AudioNmaster);
+ }
+ sprintf(mix.ctlname, "%s", mixername);
break;
case BASS_CONTROL:
mix.type = MIX_SIGNED_8;
@@ -905,10 +1049,18 @@
break;
case AGC_CONTROL:
mix.type = MIX_ON_OFF;
+ mix.ctlunit = "";
+#ifdef UAUDIO_DEBUG
sprintf(mix.ctlname, "fea%d-%s-%s", unit,
uaudio_id_name(sc, dps, srcId),
AudioNagc);
- mix.ctlunit = "";
+ uaudio_mixer_add_ctl(sc, &mix);
+#endif
+ if (master_flag == 1) {
+ sprintf(mix.ctlname, "%s.%s", AudioNmaster, AudioNagc);
+ uaudio_mixer_add_ctl(sc, &mix);
+ }
+ sprintf(mix.ctlname, "%s.%s", mixername, AudioNagc);
break;
case DELAY_CONTROL:
mix.type = MIX_UNSIGNED_16;
@@ -1217,6 +1369,153 @@
}
#undef offs
+int *
+uaudio_merge_terminal_list(struct uaudio_io_trmnl * iot)
+{
+ int i, len = 0;
+ int *tml_top, *tml_pnt;
+
+ if (iot->input == NULL)
+ return (NULL);
+ for (i = 0; i < iot->in_tml; i++) {
+ if (iot->input[i] != NULL)
+ len += iot->input[i][0];
+ }
+ tml_top = malloc(sizeof(int) * (len + 1), M_TEMP, M_NOWAIT);
+ if (tml_top == NULL) {
+ printf("uaudio_io_terminaltype: no memory\n");
+ return (NULL);
+ }
+ *tml_top = 0;
+ tml_pnt = tml_top + 1;
+ for (i = 0; i < iot->in_tml && iot->input[i][0] <= len; i++) {
+ memmove(tml_pnt, iot->input[i] + 1, iot->input[i][0] * sizeof(int));
+ *tml_top += iot->input[i][0];
+ tml_pnt += iot->input[i][0];
+ len -= iot->input[i][0];
+ }
+ return (tml_top);
+}
+
+int *
+uaudio_io_terminaltype(int outtype, int id, struct uaudio_io_trmnl ** iot,
+ usb_descriptor_t * v, usb_descriptor_t ** dps)
+{
+ int srcId, *tml, i;
+
+ if (iot[id] != NULL) {
+ if (iot[id]->output == NULL) {
+ iot[id]->output = malloc(sizeof(int) * 2, M_TEMP, M_NOWAIT);
+ if (iot[id]->output == NULL) {
+ printf("uaudio_io_terminaltype: no memory\n");
+ return uaudio_merge_terminal_list(iot[id]);
+ }
+ iot[id]->output[1] = outtype;
+ iot[id]->output[0] = 1;
+ return uaudio_merge_terminal_list(iot[id]);
+ }
+ tml = malloc(sizeof(int) * (iot[id]->output[0] + 2), M_TEMP, M_NOWAIT);
+ if (tml == NULL) {
+ printf("uaudio_io_terminaltype: no memory\n");
+ return uaudio_merge_terminal_list(iot[id]);
+ }
+ memmove(tml, iot[id]->output, sizeof(int) * (iot[id]->output[0] + 1));
+ tml[iot[id]->output[0] + 1] = outtype;
+ tml[0]++;
+ free(iot[id]->output, M_TEMP);
+ iot[id]->output = tml;
+ return uaudio_merge_terminal_list(iot[id]);
+ } /* end `iot[id] != NULL' */
+ iot[id] = malloc(sizeof(struct uaudio_io_trmnl), M_TEMP, M_NOWAIT);
+ if (iot[id] == NULL) {
+ printf("uaudio_io_terminaltype: no memory\n");
+ return (NULL);
+ }
+ iot[id]->in_tml = 0;
+ iot[id]->input = NULL;
+ iot[id]->output = malloc(sizeof(int) * 2, M_TEMP, M_NOWAIT);
+ if (iot[id]->output == NULL) {
+ printf("uaudio_io_terminaltype: no memory\n");
+ return (NULL);
+ }
+ iot[id]->output[1] = outtype;
+ iot[id]->output[0] = 1;
+
+ switch (v->bDescriptorSubtype) {
+ case UDESCSUB_AC_INPUT:
+ iot[id]->input = malloc(sizeof(int *), M_TEMP, M_NOWAIT);
+ if (iot[id]->input == NULL) {
+ printf("uaudio_io_terminaltype: no memory\n");
+ return (NULL);
+ }
+ tml = malloc(sizeof(int) * 2, M_TEMP, M_NOWAIT);
+ if (tml == NULL) {
+ printf("uaudio_io_terminaltype: no memory\n");
+ free(iot[id]->input, M_TEMP);
+ iot[id]->input = NULL;
+ return (NULL);
+ }
+ iot[id]->input[0] = tml;
+ tml[1] = UGETW(((struct usb_audio_input_terminal *) v)->wTerminalType);
+ tml[0] = 1;
+ iot[id]->in_tml = 1;
+ return uaudio_merge_terminal_list(iot[id]);
+ case UDESCSUB_AC_FEATURE:
+ srcId = ((struct usb_audio_feature_unit *) v)->bSourceId;
+ iot[id]->input = malloc(sizeof(int *), M_TEMP, M_NOWAIT);
+ if (iot[id]->input == NULL) {
+ printf("uaudio_io_terminaltype: no memory\n");
+ return (uaudio_io_terminaltype(outtype, srcId, iot, dps[srcId], dps));
+ }
+ iot[id]->input[0] = uaudio_io_terminaltype(outtype, srcId, iot, dps[srcId], dps);
+ iot[id]->in_tml = 1;
+ return uaudio_merge_terminal_list(iot[id]);
+ case UDESCSUB_AC_OUTPUT:
+ iot[id]->input = malloc(sizeof(int *), M_TEMP, M_NOWAIT);
+ if (iot[id]->input == NULL) {
+ printf("uaudio_io_terminaltype: no memory\n");
+ return (NULL);
+ }
+ srcId = ((struct usb_audio_output_terminal *) v)->bSourceId;
+ iot[id]->input[0] = uaudio_io_terminaltype(outtype, srcId, iot, dps[srcId], dps);
+ iot[id]->in_tml = 1;
+ return (NULL);
+ case UDESCSUB_AC_MIXER:
+ iot[id]->in_tml = 0;
+ iot[id]->input = malloc(sizeof(int *) * ((struct usb_audio_mixer_unit *) v)->bNrInPins, M_TEMP, M_NOWAIT);
+ if (iot[id]->input == NULL) {
+ printf("uaudio_io_terminaltype: no memory\n");
+ return (NULL);
+ }
+ for (i = 0; i < ((struct usb_audio_mixer_unit *) v)->bNrInPins; i++) {
+ srcId = ((struct usb_audio_mixer_unit *) v)->baSourceId[i];
+ iot[id]->input[i] = uaudio_io_terminaltype(outtype, srcId, iot, dps[srcId], dps);
+ iot[id]->in_tml++;
+ }
+ return uaudio_merge_terminal_list(iot[id]);
+ case UDESCSUB_AC_SELECTOR:
+ iot[id]->in_tml = 0;
+ iot[id]->input = malloc(sizeof(int *) * ((struct usb_audio_selector_unit *) v)->bNrInPins, M_TEMP, M_NOWAIT);
+ if (iot[id]->input == NULL) {
+ printf("uaudio_io_terminaltype: no memory\n");
+ return (NULL);
+ }
+ for (i = 0; i < ((struct usb_audio_selector_unit *) v)->bNrInPins; i++) {
+ srcId = ((struct usb_audio_selector_unit *) v)->baSourceId[i];
+ iot[id]->input[i] = uaudio_io_terminaltype(outtype, srcId, iot, dps[srcId], dps);
+ iot[id]->in_tml++;
+ }
+ return uaudio_merge_terminal_list(iot[id]);
+ case UDESCSUB_AC_PROCESSING:
+ case UDESCSUB_AC_EXTENSION:
+ case UDESCSUB_AC_HEADER:
+ default:
+ return (NULL);
+ break;
+ }
+ return (NULL);
+}
+
usbd_status
uaudio_identify_as(struct uaudio_softc *sc, usb_config_descriptor_t *cdesc)
{
@@ -1277,8 +1576,11 @@
usb_interface_descriptor_t *id;
struct usb_audio_control_descriptor *acdp;
usb_descriptor_t *dp, *dps[256];
+ struct uaudio_io_trmnl *dpsioterm[256];
+ int *tml;
char *buf, *ibuf, *ibufend;
- int size, offs, aclen, ndps, i;
+ int size, offs, aclen, ndps;
+ int feature_master_id, feature_master_score, score, i, j, k;
size = UGETW(cdesc->wTotalLength);
buf = (char *)cdesc;
@@ -1337,6 +1639,72 @@
}
ndps++;
+ for (i = 0; i < 256; i++)
+ dpsioterm[i] = NULL;
+
+ for (i = 0; i < ndps; i++) {
+ dp = dps[i];
+ if (dp == NULL)
+ continue;
+ if (dp->bDescriptorSubtype != UDESCSUB_AC_OUTPUT)
+ continue;
+ tml = uaudio_io_terminaltype(UGETW(((struct usb_audio_output_terminal *) dp)->wTerminalType), i, dpsioterm, dp, dps);
+ if (tml != NULL)
+ free(tml, M_TEMP);
+ }
+
+#ifdef UAUDIO_DEBUG
+ for (i = 0; i < 256; i++) {
+ if (dpsioterm[i] == NULL)
+ continue;
+ printf("id %d:\n", i);
+ for (j = 0; j < dpsioterm[i]->in_tml; j++) {
+ printf("\tinput%d: ", j);
+ tml = dpsioterm[i]->input[j];
+ for (k = 1; k <= tml[0]; k++) {
+ printf("%.4x ", tml[k]);
+ }
+ printf("\n");
+ }
+ printf("\toutput: ");
+ tml = dpsioterm[i]->output;
+ for (j = 1; j <= tml[0]; j++) {
+ printf("%.4x ", tml[j]);
+ }
+ printf("\n");
+ }
+#endif
+
+ feature_master_id = -1;
+ feature_master_score = -1;
+ for (i = 0; i < ndps; i++) {
+ dp = dps[i];
+ if (dp == NULL)
+ continue;
+ if (dp->bDescriptorSubtype != UDESCSUB_AC_FEATURE || dpsioterm[i] == NULL)
+ continue;
+ score = 0;
+ for (j = 0; j < dpsioterm[i]->in_tml; j++) {
+ if (dpsioterm[i]->input[j] == NULL)
+ continue;
+ for (k = 1; k <= dpsioterm[i]->input[j][0]; k++) {
+ score += 0x0001;
+ if ((dpsioterm[i]->input[j][k] & 0xff00) == (UAT_UNDEFINED & 0xff00))
+ score += 0x1000;
+ }
+ }
+ if (dpsioterm[i]->output != NULL)
+ score += 0x0001 * dpsioterm[i]->output[0];
+ if (score > feature_master_score) {
+ feature_master_id = i;
+ feature_master_score = score;
+ }
+ }
+#ifdef UAUDIO_DEBUG
+ printf("master feature id: %d\n", feature_master_id);
+ printf("master feature score: %.4x\n", feature_master_score);
+#endif
+
for (i = 0; i < ndps; i++) {
dp = dps[i];
if (dp == NULL)
@@ -1360,7 +1728,10 @@
uaudio_add_selector(sc, dp, dps);
break;
case UDESCSUB_AC_FEATURE:
- uaudio_add_feature(sc, dp, dps);
+ if (i == feature_master_id)
+ uaudio_add_feature(sc, dp, dps, dpsioterm[i], 1);
+ else
+ uaudio_add_feature(sc, dp, dps, dpsioterm[i], 0);
break;
case UDESCSUB_AC_PROCESSING:
uaudio_add_processing(sc, dp, dps);
@@ -1374,6 +1745,23 @@
break;
}
}
+
+ for (i = 0; i < 256; i++) {
+ if (dpsioterm[i] == NULL)
+ continue;
+ if (dpsioterm[i]->input != NULL) {
+ for (j = 0; j < dpsioterm[i]->in_tml; j++) {
+ if (dpsioterm[i]->input[j] != NULL)
+ free(dpsioterm[i]->input[j], M_TEMP);
+ }
+ free(dpsioterm[i]->input, M_TEMP);
+ }
+ if (dpsioterm[i]->output != NULL)
+ free(dpsioterm[i]->output, M_TEMP);
+ free(dpsioterm[i], M_TEMP);
+ dpsioterm[i] = NULL;
+ }
+
return (USBD_NORMAL_COMPLETION);
}
@@ -1410,6 +1798,12 @@
mi->next = mi->prev = AUDIO_MIXER_LAST;
strcpy(mi->label.name, AudioCequalization);
return (0);
+ case UAC_RECORD:
+ mi->type = AUDIO_MIXER_CLASS;
+ mi->mixer_class = UAC_RECORD;
+ mi->next = mi->prev = AUDIO_MIXER_LAST;
+ strcpy(mi->label.name, AudioCrecord);
+ return (0);
default:
break;
}
Responsible-Changed-From-To: kern-bug-people->kent
Responsible-Changed-By: kent
Responsible-Changed-When: Sun Oct 17 13:38:56 UTC 2004
Responsible-Changed-Why:
I'll take a look at HONDA-san's patch.
State-Changed-From-To: open->feedback
State-Changed-By: kent
State-Changed-When: Sat Oct 23 00:06:13 UTC 2004
State-Changed-Why:
HONDA-san's path was incorporated to -current.
Please test.
From: Sergey Svishchev <svs+pr@grep.ru>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: kern/15441
Date: Thu, 18 Nov 2004 02:54:15 +0300
Mostly works for me on 2.0H:
% mixerctl -f /dev/mixer1 -av
outputs.speaker.mute=off [ off on ]
outputs.speaker=162,162 volume delta=4
outputs.speaker.bass=149 bass delta=1
outputs.speaker.treble=128 treble delta=1
However, only master volume control is available to the ossaudio-based
application (wmsmixer) -- previously bass & treble controls were available,
too.
--
Sergey Svishchev
From: TAMURA Kent <kent@netbsd.org>
To: gnats-bugs@netbsd.org
Cc:
Subject: PR/15441 CVS commit: src
Date: Thu, 18 Nov 2004 14:02:43 +0000 (UTC)
Module Name: src
Committed By: kent
Date: Thu Nov 18 14:02:43 UTC 2004
Modified Files:
src/lib/libossaudio: ossaudio.c
src/sys/compat/ossaudio: ossaudio.c
Log Message:
getdevinfo():
If a mixer item does not match with AudioNsomething, check whether
it ends with '.' + AudioNsomething. PR#15441
To generate a diff of this commit:
cvs rdiff -r1.18 -r1.19 src/lib/libossaudio/ossaudio.c
cvs rdiff -r1.45 -r1.46 src/sys/compat/ossaudio/ossaudio.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: Sergey Svishchev <svs+pr@grep.ru>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: kern/15441
Date: Tue, 30 Nov 2004 23:30:54 +0300
Works for me.
I also noticed that an earlier problem has resurfaced (see PR 16652).
I'll investigate and append new info to that PR.
--
Sergey Svishchev
State-Changed-From-To: feedback->closed
State-Changed-By: kent@netbsd.org
State-Changed-When: Sat, 04 Dec 2004 04:35:25 +0000
State-Changed-Why:
confirmed
>Unformatted:
>Quarter:
>Keywords:
>Date-Required:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.