Update of /cvsroot/alsa/alsa-kernel/usb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16960
Modified Files: usbaudio.c usbquirks.h Log Message: Quattro USB: handle the different endianness of playback and recording sample data Index: usbaudio.c =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/usb/usbaudio.c,v retrieving revision 1.100 retrieving revision 1.101 diff -u -r1.100 -r1.101 --- usbaudio.c 5 May 2004 08:50:45 -0000 1.100 +++ usbaudio.c 14 Jun 2004 17:12:05 -0000 1.101 @@ -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: usbquirks.h =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/usb/usbquirks.h,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- usbquirks.h 12 May 2004 06:29:22 -0000 1.33 +++ usbquirks.h 14 Jun 2004 17:12:05 -0000 1.34 @@ -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 + } } } }, ------------------------------------------------------- This SF.Net email is sponsored by the new InstallShield X. >From Windows to Linux, servers to mobile, InstallShield X is the one installation-authoring solution that does it all. Learn more and evaluate today! http://www.installshield.com/Dev2Dev/0504 _______________________________________________ Alsa-cvslog mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-cvslog