alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* usbaudio: Support for USB audio v2.0 devices
@ 2010-02-22 22:49 Daniel Mack
  2010-02-22 22:49 ` [PATCH 1/5] ALSA: usbaudio: parse USB descriptors with structs Daniel Mack
                   ` (4 more replies)
  0 siblings, 5 replies; 48+ messages in thread
From: Daniel Mack @ 2010-02-22 22:49 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, clemens

Here's a new version of the patchset to start support for USB audio
v2.0 devices. I moved all the definitions to linux/usb/audio.h.

As I did that, I realized that there's actually many definitions in
sound/usb/usbaudio.h which don't need to be there at all. Most of them
are already defined in audio.h and ch9.h. Hence, I added a 5th patch
to consolidate things and ease the chaos a bit. Hope I didn't break
anything :)

Daniel

^ permalink raw reply	[flat|nested] 48+ messages in thread
* usbaudio: Support for USB audio v2.0 devices
@ 2010-02-22 16:28 Daniel Mack
  2010-02-22 17:40 ` Clemens Ladisch
  2010-03-02  9:13 ` adelias
  0 siblings, 2 replies; 48+ messages in thread
From: Daniel Mack @ 2010-02-22 16:28 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, clemens

Hi,

I've been working on support for USB devices compliant to audio class
v2.0 and would like to share what I got.

First problem is that they literally changed every single descriptor
type by adding or removing fields or changing their width,
respectively. Even worse, some enum values were dropped and reassigned
so their numerical value has a different meaning now.

My first step was to clean up most of the existing descriptor parsers
by moving away from anonymous byte array access to real structs so we
can see which fields we're actually dereferencing.

In a second step, I added definitions for the replacement descriptors
and use them at appropriate places. The bInterfaceProtocol field must
always be set correctly of course, otherwise we'll parse garbage.

Other things that have changed from v1.0 to v2.0 are:

* The number of streaming interfaces is now reported by a standard
  interface association descriptor. The old approach using a proprietary
  descriptor extension is deprecated.

* The number of channels per interface is now stored in the AS_GENERAL
  descriptor (used to be part of the FORMAT_TYPE descriptor).

* The list of supported sample rates is no longer stored in a variable
  length appendix of the FORMAT_TYPE descriptor but is retrieved from
  the device using a class specific GET_RANGE command.

* Supported sample formats are now reported as 32bit bitmap rather than
  as a fixed value. For now, this is worked around by choosing just one
  of them. Eventually, the code should propagate the full ability of the
  device.

* A devices needs to have at least one CLOCK_SOURCE descriptor which
  denotes a clockID that is needed as argument to the class request
  command. If can have more than one though and the host driver is in
  charge to choose the right one. There are also new types for clock
  selectors and sample rate converters that a device might report. This
  is all unsupported at the moment. We only parse the first CLOCK_SOURCE
  and take this one.

* Many descriptors (format_type, ...) have changed their layout. Handle
  this by casting the descriptors to the appropriate structs.

With the following patches applied, a v2.0 device is recognized and
reported as ALSA device. I can even hear at least some kind of music,
but the sample rate setting does not yet seem to be correct.

Also, the existing mixer code does not work at all for v2.0 devices.
This will be quite some work to support that and I fear the whole thing
must be reimplemented for v2.0 specifically. For now, I worked around
that by not parsing them at all but bailing out very early.

However, I would like to make sure the changes I made so far won't
cause any regression for v1.0 devices, and so it would be good to see
them applied as a preliminary support. I'll continue working on this
and send more updates along.

Let me know what you think.

Thanks,
Daniel

^ permalink raw reply	[flat|nested] 48+ messages in thread

end of thread, other threads:[~2010-05-27 18:21 UTC | newest]

Thread overview: 48+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-22 22:49 usbaudio: Support for USB audio v2.0 devices Daniel Mack
2010-02-22 22:49 ` [PATCH 1/5] ALSA: usbaudio: parse USB descriptors with structs Daniel Mack
2010-02-23  7:50   ` Clemens Ladisch
2010-02-23  7:57     ` Takashi Iwai
2010-02-23  8:10       ` Daniel Mack
2010-02-23  8:22         ` Takashi Iwai
2010-02-23  8:26           ` Daniel Mack
2010-02-23  9:30             ` [PATCH] usb/gadget/{f_audio, gmidi}.c: follow recent changes in audio.h Daniel Mack
2010-02-23  9:51               ` Takashi Iwai
2010-02-23 10:14                 ` Paul Menzel
2010-02-23 10:29                   ` Daniel Mack
2010-02-23 11:03                     ` Takashi Iwai
2010-02-23 23:31                 ` Greg KH
2010-02-23  8:07     ` [PATCH 1/5] ALSA: usbaudio: parse USB descriptors with structs Daniel Mack
2010-02-23  7:56   ` Takashi Iwai
2010-02-22 22:49 ` [PATCH 2/5] ALSA: usbaudio: introduce new types for audio class v2 Daniel Mack
2010-02-22 22:49 ` [PATCH 3/5] ALSA: usbaudio: implement basic set of class v2.0 parser Daniel Mack
2010-02-22 22:49 ` [PATCH 4/5] ALSA: usbmixer: bail out early when parsing audio class v2 descriptors Daniel Mack
2010-02-22 22:49 ` [PATCH 5/5] ALSA: usbaudio: consolidate header files Daniel Mack
2010-02-23  7:58   ` Takashi Iwai
  -- strict thread matches above, loose matches on Subject: below --
2010-02-22 16:28 usbaudio: Support for USB audio v2.0 devices Daniel Mack
2010-02-22 17:40 ` Clemens Ladisch
2010-02-22 17:50   ` Daniel Mack
2010-03-02  9:13 ` adelias
2010-03-02 18:35   ` Daniel Mack
2010-04-27 13:23     ` adelias
2010-04-27 13:31       ` The Source
2010-04-27 14:07         ` Daniel Mack
2010-04-27 15:29           ` The Source
2010-04-27 15:43             ` Daniel Mack
2010-04-27 17:27               ` The Source
2010-04-27 17:33                 ` Daniel Mack
2010-05-02 16:56                   ` The Source
2010-05-03 20:55                     ` Daniel Mack
2010-05-07 13:19                       ` The Source
2010-05-07 13:22                         ` Daniel Mack
2010-05-07 20:12                         ` Daniel Mack
2010-05-07 21:32                           ` The Source
2010-05-08  1:38                             ` Daniel Mack
2010-05-08  7:26                           ` The Source
2010-05-08  9:19                             ` Daniel Mack
2010-04-27 14:06       ` Daniel Mack
2010-05-03 12:49         ` adelias
2010-05-04 10:48           ` Daniel Mack
2010-05-18  7:07             ` adelias
2010-05-18  7:40               ` Daniel Mack
2010-05-18  8:32                 ` adelias
2010-05-27 18:21               ` Daniel Mack

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).