[linux-audio-user] running gag: m-audio quattro

Patrick Shirkey pshirkey at boosthardware.com
Mon Jun 14 12:37:37 EDT 2004


metafor at gmx.net wrote:
> hi alan
> 
> if i manage to get the card working i will write a howto, that's for 
> sure, because
> it seems that i am definetly not the only one who has problems to setup 
> up the
> card properly. i let you know.
>

First good news for a while with this device.

Clemens made a patch last week which I finally tested tonight. It 
allowed me to record crystal clear cd quality and 24 bit audio.

Took us two years to figure out that the mAudio team had made it use big 
endian format for input and little endian for output.

What a bunch of #@$X!!##

Here's the patch which I'm sure will be committed to cvs in the next few 
days.

--------------------------

Index: alsa-kernel/usb/usbaudio.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/usb/usbaudio.c,v
retrieving revision 1.100
diff -u -r1.100 usbaudio.c
--- alsa-kernel/usb/usbaudio.c	5 May 2004 08:50:45 -0000	1.100
+++ alsa-kernel/usb/usbaudio.c	10 Jun 2004 17:00:40 -0000
@@ -2182,6 +2182,24 @@


  /*
+ * check if the device uses big-endian samples
+ */
+static int is_big_endian_format(struct usb_device *dev, struct 
audioformat *fp)
+{
+	/* M-Audio */
+	if (dev->descriptor.idVendor == 0x0763) {
+		/* Quattro: captured data only */
+		if (dev->descriptor.idProduct == 0x2001 &&
+		    fp->endpoint & USB_DIR_IN)
+			return 1;
+		/* Audiophile USB */
+		if (dev->descriptor.idProduct == 0x2003)
+			return 1;
+	}
+	return 0;
+}
+
+/*
   * parse the audio format type I descriptor
   * and returns the corresponding pcm format
   *
@@ -2217,17 +2235,13 @@
  			pcm_format = SNDRV_PCM_FORMAT_S8;
  			break;
  		case 2:
-			/* M-Audio audiophile USB workaround */
-			if (dev->descriptor.idVendor == 0x0763 &&
-			    dev->descriptor.idProduct == 0x2003)
+			if (is_big_endian_format(dev, fp))
  				pcm_format = SNDRV_PCM_FORMAT_S16_BE; /* grrr, big endian!! */
  			else
  				pcm_format = SNDRV_PCM_FORMAT_S16_LE;
  			break;
  		case 3:
-			/* M-Audio audiophile USB workaround */
-			if (dev->descriptor.idVendor == 0x0763 &&
-			    dev->descriptor.idProduct == 0x2003)
+			if (is_big_endian_format(dev, fp))
  				pcm_format = SNDRV_PCM_FORMAT_S24_3BE; /* grrr, big endian!! */
  			else
  				pcm_format = SNDRV_PCM_FORMAT_S24_3LE;
Index: alsa-kernel/usb/usbquirks.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/usb/usbquirks.h,v
retrieving revision 1.33
diff -u -r1.33 usbquirks.h
--- alsa-kernel/usb/usbquirks.h	12 May 2004 06:29:22 -0000	1.33
+++ alsa-kernel/usb/usbquirks.h	10 Jun 2004 17:00:40 -0000
@@ -830,11 +830,42 @@
  	.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
  		.vendor_name = "M-Audio",
  		.product_name = "Quattro",
-		.ifnum = 9,
-		.type = QUIRK_MIDI_MIDIMAN,
-		.data = & (const snd_usb_midi_endpoint_info_t) {
-			.out_cables = 0x0001,
-			.in_cables  = 0x0001
+		.ifnum = QUIRK_ANY_INTERFACE,
+		.type = QUIRK_COMPOSITE,
+		.data = & (const snd_usb_audio_quirk_t[]) {
+			/*
+			 * Interfaces 0-2 are "Windows-compatible", 16-bit only,
+			 * and share endpoints with the other interfaces.
+			 * Ignore them.  The other interfaces can do 24 bits,
+			 * but captured samples are big-endian (see usbaudio.c).
+			 */
+			{
+				.ifnum = 4,
+				.type = QUIRK_AUDIO_STANDARD_INTERFACE
+			},
+			{
+				.ifnum = 5,
+				.type = QUIRK_AUDIO_STANDARD_INTERFACE
+			},
+			{
+				.ifnum = 7,
+				.type = QUIRK_AUDIO_STANDARD_INTERFACE
+			},
+			{
+				.ifnum = 8,
+				.type = QUIRK_AUDIO_STANDARD_INTERFACE
+			},
+			{
+				.ifnum = 9,
+				.type = QUIRK_MIDI_MIDIMAN,
+				.data = & (const snd_usb_midi_endpoint_info_t) {
+					.out_cables = 0x0001,
+					.in_cables  = 0x0001
+				}
+			},
+			{
+				.ifnum = -1
+			}
  		}
  	}
  },







-------------------

-- 
Patrick Shirkey - Boost Hardware Ltd.
Http://www.boosthardware.com
Http://www.djcj.org/LAU/guide/ - The Linux Audio Users guide
Http://www.djcj.org/gigs/ - Gigs guide Korea
Http://www.nana7.net - Bar Nana - Itaewon, Seoul, Sth Corea
========================================


Apparently upon the beginning of the barrage, the donkey broke 
discipline and panicked, toppling the cart. At that point, the rockets 
disconnected from the timer, leaving them strewn around the street. 
Tethered to the now toppled cart, the donkey was unable to escape before 
the arrival of U.S. troops.

United Press International
Rockets on donkeys hit major Baghdad sites

By P. MITCHELL PROTHERO
Published 11/21/2003 11:13 AM






More information about the Linux-audio-user mailing list