All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Saylor <bensaylor@fastmail.fm>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@lists.sourceforge.net
Subject: Re: Audiophile USB samplerate workaround
Date: Wed, 23 Jul 2003 13:14:03 -0800	[thread overview]
Message-ID: <200307231314.03395.bensaylor@fastmail.fm> (raw)
In-Reply-To: <s5hn0f5mtsv.wl@alsa2.suse.de>

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

That does the trick.  Here's a patch against 0.9.5.

I don't know if this is related, but one thing I've been puzzling over 
is that half the time after I plug in the audiophile I get static 
instead of sound.  I have to unload alsa and plug it in again.  (As I 
mentioned before, I always get static if I load the alsa modules 
explicitly).

Ben

On Wednesday 23 July 2003 2:17 am, Takashi Iwai wrote:
> At Wed, 23 Jul 2003 02:05:50 -0800,
>
> Ben Saylor wrote:
> > > ok, then it supports other sample rates :)
> > >
> > > about the symptom: do you mean that the playback gets too fast
> > > with the lower sample rate,
> >
> > Yes.  i.e. it will play a 44100 hz or whatever stream, but playback
> > is too fast.
>
> so apparently we need some workaround (as found below line 2291 of
> usbaudio.c).
> please try to check the product and vendor id and set
> 	fp->attribtes |= EP_CS_ATTR_SAMPLERATE
> with that condition.
> if it works, please give me the patch.
>
>
> thanks,
>
> Takashi

[-- Attachment #2: audiophile1.diff --]
[-- Type: text/x-diff, Size: 1630 bytes --]

--- alsa-driver-0.9.5/alsa-kernel/usb/usbaudio.c	2003-06-23 04:41:36.000000000 -0800
+++ alsa-driver-0.9.5-brs/alsa-kernel/usb/usbaudio.c	2003-07-23 12:53:19.000000000 -0800
@@ -2295,6 +2295,14 @@
 			 */
 			fp->attributes &= ~EP_CS_ATTR_SAMPLE_RATE;
 		}
+
+		/* workaround for M-Audio Audiophile USB */
+		if (dev->descriptor.idVendor == 0x0763 &&
+		    dev->descriptor.idProduct == 0x2003) {
+			/* doesn't set the sample rate attribute, but supports it */
+			fp->attributes |= EP_CS_ATTR_SAMPLE_RATE;
+		}
+
 		/*
 		 * plantronics headset and Griffin iMic have set adaptive-in
 		 * although it's really not...
@@ -2695,11 +2703,6 @@
 	if (quirk && quirk->ifnum != QUIRK_ANY_INTERFACE && ifnum != quirk->ifnum)
 		goto __err_val;
 
-	if (usb_set_configuration(dev, get_cfg_desc(config)->bConfigurationValue) < 0) {
-		snd_printk(KERN_ERR "cannot set configuration (value 0x%x)\n", get_cfg_desc(config)->bConfigurationValue);
-		goto __err_val;
-	}
-
 	/* SB Extigy needs special boot-up sequence */
 	/* if more models come, this will go to the quirk list. */
 	if (dev->descriptor.idVendor == 0x041e && dev->descriptor.idProduct == 0x3000) {
@@ -2729,6 +2732,11 @@
 		/* it's a fresh one.
 		 * now look for an empty slot and create a new card instance
 		 */
+		if (usb_set_configuration(dev, get_cfg_desc(config)->bConfigurationValue) < 0) {
+			snd_printk(KERN_ERR "cannot set configuration (value 0x%x)\n", get_cfg_desc(config)->bConfigurationValue);
+			goto __err_val;
+		}
+
 		for (i = 0; i < SNDRV_CARDS; i++)
 			if (enable[i] && ! usb_chip[i] &&
 			    (vid[i] == -1 || vid[i] == dev->descriptor.idVendor) &&

  reply	other threads:[~2003-07-23 21:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-23  6:59 Audiophile USB samplerate workaround Ben Saylor
2003-07-23  8:29 ` Takashi Iwai
2003-07-23  9:02   ` Ben Saylor
2003-07-23  9:33     ` Takashi Iwai
2003-07-23 10:05       ` Ben Saylor
2003-07-23 10:17         ` Takashi Iwai
2003-07-23 21:14           ` Ben Saylor [this message]
2003-07-24 13:04             ` Takashi Iwai

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=200307231314.03395.bensaylor@fastmail.fm \
    --to=bensaylor@fastmail.fm \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=tiwai@suse.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.