NetBSD Problem Report #8854
Received: (qmail 17123 invoked from network); 23 Nov 1999 03:29:19 -0000
Message-Id: <199911230329.WAA05317@zygorthian-space-raiders.mit.edu>
Date: Mon, 22 Nov 1999 22:29:08 -0500 (EST)
From: "Charles M. Hannum" <mycroft@MIT.EDU>
Reply-To: "Charles M. Hannum" <mycroft@MIT.EDU>
To: gnats-bugs@gnats.netbsd.org
Subject: USB audio problems with slightly funky device
X-Send-Pr-Version: 3.95
>Number: 8854
>Category: kern
>Synopsis: USB audio problems with slightly funky device
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: augustss
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Nov 22 19:30:00 +0000 1999
>Closed-Date: Fri Apr 04 21:02:19 +0000 2003
>Last-Modified: Fri Apr 04 21:02:19 +0000 2003
>Originator: Charles M. Hannum
>Release: -current as of 19991117
>Organization:
The NetBSD Mission
>Environment:
i386
>Description:
With a set of Altec Lansing ADA70 speakers, I experienced two
problems:
1) The speakers report themselves as supporting ADV rev 0.90,
not 1.00. Unfortunately, the probe code didn't tell me the
vendor/product IDs (nor did it tell me the revision until I
modified it), and I no longer have the speakers, so I can't
write a `quirk' entry for this.
2) Setting of the default mode (ulaw, 8000 Hz) failed. This
caused mpg123 to output `No support rate found!' rather
than actually telling me what happened; but more
problematically, it caused a later open of /dev/sound to
panic the kernel (divide by zero, probably because the
block size was uninitialized). Running `audioctl -w
play=44100,2,16,slinear_le' and then using only /dev/sound
worked.
Actually, there are more than two problems mentioned above:
1) There needs to be a `quirk' entry for these speakers.
2) The code should give me some indication of why the probe
failed and an *easy* way to fix it, without having to
compile multiple kernels and read the entire file.
3) mpg123 should notice the failed open.
4) mpg123 should probably actually use /dev/sound (not that it
would matter in this case).
5) ulaw (and alaw) should convert to 16-bit output if
available (and thus would never actually fail, unless the
number of channels and/or bit rate weren't supported).
6) If only stereo is supported, perhaps the driver should
emulate mono. (This is pathetically easy to do.)
7) If the default mode isn't available, the audio layer should
back off to something that is, and at the very least not
panic.
>How-To-Repeat:
Attach Altec Lansing ADA70 speakers to a machine with an uhci.
Run mpg123. After that fails, `cat /netbsd >/dev/sound'.
>Fix:
Not supplied.
>Release-Note:
>Audit-Trail:
From: Lennart Augustsson <lennart@augustsson.net>
To: "Charles M. Hannum" <mycroft@MIT.EDU>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: kern/8854: USB audio problems with slightly funky device
Date: Tue, 23 Nov 1999 09:44:08 +0100
"Charles M. Hannum" wrote:
> >Number: 8854
> >Category: kern
> >Synopsis: USB audio problems with slightly funky device
> 1) The speakers report themselves as supporting ADV rev 0.90,
> not 1.00. Unfortunately, the probe code didn't tell me the
> vendor/product IDs (nor did it tell me the revision until I
> modified it), and I no longer have the speakers, so I can't
> write a `quirk' entry for this.
Run `usbdevs -v' to find the vendor/product/revision. It could be part of
the attach message, but it's pretty verbose as it is.
> 2) Setting of the default mode (ulaw, 8000 Hz) failed. This
> caused mpg123 to output `No support rate found!' rather
> than actually telling me what happened; but more
> problematically, it caused a later open of /dev/sound to
> panic the kernel (divide by zero, probably because the
> block size was uninitialized).
I recently fixed a bug like this, but I missed one place.
> 2) The code should give me some indication of why the probe
> failed and an *easy* way to fix it, without having to
> compile multiple kernels and read the entire file.
I'm not sure how to do this, it's hard to anticipate every way a device can fail.
> 5) ulaw (and alaw) should convert to 16-bit output if
> available (and thus would never actually fail, unless the
> number of channels and/or bit rate weren't supported).
And the uaudio driver does this.
> 6) If only stereo is supported, perhaps the driver should
> emulate mono. (This is pathetically easy to do.)
Yes, this should be added. I'll have a look at it.
> 7) If the default mode isn't available, the audio layer should
> back off to something that is, and at the very least not
> panic.
Hopefully it doesn't panic now.
--
-- Lennart
From: root@ihack.net (Charles M. Hannum)
To: Lennart Augustsson <lennart@augustsson.net>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: kern/8854: USB audio problems with slightly funky device
Date: 23 Nov 1999 13:34:20 -0500
Lennart Augustsson <lennart@augustsson.net> writes:
> > 1) The speakers report themselves as supporting ADV rev 0.90,
> > not 1.00. Unfortunately, the probe code didn't tell me the
> > vendor/product IDs (nor did it tell me the revision until I
> > modified it), and I no longer have the speakers, so I can't
> > write a `quirk' entry for this.
>
> Run `usbdevs -v' to find the vendor/product/revision. It could be part of
> the attach message, but it's pretty verbose as it is.
Well, if I get another pair, I'll do that.
> > 2) The code should give me some indication of why the probe
> > failed and an *easy* way to fix it, without having to
> > compile multiple kernels and read the entire file.
>
> I'm not sure how to do this, it's hard to anticipate every way a device can fail.
It's not a matter of anticipating. You already know all the ways the
probe/attach can fail, because it's written in the driver!
> > 5) ulaw (and alaw) should convert to 16-bit output if
> > available (and thus would never actually fail, unless the
> > number of channels and/or bit rate weren't supported).
>
> And the uaudio driver does this.
No it doesn't. Look at the code:
case AUDIO_ENCODING_ULAW:
if (!(flags & HAS_MULAW)) {
if (flags & HAS_8U) {
pswcode = mulaw_to_ulinear8;
rswcode = ulinear8_to_mulaw;
enc = AUDIO_ENCODING_ULINEAR_LE;
} else if (flags & HAS_8) {
pswcode = mulaw_to_slinear8;
rswcode = slinear8_to_mulaw;
enc = AUDIO_ENCODING_SLINEAR_LE;
} else
return (EINVAL);
}
break;
What I'm talking about is essentially another case:
if (flags & HAS_16) {
pswcode = mulaw_to_slinear16;
enc = AUDIO_ENCODING_SLINEAR_LE;
}
Of course, this only applies to output, which will require some
restructuring of the code.
> > 7) If the default mode isn't available, the audio layer should
> > back off to something that is, and at the very least not
> > panic.
>
> Hopefully it doesn't panic now.
This shouldn't be hard to test...
From: Lennart Augustsson <lennart@augustsson.net>
To: "Charles M. Hannum" <root@ihack.net>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: kern/8854: USB audio problems with slightly funky device
Date: Tue, 23 Nov 1999 19:41:05 +0100
"Charles M. Hannum" wrote:
> Lennart Augustsson <lennart@augustsson.net> writes:
>
> > > 2) The code should give me some indication of why the probe
> > > failed and an *easy* way to fix it, without having to
> > > compile multiple kernels and read the entire file.
> >
> > I'm not sure how to do this, it's hard to anticipate every way a device can fail.
>
> It's not a matter of anticipating. You already know all the ways the
> probe/attach can fail, because it's written in the driver!
Yes, I know what the different failures are, but I don't know how to
make "an *easy* way to fix it". I'm not even sure exactly what you expect
the driver to do when the probe/attach fails.
> > > 5) ulaw (and alaw) should convert to 16-bit output if
> > > available (and thus would never actually fail, unless the
> > > number of channels and/or bit rate weren't supported).
> >
> > And the uaudio driver does this.
>
> ...
>
> What I'm talking about is essentially another case:
>
> if (flags & HAS_16) {
> pswcode = mulaw_to_slinear16;
> enc = AUDIO_ENCODING_SLINEAR_LE;
> }
Yes, you're right, of course. I'll fix it.
--
-- Lennart
From: root@ihack.net (Charles M. Hannum)
To: Lennart Augustsson <lennart@augustsson.net>
Cc: "Charles M. Hannum" <root@ihack.net>, gnats-bugs@gnats.netbsd.org
Subject: Re: kern/8854: USB audio problems with slightly funky device
Date: 23 Nov 1999 14:42:22 -0500
Lennart Augustsson <lennart@augustsson.net> writes:
> > It's not a matter of anticipating. You already know all the ways the
> > probe/attach can fail, because it's written in the driver!
>
> Yes, I know what the different failures are, but I don't know how to
> make "an *easy* way to fix it". I'm not even sure exactly what you expect
> the driver to do when the probe/attach fails.
I expect it to tell me *why* it failed. I *know* it's a USB audio
device; if the driver is going to reject it, it has an obligation to
explain why.
Responsible-Changed-From-To: kern-bug-people->augustss
Responsible-Changed-By: fair
Responsible-Changed-When: Wed Mar 21 18:07:14 PST 2001
Responsible-Changed-Why:
Lennart is our USB expert.
State-Changed-From-To: open->feedback
State-Changed-By: kent
State-Changed-When: Mon Mar 11 08:26:39 PST 2002
State-Changed-Why:
Fixed in current hopefully, except mpg123 message
State-Changed-From-To: feedback->closed
State-Changed-By: perry
State-Changed-When: Fri Apr 4 13:01:42 PST 2003
State-Changed-Why:
Believed fixed in -current (except for perhaps the mpg123 issue.)
>Unformatted:
(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.