[PATCH] ALSA: usb-audio: add mixer quirks for Pioneer DJM-900NXS2
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;
On Mon, 01 Feb 2021 22:22:47 +0100, Fabian Lesniak wrote:
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
Which tree / branch is this patch based on? It doesn't seem applying cleanly either on for-linus or for-next branch.
thanks,
Takashi
This patch is based upon Olivia's patch "ALSA: usb-audio: Add DJM750 to Pioneer mixer quirk" and applies cleanly after that one on v5.11-rc6. If Olivia improves the original patch, I will send this one again as well.
If there is some means to express such dependencies between patches, I'm sorry for not doing so.
Cheers Fabian
Am Dienstag, 2. Februar 2021, 12:37:12 CET schrieb Takashi Iwai:
On Mon, 01 Feb 2021 22:22:47 +0100,
Fabian Lesniak wrote:
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
Which tree / branch is this patch based on? It doesn't seem applying cleanly either on for-linus or for-next branch.
thanks,
Takashi
On Tue, 02 Feb 2021 12:49:03 +0100, Fabian Lesniak wrote:
This patch is based upon Olivia's patch "ALSA: usb-audio: Add DJM750 to Pioneer mixer quirk" and applies cleanly after that one on v5.11-rc6. If Olivia improves the original patch, I will send this one again as well.
If there is some means to express such dependencies between patches, I'm sorry for not doing so.
Alright, let's wait until Olivia's patches get merged.
thanks,
Takashi
Cheers Fabian
Am Dienstag, 2. Februar 2021, 12:37:12 CET schrieb Takashi Iwai:
On Mon, 01 Feb 2021 22:22:47 +0100,
Fabian Lesniak wrote:
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
Which tree / branch is this patch based on? It doesn't seem applying cleanly either on for-linus or for-next branch.
thanks,
Takashi
Here is a reworked version of my previous patch for DJM-900NXS2 mixer quirks. It is now based on "[PATCH v4 1/1] ALSA: usb-audio: Add DJM750 to Pioneer mixer quirk" and should apply cleanly after it on sound/master. Thanks to Olivia's work, this patch is now much shorter.
Fabian Lesniak (1): ALSA: usb-audio: add mixer quirks for Pioneer DJM-900NXS2
sound/usb/mixer_quirks.c | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-)
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.
Signed-off-by: Fabian Lesniak fabian@lesniak-it.de --- sound/usb/mixer_quirks.c | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-)
diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c index 9d0ac2aa9044..08873d2afe4d 100644 --- a/sound/usb/mixer_quirks.c +++ b/sound/usb/mixer_quirks.c @@ -2618,6 +2618,7 @@ static int snd_bbfpro_controls_create(struct usb_mixer_interface *mixer) // Capture types #define SND_DJM_CAP_LINE 0x00 #define SND_DJM_CAP_CDLINE 0x01 +#define SND_DJM_CAP_DIGITAL 0x02 #define SND_DJM_CAP_PHONO 0x03 #define SND_DJM_CAP_PFADER 0x06 #define SND_DJM_CAP_XFADERA 0x07 @@ -2628,6 +2629,8 @@ static int snd_bbfpro_controls_create(struct usb_mixer_interface *mixer) #define SND_DJM_CAP_NONE 0x0f #define SND_DJM_CAP_CH1PFADER 0x11 #define SND_DJM_CAP_CH2PFADER 0x12 +#define SND_DJM_CAP_CH3PFADER 0x13 +#define SND_DJM_CAP_CH4PFADER 0x14
// Playback types #define SND_DJM_PB_CH1 0x00 @@ -2648,6 +2651,7 @@ static int snd_bbfpro_controls_create(struct usb_mixer_interface *mixer) // device table index #define SND_DJM_250MK2_IDX 0x0 #define SND_DJM_750_IDX 0x1 +#define SND_DJM_900NXS2_IDX 0x2
#define SND_DJM_CTL(_name, suffix, _default_value, _windex) { \ @@ -2692,6 +2696,7 @@ static const char *snd_djm_get_label_cap(u16 wvalue) switch (wvalue & 0x00ff) { case SND_DJM_CAP_LINE: return "Control Tone LINE"; case SND_DJM_CAP_CDLINE: return "Control Tone CD/LINE"; + case SND_DJM_CAP_DIGITAL: return "Control Tone DIGITAL"; case SND_DJM_CAP_PHONO: return "Control Tone PHONO"; case SND_DJM_CAP_PFADER: return "Post Fader"; case SND_DJM_CAP_XFADERA: return "Cross Fader A"; @@ -2702,6 +2707,8 @@ static const char *snd_djm_get_label_cap(u16 wvalue) case SND_DJM_CAP_NONE: return "None"; case SND_DJM_CAP_CH1PFADER: return "Post Fader Ch1"; case SND_DJM_CAP_CH2PFADER: return "Post Fader Ch2"; + case SND_DJM_CAP_CH3PFADER: return "Post Fader Ch3"; + case SND_DJM_CAP_CH4PFADER: return "Post Fader Ch4"; default: return NULL; } }; @@ -2774,9 +2781,32 @@ static const struct snd_djm_ctl snd_djm_ctls_750[] = { };
+// DJM-900NXS2 +static const u16 snd_djm_opts_900nxs2_cap1[] = { + 0x0100, 0x0102, 0x0103, 0x0106, 0x0107, 0x0108, 0x0109, 0x010a }; +static const u16 snd_djm_opts_900nxs2_cap2[] = { + 0x0200, 0x0202, 0x0203, 0x0206, 0x0207, 0x0208, 0x0209, 0x020a }; +static const u16 snd_djm_opts_900nxs2_cap3[] = { + 0x0300, 0x0302, 0x0303, 0x0306, 0x0307, 0x0308, 0x0309, 0x030a }; +static const u16 snd_djm_opts_900nxs2_cap4[] = { + 0x0400, 0x0402, 0x0403, 0x0406, 0x0407, 0x0408, 0x0409, 0x040a }; +static const u16 snd_djm_opts_900nxs2_cap5[] = { + 0x0507, 0x0508, 0x0509, 0x050a, 0x0511, 0x0512, 0x0513, 0x0514 }; + +static const struct snd_djm_ctl snd_djm_ctls_900nxs2[] = { + SND_DJM_CTL("Capture Level", cap_level, 0, SND_DJM_WINDEX_CAPLVL), + SND_DJM_CTL("Ch1 Input", 900nxs2_cap1, 2, SND_DJM_WINDEX_CAP), + SND_DJM_CTL("Ch2 Input", 900nxs2_cap2, 2, SND_DJM_WINDEX_CAP), + SND_DJM_CTL("Ch3 Input", 900nxs2_cap3, 2, SND_DJM_WINDEX_CAP), + SND_DJM_CTL("Ch4 Input", 900nxs2_cap4, 2, SND_DJM_WINDEX_CAP), + SND_DJM_CTL("Ch5 Input", 900nxs2_cap5, 3, SND_DJM_WINDEX_CAP) +}; + + static const struct snd_djm_device snd_djm_devices[] = { SND_DJM_DEVICE(250mk2), - SND_DJM_DEVICE(750) + SND_DJM_DEVICE(750), + SND_DJM_DEVICE(900nxs2) };
@@ -3015,6 +3045,9 @@ int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer) case USB_ID(0x08e4, 0x017f): /* Pioneer DJ DJM-750 */ err = snd_djm_controls_create(mixer, SND_DJM_750_IDX); break; + case USB_ID(0x2b73, 0x000a): /* Pioneer DJ DJM-900NXS2 */ + err = snd_djm_controls_create(mixer, SND_DJM_900NXS2_IDX); + break; }
return err;
On Fri, 05 Feb 2021 22:51:16 +0100, Fabian Lesniak wrote:
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.
Signed-off-by: Fabian Lesniak fabian@lesniak-it.de
Thanks, applied now.
Takashi
participants (2)
-
Fabian Lesniak
-
Takashi Iwai