ALSA: usb-audio: M-Audio FT C400 skip packet quirk
authorEldad Zack <eldad@fogrefinery.com>
Sun, 13 Jan 2013 22:02:03 +0000 (23:02 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 14 Jan 2013 09:06:03 +0000 (10:06 +0100)
Attain constant real-world latency by skipping 16 data packets.
The number of packets to be skipped was found by trial and error.

Signed-off-by: Eldad Zack <eldad@fogrefinery.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/quirks.c

index e71fc8bc3a70da7d98caecba69ba7153275bdbe7..2c971858d6b70a146e57266bfa0afe7a1bfe80cb 100644 (file)
@@ -861,6 +861,17 @@ void snd_usb_endpoint_start_quirk(struct snd_usb_endpoint *ep)
        if ((le16_to_cpu(ep->chip->dev->descriptor.idVendor) == 0x23ba) &&
            ep->type == SND_USB_ENDPOINT_TYPE_SYNC)
                ep->skip_packets = 4;
        if ((le16_to_cpu(ep->chip->dev->descriptor.idVendor) == 0x23ba) &&
            ep->type == SND_USB_ENDPOINT_TYPE_SYNC)
                ep->skip_packets = 4;
+
+       /*
+        * M-Audio Fast Track C400 - when packets are not skipped, real world
+        * latency varies by approx. +/- 50 frames (at 96KHz) each time the
+        * stream is (re)started. When skipping packets 16 at endpoint start
+        * up, the real world latency is stable within +/- 1 frame (also
+        * across power cycles).
+        */
+       if (ep->chip->usb_id == USB_ID(0x0763, 0x2030) &&
+           ep->type == SND_USB_ENDPOINT_TYPE_DATA)
+               ep->skip_packets = 16;
 }
 
 void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe,
 }
 
 void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe,