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

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-user] running gag: m-audio quattro
From: Patrick Shirkey (pshirkey_AT_boosthardware.com)
Date: Mon Jun 14 2004 - 19:37:37 EEST


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


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Mon Jun 14 2004 - 19:38:53 EEST