Subject: kern/8854: USB audio problems with slightly funky device
To: None <gnats-bugs@gnats.netbsd.org>
From: Charles M. Hannum <mycroft@MIT.EDU>
List: netbsd-bugs
Date: 11/22/1999 19:30:52
>Number:         8854
>Category:       kern
>Synopsis:       USB audio problems with slightly funky device
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 22 19:30:00 1999
>Last-Modified:
>Originator:     Charles M. Hannum
>Organization:
	The NetBSD Mission
>Release:        -current as of 19991117
>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.

>Audit-Trail:
>Unformatted: