Skip to content

Commit 5e21233

Browse files
hillstiwai
authored andcommitted
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>
1 parent ba615b8 commit 5e21233

2 files changed

Lines changed: 55 additions & 0 deletions

File tree

‎sound/usb/quirks-table.h‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2747,6 +2747,46 @@ YAMAHA_DEVICE(0x7010, "UB99"),
27472747
.type = QUIRK_MIDI_RAW_BYTES
27482748
}
27492749
},
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+
},
27502790
{
27512791
USB_DEVICE_VENDOR_SPEC(0x1235, 0x4661),
27522792
.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {

‎sound/usb/quirks.c‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,17 @@ static int snd_usb_cm6206_boot_quirk(struct usb_device *dev)
445445
return err;
446446
}
447447

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+
448459
/*
449460
* This call will put the synth in "USB send" mode, i.e it will send MIDI
450461
* messages through USB (this is disabled at startup). The synth will
@@ -746,6 +757,10 @@ int snd_usb_apply_boot_quirk(struct usb_device *dev,
746757
/* Digidesign Mbox 2 */
747758
return snd_usb_mbox2_boot_quirk(dev);
748759

760+
case USB_ID(0x1235, 0x0018):
761+
/* Focusrite Novation Twitch */
762+
return snd_usb_twitch_boot_quirk(dev);
763+
749764
case USB_ID(0x133e, 0x0815):
750765
/* Access Music VirusTI Desktop */
751766
return snd_usb_accessmusic_boot_quirk(dev);

0 commit comments

Comments
 (0)