diff mbox series

ALSA: usb-audio: Add quirk for PioneerDJ DDJ-1000

Message ID 2322911.ElGaqSPkdT@pc
State New
Headers show
Series ALSA: usb-audio: Add quirk for PioneerDJ DDJ-1000 | expand

Commit Message

rp@nrp.de Jan. 31, 2024, 8:28 p.m. UTC
Problems:
	- PioneerDJ DDJ-1000 audio channels are not recognized.
	- Jog dial displays are showing permanently "NO AUDIO DRIVER" 

The attached patch fixes this.
The jog displays and all output and input channels are working now.

Signed-off-by: Ralf Pachali <rp@nrp.de>
diff mbox series

Patch

--- sound/usb/quirks-table.h
+++ sound/usb/quirks-table.h
@@ -3942,6 +3942,64 @@ 
 	}
 },
 
+{
+	/*
+	 * PIONEER DJ DDJ-1000
+	 * PCM is 6 channels out, 12 channels in @ 44.1 fixed
+	 * The Feedback for the output is the input
+	 */
+	USB_DEVICE_VENDOR_SPEC(0x2b73, 0x0020),
+		.driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) {
+		.ifnum = QUIRK_ANY_INTERFACE,
+		.type = QUIRK_COMPOSITE,
+		.data = (const struct snd_usb_audio_quirk[]) {
+			{
+				.ifnum = 0,
+				.type = QUIRK_AUDIO_FIXED_ENDPOINT,
+				.data = &(const struct audioformat) {
+					.formats = SNDRV_PCM_FMTBIT_S24_3LE,
+					.channels = 6,
+					.iface = 0,
+					.altsetting = 1,
+					.altset_idx = 1,
+					.endpoint = 0x01,
+					.ep_attr = USB_ENDPOINT_XFER_ISOC|
+						USB_ENDPOINT_SYNC_ASYNC,
+					.rates = SNDRV_PCM_RATE_44100,
+					.rate_min = 44100,
+					.rate_max = 44100,
+					.nr_rates = 1,
+					.rate_table = (unsigned int[]) { 44100 }
+				}
+			},
+			{
+				.ifnum = 0,
+				.type = QUIRK_AUDIO_FIXED_ENDPOINT,
+				.data = &(const struct audioformat) {
+					.formats = SNDRV_PCM_FMTBIT_S24_3LE,
+					.channels = 12,
+					.iface = 0,
+					.altsetting = 1,
+					.altset_idx = 1,
+					.endpoint = 0x82,
+					.ep_idx = 1,
+					.ep_attr = USB_ENDPOINT_XFER_ISOC|
+						USB_ENDPOINT_SYNC_ASYNC|
+					USB_ENDPOINT_USAGE_IMPLICIT_FB,
+					.rates = SNDRV_PCM_RATE_44100,
+					.rate_min = 44100,
+					.rate_max = 44100,
+					.nr_rates = 1,
+					.rate_table = (unsigned int[]) { 44100 }
+				}
+			},
+			{
+				.ifnum = -1
+			}
+		}
+	}
+},
+
 /*
  * MacroSilicon MS2100/MS2106 based AV capture cards
  *
--- sound/usb/quirks.c
+++ sound/usb/quirks.c
@@ -1390,6 +1390,16 @@ 
 	return 0;
 }
 
+static int snd_usb_pioneer_ddj1000_boot_quirk(struct usb_device *dev)
+{
+	/* disable "no audio driver" message on jog wheel displays */
+	snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0), 0,
+			USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
+			0, 0x8003, NULL, 0);
+
+	return 0;
+}
+
 /*
  * Setup quirks
  */
@@ -1630,6 +1640,8 @@ 
 	switch (id) {
 	case USB_ID(0x07fd, 0x0008): /* MOTU M Series */
 		return snd_usb_motu_m_series_boot_quirk(dev);
+	case USB_ID(0x2b73, 0x0020): /* Pioneer DDJ-1000 */
+		return snd_usb_pioneer_ddj1000_boot_quirk(dev);
 	}
 
 	return 0;