alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Felix Homann <fexpop@web.de>
Cc: alsa-devel@alsa-project.org, clemens@ladisch.de
Subject: 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.
Date: Thu, 02 Sep 2010 10:33:32 +0200	[thread overview]
Message-ID: <s5hk4n4zgrn.wl%tiwai@suse.de> (raw)
In-Reply-To: <4C7E1376.9030208@web.de>

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

  reply	other threads:[~2010-09-02  8:33 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-06  8:05 [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 Felix Homann
2010-07-07  9:05 ` Felix Homann
2010-07-07 12:44   ` Clemens Ladisch
2010-07-07 13:19     ` Felix Homann
2010-07-07 13:59       ` Felix Homann
2010-07-07 14:23       ` Clemens Ladisch
2010-07-07 16:55         ` Felix Homann
2010-07-08  6:25           ` Clemens Ladisch
2010-07-08  8:35             ` Felix Homann
2010-07-08 13:10               ` Clemens Ladisch
2010-07-08 15:14                 ` Felix Homann
2010-07-08 15:19                   ` Clemens Ladisch
2010-07-08 15:54                     ` Felix Homann
2010-07-16  8:27         ` Felix Homann
2010-08-31  6:39 ` Felix Homann
2010-08-31  8:24   ` [PATCH] - Fix Fast Track Ultra series: 44.1/88.1 kHz 1/Fix playback/capture issues and related crashes " Paul Menzel
2010-09-01  8:48 ` [RESENT] [PATCH - Fix Fast Track Ultra series: 44.1/88.1 kHz 1/Fix playback/capture issues and related chrashes " Felix Homann
2010-09-02  8:33   ` Takashi Iwai [this message]
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
  -- strict thread matches above, loose matches on Subject: below --
2010-09-02 18:05 Garnet MacPhee
2010-09-03  7:26 ` Clemens Ladisch

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=s5hk4n4zgrn.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.de \
    --cc=fexpop@web.de \
    /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).