From: Nicolas MURE <nicolas.mure2019@gmail.com>
To: tiwai@suse.de
Cc: Nicolas MURE <nicolas.mure2019@gmail.com>,
alsa-devel@alsa-project.org, livvy@base.nu
Subject: [PATCH v2 2/4] ASLA: usb-audio: Declare Pioneer DJM-850 mixer controls
Date: Mon, 1 Mar 2021 16:27:27 +0100 [thread overview]
Message-ID: <20210301152729.18094-3-nicolas.mure2019@gmail.com> (raw)
In-Reply-To: <20210301152729.18094-1-nicolas.mure2019@gmail.com>
Declare audio capture controls to choose the audio source, and also to
set the capture level (in dB).
See https://github.com/nm2107/Pioneer-DJM-850-driver-reverse-engineering/blob/172fb9a61055960c88c67b7c416fe5bf3609807b/doc/windows-djm-850-setting-utility/mixer-output-tab/README.md
Signed-off-by: Nicolas MURE <nicolas.mure2019@gmail.com>
---
sound/usb/mixer_quirks.c | 32 +++++++++++++++++++++++++++++---
1 file changed, 29 insertions(+), 3 deletions(-)
diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c
index 08873d2afe4d..b325b6597d91 100644
--- a/sound/usb/mixer_quirks.c
+++ b/sound/usb/mixer_quirks.c
@@ -2649,9 +2649,11 @@ static int snd_bbfpro_controls_create(struct usb_mixer_interface *mixer)
#define SND_DJM_DEVICE_SHIFT 24
// device table index
+// used for the snd_djm_devices table, so please update accordingly
#define SND_DJM_250MK2_IDX 0x0
#define SND_DJM_750_IDX 0x1
-#define SND_DJM_900NXS2_IDX 0x2
+#define SND_DJM_850_IDX 0x2
+#define SND_DJM_900NXS2_IDX 0x3
#define SND_DJM_CTL(_name, suffix, _default_value, _windex) { \
@@ -2733,11 +2735,12 @@ static const char *snd_djm_get_label(u16 wvalue, u16 windex)
}
};
-
-// DJM-250MK2
+// common DJM capture level option values
static const u16 snd_djm_opts_cap_level[] = {
0x0000, 0x0100, 0x0200, 0x0300 };
+
+// DJM-250MK2
static const u16 snd_djm_opts_250mk2_cap1[] = {
0x0103, 0x0100, 0x0106, 0x0107, 0x0108, 0x0109, 0x010d, 0x010a };
@@ -2781,6 +2784,25 @@ static const struct snd_djm_ctl snd_djm_ctls_750[] = {
};
+// DJM-850
+static const u16 snd_djm_opts_850_cap1[] = {
+ 0x0100, 0x0103, 0x0106, 0x0107, 0x0108, 0x0109, 0x010a, 0x010f };
+static const u16 snd_djm_opts_850_cap2[] = {
+ 0x0200, 0x0201, 0x0206, 0x0207, 0x0208, 0x0209, 0x020a, 0x020f };
+static const u16 snd_djm_opts_850_cap3[] = {
+ 0x0300, 0x0301, 0x0306, 0x0307, 0x0308, 0x0309, 0x030a, 0x030f };
+static const u16 snd_djm_opts_850_cap4[] = {
+ 0x0400, 0x0403, 0x0406, 0x0407, 0x0408, 0x0409, 0x040a, 0x040f };
+
+static const struct snd_djm_ctl snd_djm_ctls_850[] = {
+ SND_DJM_CTL("Capture Level", cap_level, 0, SND_DJM_WINDEX_CAPLVL),
+ SND_DJM_CTL("Ch1 Input", 850_cap1, 1, SND_DJM_WINDEX_CAP),
+ SND_DJM_CTL("Ch2 Input", 850_cap2, 0, SND_DJM_WINDEX_CAP),
+ SND_DJM_CTL("Ch3 Input", 850_cap3, 0, SND_DJM_WINDEX_CAP),
+ SND_DJM_CTL("Ch4 Input", 850_cap4, 1, SND_DJM_WINDEX_CAP)
+};
+
+
// DJM-900NXS2
static const u16 snd_djm_opts_900nxs2_cap1[] = {
0x0100, 0x0102, 0x0103, 0x0106, 0x0107, 0x0108, 0x0109, 0x010a };
@@ -2806,6 +2828,7 @@ static const struct snd_djm_ctl snd_djm_ctls_900nxs2[] = {
static const struct snd_djm_device snd_djm_devices[] = {
SND_DJM_DEVICE(250mk2),
SND_DJM_DEVICE(750),
+ SND_DJM_DEVICE(850),
SND_DJM_DEVICE(900nxs2)
};
@@ -3045,6 +3068,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(0x08e4, 0x0163): /* Pioneer DJ DJM-850 */
+ err = snd_djm_controls_create(mixer, SND_DJM_850_IDX);
+ break;
case USB_ID(0x2b73, 0x000a): /* Pioneer DJ DJM-900NXS2 */
err = snd_djm_controls_create(mixer, SND_DJM_900NXS2_IDX);
break;
--
2.29.2
next prev parent reply other threads:[~2021-03-01 15:30 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-26 13:34 [PATCH 0/4]: ALSA: usb-audio: Add Pioneer DJM-850 support Nicolas MURE
2021-02-26 13:34 ` [PATCH 1/4] ALSA: usb-audio: Add Pioneer DJM-850 to quirks-table Nicolas MURE
2021-02-26 13:34 ` [PATCH 2/4] ASLA: usb-audio: Declare Pioneer DJM-850 mixer controls Nicolas MURE
2021-02-26 13:34 ` [PATCH 3/4] ALSA: usb-audio: Configure Pioneer DJM-850 samplerate Nicolas MURE
2021-03-01 13:58 ` Takashi Iwai
2021-03-01 15:27 ` [PATCH v2 0/4] ALSA: usb-audio: Add Pioneer DJM-850 support Nicolas MURE
2021-03-01 15:27 ` [PATCH v2 1/4] ALSA: usb-audio: Add Pioneer DJM-850 to quirks-table Nicolas MURE
2021-03-01 15:27 ` Nicolas MURE [this message]
2021-03-01 15:27 ` [PATCH v2 3/4] ALSA: usb-audio: Configure Pioneer DJM-850 samplerate Nicolas MURE
2021-03-01 15:27 ` [PATCH v2 4/4] ASLA: usb-audio: fix Pioneer DJM-850 control label info Nicolas MURE
2021-03-02 9:20 ` [PATCH v2 0/4] ALSA: usb-audio: Add Pioneer DJM-850 support Takashi Iwai
2021-02-26 13:34 ` [PATCH 4/4] ASLA: usb-audio: fix Pioneer DJM-850 control label info Nicolas MURE
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=20210301152729.18094-3-nicolas.mure2019@gmail.com \
--to=nicolas.mure2019@gmail.com \
--cc=alsa-devel@alsa-project.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox