All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabian Lesniak <fabian@lesniak-it.de>
To: alsa-devel@alsa-project.org
Cc: "Takashi Iwai" <tiwai@suse.de>,
	"Olivia Mackintosh" <livvy@base.nu>,
	"František Kučera" <franta-linux@frantovo.cz>,
	"Fabian Lesniak" <fabian@lesniak-it.de>
Subject: [PATCH] ALSA: usb-audio: add mixer quirks for Pioneer DJM-900NXS2
Date: Mon,  1 Feb 2021 22:22:47 +0100	[thread overview]
Message-ID: <20210201212248.54364-1-fabian@lesniak-it.de> (raw)

This commit adds mixer quirks for the Pioneer DJM-900NXS2 mixer. This
device has 6 capture channels, 5 of them allow setting the signal
source. This adds controls for these, similar to the DJM-250Mk2.
However, playpack channels are not controllable via software like on the
250Mk2, as they can only be set manually on the mixing console.
Read-only controls showing the currently selected playback channels are
omitted.

This patch is built on top of the DJM750 mixer quirk support and
requires it to be applied first.

Signed-off-by: Fabian Lesniak <fabian@lesniak-it.de>
---
 sound/usb/mixer_quirks.c | 73 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 72 insertions(+), 1 deletion(-)

diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c
index 10e472feb757..6688a38321a4 100644
--- a/sound/usb/mixer_quirks.c
+++ b/sound/usb/mixer_quirks.c
@@ -2777,9 +2777,76 @@ static const struct snd_pioneer_djm_option_group snd_pioneer_djm750_option_group
 	snd_pioneer_djm_option_group_item("CH4 Input", djm750_capture_ch4, 0),
 };
 
+
+/* DJM-900NXS2 */
+static const struct snd_pioneer_djm_option snd_pioneer_djm_options_djm900nxs2_capture_ch1[] = {
+	{ .name =  "CH1 Control Tone LINE",    .wValue = 0x0100, .wIndex = 0x8002 },
+	{ .name =  "CH1 Control Tone DITITAL", .wValue = 0x0102, .wIndex = 0x8002 },
+	{ .name =  "CH1 Control Tone PHONO",   .wValue = 0x0103, .wIndex = 0x8002 },
+	{ .name =  "Post CH1 Fader",           .wValue = 0x0106, .wIndex = 0x8002 },
+	{ .name =  "Cross Fader A",            .wValue = 0x0107, .wIndex = 0x8002 },
+	{ .name =  "Cross Fader B",            .wValue = 0x0108, .wIndex = 0x8002 },
+	{ .name =  "MIC",                      .wValue = 0x0109, .wIndex = 0x8002 },
+	{ .name =  "REC OUT",                  .wValue = 0x010a, .wIndex = 0x8002 },
+};
+
+static const struct snd_pioneer_djm_option snd_pioneer_djm_options_djm900nxs2_capture_ch2[] = {
+	{ .name =  "CH2 Control Tone LINE",    .wValue = 0x0200, .wIndex = 0x8002 },
+	{ .name =  "CH2 Control Tone DITITAL", .wValue = 0x0202, .wIndex = 0x8002 },
+	{ .name =  "CH2 Control Tone PHONO",   .wValue = 0x0203, .wIndex = 0x8002 },
+	{ .name =  "Post CH2 Fader",           .wValue = 0x0206, .wIndex = 0x8002 },
+	{ .name =  "Cross Fader A",            .wValue = 0x0207, .wIndex = 0x8002 },
+	{ .name =  "Cross Fader B",            .wValue = 0x0208, .wIndex = 0x8002 },
+	{ .name =  "MIC",                      .wValue = 0x0209, .wIndex = 0x8002 },
+	{ .name =  "REC OUT",                  .wValue = 0x020a, .wIndex = 0x8002 },
+};
+
+static const struct snd_pioneer_djm_option snd_pioneer_djm_options_djm900nxs2_capture_ch3[] = {
+	{ .name =  "CH3 Control Tone LINE",    .wValue = 0x0300, .wIndex = 0x8002 },
+	{ .name =  "CH3 Control Tone DITITAL", .wValue = 0x0302, .wIndex = 0x8002 },
+	{ .name =  "CH3 Control Tone PHONO",   .wValue = 0x0303, .wIndex = 0x8002 },
+	{ .name =  "Post CH3 Fader",           .wValue = 0x0306, .wIndex = 0x8002 },
+	{ .name =  "Cross Fader A",            .wValue = 0x0307, .wIndex = 0x8002 },
+	{ .name =  "Cross Fader B",            .wValue = 0x0308, .wIndex = 0x8002 },
+	{ .name =  "MIC",                      .wValue = 0x0309, .wIndex = 0x8002 },
+	{ .name =  "REC OUT",                  .wValue = 0x030a, .wIndex = 0x8002 },
+};
+
+static const struct snd_pioneer_djm_option snd_pioneer_djm_options_djm900nxs2_capture_ch4[] = {
+	{ .name =  "CH4 Control Tone LINE",    .wValue = 0x0400, .wIndex = 0x8002 },
+	{ .name =  "CH4 Control Tone DITITAL", .wValue = 0x0402, .wIndex = 0x8002 },
+	{ .name =  "CH4 Control Tone PHONO",   .wValue = 0x0403, .wIndex = 0x8002 },
+	{ .name =  "Post CH4 Fader",           .wValue = 0x0406, .wIndex = 0x8002 },
+	{ .name =  "Cross Fader A",            .wValue = 0x0407, .wIndex = 0x8002 },
+	{ .name =  "Cross Fader B",            .wValue = 0x0408, .wIndex = 0x8002 },
+	{ .name =  "MIC",                      .wValue = 0x0409, .wIndex = 0x8002 },
+	{ .name =  "REC OUT",                  .wValue = 0x040a, .wIndex = 0x8002 },
+};
+
+static const struct snd_pioneer_djm_option snd_pioneer_djm_options_djm900nxs2_capture_ch5[] = {
+	{ .name =  "Cross Fader A",            .wValue = 0x0507, .wIndex = 0x8002 },
+	{ .name =  "Cross Fader B",            .wValue = 0x0508, .wIndex = 0x8002 },
+	{ .name =  "MIC",                      .wValue = 0x0509, .wIndex = 0x8002 },
+	{ .name =  "REC OUT",                  .wValue = 0x050a, .wIndex = 0x8002 },
+	{ .name =  "Post Fader A",             .wValue = 0x050b, .wIndex = 0x8002 },
+	{ .name =  "Post Fader B",             .wValue = 0x050c, .wIndex = 0x8002 },
+	{ .name =  "Post Fader C",             .wValue = 0x050d, .wIndex = 0x8002 },
+	{ .name =  "Post Fader D",             .wValue = 0x050e, .wIndex = 0x8002 },
+};
+
+static const struct snd_pioneer_djm_option_group snd_pioneer_djm900nxs2_option_groups[] = {
+	snd_pioneer_djm_option_group_item("Capture Level", capture_level, 0),
+	snd_pioneer_djm_option_group_item("CH1 Input", djm900nxs2_capture_ch1, 2),
+	snd_pioneer_djm_option_group_item("CH2 Input", djm900nxs2_capture_ch2, 2),
+	snd_pioneer_djm_option_group_item("CH3 Input", djm900nxs2_capture_ch3, 2),
+	snd_pioneer_djm_option_group_item("CH4 Input", djm900nxs2_capture_ch4, 2),
+	snd_pioneer_djm_option_group_item("CH5 Input", djm900nxs2_capture_ch5, 3),
+};
+
 static const struct snd_pioneer_djm_device snd_pioneer_djm_devices[] = {
 	{ .name = "DJM-250Mk2", .controls = snd_pioneer_djm250mk2_option_groups, .ncontrols = 7},
-	{ .name = "DJM-750", .controls = snd_pioneer_djm750_option_groups, .ncontrols = 5}
+	{ .name = "DJM-750", .controls = snd_pioneer_djm750_option_groups, .ncontrols = 5},
+	{ .name = "DJM-900NXS2", .controls = snd_pioneer_djm900nxs2_option_groups, .ncontrols = 6}
 };
 
 // layout of the kcontrol->private_value:
@@ -3020,6 +3087,10 @@ int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer)
 	case USB_ID(0x08e4, 0x017f): /* Pioneer DJ DJM-750 */
 		err = snd_pioneer_djm_controls_create(mixer, 0x01);
 		break;
+	case USB_ID(0x2b73, 0x000a): /* Pioneer DJ DJM-900NXS2 */
+		err = snd_pioneer_djm_controls_create(mixer, 0x02);
+		break;
+
 	}
 
 	return err;
-- 
2.30.0


             reply	other threads:[~2021-02-01 21:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-01 21:22 Fabian Lesniak [this message]
2021-02-02 11:37 ` [PATCH] ALSA: usb-audio: add mixer quirks for Pioneer DJM-900NXS2 Takashi Iwai
2021-02-02 11:49   ` Fabian Lesniak
2021-02-02 12:12     ` Takashi Iwai
2021-02-05 21:51       ` [PATCH v2 0/1] add mixer quirks for DJM-900NXS2 Fabian Lesniak
2021-02-05 21:51         ` [PATCH v2 1/1] ALSA: usb-audio: add mixer quirks for Pioneer DJM-900NXS2 Fabian Lesniak
2021-02-05 22:19           ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210201212248.54364-1-fabian@lesniak-it.de \
    --to=fabian@lesniak-it.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=franta-linux@frantovo.cz \
    --cc=livvy@base.nu \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.