Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Aug 2004 01:10:12 -0700
From:      Eric Hodel <drbrain@segment7.net>
To:        current@freebsd.org
Subject:   ADA-305 - USB Audiocontrol device or proprietary poser?
Message-ID:  <20040815081012.GZ89329@segment7.net>

next in thread | raw e-mail | index | archive | help

--P6d3k5Edf9pZm0D3
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

In light of the recent USB threads, I decided now would be a good time
to bring up my USB-controlled speakers.

I have ADA-305 speakers by Altec Lansing.  Allegedly they support the
USB audiocontrol interface, and FreeBSD's uaudio driver attempts to
recognize them, but ultimately fails.  (In windows there is a nifty
little utility that lets me adjust the volume of each speaker.)

They don't send any audio over USB, they only do volume control.

Here's what uaudio says about the speakers when I plug them in:

uaudio0: audio descriptors make no sense, error=3D4
device_attach: uaudio0 attach returned 6

Here's what udesc_dump says about the speakers:

Standard Device Descriptor:
  bLength            18
  bDescriptorType    01
  bcdUSB             0100
  bDeviceClass       ff
  bDeviceSubClass    00
  bDeviceProtocol    00
  bMaxPacketSize     8
  idVendor           04d2
  idProduct          0305
  bcdDevice          0000
  iManufacturer      1
  iProduct           2
  iSerialNumber      0
  bNumConfigurations 1

Configuration 0:
        Standard Configuration Descriptor:
          bLength             9
          bDescriptorType     02
          wTotalLength        25
          bNumInterface       1
          bConfigurationValue 1
          iConfiguration      0
          bmAttributes        40 (self-powered)
          bMaxPower           0 (0 mA)

        Standard Interface Descriptor:
          bLength            9
          bDescriptorType    04
          bInterfaceNumber   0
          bAlternateSetting  0
          bNumEndpoints      1
          bInterfaceClass    01
          bInterfaceSubClass 01
          bInterfaceProtocol 00
          iInterface         0

        Standard Endpoint Descriptor:
          bLength          7
          bDescriptorType  05
          bEndpointAddress 81 (in)
          bmAttributes     03 (Interrupt)
          wMaxPacketSize   2
          bInterval        32
          bRefresh         208
          bSynchAddress    d0

Codes Representing Languages by the Device:
  bLength          4
  bDescriptorType  03
  wLANGID[0]       0409

String (index 1): ALTEC LANSING Multimedia

String (index 2): ADA305 Speakers

I added some debugging, and the attach fails in uaudio_identify_ac on
the following:

	id =3D uaudio_find_iface(buf, size, &offs, UISUBCLASS_AUDIOCONTROL);
	if (id =3D=3D NULL)
		return (USBD_INVAL);
	if (offs + sizeof *acdp > size)
		return (USBD_INVAL); /* BOOM! */

Here are the values it failed on:

  uaudio_identify_ac: offs + sizeof *acdp > size
  uaudio_identify_ac: offs =3D 18
  uaudio_identify_ac: sizeof *acdp =3D 9
  uaudio_identify_ac: size =3D 25

It looks like uaudio_find_iface is incrementing offs even if it found
the correct interface descriptor, so I moved the *offsp +=3D d->bLength;
after the return.  (See the lengths from udesc_dump above, is this
a correct fix?.)

I now die just below that here:

	ibuf =3D buf + offs;
	acdp =3D (struct usb_audio_control_descriptor *)ibuf;
	if (acdp->bDescriptorType !=3D UDESC_CS_INTERFACE ||
	    acdp->bDescriptorSubtype !=3D UDESCSUB_AC_HEADER)
		return (USBD_INVAL); /* BOOM! */

Looking at the endpoint descriptor above, the DescriptorType is a
UDESC_ENDPOINT, not a UDESC_CS_INTERFACE.  It also has no
DescriptorSubtype.

Are these speakers just pretending to be USB audiocontrol devices and
have some proprietary implementation underneath, or could there be
something mis-detected somewhere else?

--=20
Eric Hodel - drbrain@segment7.net - http://segment7.net
All messages signed with fingerprint:
FEC2 57F1 D465 EB15 5D6E  7C11 332A 551C 796C 9F04


--P6d3k5Edf9pZm0D3
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (FreeBSD)

iD8DBQFBHxpkMypVHHlsnwQRAgtNAKDzoMBAQegka1NUn4CiUPSn+GSg5wCdGHP/
iu+S0hKVgHw1kkUiNDdpf0s=
=7ShX
-----END PGP SIGNATURE-----

--P6d3k5Edf9pZm0D3--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040815081012.GZ89329>