alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [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
* [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 ` [RESENT] " Felix Homann
  0 siblings, 1 reply; 10+ messages in thread
From: Felix Homann @ 2010-07-06  8:05 UTC (permalink / raw)
  To: patch; +Cc: alsa-devel, Felix Homann

[-- Attachment #1: Type: text/plain, Size: 308 bytes --]

This fixes issues with M-Audio's Fast Track Ultra series:

* devices now work at 44100 and 88200 Hz
* apparently, fixes some crashes, too

This is based on a patch posted by user 'dhubsith' on the M-Audio user 
forum.

Sorry for not sending via 'git send-email': I just don't get it...

Kind regards,

Felix

[-- Attachment #2: 0001-fix-sample-rates-ftu.patch --]
[-- Type: text/x-patch, Size: 4875 bytes --]

>From 57cd7afd0b0fbccd80acab16e617cf8a844e37d1 Mon Sep 17 00:00:00 2001
From: Felix <fexpop@web.de>
Date: Tue, 6 Jul 2010 09:16:17 +0200
Subject: [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.


Signed-off-by: Felix <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..af9c2a1 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, 0x2081),
+		.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 = 0x01,
+					.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 = 0x01,
+					.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 = 0x01,
+					.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 = 0x01,
+					.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.0.4


[-- 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

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).