[PATCH 0/4]: ALSA: usb-audio: Add Pioneer DJM-850 support
Hello,
This patches serie adds support for the Pioneer DJM-850 mixer. The mixer has a 24bits (little endian) sound card, which features 4 stereo channels for capture and 4 stereo channels for playback. The mixer also has controls to specify the capture source for each channels, and also a control to set the sample rate (44.1kHz, 48kHz, 96kHz).
Thank you :)
Signed-off-by: Nicolas MURE nicolas.mure2019@gmail.com
Declare the Pioneer DJM-850 interfaces for capture and playback.
See https://github.com/nm2107/Pioneer-DJM-850-driver-reverse-engineering /blob/172fb9a61055960c88c67b7c416fe5bf3609807b /doc/usb-device-specifications.md
for the complete device spec.
Signed-off-by: Nicolas MURE nicolas.mure2019@gmail.com --- sound/usb/quirks-table.h | 63 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+)
diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h index 1165a5ac60f2..9716a9f7c095 100644 --- a/sound/usb/quirks-table.h +++ b/sound/usb/quirks-table.h @@ -3817,6 +3817,69 @@ AU0828_DEVICE(0x2040, 0x7270, "Hauppauge", "HVR-950Q"), } } }, +{ + /* + * Pioneer DJ DJM-850 + * 8 channels playback and 8 channels capture @ 44.1/48/96kHz S24LE + * Playback on EP 0x05 + * Capture on EP 0x86 + */ + USB_DEVICE_VENDOR_SPEC(0x08e4, 0x0163), + .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 = 8, + .iface = 0, + .altsetting = 1, + .altset_idx = 1, + .endpoint = 0x05, + .ep_attr = USB_ENDPOINT_XFER_ISOC| + USB_ENDPOINT_SYNC_ASYNC| + USB_ENDPOINT_USAGE_DATA, + .rates = SNDRV_PCM_RATE_44100| + SNDRV_PCM_RATE_48000| + SNDRV_PCM_RATE_96000, + .rate_min = 44100, + .rate_max = 96000, + .nr_rates = 3, + .rate_table = (unsigned int[]) { 44100, 48000, 96000 } + } + }, + { + .ifnum = 0, + .type = QUIRK_AUDIO_FIXED_ENDPOINT, + .data = &(const struct audioformat) { + .formats = SNDRV_PCM_FMTBIT_S24_3LE, + .channels = 8, + .iface = 0, + .altsetting = 1, + .altset_idx = 1, + .endpoint = 0x86, + .ep_idx = 1, + .ep_attr = USB_ENDPOINT_XFER_ISOC| + USB_ENDPOINT_SYNC_ASYNC| + USB_ENDPOINT_USAGE_DATA, + .rates = SNDRV_PCM_RATE_44100| + SNDRV_PCM_RATE_48000| + SNDRV_PCM_RATE_96000, + .rate_min = 44100, + .rate_max = 96000, + .nr_rates = 3, + .rate_table = (unsigned int[]) { 44100, 48000, 96000 } + } + }, + { + .ifnum = -1 + } + } + } +}, { /* * Pioneer DJ DJM-450
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;
Send an `URB_CONTROL out` USB frame to the device to configure its samplerate. This should be done before using the device for audio streaming (capture or playback).
About the change of `usb_rcvctrlpipe` to `usb_sndctrlpipe`, I reached the author of this line and she agrees about this change. Control frames to set device options should have the `out` direction instead of the `in` direction.
See https://github.com/nm2107/Pioneer-DJM-850-driver-reverse-engineering /blob/172fb9a61055960c88c67b7c416fe5bf3609807b /doc/windows-dvs/framerate-setting/README.md
Signed-off-by: Nicolas MURE nicolas.mure2019@gmail.com --- sound/usb/quirks.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index 9ba4682ebc48..d02dac5fcd40 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -1482,7 +1482,7 @@ static int pioneer_djm_set_format_quirk(struct snd_usb_substream *subs, usb_set_interface(subs->dev, 0, 1); // we should derive windex from fmt-sync_ep but it's not set snd_usb_ctl_msg(subs->stream->chip->dev, - usb_rcvctrlpipe(subs->stream->chip->dev, 0), + usb_sndctrlpipe(subs->stream->chip->dev, 0), 0x01, 0x22, 0x0100, windex, &sr, 0x0003); return 0; } @@ -1503,6 +1503,9 @@ void snd_usb_set_format_quirk(struct snd_usb_substream *subs, case USB_ID(0x2b73, 0x0013): /* Pioneer DJM-450 */ pioneer_djm_set_format_quirk(subs, 0x0082); break; + case USB_ID(0x08e4, 0x0163): /* Pioneer DJM-850 */ + pioneer_djm_set_format_quirk(subs, 0x0086); + break; } }
On Fri, 26 Feb 2021 14:34:28 +0100, Nicolas MURE wrote:
Send an `URB_CONTROL out` USB frame to the device to configure its samplerate. This should be done before using the device for audio streaming (capture or playback).
About the change of `usb_rcvctrlpipe` to `usb_sndctrlpipe`, I reached the author of this line and she agrees about this change. Control frames to set device options should have the `out` direction instead of the `in` direction.
This specific fix should be applied separately for 5.12. Could you split this one and submit as an individual fix?
I'm currently thinking of merging the rest for 5.13, as 5.12 merge window was already closed.
thanks,
Takashi
See https://github.com/nm2107/Pioneer-DJM-850-driver-reverse-engineering /blob/172fb9a61055960c88c67b7c416fe5bf3609807b /doc/windows-dvs/framerate-setting/README.md
Signed-off-by: Nicolas MURE nicolas.mure2019@gmail.com
sound/usb/quirks.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index 9ba4682ebc48..d02dac5fcd40 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -1482,7 +1482,7 @@ static int pioneer_djm_set_format_quirk(struct snd_usb_substream *subs, usb_set_interface(subs->dev, 0, 1); // we should derive windex from fmt-sync_ep but it's not set snd_usb_ctl_msg(subs->stream->chip->dev,
usb_rcvctrlpipe(subs->stream->chip->dev, 0),
0x01, 0x22, 0x0100, windex, &sr, 0x0003); return 0;usb_sndctrlpipe(subs->stream->chip->dev, 0),
} @@ -1503,6 +1503,9 @@ void snd_usb_set_format_quirk(struct snd_usb_substream *subs, case USB_ID(0x2b73, 0x0013): /* Pioneer DJM-450 */ pioneer_djm_set_format_quirk(subs, 0x0082); break;
- case USB_ID(0x08e4, 0x0163): /* Pioneer DJM-850 */
pioneer_djm_set_format_quirk(subs, 0x0086);
}break;
}
-- 2.29.2
Hello,
I updated the patches to consider the request to split patch #3 (c.f. https://mailman.alsa-project.org/pipermail/alsa-devel/2021-March/181275.html ).
The patch #3 now only contains changes related to DJM-850 support as the fix it was previously containing was applied in linux 5.12 (c.f. https://mailman.alsa-project.org/pipermail/alsa-devel/2021-March/181279.html ).
The patches should be ready to merge into linux 5.13 .
Thank you :)
Patches list :
[PATCH v2 1/4] ALSA: usb-audio: Add Pioneer DJM-850 to quirks-table [PATCH v2 2/4] ASLA: usb-audio: Declare Pioneer DJM-850 mixer [PATCH v2 3/4] ALSA: usb-audio: Configure Pioneer DJM-850 samplerate [PATCH v2 4/4] ASLA: usb-audio: fix Pioneer DJM-850 control label
Declare the Pioneer DJM-850 interfaces for capture and playback.
See https://github.com/nm2107/Pioneer-DJM-850-driver-reverse-engineering/blob/17... for the complete device spec.
Signed-off-by: Nicolas MURE nicolas.mure2019@gmail.com --- sound/usb/quirks-table.h | 63 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+)
diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h index 1165a5ac60f2..9716a9f7c095 100644 --- a/sound/usb/quirks-table.h +++ b/sound/usb/quirks-table.h @@ -3817,6 +3817,69 @@ AU0828_DEVICE(0x2040, 0x7270, "Hauppauge", "HVR-950Q"), } } }, +{ + /* + * Pioneer DJ DJM-850 + * 8 channels playback and 8 channels capture @ 44.1/48/96kHz S24LE + * Playback on EP 0x05 + * Capture on EP 0x86 + */ + USB_DEVICE_VENDOR_SPEC(0x08e4, 0x0163), + .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 = 8, + .iface = 0, + .altsetting = 1, + .altset_idx = 1, + .endpoint = 0x05, + .ep_attr = USB_ENDPOINT_XFER_ISOC| + USB_ENDPOINT_SYNC_ASYNC| + USB_ENDPOINT_USAGE_DATA, + .rates = SNDRV_PCM_RATE_44100| + SNDRV_PCM_RATE_48000| + SNDRV_PCM_RATE_96000, + .rate_min = 44100, + .rate_max = 96000, + .nr_rates = 3, + .rate_table = (unsigned int[]) { 44100, 48000, 96000 } + } + }, + { + .ifnum = 0, + .type = QUIRK_AUDIO_FIXED_ENDPOINT, + .data = &(const struct audioformat) { + .formats = SNDRV_PCM_FMTBIT_S24_3LE, + .channels = 8, + .iface = 0, + .altsetting = 1, + .altset_idx = 1, + .endpoint = 0x86, + .ep_idx = 1, + .ep_attr = USB_ENDPOINT_XFER_ISOC| + USB_ENDPOINT_SYNC_ASYNC| + USB_ENDPOINT_USAGE_DATA, + .rates = SNDRV_PCM_RATE_44100| + SNDRV_PCM_RATE_48000| + SNDRV_PCM_RATE_96000, + .rate_min = 44100, + .rate_max = 96000, + .nr_rates = 3, + .rate_table = (unsigned int[]) { 44100, 48000, 96000 } + } + }, + { + .ifnum = -1 + } + } + } +}, { /* * Pioneer DJ DJM-450
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/17...
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;
Send an `URB_CONTROL out` USB frame to the device to configure its samplerate. This should be done before using the device for audio streaming (capture or playback).
See https://github.com/nm2107/Pioneer-DJM-850-driver-reverse-engineering/blob/17...
Signed-off-by: Nicolas MURE nicolas.mure2019@gmail.com --- sound/usb/quirks.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index 737b2729c0d3..d02dac5fcd40 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -1503,6 +1503,9 @@ void snd_usb_set_format_quirk(struct snd_usb_substream *subs, case USB_ID(0x2b73, 0x0013): /* Pioneer DJM-450 */ pioneer_djm_set_format_quirk(subs, 0x0082); break; + case USB_ID(0x08e4, 0x0163): /* Pioneer DJM-850 */ + pioneer_djm_set_format_quirk(subs, 0x0086); + break; } }
Unlike the other DJM, the value to set the "CD/LINE" and "LINE" capture control options are inverted. This fix makes sure that the displayed info label while using `alsamixer` matches the input switches label on the DJM-850 mixer.
Signed-off-by: Nicolas MURE nicolas.mure2019@gmail.com --- sound/usb/mixer_quirks.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-)
diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c index b325b6597d91..5b77e8140ba6 100644 --- a/sound/usb/mixer_quirks.c +++ b/sound/usb/mixer_quirks.c @@ -2693,7 +2693,7 @@ static const char *snd_djm_get_label_caplevel(u16 wvalue) } };
-static const char *snd_djm_get_label_cap(u16 wvalue) +static const char *snd_djm_get_label_cap_common(u16 wvalue) { switch (wvalue & 0x00ff) { case SND_DJM_CAP_LINE: return "Control Tone LINE"; @@ -2715,6 +2715,25 @@ static const char *snd_djm_get_label_cap(u16 wvalue) } };
+// The DJM-850 has different values for CD/LINE and LINE capture +// control options than the other DJM declared in this file. +static const char *snd_djm_get_label_cap_850(u16 wvalue) +{ + switch (wvalue & 0x00ff) { + case 0x00: return "Control Tone CD/LINE"; + case 0x01: return "Control Tone LINE"; + default: return snd_djm_get_label_cap_common(wvalue); + } +}; + +static const char *snd_djm_get_label_cap(u8 device_idx, u16 wvalue) +{ + switch (device_idx) { + case SND_DJM_850_IDX: return snd_djm_get_label_cap_850(wvalue); + default: return snd_djm_get_label_cap_common(wvalue); + } +}; + static const char *snd_djm_get_label_pb(u16 wvalue) { switch (wvalue & 0x00ff) { @@ -2725,11 +2744,11 @@ static const char *snd_djm_get_label_pb(u16 wvalue) } };
-static const char *snd_djm_get_label(u16 wvalue, u16 windex) +static const char *snd_djm_get_label(u8 device_idx, u16 wvalue, u16 windex) { switch (windex) { case SND_DJM_WINDEX_CAPLVL: return snd_djm_get_label_caplevel(wvalue); - case SND_DJM_WINDEX_CAP: return snd_djm_get_label_cap(wvalue); + case SND_DJM_WINDEX_CAP: return snd_djm_get_label_cap(device_idx, wvalue); case SND_DJM_WINDEX_PB: return snd_djm_get_label_pb(wvalue); default: return NULL; } @@ -2852,7 +2871,8 @@ static int snd_djm_controls_info(struct snd_kcontrol *kctl, if (info->value.enumerated.item >= noptions) info->value.enumerated.item = noptions - 1;
- name = snd_djm_get_label(ctl->options[info->value.enumerated.item], + name = snd_djm_get_label(device_idx, + ctl->options[info->value.enumerated.item], ctl->wIndex); if (!name) return -EINVAL;
On Mon, 01 Mar 2021 16:27:25 +0100, Nicolas MURE wrote:
Hello,
I updated the patches to consider the request to split patch #3 (c.f. https://mailman.alsa-project.org/pipermail/alsa-devel/2021-March/181275.html ).
The patch #3 now only contains changes related to DJM-850 support as the fix it was previously containing was applied in linux 5.12 (c.f. https://mailman.alsa-project.org/pipermail/alsa-devel/2021-March/181279.html ).
The patches should be ready to merge into linux 5.13 .
Thank you :)
Patches list :
[PATCH v2 1/4] ALSA: usb-audio: Add Pioneer DJM-850 to quirks-table [PATCH v2 2/4] ASLA: usb-audio: Declare Pioneer DJM-850 mixer [PATCH v2 3/4] ALSA: usb-audio: Configure Pioneer DJM-850 samplerate [PATCH v2 4/4] ASLA: usb-audio: fix Pioneer DJM-850 control label
Applied all four patches now (with correction of subject prefix :)
thanks,
Takashi
Unlike the other DJM, the value to set the "CD/LINE" and "LINE" capture control options are inverted. This fix makes sure that the displayed info label while using `alsamixer` matches the input switches label on the DJM-850 mixer.
Signed-off-by: Nicolas MURE nicolas.mure2019@gmail.com --- sound/usb/mixer_quirks.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-)
diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c index b325b6597d91..5b77e8140ba6 100644 --- a/sound/usb/mixer_quirks.c +++ b/sound/usb/mixer_quirks.c @@ -2693,7 +2693,7 @@ static const char *snd_djm_get_label_caplevel(u16 wvalue) } };
-static const char *snd_djm_get_label_cap(u16 wvalue) +static const char *snd_djm_get_label_cap_common(u16 wvalue) { switch (wvalue & 0x00ff) { case SND_DJM_CAP_LINE: return "Control Tone LINE"; @@ -2715,6 +2715,25 @@ static const char *snd_djm_get_label_cap(u16 wvalue) } };
+// The DJM-850 has different values for CD/LINE and LINE capture +// control options than the other DJM declared in this file. +static const char *snd_djm_get_label_cap_850(u16 wvalue) +{ + switch (wvalue & 0x00ff) { + case 0x00: return "Control Tone CD/LINE"; + case 0x01: return "Control Tone LINE"; + default: return snd_djm_get_label_cap_common(wvalue); + } +}; + +static const char *snd_djm_get_label_cap(u8 device_idx, u16 wvalue) +{ + switch (device_idx) { + case SND_DJM_850_IDX: return snd_djm_get_label_cap_850(wvalue); + default: return snd_djm_get_label_cap_common(wvalue); + } +}; + static const char *snd_djm_get_label_pb(u16 wvalue) { switch (wvalue & 0x00ff) { @@ -2725,11 +2744,11 @@ static const char *snd_djm_get_label_pb(u16 wvalue) } };
-static const char *snd_djm_get_label(u16 wvalue, u16 windex) +static const char *snd_djm_get_label(u8 device_idx, u16 wvalue, u16 windex) { switch (windex) { case SND_DJM_WINDEX_CAPLVL: return snd_djm_get_label_caplevel(wvalue); - case SND_DJM_WINDEX_CAP: return snd_djm_get_label_cap(wvalue); + case SND_DJM_WINDEX_CAP: return snd_djm_get_label_cap(device_idx, wvalue); case SND_DJM_WINDEX_PB: return snd_djm_get_label_pb(wvalue); default: return NULL; } @@ -2852,7 +2871,8 @@ static int snd_djm_controls_info(struct snd_kcontrol *kctl, if (info->value.enumerated.item >= noptions) info->value.enumerated.item = noptions - 1;
- name = snd_djm_get_label(ctl->options[info->value.enumerated.item], + name = snd_djm_get_label(device_idx, + ctl->options[info->value.enumerated.item], ctl->wIndex); if (!name) return -EINVAL;
participants (2)
-
Nicolas MURE
-
Takashi Iwai