* [RESENT] [PATCH - Fix Fast Track Ultra series: 44.1/88.1 kHz 1/Fix playback/capture issues and related chrashes at 44100 Hz and 88200 Hz for M-Audio Fast Track Ultra series.
2010-07-06 8:05 Felix Homann
@ 2010-09-01 8:48 ` Felix Homann
2010-09-02 8:33 ` Takashi Iwai
0 siblings, 1 reply; 10+ messages in thread
From: Felix Homann @ 2010-09-01 8:48 UTC (permalink / raw)
To: patch; +Cc: alsa-devel
[-- Attachment #1: Type: text/plain, Size: 1922 bytes --]
Hi,
This is my second try to get support for all supported sample rates for
the Fast Track Ultra (FTU) series into mainline alsa.
For clarification: Current Alsa already recognizes the supported sample
rates. But it will sound very corrupted at 44.1000 Hz and 88.200 Hz.
Without this patch your system will even probably freeze eventually when
using the FTU at 44.100/88.200 Hz too long.
So the key idea in this patch is not to get 44.1 kHz and 88.2 kHz listed
as supported sample rates (as they already are recognized) but to change
the endpoint attributes.
Citing dhubsith on the M-Audio forum:
" The problem with using QUIRK_AUDIO_STANDARD_INTERFACE rather than
QUIRK_AUDIO_FIXED_ENDPOINT is that ep_attr does not get set correctly.
The device default for synchronization is async (0x05) for both capture
and playback, but in fact it should be set to adaptive (0x09) on
playback, so that playback follows capture, this way you don't get
capture and playback using different sample rates.
Also, the Interface Class protocol for the device defaults to Vendor
Specific Class, but the driver only recognizes Class 1 or 2. The device
is really Class 1, so we have to force it to reflect this. There are 4
places that we need to set this."
The patch has been discussed starting here:
http://forums.m-audio.com/showthread.php?714-Not-a-problem.-FastTrack-on-linux/page8
The "key" has been found by dhubsith. Please read posts #79, #81, #84,
#87, #97.
In post #102 of that forum you can even find an alternate patch by
dhubsith which doesn't use a fixed endpoint quirk but sets
protocol = UAC_VERSION_1;
for the FTU devices in sound/usb/format .c. You might even consider that
patch. (I've resend it to alsa-devel yesterday).
After all, either one of the above mentioned patches should go into
alsa, as right now we can't use the FTU devices at 44.1 and 88.2 kHz.
Kind regards,
Felix
[-- Attachment #2: 0001-fix-sample-rates-ftu-v3.patch --]
[-- Type: text/x-patch, Size: 4896 bytes --]
>From 1573e7e973e6adcfe39fbfdaae0be2d1a5e01501 Mon Sep 17 00:00:00 2001
From: Felix Homann <fexpop@web.de>
Date: Wed, 7 Jul 2010 15:51:58 +0200
Subject: [PATCH - Fix Fast Track Ultra series 1/1] Fix 44.1/88.1 kHz 1/Fix playback/capture issues and related chrashes at 44100 Hz and 88200 Hz for M-Audio Fast Track Ultra series.
Signed-off-by: Felix Homann <fexpop@web.de>
diff --git a/usb/endpoint.c b/usb/endpoint.c
index 1a701f1..bb9f938 100644
--- a/usb/endpoint.c
+++ b/usb/endpoint.c
@@ -404,8 +404,6 @@ int snd_usb_parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no)
break;
case USB_ID(0x041e, 0x3020): /* Creative SB Audigy 2 NX */
case USB_ID(0x0763, 0x2003): /* M-Audio Audiophile USB */
- case USB_ID(0x0763, 0x2080): /* M-Audio Fast Track Ultra 8 */
- case USB_ID(0x0763, 0x2081): /* M-Audio Fast Track Ultra 8R */
/* doesn't set the sample rate attribute, but supports it */
fp->attributes |= UAC_EP_CS_ATTR_SAMPLE_RATE;
break;
diff --git a/usb/quirks-table.h b/usb/quirks-table.h
index f8797f6..4c1dc12 100644
--- a/usb/quirks-table.h
+++ b/usb/quirks-table.h
@@ -1827,10 +1827,10 @@ YAMAHA_DEVICE(0x7010, "UB99"),
}
},
{
- USB_DEVICE(0x0763, 0x2080),
- .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
+ USB_DEVICE(0x0763, 0x2080),
+ .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
/* .vendor_name = "M-Audio", */
- /* .product_name = "Fast Track Ultra 8", */
+ /* .product_name = "Fast Track Ultra", */
.ifnum = QUIRK_ANY_INTERFACE,
.type = QUIRK_COMPOSITE,
.data = & (const struct snd_usb_audio_quirk[]) {
@@ -1840,11 +1840,51 @@ YAMAHA_DEVICE(0x7010, "UB99"),
},
{
.ifnum = 1,
- .type = QUIRK_AUDIO_STANDARD_INTERFACE
+ .type = QUIRK_AUDIO_FIXED_ENDPOINT,
+ .data = & (const struct audioformat) {
+ .formats = SNDRV_PCM_FMTBIT_S24_3LE,
+ .channels = 8,
+ .iface = 1,
+ .altsetting = 1,
+ .altset_idx = 1,
+ .attributes = UAC_EP_CS_ATTR_SAMPLE_RATE,
+ .endpoint = 0x01,
+ .ep_attr = 0x09,
+ .rates = SNDRV_PCM_RATE_44100 |
+ SNDRV_PCM_RATE_48000 |
+ SNDRV_PCM_RATE_88200 |
+ SNDRV_PCM_RATE_96000,
+ .rate_min = 44100,
+ .rate_max = 96000,
+ .nr_rates = 4,
+ .rate_table = (unsigned int[]) {
+ 44100, 48000, 88200, 96000
+ }
+ }
},
{
.ifnum = 2,
- .type = QUIRK_AUDIO_STANDARD_INTERFACE
+ .type = QUIRK_AUDIO_FIXED_ENDPOINT,
+ .data = & (const struct audioformat) {
+ .formats = SNDRV_PCM_FMTBIT_S24_3LE,
+ .channels = 8,
+ .iface = 2,
+ .altsetting = 1,
+ .altset_idx = 1,
+ .attributes = UAC_EP_CS_ATTR_SAMPLE_RATE,
+ .endpoint = 0x81,
+ .ep_attr = 0x05,
+ .rates = SNDRV_PCM_RATE_44100 |
+ SNDRV_PCM_RATE_48000 |
+ SNDRV_PCM_RATE_88200 |
+ SNDRV_PCM_RATE_96000,
+ .rate_min = 44100,
+ .rate_max = 96000,
+ .nr_rates = 4,
+ .rate_table = (unsigned int[]) {
+ 44100, 48000, 88200, 96000
+ }
+ }
},
/* interface 3 (MIDI) is standard compliant */
{
@@ -1855,7 +1895,7 @@ YAMAHA_DEVICE(0x7010, "UB99"),
},
{
USB_DEVICE(0x0763, 0x2081),
- .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
+ .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
/* .vendor_name = "M-Audio", */
/* .product_name = "Fast Track Ultra 8R", */
.ifnum = QUIRK_ANY_INTERFACE,
@@ -1867,11 +1907,51 @@ YAMAHA_DEVICE(0x7010, "UB99"),
},
{
.ifnum = 1,
- .type = QUIRK_AUDIO_STANDARD_INTERFACE
+ .type = QUIRK_AUDIO_FIXED_ENDPOINT,
+ .data = & (const struct audioformat) {
+ .formats = SNDRV_PCM_FMTBIT_S24_3LE,
+ .channels = 8,
+ .iface = 1,
+ .altsetting = 1,
+ .altset_idx = 1,
+ .attributes = UAC_EP_CS_ATTR_SAMPLE_RATE,
+ .endpoint = 0x01,
+ .ep_attr = 0x09,
+ .rates = SNDRV_PCM_RATE_44100 |
+ SNDRV_PCM_RATE_48000 |
+ SNDRV_PCM_RATE_88200 |
+ SNDRV_PCM_RATE_96000,
+ .rate_min = 44100,
+ .rate_max = 96000,
+ .nr_rates = 4,
+ .rate_table = (unsigned int[]) {
+ 44100, 48000, 88200, 96000
+ }
+ }
},
{
.ifnum = 2,
- .type = QUIRK_AUDIO_STANDARD_INTERFACE
+ .type = QUIRK_AUDIO_FIXED_ENDPOINT,
+ .data = & (const struct audioformat) {
+ .formats = SNDRV_PCM_FMTBIT_S24_3LE,
+ .channels = 8,
+ .iface = 2,
+ .altsetting = 1,
+ .altset_idx = 1,
+ .attributes = UAC_EP_CS_ATTR_SAMPLE_RATE,
+ .endpoint = 0x81,
+ .ep_attr = 0x05,
+ .rates = SNDRV_PCM_RATE_44100 |
+ SNDRV_PCM_RATE_48000 |
+ SNDRV_PCM_RATE_88200 |
+ SNDRV_PCM_RATE_96000,
+ .rate_min = 44100,
+ .rate_max = 96000,
+ .nr_rates = 4,
+ .rate_table = (unsigned int[]) {
+ 44100, 48000, 88200, 96000
+ }
+ }
},
/* interface 3 (MIDI) is standard compliant */
{
--
1.7.1
[-- Attachment #3: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [RESENT] [PATCH - Fix Fast Track Ultra series: 44.1/88.1 kHz 1/Fix playback/capture issues and related chrashes at 44100 Hz and 88200 Hz for M-Audio Fast Track Ultra series.
2010-09-01 8:48 ` [RESENT] " Felix Homann
@ 2010-09-02 8:33 ` Takashi Iwai
2010-09-02 9:12 ` Clemens Ladisch
0 siblings, 1 reply; 10+ messages in thread
From: Takashi Iwai @ 2010-09-02 8:33 UTC (permalink / raw)
To: Felix Homann; +Cc: alsa-devel, clemens
At Wed, 01 Sep 2010 10:48:54 +0200,
Felix Homann wrote:
>
> Hi,
>
> This is my second try to get support for all supported sample rates for
> the Fast Track Ultra (FTU) series into mainline alsa.
>
> For clarification: Current Alsa already recognizes the supported sample
> rates. But it will sound very corrupted at 44.1000 Hz and 88.200 Hz.
> Without this patch your system will even probably freeze eventually when
> using the FTU at 44.100/88.200 Hz too long.
>
> So the key idea in this patch is not to get 44.1 kHz and 88.2 kHz listed
> as supported sample rates (as they already are recognized) but to change
> the endpoint attributes.
>
> Citing dhubsith on the M-Audio forum:
>
> " The problem with using QUIRK_AUDIO_STANDARD_INTERFACE rather than
> QUIRK_AUDIO_FIXED_ENDPOINT is that ep_attr does not get set correctly.
> The device default for synchronization is async (0x05) for both capture
> and playback, but in fact it should be set to adaptive (0x09) on
> playback, so that playback follows capture, this way you don't get
> capture and playback using different sample rates.
>
> Also, the Interface Class protocol for the device defaults to Vendor
> Specific Class, but the driver only recognizes Class 1 or 2. The device
> is really Class 1, so we have to force it to reflect this. There are 4
> places that we need to set this."
>
>
>
> The patch has been discussed starting here:
>
> http://forums.m-audio.com/showthread.php?714-Not-a-problem.-FastTrack-on-linux/page8
>
> The "key" has been found by dhubsith. Please read posts #79, #81, #84,
> #87, #97.
>
>
> In post #102 of that forum you can even find an alternate patch by
> dhubsith which doesn't use a fixed endpoint quirk but sets
>
> protocol = UAC_VERSION_1;
>
> for the FTU devices in sound/usb/format .c. You might even consider that
> patch. (I've resend it to alsa-devel yesterday).
>
> After all, either one of the above mentioned patches should go into
> alsa, as right now we can't use the FTU devices at 44.1 and 88.2 kHz.
Thanks for the patch (and reposting it).
I myself find it's OK to apply since it's pretty local change.
Clemens, what was your objection at that time?
thanks,
Takashi
>
> Kind regards,
>
> Felix
>
> [2 0001-fix-sample-rates-ftu-v3.patch <text/x-patch (7bit)>]
> >From 1573e7e973e6adcfe39fbfdaae0be2d1a5e01501 Mon Sep 17 00:00:00 2001
> From: Felix Homann <fexpop@web.de>
> Date: Wed, 7 Jul 2010 15:51:58 +0200
> Subject: [PATCH - Fix Fast Track Ultra series 1/1] Fix 44.1/88.1 kHz 1/Fix playback/capture issues and related chrashes at 44100 Hz and 88200 Hz for M-Audio Fast Track Ultra series.
>
>
> Signed-off-by: Felix Homann <fexpop@web.de>
>
> diff --git a/usb/endpoint.c b/usb/endpoint.c
> index 1a701f1..bb9f938 100644
> --- a/usb/endpoint.c
> +++ b/usb/endpoint.c
> @@ -404,8 +404,6 @@ int snd_usb_parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no)
> break;
> case USB_ID(0x041e, 0x3020): /* Creative SB Audigy 2 NX */
> case USB_ID(0x0763, 0x2003): /* M-Audio Audiophile USB */
> - case USB_ID(0x0763, 0x2080): /* M-Audio Fast Track Ultra 8 */
> - case USB_ID(0x0763, 0x2081): /* M-Audio Fast Track Ultra 8R */
> /* doesn't set the sample rate attribute, but supports it */
> fp->attributes |= UAC_EP_CS_ATTR_SAMPLE_RATE;
> break;
> diff --git a/usb/quirks-table.h b/usb/quirks-table.h
> index f8797f6..4c1dc12 100644
> --- a/usb/quirks-table.h
> +++ b/usb/quirks-table.h
> @@ -1827,10 +1827,10 @@ YAMAHA_DEVICE(0x7010, "UB99"),
> }
> },
> {
> - USB_DEVICE(0x0763, 0x2080),
> - .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
> + USB_DEVICE(0x0763, 0x2080),
> + .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
> /* .vendor_name = "M-Audio", */
> - /* .product_name = "Fast Track Ultra 8", */
> + /* .product_name = "Fast Track Ultra", */
> .ifnum = QUIRK_ANY_INTERFACE,
> .type = QUIRK_COMPOSITE,
> .data = & (const struct snd_usb_audio_quirk[]) {
> @@ -1840,11 +1840,51 @@ YAMAHA_DEVICE(0x7010, "UB99"),
> },
> {
> .ifnum = 1,
> - .type = QUIRK_AUDIO_STANDARD_INTERFACE
> + .type = QUIRK_AUDIO_FIXED_ENDPOINT,
> + .data = & (const struct audioformat) {
> + .formats = SNDRV_PCM_FMTBIT_S24_3LE,
> + .channels = 8,
> + .iface = 1,
> + .altsetting = 1,
> + .altset_idx = 1,
> + .attributes = UAC_EP_CS_ATTR_SAMPLE_RATE,
> + .endpoint = 0x01,
> + .ep_attr = 0x09,
> + .rates = SNDRV_PCM_RATE_44100 |
> + SNDRV_PCM_RATE_48000 |
> + SNDRV_PCM_RATE_88200 |
> + SNDRV_PCM_RATE_96000,
> + .rate_min = 44100,
> + .rate_max = 96000,
> + .nr_rates = 4,
> + .rate_table = (unsigned int[]) {
> + 44100, 48000, 88200, 96000
> + }
> + }
> },
> {
> .ifnum = 2,
> - .type = QUIRK_AUDIO_STANDARD_INTERFACE
> + .type = QUIRK_AUDIO_FIXED_ENDPOINT,
> + .data = & (const struct audioformat) {
> + .formats = SNDRV_PCM_FMTBIT_S24_3LE,
> + .channels = 8,
> + .iface = 2,
> + .altsetting = 1,
> + .altset_idx = 1,
> + .attributes = UAC_EP_CS_ATTR_SAMPLE_RATE,
> + .endpoint = 0x81,
> + .ep_attr = 0x05,
> + .rates = SNDRV_PCM_RATE_44100 |
> + SNDRV_PCM_RATE_48000 |
> + SNDRV_PCM_RATE_88200 |
> + SNDRV_PCM_RATE_96000,
> + .rate_min = 44100,
> + .rate_max = 96000,
> + .nr_rates = 4,
> + .rate_table = (unsigned int[]) {
> + 44100, 48000, 88200, 96000
> + }
> + }
> },
> /* interface 3 (MIDI) is standard compliant */
> {
> @@ -1855,7 +1895,7 @@ YAMAHA_DEVICE(0x7010, "UB99"),
> },
> {
> USB_DEVICE(0x0763, 0x2081),
> - .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
> + .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
> /* .vendor_name = "M-Audio", */
> /* .product_name = "Fast Track Ultra 8R", */
> .ifnum = QUIRK_ANY_INTERFACE,
> @@ -1867,11 +1907,51 @@ YAMAHA_DEVICE(0x7010, "UB99"),
> },
> {
> .ifnum = 1,
> - .type = QUIRK_AUDIO_STANDARD_INTERFACE
> + .type = QUIRK_AUDIO_FIXED_ENDPOINT,
> + .data = & (const struct audioformat) {
> + .formats = SNDRV_PCM_FMTBIT_S24_3LE,
> + .channels = 8,
> + .iface = 1,
> + .altsetting = 1,
> + .altset_idx = 1,
> + .attributes = UAC_EP_CS_ATTR_SAMPLE_RATE,
> + .endpoint = 0x01,
> + .ep_attr = 0x09,
> + .rates = SNDRV_PCM_RATE_44100 |
> + SNDRV_PCM_RATE_48000 |
> + SNDRV_PCM_RATE_88200 |
> + SNDRV_PCM_RATE_96000,
> + .rate_min = 44100,
> + .rate_max = 96000,
> + .nr_rates = 4,
> + .rate_table = (unsigned int[]) {
> + 44100, 48000, 88200, 96000
> + }
> + }
> },
> {
> .ifnum = 2,
> - .type = QUIRK_AUDIO_STANDARD_INTERFACE
> + .type = QUIRK_AUDIO_FIXED_ENDPOINT,
> + .data = & (const struct audioformat) {
> + .formats = SNDRV_PCM_FMTBIT_S24_3LE,
> + .channels = 8,
> + .iface = 2,
> + .altsetting = 1,
> + .altset_idx = 1,
> + .attributes = UAC_EP_CS_ATTR_SAMPLE_RATE,
> + .endpoint = 0x81,
> + .ep_attr = 0x05,
> + .rates = SNDRV_PCM_RATE_44100 |
> + SNDRV_PCM_RATE_48000 |
> + SNDRV_PCM_RATE_88200 |
> + SNDRV_PCM_RATE_96000,
> + .rate_min = 44100,
> + .rate_max = 96000,
> + .nr_rates = 4,
> + .rate_table = (unsigned int[]) {
> + 44100, 48000, 88200, 96000
> + }
> + }
> },
> /* interface 3 (MIDI) is standard compliant */
> {
> --
> 1.7.1
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RESENT] [PATCH - Fix Fast Track Ultra series: 44.1/88.1 kHz 1/Fix playback/capture issues and related chrashes at 44100 Hz and 88200 Hz for M-Audio Fast Track Ultra series.
2010-09-02 8:33 ` Takashi Iwai
@ 2010-09-02 9:12 ` Clemens Ladisch
2010-09-02 9:16 ` Daniel Mack
2010-09-02 10:12 ` Felix Homann
0 siblings, 2 replies; 10+ messages in thread
From: Clemens Ladisch @ 2010-09-02 9:12 UTC (permalink / raw)
To: Takashi Iwai, Daniel Mack, Felix Homann; +Cc: alsa-devel
Takashi Iwai wrote:
> I myself find it's OK to apply since it's pretty local change.
> Clemens, what was your objection at that time?
No objection per se, I wanted to find out what descriptor field is
changed by the quirk, and where the crashes come from exactly. The
latter is still unclear, but it seems a quirk like this is required.
I've committed the patch now.
> > Also, the Interface Class protocol for the device defaults to Vendor
> > Specific Class, but the driver only recognizes Class 1 or 2. The device
> > is really Class 1, so we have to force it to reflect this. There are 4
> > places that we need to set this."
Daniel, this seems to be a regression introduced with the UAC2 changes.
The old driver accepted vendor-specific interfaces, if some quirk forced
it to look at them.
Regards,
Clemens
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RESENT] [PATCH - Fix Fast Track Ultra series: 44.1/88.1 kHz 1/Fix playback/capture issues and related chrashes at 44100 Hz and 88200 Hz for M-Audio Fast Track Ultra series.
2010-09-02 9:12 ` Clemens Ladisch
@ 2010-09-02 9:16 ` Daniel Mack
2010-09-02 11:13 ` Clemens Ladisch
2010-09-02 10:12 ` Felix Homann
1 sibling, 1 reply; 10+ messages in thread
From: Daniel Mack @ 2010-09-02 9:16 UTC (permalink / raw)
To: Clemens Ladisch; +Cc: Takashi Iwai, Felix Homann, alsa-devel
On Thu, Sep 02, 2010 at 11:12:59AM +0200, Clemens Ladisch wrote:
> Takashi Iwai wrote:
> > I myself find it's OK to apply since it's pretty local change.
> > Clemens, what was your objection at that time?
>
> No objection per se, I wanted to find out what descriptor field is
> changed by the quirk, and where the crashes come from exactly. The
> latter is still unclear, but it seems a quirk like this is required.
>
> I've committed the patch now.
>
> > > Also, the Interface Class protocol for the device defaults to Vendor
> > > Specific Class, but the driver only recognizes Class 1 or 2. The device
> > > is really Class 1, so we have to force it to reflect this. There are 4
> > > places that we need to set this."
>
> Daniel, this seems to be a regression introduced with the UAC2 changes.
> The old driver accepted vendor-specific interfaces, if some quirk forced
> it to look at them.
Hmm, I don't follow. What's the problem, and why should that be caused
by the UAC2 changes? Sorry, but I seem to have missed that thread.
Thanks,
Daniel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RESENT] [PATCH - Fix Fast Track Ultra series: 44.1/88.1 kHz 1/Fix playback/capture issues and related chrashes at 44100 Hz and 88200 Hz for M-Audio Fast Track Ultra series.
2010-09-02 9:12 ` Clemens Ladisch
2010-09-02 9:16 ` Daniel Mack
@ 2010-09-02 10:12 ` Felix Homann
1 sibling, 0 replies; 10+ messages in thread
From: Felix Homann @ 2010-09-02 10:12 UTC (permalink / raw)
To: alsa-devel; +Cc: tiwai, Clemens Ladisch
Am 02.09.2010 11:12, schrieb Clemens Ladisch:
>
> I've committed the patch now.
>
>
Thank you and Takashi!
Regards,
Felix
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RESENT] [PATCH - Fix Fast Track Ultra series: 44.1/88.1 kHz 1/Fix playback/capture issues and related chrashes at 44100 Hz and 88200 Hz for M-Audio Fast Track Ultra series.
2010-09-02 9:16 ` Daniel Mack
@ 2010-09-02 11:13 ` Clemens Ladisch
2010-09-03 13:34 ` Daniel Mack
0 siblings, 1 reply; 10+ messages in thread
From: Clemens Ladisch @ 2010-09-02 11:13 UTC (permalink / raw)
To: Daniel Mack; +Cc: Takashi Iwai, alsa-devel
Daniel Mack wrote:
> On Thu, Sep 02, 2010 at 11:12:59AM +0200, Clemens Ladisch wrote:
> > > > Also, the Interface Class protocol for the device defaults to Vendor
> > > > Specific Class, but the driver only recognizes Class 1 or 2. The device
> > > > is really Class 1, so we have to force it to reflect this. There are 4
> > > > places that we need to set this."
> >
> > Daniel, this seems to be a regression introduced with the UAC2 changes.
> > The old driver accepted vendor-specific interfaces, if some quirk forced
> > it to look at them.
>
> Hmm, I don't follow. What's the problem, and why should that be caused
> by the UAC2 changes? Sorry, but I seem to have missed that thread.
I've got several reports that devices no longer work since UAC2 support got
added. But I've just noticed this is not related to the interface class
but to the interface protocol: the new code added checks for UAC_VERSION_1
or _2, but real devices apparently write just random junk into this field.
(For vendor-specific interfaces, they are actually justified to do so.)
We need something like the following (untested), unless you have a better
idea:
diff --git a/sound/usb/card.c b/sound/usb/card.c
index 9feb00c..d5141a1 100644
--- a/sound/usb/card.c
+++ b/sound/usb/card.c
@@ -216,6 +216,10 @@ static int snd_usb_create_streams(struct snd_usb_audio *chip, int ctrlif)
}
switch (protocol) {
+ default:
+ snd_printdd(KERN_WARN "unknown interface protocol %#02x, assuming v1\n");
+ /* fall through */
+
case UAC_VERSION_1: {
struct uac1_ac_header_descriptor *h1 = control_header;
@@ -253,10 +257,6 @@ static int snd_usb_create_streams(struct snd_usb_audio *chip, int ctrlif)
break;
}
-
- default:
- snd_printk(KERN_ERR "unknown protocol version 0x%02x\n", protocol);
- return -EINVAL;
}
return 0;
diff --git a/sound/usb/clock.c b/sound/usb/clock.c
index b853f8d..7754a10 100644
--- a/sound/usb/clock.c
+++ b/sound/usb/clock.c
@@ -295,12 +295,11 @@ int snd_usb_init_sample_rate(struct snd_usb_audio *chip, int iface,
switch (altsd->bInterfaceProtocol) {
case UAC_VERSION_1:
+ default:
return set_sample_rate_v1(chip, iface, alts, fmt, rate);
case UAC_VERSION_2:
return set_sample_rate_v2(chip, iface, alts, fmt, rate);
}
-
- return -EINVAL;
}
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c
index bb9f938..22589b5 100644
--- a/sound/usb/endpoint.c
+++ b/sound/usb/endpoint.c
@@ -275,6 +275,12 @@ int snd_usb_parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no)
/* get audio formats */
switch (protocol) {
+ default:
+ snd_printdd(KERN_WARN "%d:%u:%d: unknown interface protocol %#02x, assuming v1\n",
+ dev->devnum, iface_no, altno, protocol);
+ protocol = UAC_VERSION_1;
+ /* fall through */
+
case UAC_VERSION_1: {
struct uac1_as_header_descriptor *as =
snd_usb_find_csint_desc(alts->extra, alts->extralen, NULL, UAC_AS_GENERAL);
@@ -336,11 +342,6 @@ int snd_usb_parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no)
dev->devnum, iface_no, altno, as->bTerminalLink);
continue;
}
-
- default:
- snd_printk(KERN_ERR "%d:%u:%d : unknown interface protocol %04x\n",
- dev->devnum, iface_no, altno, protocol);
- continue;
}
/* get format type */
diff --git a/sound/usb/format.c b/sound/usb/format.c
index 4387f54..2ec73dd 100644
--- a/sound/usb/format.c
+++ b/sound/usb/format.c
@@ -49,7 +49,8 @@ static u64 parse_audio_format_i_type(struct snd_usb_audio *chip,
u64 pcm_formats;
switch (protocol) {
- case UAC_VERSION_1: {
+ case UAC_VERSION_1:
+ default: {
struct uac_format_type_i_discrete_descriptor *fmt = _fmt;
sample_width = fmt->bBitResolution;
sample_bytes = fmt->bSubframeSize;
@@ -64,9 +65,6 @@ static u64 parse_audio_format_i_type(struct snd_usb_audio *chip,
format <<= 1;
break;
}
-
- default:
- return -EINVAL;
}
pcm_formats = 0;
@@ -385,6 +383,7 @@ static int parse_audio_format_i(struct snd_usb_audio *chip,
*/
switch (protocol) {
case UAC_VERSION_1:
+ default:
fp->channels = fmt->bNrChannels;
ret = parse_audio_format_rates_v1(chip, fp, (unsigned char *) fmt, 7);
break;
@@ -434,7 +433,8 @@ static int parse_audio_format_ii(struct snd_usb_audio *chip,
fp->channels = 1;
switch (protocol) {
- case UAC_VERSION_1: {
+ case UAC_VERSION_1:
+ default: {
struct uac_format_type_ii_discrete_descriptor *fmt = _fmt;
brate = le16_to_cpu(fmt->wMaxBitRate);
framesize = le16_to_cpu(fmt->wSamplesPerFrame);
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index c166db0..0478fa3 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -365,7 +365,7 @@ static int get_ctl_value_v2(struct usb_mixer_elem_info *cval, int request, int v
static int get_ctl_value(struct usb_mixer_elem_info *cval, int request, int validx, int *value_ret)
{
- return (cval->mixer->protocol == UAC_VERSION_1) ?
+ return (cval->mixer->protocol != UAC_VERSION_2) ?
get_ctl_value_v1(cval, request, validx, value_ret) :
get_ctl_value_v2(cval, request, validx, value_ret);
}
@@ -415,7 +415,7 @@ int snd_usb_mixer_set_ctl_value(struct usb_mixer_elem_info *cval,
unsigned char buf[2];
int val_len, timeout = 10;
- if (cval->mixer->protocol == UAC_VERSION_1) {
+ if (cval->mixer->protocol != UAC_VERSION_2) {
val_len = cval->val_type >= USB_MIXER_S16 ? 2 : 1;
} else { /* UAC_VERSION_2 */
/* audio class v2 controls are always 2 bytes in size */
@@ -642,7 +642,7 @@ static int check_input_term(struct mixer_build *state, int id, struct usb_audio_
term->id = id;
switch (hdr[2]) {
case UAC_INPUT_TERMINAL:
- if (state->mixer->protocol == UAC_VERSION_1) {
+ if (state->mixer->protocol != UAC_VERSION_2) {
struct uac_input_terminal_descriptor *d = p1;
term->type = le16_to_cpu(d->wTerminalType);
term->channels = d->bNrChannels;
@@ -1159,7 +1159,7 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid, void
struct uac_feature_unit_descriptor *hdr = _ftr;
__u8 *bmaControls;
- if (state->mixer->protocol == UAC_VERSION_1) {
+ if (state->mixer->protocol != UAC_VERSION_2) {
csize = hdr->bControlSize;
channels = (hdr->bLength - 7) / csize - 1;
bmaControls = hdr->bmaControls;
@@ -1198,7 +1198,7 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid, void
else
first_ch_bits = 0;
- if (state->mixer->protocol == UAC_VERSION_1) {
+ if (state->mixer->protocol != UAC_VERSION_2) {
/* check all control types */
for (i = 0; i < 10; i++) {
unsigned int ch_bits = 0;
@@ -1865,13 +1865,13 @@ static int parse_audio_unit(struct mixer_build *state, int unitid)
return parse_audio_feature_unit(state, unitid, p1);
case UAC1_PROCESSING_UNIT:
/* UAC2_EFFECT_UNIT has the same value */
- if (state->mixer->protocol == UAC_VERSION_1)
+ if (state->mixer->protocol != UAC_VERSION_2)
return parse_audio_processing_unit(state, unitid, p1);
else
return 0; /* FIXME - effect units not implemented yet */
case UAC1_EXTENSION_UNIT:
/* UAC2_PROCESSING_UNIT_V2 has the same value */
- if (state->mixer->protocol == UAC_VERSION_1)
+ if (state->mixer->protocol != UAC_VERSION_2)
return parse_audio_extension_unit(state, unitid, p1);
else /* UAC_VERSION_2 */
return parse_audio_processing_unit(state, unitid, p1);
@@ -1932,7 +1932,7 @@ static int snd_usb_mixer_controls(struct usb_mixer_interface *mixer)
p = NULL;
while ((p = snd_usb_find_csint_desc(hostif->extra, hostif->extralen, p, UAC_OUTPUT_TERMINAL)) != NULL) {
- if (mixer->protocol == UAC_VERSION_1) {
+ if (mixer->protocol != UAC_VERSION_2) {
struct uac1_output_terminal_descriptor *desc = p;
if (desc->bLength < sizeof(*desc))
@@ -2070,7 +2070,7 @@ static void snd_usb_mixer_interrupt(struct urb *urb)
if (urb->status != 0)
goto requeue;
- if (mixer->protocol == UAC_VERSION_1) {
+ if (mixer->protocol != UAC_VERSION_2) {
struct uac1_status_word *status;
for (status = urb->transfer_buffer;
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
index 3634ced..3b5135c 100644
--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -173,13 +173,12 @@ int snd_usb_init_pitch(struct snd_usb_audio *chip, int iface,
switch (altsd->bInterfaceProtocol) {
case UAC_VERSION_1:
+ default:
return init_pitch_v1(chip, iface, alts, fmt);
case UAC_VERSION_2:
return init_pitch_v2(chip, iface, alts, fmt);
}
-
- return -EINVAL;
}
/*
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [RESENT] [PATCH - Fix Fast Track Ultra series: 44.1/88.1 kHz 1/Fix playback/capture issues and related chrashes at 44100 Hz and 88200 Hz for M-Audio Fast Track Ultra series.
@ 2010-09-02 18:05 Garnet MacPhee
2010-09-03 7:26 ` Clemens Ladisch
0 siblings, 1 reply; 10+ messages in thread
From: Garnet MacPhee @ 2010-09-02 18:05 UTC (permalink / raw)
To: alsa-devel
Clemens Ladisch wrote:
> I've got several reports that devices no longer work since UAC2 support got
> added. But I've just noticed this is not related to the interface class
> but to the interface protocol: the new code added checks for UAC_VERSION_1
> or _2, but real devices apparently write just random junk into this field.
> (For vendor-specific interfaces, they are actually justified to do so.)
> We need something like the following (untested), unless you have a better
> idea:
I retro-fitted Clemens' patch to kernel 2.6.35 and tested it. There is a problem in card.c and endpoint.c in that KERN_WARN needs to be KERN_WARNING, but otherwise the patch works. I get this in dmesg:
ALSA sound/usb/endpoint.c:279: 2:1:1: unknown interface protocol 0xff, assuming v1
ALSA sound/usb/endpoint.c:439: 2:1:1: add audio endpoint 0x1
ALSA sound/usb/endpoint.c:279: 2:2:1: unknown interface protocol 0xff, assuming v1
ALSA sound/usb/endpoint.c:439: 2:2:1: add audio endpoint 0x81
ALSA sound/usb/endpoint.c:279: 2:2:2: unknown interface protocol 0xff, assuming v1
ALSA sound/usb/endpoint.c:439: 2:2:2: add audio endpoint 0x81
ALSA sound/usb/clock.c:243: current rate 48000 is different from the runtime rate 96000
It is still necessary to have the following bit of code in endpoint.c, otherwise sample rates of 44100 or 88200 do not work (the original problem). I think there should be a standard name instead of using 0x09, something like UAC_EP_CS_ATTR_ADAPTIVE, this would have to be defined somewhere.
diff -rupN /sound/usb/endpoint.c /sound/usb/endpoint.c
--- /sound/usb/endpoint.c
+++ /sound/usb/endpoint.c
@@ -403,11 +405,15 @@ int snd_usb_parse_audio_endpoints(struct
break;
case USB_ID(0x041e, 0x3020): /* Creative SB Audigy 2 NX */
case USB_ID(0x0763, 0x2003): /* M-Audio Audiophile USB */
- case USB_ID(0x0763, 0x2080): /* M-Audio Fast Track Ultra 8 */
- case USB_ID(0x0763, 0x2081): /* M-Audio Fast Track Ultra 8R */
/* doesn't set the sample rate attribute, but supports it */
fp->attributes |= UAC_EP_CS_ATTR_SAMPLE_RATE;
break;
+ case USB_ID(0x0763, 0x2080): /* M-Audio Fast Track Ultra */
+ case USB_ID(0x0763, 0x2081): /* M-Audio Fast Track Ultra 8R */
+ /* force playback sync to adaptive only and turn off async*/
+ if (stream == SNDRV_PCM_STREAM_PLAYBACK)
+ fp->ep_attr = 0x09;
+ break;
case USB_ID(0x047f, 0x0ca1): /* plantronics headset */
case USB_ID(0x077d, 0x07af): /* Griffin iMic (note that there is
an older model 77d:223) */
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RESENT] [PATCH - Fix Fast Track Ultra series: 44.1/88.1 kHz 1/Fix playback/capture issues and related chrashes at 44100 Hz and 88200 Hz for M-Audio Fast Track Ultra series.
2010-09-02 18:05 [RESENT] [PATCH - Fix Fast Track Ultra series: 44.1/88.1 kHz 1/Fix playback/capture issues and related chrashes at 44100 Hz and 88200 Hz for M-Audio Fast Track Ultra series Garnet MacPhee
@ 2010-09-03 7:26 ` Clemens Ladisch
0 siblings, 0 replies; 10+ messages in thread
From: Clemens Ladisch @ 2010-09-03 7:26 UTC (permalink / raw)
To: Garnet MacPhee; +Cc: alsa-devel
Garnet MacPhee wrote:
> Clemens Ladisch wrote:
> > I've got several reports that devices no longer work since UAC2 support got
> > added. But I've just noticed this is not related to the interface class
> > but to the interface protocol: the new code added checks for UAC_VERSION_1
> > or _2, but real devices apparently write just random junk into this field.
> >
> > We need something like the following (untested), unless you have a better
> > idea:
>
> I retro-fitted Clemens' patch to kernel 2.6.35 and tested it. There is
> a problem in card.c and endpoint.c in that KERN_WARN needs to be
> KERN_WARNING,
That's why I wrote "untested". :-)
> but otherwise the patch works. I get this in dmesg:
>
> ALSA sound/usb/endpoint.c:279: 2:1:1: unknown interface protocol 0xff, assuming v1
> ALSA sound/usb/endpoint.c:439: 2:1:1: add audio endpoint 0x1
> ALSA sound/usb/endpoint.c:279: 2:2:1: unknown interface protocol 0xff, assuming v1
> ALSA sound/usb/endpoint.c:439: 2:2:1: add audio endpoint 0x81
> ALSA sound/usb/endpoint.c:279: 2:2:2: unknown interface protocol 0xff, assuming v1
> ALSA sound/usb/endpoint.c:439: 2:2:2: add audio endpoint 0x81
> ALSA sound/usb/clock.c:243: current rate 48000 is different from the runtime rate 96000
>
> It is still necessary to have the following bit of code in endpoint.c,
> otherwise sample rates of 44100 or 88200 do not work (the original
> problem).
The sample rate problems are handled by Felix' patch, which I applied
yesterday.
All known FTU problem should now be fixed in the alsa-kernel tree.
Regards,
Clemens
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RESENT] [PATCH - Fix Fast Track Ultra series: 44.1/88.1 kHz 1/Fix playback/capture issues and related chrashes at 44100 Hz and 88200 Hz for M-Audio Fast Track Ultra series.
2010-09-02 11:13 ` Clemens Ladisch
@ 2010-09-03 13:34 ` Daniel Mack
2010-09-03 14:26 ` Clemens Ladisch
0 siblings, 1 reply; 10+ messages in thread
From: Daniel Mack @ 2010-09-03 13:34 UTC (permalink / raw)
To: Clemens Ladisch; +Cc: Takashi Iwai, alsa-devel
On Thu, Sep 02, 2010 at 01:13:48PM +0200, Clemens Ladisch wrote:
> Daniel Mack wrote:
> > On Thu, Sep 02, 2010 at 11:12:59AM +0200, Clemens Ladisch wrote:
> > > > > Also, the Interface Class protocol for the device defaults to Vendor
> > > > > Specific Class, but the driver only recognizes Class 1 or 2. The device
> > > > > is really Class 1, so we have to force it to reflect this. There are 4
> > > > > places that we need to set this."
> > >
> > > Daniel, this seems to be a regression introduced with the UAC2 changes.
> > > The old driver accepted vendor-specific interfaces, if some quirk forced
> > > it to look at them.
> >
> > Hmm, I don't follow. What's the problem, and why should that be caused
> > by the UAC2 changes? Sorry, but I seem to have missed that thread.
>
> I've got several reports that devices no longer work since UAC2 support got
> added. But I've just noticed this is not related to the interface class
> but to the interface protocol: the new code added checks for UAC_VERSION_1
> or _2, but real devices apparently write just random junk into this field.
> (For vendor-specific interfaces, they are actually justified to do so.)
Grr. So what about cases where this "random junk" is 0x20 by coincidence?
> We need something like the following (untested), unless you have a better
> idea:
We could also fix up such devices with quirks tables, but your approach
is probably better as it catches all devices right away.
Thanks,
Daniel
>
> diff --git a/sound/usb/card.c b/sound/usb/card.c
> index 9feb00c..d5141a1 100644
> --- a/sound/usb/card.c
> +++ b/sound/usb/card.c
> @@ -216,6 +216,10 @@ static int snd_usb_create_streams(struct snd_usb_audio *chip, int ctrlif)
> }
>
> switch (protocol) {
> + default:
> + snd_printdd(KERN_WARN "unknown interface protocol %#02x, assuming v1\n");
> + /* fall through */
> +
> case UAC_VERSION_1: {
> struct uac1_ac_header_descriptor *h1 = control_header;
>
> @@ -253,10 +257,6 @@ static int snd_usb_create_streams(struct snd_usb_audio *chip, int ctrlif)
>
> break;
> }
> -
> - default:
> - snd_printk(KERN_ERR "unknown protocol version 0x%02x\n", protocol);
> - return -EINVAL;
> }
>
> return 0;
> diff --git a/sound/usb/clock.c b/sound/usb/clock.c
> index b853f8d..7754a10 100644
> --- a/sound/usb/clock.c
> +++ b/sound/usb/clock.c
> @@ -295,12 +295,11 @@ int snd_usb_init_sample_rate(struct snd_usb_audio *chip, int iface,
>
> switch (altsd->bInterfaceProtocol) {
> case UAC_VERSION_1:
> + default:
> return set_sample_rate_v1(chip, iface, alts, fmt, rate);
>
> case UAC_VERSION_2:
> return set_sample_rate_v2(chip, iface, alts, fmt, rate);
> }
> -
> - return -EINVAL;
> }
>
> diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c
> index bb9f938..22589b5 100644
> --- a/sound/usb/endpoint.c
> +++ b/sound/usb/endpoint.c
> @@ -275,6 +275,12 @@ int snd_usb_parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no)
>
> /* get audio formats */
> switch (protocol) {
> + default:
> + snd_printdd(KERN_WARN "%d:%u:%d: unknown interface protocol %#02x, assuming v1\n",
> + dev->devnum, iface_no, altno, protocol);
> + protocol = UAC_VERSION_1;
> + /* fall through */
> +
> case UAC_VERSION_1: {
> struct uac1_as_header_descriptor *as =
> snd_usb_find_csint_desc(alts->extra, alts->extralen, NULL, UAC_AS_GENERAL);
> @@ -336,11 +342,6 @@ int snd_usb_parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no)
> dev->devnum, iface_no, altno, as->bTerminalLink);
> continue;
> }
> -
> - default:
> - snd_printk(KERN_ERR "%d:%u:%d : unknown interface protocol %04x\n",
> - dev->devnum, iface_no, altno, protocol);
> - continue;
> }
>
> /* get format type */
> diff --git a/sound/usb/format.c b/sound/usb/format.c
> index 4387f54..2ec73dd 100644
> --- a/sound/usb/format.c
> +++ b/sound/usb/format.c
> @@ -49,7 +49,8 @@ static u64 parse_audio_format_i_type(struct snd_usb_audio *chip,
> u64 pcm_formats;
>
> switch (protocol) {
> - case UAC_VERSION_1: {
> + case UAC_VERSION_1:
> + default: {
> struct uac_format_type_i_discrete_descriptor *fmt = _fmt;
> sample_width = fmt->bBitResolution;
> sample_bytes = fmt->bSubframeSize;
> @@ -64,9 +65,6 @@ static u64 parse_audio_format_i_type(struct snd_usb_audio *chip,
> format <<= 1;
> break;
> }
> -
> - default:
> - return -EINVAL;
> }
>
> pcm_formats = 0;
> @@ -385,6 +383,7 @@ static int parse_audio_format_i(struct snd_usb_audio *chip,
> */
> switch (protocol) {
> case UAC_VERSION_1:
> + default:
> fp->channels = fmt->bNrChannels;
> ret = parse_audio_format_rates_v1(chip, fp, (unsigned char *) fmt, 7);
> break;
> @@ -434,7 +433,8 @@ static int parse_audio_format_ii(struct snd_usb_audio *chip,
> fp->channels = 1;
>
> switch (protocol) {
> - case UAC_VERSION_1: {
> + case UAC_VERSION_1:
> + default: {
> struct uac_format_type_ii_discrete_descriptor *fmt = _fmt;
> brate = le16_to_cpu(fmt->wMaxBitRate);
> framesize = le16_to_cpu(fmt->wSamplesPerFrame);
> diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
> index c166db0..0478fa3 100644
> --- a/sound/usb/mixer.c
> +++ b/sound/usb/mixer.c
> @@ -365,7 +365,7 @@ static int get_ctl_value_v2(struct usb_mixer_elem_info *cval, int request, int v
>
> static int get_ctl_value(struct usb_mixer_elem_info *cval, int request, int validx, int *value_ret)
> {
> - return (cval->mixer->protocol == UAC_VERSION_1) ?
> + return (cval->mixer->protocol != UAC_VERSION_2) ?
> get_ctl_value_v1(cval, request, validx, value_ret) :
> get_ctl_value_v2(cval, request, validx, value_ret);
> }
> @@ -415,7 +415,7 @@ int snd_usb_mixer_set_ctl_value(struct usb_mixer_elem_info *cval,
> unsigned char buf[2];
> int val_len, timeout = 10;
>
> - if (cval->mixer->protocol == UAC_VERSION_1) {
> + if (cval->mixer->protocol != UAC_VERSION_2) {
> val_len = cval->val_type >= USB_MIXER_S16 ? 2 : 1;
> } else { /* UAC_VERSION_2 */
> /* audio class v2 controls are always 2 bytes in size */
> @@ -642,7 +642,7 @@ static int check_input_term(struct mixer_build *state, int id, struct usb_audio_
> term->id = id;
> switch (hdr[2]) {
> case UAC_INPUT_TERMINAL:
> - if (state->mixer->protocol == UAC_VERSION_1) {
> + if (state->mixer->protocol != UAC_VERSION_2) {
> struct uac_input_terminal_descriptor *d = p1;
> term->type = le16_to_cpu(d->wTerminalType);
> term->channels = d->bNrChannels;
> @@ -1159,7 +1159,7 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid, void
> struct uac_feature_unit_descriptor *hdr = _ftr;
> __u8 *bmaControls;
>
> - if (state->mixer->protocol == UAC_VERSION_1) {
> + if (state->mixer->protocol != UAC_VERSION_2) {
> csize = hdr->bControlSize;
> channels = (hdr->bLength - 7) / csize - 1;
> bmaControls = hdr->bmaControls;
> @@ -1198,7 +1198,7 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid, void
> else
> first_ch_bits = 0;
>
> - if (state->mixer->protocol == UAC_VERSION_1) {
> + if (state->mixer->protocol != UAC_VERSION_2) {
> /* check all control types */
> for (i = 0; i < 10; i++) {
> unsigned int ch_bits = 0;
> @@ -1865,13 +1865,13 @@ static int parse_audio_unit(struct mixer_build *state, int unitid)
> return parse_audio_feature_unit(state, unitid, p1);
> case UAC1_PROCESSING_UNIT:
> /* UAC2_EFFECT_UNIT has the same value */
> - if (state->mixer->protocol == UAC_VERSION_1)
> + if (state->mixer->protocol != UAC_VERSION_2)
> return parse_audio_processing_unit(state, unitid, p1);
> else
> return 0; /* FIXME - effect units not implemented yet */
> case UAC1_EXTENSION_UNIT:
> /* UAC2_PROCESSING_UNIT_V2 has the same value */
> - if (state->mixer->protocol == UAC_VERSION_1)
> + if (state->mixer->protocol != UAC_VERSION_2)
> return parse_audio_extension_unit(state, unitid, p1);
> else /* UAC_VERSION_2 */
> return parse_audio_processing_unit(state, unitid, p1);
> @@ -1932,7 +1932,7 @@ static int snd_usb_mixer_controls(struct usb_mixer_interface *mixer)
>
> p = NULL;
> while ((p = snd_usb_find_csint_desc(hostif->extra, hostif->extralen, p, UAC_OUTPUT_TERMINAL)) != NULL) {
> - if (mixer->protocol == UAC_VERSION_1) {
> + if (mixer->protocol != UAC_VERSION_2) {
> struct uac1_output_terminal_descriptor *desc = p;
>
> if (desc->bLength < sizeof(*desc))
> @@ -2070,7 +2070,7 @@ static void snd_usb_mixer_interrupt(struct urb *urb)
> if (urb->status != 0)
> goto requeue;
>
> - if (mixer->protocol == UAC_VERSION_1) {
> + if (mixer->protocol != UAC_VERSION_2) {
> struct uac1_status_word *status;
>
> for (status = urb->transfer_buffer;
> diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
> index 3634ced..3b5135c 100644
> --- a/sound/usb/pcm.c
> +++ b/sound/usb/pcm.c
> @@ -173,13 +173,12 @@ int snd_usb_init_pitch(struct snd_usb_audio *chip, int iface,
>
> switch (altsd->bInterfaceProtocol) {
> case UAC_VERSION_1:
> + default:
> return init_pitch_v1(chip, iface, alts, fmt);
>
> case UAC_VERSION_2:
> return init_pitch_v2(chip, iface, alts, fmt);
> }
> -
> - return -EINVAL;
> }
>
> /*
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RESENT] [PATCH - Fix Fast Track Ultra series: 44.1/88.1 kHz 1/Fix playback/capture issues and related chrashes at 44100 Hz and 88200 Hz for M-Audio Fast Track Ultra series.
2010-09-03 13:34 ` Daniel Mack
@ 2010-09-03 14:26 ` Clemens Ladisch
0 siblings, 0 replies; 10+ messages in thread
From: Clemens Ladisch @ 2010-09-03 14:26 UTC (permalink / raw)
To: Daniel Mack; +Cc: Takashi Iwai, alsa-devel
Daniel Mack wrote:
> On Thu, Sep 02, 2010 at 01:13:48PM +0200, Clemens Ladisch wrote:
> > I've got several reports that devices no longer work since UAC2 support got
> > added. But I've just noticed this is not related to the interface class
> > but to the interface protocol: the new code added checks for UAC_VERSION_1
> > or _2, but real devices apparently write just random junk into this field.
> > (For vendor-specific interfaces, they are actually justified to do so.)
>
> Grr. So what about cases where this "random junk" is 0x20 by coincidence?
Actually, it isn't too random: I've seen 0xff (obviously "vendor-
specific") and 0x01/0x02 (interface subclass moved to protocol).
Regards,
Clemens
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2010-09-03 14:26 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-02 18:05 [RESENT] [PATCH - Fix Fast Track Ultra series: 44.1/88.1 kHz 1/Fix playback/capture issues and related chrashes at 44100 Hz and 88200 Hz for M-Audio Fast Track Ultra series Garnet MacPhee
2010-09-03 7:26 ` Clemens Ladisch
-- strict thread matches above, loose matches on Subject: below --
2010-07-06 8:05 Felix Homann
2010-09-01 8:48 ` [RESENT] " Felix Homann
2010-09-02 8:33 ` Takashi Iwai
2010-09-02 9:12 ` Clemens Ladisch
2010-09-02 9:16 ` Daniel Mack
2010-09-02 11:13 ` Clemens Ladisch
2010-09-03 13:34 ` Daniel Mack
2010-09-03 14:26 ` Clemens Ladisch
2010-09-02 10:12 ` Felix Homann
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).