@@ -3498,7 +3498,7 @@ static int snd_rme_digiface_controls_create(struct usb_mixer_interface *mixer)
34983498}
34993499
35003500/*
3501- * Pioneer DJ DJM Mixers
3501+ * Pioneer DJ / AlphaTheta DJM Mixers
35023502 *
35033503 * These devices generally have options for soft-switching the playback and
35043504 * capture sources in addition to the recording level. Although different
@@ -3515,17 +3515,23 @@ static int snd_rme_digiface_controls_create(struct usb_mixer_interface *mixer)
35153515#define SND_DJM_CAP_CDLINE 0x01
35163516#define SND_DJM_CAP_DIGITAL 0x02
35173517#define SND_DJM_CAP_PHONO 0x03
3518+ #define SND_DJM_CAP_PREFADER 0x05
35183519#define SND_DJM_CAP_PFADER 0x06
35193520#define SND_DJM_CAP_XFADERA 0x07
35203521#define SND_DJM_CAP_XFADERB 0x08
35213522#define SND_DJM_CAP_MIC 0x09
35223523#define SND_DJM_CAP_AUX 0x0d
35233524#define SND_DJM_CAP_RECOUT 0x0a
3525+ #define SND_DJM_CAP_RECOUT_NOMIC 0x0e
35243526#define SND_DJM_CAP_NONE 0x0f
35253527#define SND_DJM_CAP_CH1PFADER 0x11
35263528#define SND_DJM_CAP_CH2PFADER 0x12
35273529#define SND_DJM_CAP_CH3PFADER 0x13
35283530#define SND_DJM_CAP_CH4PFADER 0x14
3531+ #define SND_DJM_CAP_CH1PREFADER 0x31
3532+ #define SND_DJM_CAP_CH2PREFADER 0x32
3533+ #define SND_DJM_CAP_CH3PREFADER 0x33
3534+ #define SND_DJM_CAP_CH4PREFADER 0x34
35293535
35303536// Playback types
35313537#define SND_DJM_PB_CH1 0x00
@@ -3551,6 +3557,7 @@ static int snd_rme_digiface_controls_create(struct usb_mixer_interface *mixer)
35513557#define SND_DJM_900NXS2_IDX 0x3
35523558#define SND_DJM_750MK2_IDX 0x4
35533559#define SND_DJM_450_IDX 0x5
3560+ #define SND_DJM_A9_IDX 0x6
35543561
35553562
35563563#define SND_DJM_CTL (_name , suffix , _default_value , _windex ) { \
@@ -3579,7 +3586,7 @@ struct snd_djm_ctl {
35793586 u16 wIndex ;
35803587};
35813588
3582- static const char * snd_djm_get_label_caplevel (u16 wvalue )
3589+ static const char * snd_djm_get_label_caplevel_common (u16 wvalue )
35833590{
35843591 switch (wvalue ) {
35853592 case 0x0000 : return "-19dB" ;
@@ -3590,6 +3597,20 @@ static const char *snd_djm_get_label_caplevel(u16 wvalue)
35903597 }
35913598};
35923599
3600+ // The DJM-A9 has different capture levels than other, older models
3601+ static const char * snd_djm_get_label_caplevel_a9 (u16 wvalue )
3602+ {
3603+ switch (wvalue ) {
3604+ case 0x0000 : return "+15dB" ;
3605+ case 0x0100 : return "+12dB" ;
3606+ case 0x0200 : return "+9dB" ;
3607+ case 0x0300 : return "+6dB" ;
3608+ case 0x0400 : return "+3dB" ;
3609+ case 0x0500 : return "0dB" ;
3610+ default : return NULL ;
3611+ }
3612+ };
3613+
35933614static const char * snd_djm_get_label_cap_common (u16 wvalue )
35943615{
35953616 switch (wvalue & 0x00ff ) {
@@ -3602,8 +3623,13 @@ static const char *snd_djm_get_label_cap_common(u16 wvalue)
36023623 case SND_DJM_CAP_XFADERB : return "Cross Fader B" ;
36033624 case SND_DJM_CAP_MIC : return "Mic" ;
36043625 case SND_DJM_CAP_RECOUT : return "Rec Out" ;
3626+ case SND_DJM_CAP_RECOUT_NOMIC : return "Rec Out without Mic" ;
36053627 case SND_DJM_CAP_AUX : return "Aux" ;
36063628 case SND_DJM_CAP_NONE : return "None" ;
3629+ case SND_DJM_CAP_CH1PREFADER : return "Pre Fader Ch1" ;
3630+ case SND_DJM_CAP_CH2PREFADER : return "Pre Fader Ch2" ;
3631+ case SND_DJM_CAP_CH3PREFADER : return "Pre Fader Ch3" ;
3632+ case SND_DJM_CAP_CH4PREFADER : return "Pre Fader Ch4" ;
36073633 case SND_DJM_CAP_CH1PFADER : return "Post Fader Ch1" ;
36083634 case SND_DJM_CAP_CH2PFADER : return "Post Fader Ch2" ;
36093635 case SND_DJM_CAP_CH3PFADER : return "Post Fader Ch3" ;
@@ -3623,6 +3649,14 @@ static const char *snd_djm_get_label_cap_850(u16 wvalue)
36233649 }
36243650};
36253651
3652+ static const char * snd_djm_get_label_caplevel (u8 device_idx , u16 wvalue )
3653+ {
3654+ switch (device_idx ) {
3655+ case SND_DJM_A9_IDX : return snd_djm_get_label_caplevel_a9 (wvalue );
3656+ default : return snd_djm_get_label_caplevel_common (wvalue );
3657+ }
3658+ };
3659+
36263660static const char * snd_djm_get_label_cap (u8 device_idx , u16 wvalue )
36273661{
36283662 switch (device_idx ) {
@@ -3644,7 +3678,7 @@ static const char *snd_djm_get_label_pb(u16 wvalue)
36443678static const char * snd_djm_get_label (u8 device_idx , u16 wvalue , u16 windex )
36453679{
36463680 switch (windex ) {
3647- case SND_DJM_WINDEX_CAPLVL : return snd_djm_get_label_caplevel (wvalue );
3681+ case SND_DJM_WINDEX_CAPLVL : return snd_djm_get_label_caplevel (device_idx , wvalue );
36483682 case SND_DJM_WINDEX_CAP : return snd_djm_get_label_cap (device_idx , wvalue );
36493683 case SND_DJM_WINDEX_PB : return snd_djm_get_label_pb (wvalue );
36503684 default : return NULL ;
@@ -3653,7 +3687,7 @@ static const char *snd_djm_get_label(u8 device_idx, u16 wvalue, u16 windex)
36533687
36543688// common DJM capture level option values
36553689static const u16 snd_djm_opts_cap_level [] = {
3656- 0x0000 , 0x0100 , 0x0200 , 0x0300 };
3690+ 0x0000 , 0x0100 , 0x0200 , 0x0300 , 0x400 , 0x500 };
36573691
36583692
36593693// DJM-250MK2
@@ -3795,13 +3829,36 @@ static const struct snd_djm_ctl snd_djm_ctls_750mk2[] = {
37953829};
37963830
37973831
3832+ // DJM-A9
3833+ static const u16 snd_djm_opts_a9_cap1 [] = {
3834+ 0x0107 , 0x0108 , 0x0109 , 0x010a , 0x010e ,
3835+ 0x111 , 0x112 , 0x113 , 0x114 , 0x0131 , 0x132 , 0x133 , 0x134 };
3836+ static const u16 snd_djm_opts_a9_cap2 [] = {
3837+ 0x0201 , 0x0202 , 0x0203 , 0x0205 , 0x0206 , 0x0207 , 0x0208 , 0x0209 , 0x020a , 0x020e };
3838+ static const u16 snd_djm_opts_a9_cap3 [] = {
3839+ 0x0301 , 0x0302 , 0x0303 , 0x0305 , 0x0306 , 0x0307 , 0x0308 , 0x0309 , 0x030a , 0x030e };
3840+ static const u16 snd_djm_opts_a9_cap4 [] = {
3841+ 0x0401 , 0x0402 , 0x0403 , 0x0405 , 0x0406 , 0x0407 , 0x0408 , 0x0409 , 0x040a , 0x040e };
3842+ static const u16 snd_djm_opts_a9_cap5 [] = {
3843+ 0x0501 , 0x0502 , 0x0503 , 0x0505 , 0x0506 , 0x0507 , 0x0508 , 0x0509 , 0x050a , 0x050e };
3844+
3845+ static const struct snd_djm_ctl snd_djm_ctls_a9 [] = {
3846+ SND_DJM_CTL ("Capture Level" , cap_level , 0 , SND_DJM_WINDEX_CAPLVL ),
3847+ SND_DJM_CTL ("Master Input" , a9_cap1 , 3 , SND_DJM_WINDEX_CAP ),
3848+ SND_DJM_CTL ("Ch1 Input" , a9_cap2 , 2 , SND_DJM_WINDEX_CAP ),
3849+ SND_DJM_CTL ("Ch2 Input" , a9_cap3 , 2 , SND_DJM_WINDEX_CAP ),
3850+ SND_DJM_CTL ("Ch3 Input" , a9_cap4 , 2 , SND_DJM_WINDEX_CAP ),
3851+ SND_DJM_CTL ("Ch4 Input" , a9_cap5 , 2 , SND_DJM_WINDEX_CAP )
3852+ };
3853+
37983854static const struct snd_djm_device snd_djm_devices [] = {
37993855 [SND_DJM_250MK2_IDX ] = SND_DJM_DEVICE (250 mk2 ),
38003856 [SND_DJM_750_IDX ] = SND_DJM_DEVICE (750 ),
38013857 [SND_DJM_850_IDX ] = SND_DJM_DEVICE (850 ),
38023858 [SND_DJM_900NXS2_IDX ] = SND_DJM_DEVICE (900 nxs2 ),
38033859 [SND_DJM_750MK2_IDX ] = SND_DJM_DEVICE (750 mk2 ),
38043860 [SND_DJM_450_IDX ] = SND_DJM_DEVICE (450 ),
3861+ [SND_DJM_A9_IDX ] = SND_DJM_DEVICE (a9 ),
38053862};
38063863
38073864
@@ -4076,6 +4133,9 @@ int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer)
40764133 case USB_ID (0x2b73 , 0x000a ): /* Pioneer DJ DJM-900NXS2 */
40774134 err = snd_djm_controls_create (mixer , SND_DJM_900NXS2_IDX );
40784135 break ;
4136+ case USB_ID (0x2b73 , 0x003c ): /* Pioneer DJ / AlphaTheta DJM-A9 */
4137+ err = snd_djm_controls_create (mixer , SND_DJM_A9_IDX );
4138+ break ;
40794139 }
40804140
40814141 return err ;
0 commit comments