From: adelias <adelias@freemail.gr>
To: alsa-devel@alsa-project.org
Subject: Re: usbaudio: Support for USB audio v2.0 devices
Date: Tue, 02 Mar 2010 11:13:04 +0200 [thread overview]
Message-ID: <4B8CD6A0.40204@freemail.gr> (raw)
In-Reply-To: <1266856137-26252-1-git-send-email-daniel@caiaq.de>
On 22/2/2010 6:28 μμ, Daniel Mack wrote:
> 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
Thanks to all involved for working on usb audio v2.
Last night I installed the 20100226 snapshot. I did a little testing
with my XMOS board using toslink out into may DAC. I tried various files
ranging 16bit/44110kHz-24bit/192000kHz. The 44110 files had quite a bit
of static, the higher bitrate files were better. As you stated the
sampling rate is not correct and be verified by looking at the flashing
LEDs on the XMOS board. They should flash faster as sampling rate
increase. In this case no change was observed.
Thanks,
Nikos
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
next prev parent reply other threads:[~2010-03-02 9:14 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-22 16:28 usbaudio: Support for USB audio v2.0 devices Daniel Mack
2010-02-22 16:28 ` [PATCH 1/4] ALSA: usbaudio: parse USB descriptors with structs Daniel Mack
2010-02-22 16:28 ` [PATCH 2/4] ALSA: usbaudio: introduce new types for audio class v2 Daniel Mack
2010-02-22 16:28 ` [PATCH 3/4] ALSA: usbaudio: implement basic set of class v2.0 parser Daniel Mack
2010-02-22 16:28 ` [PATCH 4/4] ALSA: usbmixer: bail out early when parsing audio class v2 descriptors Daniel Mack
2010-02-22 17:40 ` usbaudio: Support for USB audio v2.0 devices Clemens Ladisch
2010-02-22 17:50 ` Daniel Mack
2010-03-02 9:13 ` adelias [this message]
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-05-08 9:24 ` [PATCH] ALSA: sound/usb: fix UAC1 regression Daniel Mack
2010-05-08 9:45 ` Takashi Iwai
2010-04-27 14:06 ` usbaudio: Support for USB audio v2.0 devices 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
-- strict thread matches above, loose matches on Subject: below --
2010-02-22 22:49 Daniel Mack
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B8CD6A0.40204@freemail.gr \
--to=adelias@freemail.gr \
--cc=alsa-devel@alsa-project.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).