Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: usb-audio: Playback and MIDI support for Novation Twitch DJ controller

The hardware also has a PCM capture device which is not implemented in
this patch.

It may be possible to generalise this to Saffire 6 USB support and some
of the other Focusrite interfaces, but as I don't have access to these
devices we should wait until capture support is working first.

Capture support is not implemented because the code assumes the endpoint
to have its own interface (instead, it shares the interface with playback)
and some thought will be needed to lift this limitation.

Signed-off-by: Mark Hills <mark@xwax.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Mark Hills and committed by
Takashi Iwai
5e212332 ba615b86

+55
+40
sound/usb/quirks-table.h
··· 2748 2748 } 2749 2749 }, 2750 2750 { 2751 + USB_DEVICE(0x1235, 0x0018), 2752 + .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { 2753 + .vendor_name = "Novation", 2754 + .product_name = "Twitch", 2755 + .ifnum = QUIRK_ANY_INTERFACE, 2756 + .type = QUIRK_COMPOSITE, 2757 + .data = (const struct snd_usb_audio_quirk[]) { 2758 + { 2759 + .ifnum = 0, 2760 + .type = QUIRK_AUDIO_FIXED_ENDPOINT, 2761 + .data = & (const struct audioformat) { 2762 + .formats = SNDRV_PCM_FMTBIT_S24_3LE, 2763 + .channels = 4, 2764 + .iface = 0, 2765 + .altsetting = 1, 2766 + .altset_idx = 1, 2767 + .attributes = UAC_EP_CS_ATTR_SAMPLE_RATE, 2768 + .endpoint = 0x01, 2769 + .ep_attr = USB_ENDPOINT_XFER_ISOC, 2770 + .rates = SNDRV_PCM_RATE_44100 | 2771 + SNDRV_PCM_RATE_48000, 2772 + .rate_min = 44100, 2773 + .rate_max = 48000, 2774 + .nr_rates = 2, 2775 + .rate_table = (unsigned int[]) { 2776 + 44100, 48000 2777 + } 2778 + } 2779 + }, 2780 + { 2781 + .ifnum = 1, 2782 + .type = QUIRK_MIDI_RAW_BYTES 2783 + }, 2784 + { 2785 + .ifnum = -1 2786 + } 2787 + } 2788 + } 2789 + }, 2790 + { 2751 2791 USB_DEVICE_VENDOR_SPEC(0x1235, 0x4661), 2752 2792 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { 2753 2793 .vendor_name = "Novation",
+15
sound/usb/quirks.c
··· 446 446 } 447 447 448 448 /* 449 + * Novation Twitch DJ controller 450 + */ 451 + static int snd_usb_twitch_boot_quirk(struct usb_device *dev) 452 + { 453 + /* preemptively set up the device because otherwise the 454 + * raw MIDI endpoints are not active */ 455 + usb_set_interface(dev, 0, 1); 456 + return 0; 457 + } 458 + 459 + /* 449 460 * This call will put the synth in "USB send" mode, i.e it will send MIDI 450 461 * messages through USB (this is disabled at startup). The synth will 451 462 * acknowledge by sending a sysex on endpoint 0x85 and by displaying a USB ··· 756 745 case USB_ID(0x0dba, 0x3000): 757 746 /* Digidesign Mbox 2 */ 758 747 return snd_usb_mbox2_boot_quirk(dev); 748 + 749 + case USB_ID(0x1235, 0x0018): 750 + /* Focusrite Novation Twitch */ 751 + return snd_usb_twitch_boot_quirk(dev); 759 752 760 753 case USB_ID(0x133e, 0x0815): 761 754 /* Access Music VirusTI Desktop */