Skip to contentSkip to conversation

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

PATCH In review [email protected] 2 participants 2 messages Feb 1, 2024 – Feb 6, 2024

lore
Share & tools
lore
#1 lore raw
In reply to [email protected]
Quoted 9 lines · On Wed, 31 Jan 2024 21:28:48 +0100, [email protected] wrote:

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.

The code changes look OK, but the submission has a minor problem.

usb/quirks-table.h

Quoted 2 lines
usb/quirks-table.h +0 -0

Please create a patch that is applied with -p1, just like what git format-patch provides.

Also, when applied to git tree, there is "attached patch". It'll be the commit log text, hence better to rephrase the texts to fit as a git commit log.

Last but not least, please use the "From:" line aligned with your Signed-off-by line. If you don't want to change the mailer setup, put the From: line in the patch itself, so that it's taken at applying.

Could you address those and resubmit?

thanks,

Takashi

#0 lore raw

PATCH 1/1 ALSA: usb-audio: Add quirk for PioneerDJ DDJ-1000

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.

usb/quirks-table.h +58 -0
@@ -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
  *
usb/quirks.c +12 -0
@@ -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;