-
Notifications
You must be signed in to change notification settings - Fork 4
/
opensuse-leap-linux-5.3.18-scarlett-gen3.patch
5302 lines (5083 loc) · 168 KB
/
opensuse-leap-linux-5.3.18-scarlett-gen3.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
diff -uNr linux-5.3.18-lp152.44/sound/usb/mixer.c linux-5.3.18-custom/sound/usb/mixer.c
--- linux-5.3.18-lp152.44/sound/usb/mixer.c 2020-09-30 21:51:43.000000000 +0300
+++ linux-5.3.18-custom/sound/usb/mixer.c 2021-01-07 01:22:12.147806820 +0300
@@ -50,7 +50,7 @@
#include "mixer_quirks.h"
#include "power.h"
-#define MAX_ID_ELEMS 256
+#define MAX_ID_ELEMS 1024
struct usb_audio_term {
int id;
diff -uNr linux-5.3.18-lp152.44/sound/usb/mixer_quirks.c linux-5.3.18-custom/sound/usb/mixer_quirks.c
--- linux-5.3.18-lp152.44/sound/usb/mixer_quirks.c 2020-09-30 21:51:43.000000000 +0300
+++ linux-5.3.18-custom/sound/usb/mixer_quirks.c 2021-01-15 01:57:54.578314316 +0300
@@ -2684,6 +2684,12 @@
case USB_ID(0x1235, 0x8203): /* Focusrite Scarlett 6i6 2nd Gen */
case USB_ID(0x1235, 0x8204): /* Focusrite Scarlett 18i8 2nd Gen */
case USB_ID(0x1235, 0x8201): /* Focusrite Scarlett 18i20 2nd Gen */
+ case USB_ID(0x1235, 0x8210): /* Focusrite Scarlett 2i2 3rd Gen */
+ case USB_ID(0x1235, 0x8211): /* Focusrite Scarlett Solo 3rd Gen */
+ case USB_ID(0x1235, 0x8212): /* Focusrite Scarlett 4i4 3rd Gen */
+ case USB_ID(0x1235, 0x8213): /* Focusrite Scarlett 8i6 3rd Gen */
+ case USB_ID(0x1235, 0x8214): /* Focusrite Scarlett 18i8 3rd Gen */
+ case USB_ID(0x1235, 0x8215): /* Focusrite Scarlett 18i20 3rd Gen */
err = snd_scarlett_gen2_controls_create(mixer);
break;
diff -uNr linux-5.3.18-lp152.44/sound/usb/mixer_scarlett_gen2.c linux-5.3.18-custom/sound/usb/mixer_scarlett_gen2.c
--- linux-5.3.18-lp152.44/sound/usb/mixer_scarlett_gen2.c 2020-09-30 21:51:43.000000000 +0300
+++ linux-5.3.18-custom/sound/usb/mixer_scarlett_gen2.c 2021-01-18 22:44:14.851095523 +0300
@@ -1,8 +1,10 @@
// SPDX-License-Identifier: GPL-2.0
/*
- * Focusrite Scarlett 6i6/18i8/18i20 Gen 2 Driver for ALSA
+ * Focusrite Scarlett 6i6/18i8/18i20 Gen 2 and 2i2/4i4/8i6/18i8/18i20
+ * Gen 3 Driver for ALSA
*
- * Copyright (c) 2018-2019 by Geoffrey D. Bennett <g at b4.vu>
+ * Copyright (c) 2018-2020 by Geoffrey D. Bennett <g at b4.vu>
+ * Copyright (c) 2020 by Vladimir Sadovnikov <sadko4u at gmail.com>
*
* Based on the Scarlett (Gen 1) Driver for ALSA:
*
@@ -19,25 +21,42 @@
* David Henningsson <david.henningsson at canonical.com>
*/
-/* Mixer Interface for the Focusrite Scarlett 6i6/18i8/18i20 Gen 2 audio
- * interface. Based on the Gen 1 driver and rewritten.
+/* Mixer Interface for the Focusrite Scarlett 6i6/18i8/18i20 Gen 2 and
+ * 2i2/4i4/8i6/18i8/18i20 Gen 3 audio interfaces. Based on the Gen 1
+ * driver and rewritten.
*/
/* The protocol was reverse engineered by looking at the communication
* between Focusrite Control 2.3.4 and the Focusrite(R) Scarlett 18i20
* (firmware 1083) using usbmon in July-August 2018.
*
- * Scarlett 18i8 support added in April 2019.
+ * Scarlett 18i8 Gen 2 support added in April 2019.
*
- * Scarlett 6i6 support added in June 2019 (thanks to Martin Wittmann
- * for providing usbmon output and testing).
+ * Scarlett 6i6 Gen 2 support added in June 2019 (thanks to Martin
+ * Wittmann for providing usbmon output and testing).
*
- * This ALSA mixer gives access to:
+ * Scarlett 4i4/8i6 Gen 3 support added in May 2020 (thanks to Laurent
+ * Debricon for donating a 4i4 and to Fredrik Unger for providing 8i6
+ * usbmon output and testing).
+ *
+ * Scarlett 18i8/18i20 Gen 3 support added in June 2020 (thanks to
+ * Darren Jaeckel, Alex Sedlack, Clovis Lunel and Dirk Lattermann for
+ * providing usbmon output, protocol traces and testing).
+ *
+ * Scarlett 2i2 Gen 3 support added in November 2020 (thanks to Alexander
+ * Vorona for taking 2i2 USB protocol dumps).
+ *
+ * Scarlett Solo Gen 3 support added in January 2021 (thanks to Valeriy
+ * Chernoivanov who provided USB identifier of device)
+ *
+ * This ALSA mixer gives access to (model-dependent):
* - input, output, mixer-matrix muxes
* - 18x10 mixer-matrix gain stages
* - gain/volume controls
* - level meters
- * - line/inst level and pad controls
+ * - line/inst level, pad, and air controls
+ * - enable/disable MSD mode
+ * - main/alt speaker switching
*
* <ditaa>
* /--------------\ 18chn 20chn /--------------\
@@ -90,6 +109,14 @@
* \--------------/
* </ditaa>
*
+ * Gen 3 devices have a Mass Storage Device (MSD) mode where a small
+ * disk with registration and driver download information is presented
+ * to the host. To access the full functionality of the device without
+ * proprietary software, MSD mode can be disabled by:
+ * - holding down the 48V button for five seconds while powering on
+ * the device, or
+ * - using this driver and alsamixer to change the "MSD Mode" setting
+ * to Off, waiting two seconds, then power-cycling the device
*/
#include <linux/slab.h>
@@ -108,6 +135,9 @@
/* device_setup value to enable */
#define SCARLETT2_ENABLE 0x01
+/* device_setup value to allow turning MSD mode back on */
+#define SCARLETT2_MSD_ENABLE 0x02
+
/* some gui mixers can't handle negative ctl values */
#define SCARLETT2_VOLUME_BIAS 127
@@ -122,44 +152,92 @@
* for dB in 0 .. 172: int(8192 * pow(10, ((dB - 160) / 2 / 20)))
*/
static const u16 scarlett2_mixer_values[173] = {
- 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
- 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 8, 8,
- 9, 9, 10, 10, 11, 12, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
- 23, 24, 25, 27, 29, 30, 32, 34, 36, 38, 41, 43, 46, 48, 51,
- 54, 57, 61, 65, 68, 73, 77, 81, 86, 91, 97, 103, 109, 115,
- 122, 129, 137, 145, 154, 163, 173, 183, 194, 205, 217, 230,
- 244, 259, 274, 290, 307, 326, 345, 365, 387, 410, 434, 460,
- 487, 516, 547, 579, 614, 650, 689, 730, 773, 819, 867, 919,
- 973, 1031, 1092, 1157, 1225, 1298, 1375, 1456, 1543, 1634,
- 1731, 1833, 1942, 2057, 2179, 2308, 2445, 2590, 2744, 2906,
- 3078, 3261, 3454, 3659, 3876, 4105, 4349, 4606, 4879, 5168,
- 5475, 5799, 6143, 6507, 6892, 7301, 7733, 8192, 8677, 9191,
- 9736, 10313, 10924, 11571, 12257, 12983, 13752, 14567, 15430,
- 16345
-};
-
-/* Maximum number of analogue outputs */
-#define SCARLETT2_ANALOGUE_MAX 10
-
-/* Maximum number of level and pad switches */
-#define SCARLETT2_LEVEL_SWITCH_MAX 2
-#define SCARLETT2_PAD_SWITCH_MAX 4
-
-/* Maximum number of inputs to the mixer */
-#define SCARLETT2_INPUT_MIX_MAX 18
-
-/* Maximum number of outputs from the mixer */
-#define SCARLETT2_OUTPUT_MIX_MAX 10
+ /* 8 items per row */
+ 0, 0, 0, 0, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 2, 2, 2, 2, 2, 2, 2, 3,
+ 3, 3, 3, 3, 4, 4, 4, 4,
+ 5, 5, 5, 6, 6, 6, 7, 7,
+ 8, 8, 9, 9, 10, 10, 11, 12,
+ 12, 13, 14, 15, 16, 17, 18, 19,
+ 20, 21, 23, 24, 25, 27, 29, 30,
+ 32, 34, 36, 38, 41, 43, 46, 48,
+ 51, 54, 57, 61, 65, 68, 73, 77,
+ 81, 86, 91, 97, 103, 109, 115, 122,
+ 129, 137, 145, 154, 163, 173, 183, 194,
+ 205, 217, 230, 244, 259, 274, 290, 307,
+ 326, 345, 365, 387, 410, 434, 460, 487,
+ 516, 547, 579, 614, 650, 689, 730, 773,
+ 819, 867, 919, 973, 1031, 1092, 1157, 1225,
+ 1298, 1375, 1456, 1543, 1634, 1731, 1833, 1942,
+ 2057, 2179, 2308, 2445, 2590, 2744, 2906, 3078,
+ 3261, 3454, 3659, 3876, 4105, 4349, 4606, 4879,
+ 5168, 5475, 5799, 6143, 6507, 6892, 7301, 7733,
+ 8192, 8677, 9191, 9736, 10313, 10924, 11571, 12257,
+ 12983, 13752, 14567, 15430, 16345
+};
-/* Maximum size of the data in the USB mux assignment message:
- * 18 inputs, 20 outputs, 18 matrix inputs, 8 spare
+/* This is array of high parts of the 32-bit floating point values
+ * which are matching the -80..+6 dB level with 0.5 dB step
+ * The lowest value is encoded as -128.0f for compatibility with
+ * the original software
*/
-#define SCARLETT2_MUX_MAX 64
+static const u16 scarlett2_sw_config_mixer_values[173] = {
+ /* 8 items per row */
+ 0xc300, 0xc29f, 0xc29e, 0xc29d, 0xc29c, 0xc29b, 0xc29a, 0xc299,
+ 0xc298, 0xc297, 0xc296, 0xc295, 0xc294, 0xc293, 0xc292, 0xc291,
+ 0xc290, 0xc28f, 0xc28e, 0xc28d, 0xc28c, 0xc28b, 0xc28a, 0xc289,
+ 0xc288, 0xc287, 0xc286, 0xc285, 0xc284, 0xc283, 0xc282, 0xc281,
+ 0xc280, 0xc27e, 0xc27c, 0xc27a, 0xc278, 0xc276, 0xc274, 0xc272,
+ 0xc270, 0xc26e, 0xc26c, 0xc26a, 0xc268, 0xc266, 0xc264, 0xc262,
+ 0xc260, 0xc25e, 0xc25c, 0xc25a, 0xc258, 0xc256, 0xc254, 0xc252,
+ 0xc250, 0xc24e, 0xc24c, 0xc24a, 0xc248, 0xc246, 0xc244, 0xc242,
+ 0xc240, 0xc23e, 0xc23c, 0xc23a, 0xc238, 0xc236, 0xc234, 0xc232,
+ 0xc230, 0xc22e, 0xc22c, 0xc22a, 0xc228, 0xc226, 0xc224, 0xc222,
+ 0xc220, 0xc21e, 0xc21c, 0xc21a, 0xc218, 0xc216, 0xc214, 0xc212,
+ 0xc210, 0xc20e, 0xc20c, 0xc20a, 0xc208, 0xc206, 0xc204, 0xc202,
+ 0xc200, 0xc1fc, 0xc1f8, 0xc1f4, 0xc1f0, 0xc1ec, 0xc1e8, 0xc1e4,
+ 0xc1e0, 0xc1dc, 0xc1d8, 0xc1d4, 0xc1d0, 0xc1cc, 0xc1c8, 0xc1c4,
+ 0xc1c0, 0xc1bc, 0xc1b8, 0xc1b4, 0xc1b0, 0xc1ac, 0xc1a8, 0xc1a4,
+ 0xc1a0, 0xc19c, 0xc198, 0xc194, 0xc190, 0xc18c, 0xc188, 0xc184,
+ 0xc180, 0xc178, 0xc170, 0xc168, 0xc160, 0xc158, 0xc150, 0xc148,
+ 0xc140, 0xc138, 0xc130, 0xc128, 0xc120, 0xc118, 0xc110, 0xc108,
+ 0xc100, 0xc0f0, 0xc0e0, 0xc0d0, 0xc0c0, 0xc0b0, 0xc0a0, 0xc090,
+ 0xc080, 0xc060, 0xc040, 0xc020, 0xc000, 0xbfc0, 0xbf80, 0xbf00,
+ 0x0000, 0x3f00, 0x3f80, 0x3fc0, 0x4000, 0x4020, 0x4040, 0x4060,
+ 0x4080, 0x4090, 0x40a0, 0x40b0, 0x40c0
+};
-/* Number of meters:
- * 18 inputs, 20 outputs, 18 matrix inputs
- */
-#define SCARLETT2_NUM_METERS 56
+
+#define SCARLETT2_ANALOGUE_IN_MAX 8 /* Maximum number of analogue inputs */
+#define SCARLETT2_ANALOGUE_OUT_MAX 10 /* Maximum number of analogue outputs */
+#define SCARLETT2_ALL_IN_MAX 42 /* Maximum number of all inputs */
+#define SCARLETT2_ALL_OUT_MAX 26 /* Maximum number of all outputs */
+#define SCARLETT2_LEVEL_SWITCH_MAX 2 /* Maximum number of LINE/INST switches */
+#define SCARLETT2_PAD_SWITCH_MAX 8 /* Maximum number of PAD switches */
+#define SCARLETT2_AIR_SWITCH_MAX 8 /* Maximum number of AIR switches */
+#define SCARLETT2_48V_SWITCH_MAX 2 /* Maximum number of 48V switches */
+#define SCARLETT2_BUTTON_MAX 2 /* Hardware buttons on the 18i20 */
+#define SCARLETT2_INPUT_MIX_MAX 24 /* Maximum number of inputs to the mixer */
+#define SCARLETT2_OUTPUT_MIX_MAX 12 /* Maximum number of outputs from the mixer */
+#define SCARLETT2_MUX_MAX 77 /* The maximum possible MUX connection count */
+#define SCARLETT2_NUM_METERS 56 /* Number of meters: 18 inputs, 20 outputs, 18 matrix inputs (XX FIXME) */
+#define SCARLETT2_IN_NAME_LEN 12 /* Maximum length of the input name */
+#define SCARLETT2_OUT_NAME_LEN 12 /* Maximum length of the output name */
+#define SCARLETT2_GAIN_HALO_LEVELS 3 /* Number of gain halo levels */
+#define SCARLETT2_GAIN_HALO_LEDS_MAX 8 /* Maximum number of gain halo LEDs */
+
+#define SCARLETT2_SW_CONFIG_BASE 0xec
+
+#define SCARLETT2_SW_CONFIG_PACKET_SIZE 992 /* The maximum packet size used to transfer data */
+
+#define SCARLETT2_SW_CONFIG_MIXER_INPUTS 30 /* 30 inputs per one mixer in config */
+#define SCARLETT2_SW_CONFIG_MIXER_OUTPUTS 12 /* 12 outputs in config */
+#define SCARLETT2_SW_CONFIG_OUTPUT_MAX 26 /* Maximum number of outputs */
+#define SCARLETT2_SW_CONFIG_SIZE_OFFSET 0x08 /* 0xf4 - 0xec */
+#define SCARLETT2_SW_CONFIG_STEREO_BITS_OFFSET 0x0c8 /* 0x1b4 - 0xec */
+#define SCARLETT2_SW_CONFIG_VOLUMES_OFFSET 0x0d0 /* 0x1bc - 0xec */
+#define SCARLETT2_SW_CONFIG_MIXER_OFFSET 0xf04 /* 0xff0 - 0xec */
/* Hardware port types:
* - None (no input to mux)
@@ -170,13 +248,26 @@
* - PCM I/O
*/
enum {
- SCARLETT2_PORT_TYPE_NONE = 0,
- SCARLETT2_PORT_TYPE_ANALOGUE = 1,
- SCARLETT2_PORT_TYPE_SPDIF = 2,
- SCARLETT2_PORT_TYPE_ADAT = 3,
- SCARLETT2_PORT_TYPE_MIX = 4,
- SCARLETT2_PORT_TYPE_PCM = 5,
- SCARLETT2_PORT_TYPE_COUNT = 6,
+ SCARLETT2_PORT_TYPE_ANALOGUE = 0, /* Analogue input/output */
+ SCARLETT2_PORT_TYPE_SPDIF = 1, /* S/PDIF input/oputput */
+ SCARLETT2_PORT_TYPE_ADAT = 2, /* ADAT input/output */
+ SCARLETT2_PORT_TYPE_ADAT2 = 3, /* ADAT2 input/output (mapping) */
+ SCARLETT2_PORT_TYPE_MIX = 3, /* Mixer input/output */
+ SCARLETT2_PORT_TYPE_PCM = 4, /* PCM input/output */
+ SCARLETT2_PORT_TYPE_INT_MIC = 5, /* Internal microphone */
+ SCARLETT2_PORT_TYPE_TALKBACK = 6, /* Talkback source */
+ SCARLETT2_PORT_TYPE_COUNT = 7
+};
+
+enum {
+ SCARLETT2_PORT_ID_NONE = 0,
+ SCARLETT2_PORT_ID_ANALOGUE = 0x80,
+ SCARLETT2_PORT_ID_SPDIF = 0x180,
+ SCARLETT2_PORT_ID_ADAT = 0x200,
+ SCARLETT2_PORT_ID_MIX = 0x300,
+ SCARLETT2_PORT_ID_PCM = 0x600,
+ SCARLETT2_PORT_ID_MASK = 0x0f80,
+ SCARLETT2_PORT_NUM_MASK = 0x007f
};
/* Count of total I/O and number available at each sample rate */
@@ -189,13 +280,47 @@
SCARLETT2_PORT_DIRECTIONS = 5,
};
-/* Hardware buttons on the 18i20 */
-#define SCARLETT2_BUTTON_MAX 2
+/* Configuration parameters that can be read and written */
+enum {
+ SCARLETT2_CONFIG_BUTTONS = 0,
+ SCARLETT2_CONFIG_LINE_OUT_VOLUME = 1,
+ SCARLETT2_CONFIG_SW_HW_SWITCH = 2,
+ SCARLETT2_CONFIG_LEVEL_SWITCH = 3,
+ SCARLETT2_CONFIG_PAD_SWITCH = 4,
+ SCARLETT2_CONFIG_AIR_SWITCH = 5,
+ SCARLETT2_CONFIG_SPDIF_SWITCH = 6,
+ SCARLETT2_CONFIG_48V_SWITCH = 7,
+ SCARLETT2_CONFIG_MSD_SWITCH = 8,
+ SCARLETT2_CONFIG_MAIN_ALT_SPEAKER_SWITCH = 9,
+ SCARLETT2_CONFIG_SPEAKER_SWITCHING_SWITCH = 10,
+ SCARLETT2_CONFIG_GAIN_HALO_ENABLE = 11,
+ SCARLETT2_CONFIG_GAIN_HALO_LEDS = 12,
+ SCARLETT2_CONFIG_GAIN_HALO_LEVELS = 13,
+ SCARLETT2_CONFIG_MIX_TALKBACK = 14,
+ SCARLETT2_CONFIG_RETAIN_48V = 15,
+ SCARLETT2_CONFIG_MUTES = 16,
+ SCARLETT2_CONFIG_DIRECT_MONITOR_SWITCH = 17,
+ SCARLETT2_CONFIG_COUNT = 18
+};
static const char *const scarlett2_button_names[SCARLETT2_BUTTON_MAX] = {
"Mute", "Dim"
};
+struct scarlett2_port_name {
+ s8 direction; /* Direction of port - SCARLETT2_PORT_* */
+ s8 type; /* Type of port - SCARLETT2_PORT_TYPE_* */
+ s8 index; /* Index of port */
+ const char *name; /* The name of port */
+};
+
+struct scarlett2_sw_port_mapping {
+ s8 direction; /* Direction of port - SCARLETT2_PORT_* */
+ s8 type; /* Type of port - SCARLETT2_PORT_TYPE_* */
+ s8 index; /* The start index of routed port */
+ s8 count; /* Number of ports */
+};
+
/* Description of each hardware port type:
* - id: hardware ID for this port type
* - num: number of sources/destinations of this port type
@@ -209,42 +334,263 @@
const char * const src_descr;
int src_num_offset;
const char * const dst_descr;
+ const u8 * const dst_remapping;
+};
+
+/* Location, size, and activation command number for the configuration
+ * parameters
+ */
+struct scarlett2_config {
+ u8 offset;
+ u8 size;
+ u8 activate;
};
+/* The device descriptor structure */
struct scarlett2_device_info {
+ u32 usb_id; /* USB device identifier */
u8 line_out_hw_vol; /* line out hw volume is sw controlled */
u8 button_count; /* number of buttons */
u8 level_input_count; /* inputs with level selectable */
+ u8 level_input_offset; /* inputs with level selectable - UI numbering offset */
+ u8 level_input_bitmask; /* input levels are present as bitmask */
u8 pad_input_count; /* inputs with pad selectable */
- const char * const line_out_descrs[SCARLETT2_ANALOGUE_MAX];
+ u8 air_input_count; /* inputs with air selectable */
+ u8 air_input_bitmask; /* air inputs are present as bitmask */
+ u8 power_48v_count; /* 48V phantom power */
+ u8 has_retain48v; /* Retain 48V switch is present */
+ u8 has_msd_mode; /* Gen 3 devices have an internal MSD mode switch */
+ u8 has_speaker_switching; /* main/alt speaker switching */
+ u8 has_direct_monitor; /* off/mono/stereo direct monitor */
+ u8 has_talkback; /* 18i20 Gen 3 has 'talkback' feature */
+ u8 has_mux; /* MUX (routing) is present */
+ u8 has_mixer; /* Internal Mixer is present */
+ u8 has_sw_config; /* Software configuration is present */
+ u8 has_meters; /* Device has meters */
+ u8 has_hw_volume; /* Has hardware volume control */
+ u8 gain_halos_count; /* Number of gain halos */
+ u8 config_size; /* Configuration space size for device, 0 for large configs */
+ const struct scarlett2_port_name * const port_names; /* Special names of ports */
+ const struct scarlett2_sw_port_mapping * const sw_port_mapping; /* Software port mapping */
+ const u8 mux_size[SCARLETT2_PORT_DIRECTIONS]; /* The maximum number of elements per mux */
struct scarlett2_ports ports[SCARLETT2_PORT_TYPE_COUNT];
+ const struct scarlett2_config * const config;
+};
+
+struct scarlett2_sw_cfg_volume {
+ __le16 volume; /* volume */
+ u8 changed; /* change flag */
+ u8 flags; /* some flags? */
};
+/* Software configuration of the scarlett device */
+struct scarlett2_sw_cfg {
+ __le16 all_size; /* +0x0000: overall size, 0x1990 for all devices */
+ __le16 magic1; /* +0x0002: magic number: 0x3006 */
+ __le32 version; /* +0x0004: probably version */
+ __le16 szof; /* +0x0008: the overall size, 0x1984 for all devices */
+ __le16 __pad0; /* +0x000a: ???????? */
+ u8 out_mux[SCARLETT2_SW_CONFIG_OUTPUT_MAX]; /* +0x00f8: output routing */
+ u8 __pad1[0x0066]; /* +0x0112: ???????? */
+ u8 mixer_in_mux[SCARLETT2_SW_CONFIG_MIXER_INPUTS]; /* +0x008c: 'custom mix' input routing */
+ u8 mixer_in_map[SCARLETT2_SW_CONFIG_MIXER_INPUTS]; /* +0x00aa: 'custom mix' input mapping */
+ __le32 stereo_sw; /* +0x01b4: stereo configuration for each port (bit mask) */
+ __le32 mute_sw; /* +0x01b8: mute switches (bit mask) */
+ struct scarlett2_sw_cfg_volume volume[SCARLETT2_ANALOGUE_OUT_MAX]; /* +0x01bc: Volume settings of each output */
+ u8 __pad2[0x01dc]; /* +0x01e4: ???????? */
+ u8 in_alias[SCARLETT2_ALL_IN_MAX][SCARLETT2_IN_NAME_LEN]; /* +0x03c0: Symbolic names of inputs */
+ u8 __pad3[0x0438]; /* +0x0420: ???????? */
+ u8 out_alias[SCARLETT2_ALL_OUT_MAX][SCARLETT2_OUT_NAME_LEN]; /* +0x09f0: Symbolic names of outputs */
+ u8 __pad4[0x04c8]; /* +0x0b28: ???????? */
+ __le32 mixer[SCARLETT2_SW_CONFIG_MIXER_OUTPUTS][SCARLETT2_SW_CONFIG_MIXER_INPUTS]; /* +0x0ff0: Matrix mixer settings */
+ u8 __pad5[0x01e0]; /* +0x1590: ???????? */
+ s8 mixer_pan[SCARLETT2_SW_CONFIG_MIXER_OUTPUTS][SCARLETT2_SW_CONFIG_MIXER_INPUTS]; /* +0x1684: Input pan settings for mixer */
+ u8 __pad6[0x0078]; /* +0x17ec: ???????? */
+ __le32 mixer_mute[SCARLETT2_SW_CONFIG_MIXER_OUTPUTS]; /* +0x1950: Mute settings for mixer inputs */
+ __le32 mixer_solo[SCARLETT2_SW_CONFIG_MIXER_OUTPUTS]; /* +0x1980: Solo settings for mixer inputs */
+ u8 __pad7[0x004a]; /* +0x19b0: ???????? */
+ __le32 mixer_bind; /* +0x19fa: output to 'custom mix' routing bitmap */
+ u8 __pad8[0x006e]; /* +0x19fe: ???????? */
+ __le32 checksum; /* +0x1a6c: checksum of the area */
+} __packed;
+
struct scarlett2_mixer_data {
struct usb_mixer_interface *mixer;
struct mutex usb_mutex; /* prevent sending concurrent USB requests */
struct mutex data_mutex; /* lock access to this data */
struct delayed_work work;
const struct scarlett2_device_info *info;
- int num_mux_srcs;
+ __u8 interface; /* vendor-specific interface number */
+ __u8 endpoint; /* interrupt endpoint address */
+ __le16 maxpacketsize;
+ __u8 interval;
+ int num_inputs; /* Overall number of inputs */
+ int num_outputs; /* Overall number of outputs */
u16 scarlett2_seq;
- u8 vol_updated;
+ u8 vol_updated; /* Flag that indicates that volume has been updated */
+ u8 line_ctl_updated; /* Flag that indicates that state of PAD, INST buttons have been updated */
+ u8 speaker_updated; /* Flag that indicates that speaker/talkback has been updated */
u8 master_vol;
- u8 vol[SCARLETT2_ANALOGUE_MAX];
- u8 vol_sw_hw_switch[SCARLETT2_ANALOGUE_MAX];
+ u8 vol[SCARLETT2_ANALOGUE_OUT_MAX];
+ u8 mutes[SCARLETT2_ALL_OUT_MAX]; /* Mute switches for each output */
+ u8 vol_sw_hw_switch[SCARLETT2_ANALOGUE_OUT_MAX];
u8 level_switch[SCARLETT2_LEVEL_SWITCH_MAX];
u8 pad_switch[SCARLETT2_PAD_SWITCH_MAX];
- u8 buttons[SCARLETT2_BUTTON_MAX];
- struct snd_kcontrol *master_vol_ctl;
- struct snd_kcontrol *vol_ctls[SCARLETT2_ANALOGUE_MAX];
+ u8 air_switch[SCARLETT2_AIR_SWITCH_MAX];
+ u8 pow_switch[SCARLETT2_48V_SWITCH_MAX];
+ u8 msd_switch; /* Mass storage device mode switch */
+ u8 retain48v_switch; /* Retain 48V option */
+ u8 speaker_switch; /* Off/Main/Alt speaker switching option */
+ u8 direct_monitor_switch; /* Direct monitor option */
+ u8 talkback_switch; /* Talkback option */
+ u8 buttons[SCARLETT2_BUTTON_MAX]; /* Dim/Mute buttons */
+ u8 ghalo_custom; /* Custom gain halos flag */
+ u8 ghalo_leds[SCARLETT2_GAIN_HALO_LEDS_MAX]; /* Color of each gain halo led */
+ u8 ghalo_levels[SCARLETT2_GAIN_HALO_LEVELS]; /* Gain halo colors for each level */
+
+ struct snd_kcontrol *master_vol_ctl; /* Master volume control */
+ struct snd_kcontrol *speaker_ctl; /* Speaker switching control */
+ struct snd_kcontrol *direct_monitor_ctl; /* Direct monitor control */
+ struct snd_kcontrol *talkback_ctl; /* Talkback option control */
+ struct snd_kcontrol *vol_ctls[SCARLETT2_ANALOGUE_OUT_MAX];
+ struct snd_kcontrol *mute_ctls[SCARLETT2_ALL_OUT_MAX];
+ struct snd_kcontrol *pad_ctls[SCARLETT2_PAD_SWITCH_MAX];
+ struct snd_kcontrol *air_ctls[SCARLETT2_AIR_SWITCH_MAX];
+ struct snd_kcontrol *level_ctls[SCARLETT2_LEVEL_SWITCH_MAX];
+ struct snd_kcontrol *pow_ctls[SCARLETT2_48V_SWITCH_MAX];
struct snd_kcontrol *button_ctls[SCARLETT2_BUTTON_MAX];
- u8 mux[SCARLETT2_MUX_MAX];
- u8 mix[SCARLETT2_INPUT_MIX_MAX * SCARLETT2_OUTPUT_MIX_MAX];
+ struct snd_kcontrol *mix_talkback_ctls[SCARLETT2_OUTPUT_MIX_MAX]; /* Talkback controls for each mix */
+ s8 mux[SCARLETT2_MUX_MAX]; /* Routing of outputs */
+ u8 mix[SCARLETT2_INPUT_MIX_MAX * SCARLETT2_OUTPUT_MIX_MAX]; /* Matrix mixer */
+ u8 mix_talkback[SCARLETT2_OUTPUT_MIX_MAX]; /* Talkback enable for mixer output */
+ u8 mix_mutes[SCARLETT2_INPUT_MIX_MAX * SCARLETT2_OUTPUT_MIX_MAX]; /* Mixer input mutes */
+
+ /* Software configuration */
+ struct scarlett2_sw_cfg *sw_cfg; /* Software configuration data */
+};
+
+/*
+ * PRO-class device configuration (8i6, 18i8, 18i20)
+ */
+static const struct scarlett2_config scarlett2_pro_config_items[SCARLETT2_CONFIG_COUNT] = {
+ [SCARLETT2_CONFIG_BUTTONS] = /* Mute/Dim Buttons */
+ { .offset = 0x31, .size = 1, .activate = 2 },
+
+ [SCARLETT2_CONFIG_LINE_OUT_VOLUME] = /* Line Out Volume */
+ { .offset = 0x34, .size = 2, .activate = 1 },
+
+ [SCARLETT2_CONFIG_SW_HW_SWITCH] = /* SW/HW Volume Switch */
+ { .offset = 0x66, .size = 1, .activate = 3 },
+
+ [SCARLETT2_CONFIG_LEVEL_SWITCH] = /* Inst Switch */
+ { .offset = 0x7c, .size = 1, .activate = 7 },
+
+ [SCARLETT2_CONFIG_PAD_SWITCH] = /* Pad Switch */
+ { .offset = 0x84, .size = 1, .activate = 8 },
+
+ [SCARLETT2_CONFIG_AIR_SWITCH] = /* Air Switch */
+ { .offset = 0x8c, .size = 1, .activate = 8 },
+
+ [SCARLETT2_CONFIG_SPDIF_SWITCH] = /* S/PDIF Source */
+ { .offset = 0x94, .size = 1, .activate = 6 },
+
+ [SCARLETT2_CONFIG_48V_SWITCH] = /* Phantom (48V) power */
+ { .offset = 0x9c, .size = 1, .activate = 8 },
+
+ [SCARLETT2_CONFIG_MSD_SWITCH] = /* MSD Mode */
+ { .offset = 0x9d, .size = 1, .activate = 6 },
+
+ [SCARLETT2_CONFIG_MAIN_ALT_SPEAKER_SWITCH] = /* Alternate Speaker and Talkback switches */
+ { .offset = 0x9f, .size = 1, .activate = 10 },
+
+ [SCARLETT2_CONFIG_SPEAKER_SWITCHING_SWITCH] = /* Speaker Switching */
+ { .offset = 0xa0, .size = 1, .activate = 10 },
+
+ [SCARLETT2_CONFIG_GAIN_HALO_ENABLE] = /* Gain Halo Enable flag: bit 1 enables immediate values for gain halo */
+ { .offset = 0xa1, .size = 1, .activate = 9 },
+
+ [SCARLETT2_CONFIG_GAIN_HALO_LEDS] = /* Gain Halo LED colors: 1 bit per each R,G,B component */
+ { .offset = 0xa2, .size = 1, .activate = 9 },
+
+ [SCARLETT2_CONFIG_GAIN_HALO_LEVELS] = /* Gain Halo Colors for corresponding levels: 1 byte per RGB in order: Clip, Pre-Clip, Good */
+ { .offset = 0xa6, .size = 1, .activate = 11 },
+
+ [SCARLETT2_CONFIG_MIX_TALKBACK] = /* Talkback enable flags for each output of internal mixer */
+ { .offset = 0xb0, .size = 2, .activate = 10 },
+
+ [SCARLETT2_CONFIG_RETAIN_48V] = /* Retain 48V switch */
+ { .offset = 0x9e, .size = 1, .activate = 0 },
+
+ [SCARLETT2_CONFIG_MUTES] = /* Hardware mutes for each analog output */
+ { .offset = 0x5c, .size = 1, .activate = 1 }
+};
+
+/*
+ * Configuration space for home segment devices like Scarlett 2i2 and Scarlett Solo
+ */
+static const struct scarlett2_config scarlett2_home_config_items[SCARLETT2_CONFIG_COUNT] = {
+
+// [SCARLETT2_CONFIG_MSD_SWITCH] = /* MSD Mode */
+// { .offset = 0x04, .size = 1, .activate = 6 },
+
+ [SCARLETT2_CONFIG_RETAIN_48V] = /* Retain 48V switch */
+ { .offset = 0x05, .size = 1, .activate = 0 },
+
+ [SCARLETT2_CONFIG_48V_SWITCH] = /* Phantom (48V) power */
+ { .offset = 0x06, .size = 1, .activate = 3 },
+
+ [SCARLETT2_CONFIG_DIRECT_MONITOR_SWITCH] = /* Direct monitor */
+ { .offset = 0x07, .size = 1, .activate = 4 },
+
+ [SCARLETT2_CONFIG_LEVEL_SWITCH] = /* Inst Switch */
+ { .offset = 0x08, .size = 1, .activate = 7 },
+
+ [SCARLETT2_CONFIG_AIR_SWITCH] = /* Air Switch */
+ { .offset = 0x09, .size = 1, .activate = 8 },
+
+ [SCARLETT2_CONFIG_GAIN_HALO_ENABLE] = /* Gain Halo Enable flag: bit 1 enables immediate values for gain halo */
+ { .offset = 0x16, .size = 1, .activate = 9 },
+
+ [SCARLETT2_CONFIG_GAIN_HALO_LEDS] = /* Gain Halo LED colors: 1 bit per each R,G,B component */
+ { .offset = 0x17, .size = 1, .activate = 9 },
+
+ [SCARLETT2_CONFIG_GAIN_HALO_LEVELS] = /* Gain Halo Colors for corresponding levels: 1 byte per RGB in order: Clip, Pre-Clip, Good */
+ { .offset = 0x1a, .size = 1, .activate = 11 },
+};
+
+/* proprietary request/response format */
+struct scarlett2_usb_packet {
+ __le32 cmd;
+ __le16 size;
+ __le16 seq;
+ __le32 error;
+ __le32 pad;
+ u8 data[];
};
/*** Model-specific data ***/
+static const struct scarlett2_port_name s6i6_gen2_ports[] = {
+ { SCARLETT2_PORT_OUT, SCARLETT2_PORT_TYPE_ANALOGUE, 0, "Headphones 1 L" },
+ { SCARLETT2_PORT_OUT, SCARLETT2_PORT_TYPE_ANALOGUE, 1, "Headphones 1 R" },
+ { SCARLETT2_PORT_OUT, SCARLETT2_PORT_TYPE_ANALOGUE, 2, "Headphones 2 L" },
+ { SCARLETT2_PORT_OUT, SCARLETT2_PORT_TYPE_ANALOGUE, 3, "Headphones 2 R" },
+ { -1, -1, -1, NULL }
+};
+
+static const struct scarlett2_sw_port_mapping s6i6_gen2_sw_port_mapping[] = {
+ { SCARLETT2_PORT_OUT, SCARLETT2_PORT_TYPE_ANALOGUE, 0, 6 },
+ { SCARLETT2_PORT_OUT, SCARLETT2_PORT_TYPE_SPDIF, 0, 2 },
+
+ { SCARLETT2_PORT_IN, SCARLETT2_PORT_TYPE_ANALOGUE, 0, 4 },
+ { SCARLETT2_PORT_IN, SCARLETT2_PORT_TYPE_SPDIF, 0, 2 },
+ { SCARLETT2_PORT_IN, SCARLETT2_PORT_TYPE_PCM, 0, 6 },
+
+ { -1, -1, -1, -1}
+};
static const struct scarlett2_device_info s6i6_gen2_info = {
+ .usb_id = USB_ID(0x1235, 0x8203),
+
/* The first two analogue inputs can be switched between line
* and instrument levels.
*/
@@ -253,52 +599,81 @@
/* The first two analogue inputs have an optional pad. */
.pad_input_count = 2,
- .line_out_descrs = {
- "Monitor L",
- "Monitor R",
- "Headphones L",
- "Headphones R",
- },
+ .has_mux = 1,
+
+ .has_mixer = 1,
+
+ .has_sw_config = 1,
+
+ .has_meters = 1,
+
+ .has_hw_volume = 1,
+
+ .port_names = s6i6_gen2_ports,
+
+ .sw_port_mapping = s6i6_gen2_sw_port_mapping,
+
+ .mux_size = { 42, 42, 42, 42, 42 },
.ports = {
- [SCARLETT2_PORT_TYPE_NONE] = {
- .id = 0x000,
- .num = { 1, 0, 8, 8, 8 },
- .src_descr = "Off",
- .src_num_offset = 0,
- },
[SCARLETT2_PORT_TYPE_ANALOGUE] = {
- .id = 0x080,
+ .id = SCARLETT2_PORT_ID_ANALOGUE,
.num = { 4, 4, 4, 4, 4 },
- .src_descr = "Analogue %d",
+ .src_descr = "Analogue In %02d",
.src_num_offset = 1,
- .dst_descr = "Analogue Output %02d Playback"
+ .dst_descr = "Analogue Out %02d"
},
[SCARLETT2_PORT_TYPE_SPDIF] = {
- .id = 0x180,
+ .id = SCARLETT2_PORT_ID_SPDIF,
.num = { 2, 2, 2, 2, 2 },
- .src_descr = "S/PDIF %d",
+ .src_descr = "S/PDIF In %d",
.src_num_offset = 1,
- .dst_descr = "S/PDIF Output %d Playback"
+ .dst_descr = "S/PDIF Out %d"
},
[SCARLETT2_PORT_TYPE_MIX] = {
- .id = 0x300,
+ .id = SCARLETT2_PORT_ID_MIX,
.num = { 10, 18, 18, 18, 18 },
- .src_descr = "Mix %c",
- .src_num_offset = 65,
- .dst_descr = "Mixer Input %02d Capture"
+ .src_descr = "Mix %c Out",
+ .src_num_offset = 'A',
+ .dst_descr = "Mix In %02d"
},
[SCARLETT2_PORT_TYPE_PCM] = {
- .id = 0x600,
+ .id = SCARLETT2_PORT_ID_PCM,
.num = { 6, 6, 6, 6, 6 },
- .src_descr = "PCM %d",
+ .src_descr = "PCM In %d",
.src_num_offset = 1,
- .dst_descr = "PCM %02d Capture"
+ .dst_descr = "PCM Out %02d"
},
},
+
+ .config = scarlett2_pro_config_items
+};
+
+static const struct scarlett2_port_name s18i8_gen2_port_names[] = {
+ { SCARLETT2_PORT_OUT, SCARLETT2_PORT_TYPE_ANALOGUE, 0, "Monitor L" },
+ { SCARLETT2_PORT_OUT, SCARLETT2_PORT_TYPE_ANALOGUE, 1, "Monitor R" },
+ { SCARLETT2_PORT_OUT, SCARLETT2_PORT_TYPE_ANALOGUE, 2, "Headphones 1 L" },
+ { SCARLETT2_PORT_OUT, SCARLETT2_PORT_TYPE_ANALOGUE, 3, "Headphones 1 R" },
+ { SCARLETT2_PORT_OUT, SCARLETT2_PORT_TYPE_ANALOGUE, 4, "Headphones 2 L" },
+ { SCARLETT2_PORT_OUT, SCARLETT2_PORT_TYPE_ANALOGUE, 5, "Headphones 2 R" },
+ { -1, -1, -1, NULL }
+};
+
+static const struct scarlett2_sw_port_mapping s18i8_gen2_sw_port_mapping[] = {
+ { SCARLETT2_PORT_OUT, SCARLETT2_PORT_TYPE_ANALOGUE, 0, 8 },
+ { SCARLETT2_PORT_OUT, SCARLETT2_PORT_TYPE_SPDIF, 0, 2 },
+
+ { SCARLETT2_PORT_IN, SCARLETT2_PORT_TYPE_ANALOGUE, 0, 8 },
+ { SCARLETT2_PORT_IN, SCARLETT2_PORT_TYPE_SPDIF, 0, 2 },
+ { SCARLETT2_PORT_IN, SCARLETT2_PORT_TYPE_ADAT, 0, 8 },
+ { SCARLETT2_PORT_IN, SCARLETT2_PORT_TYPE_PCM, 0, 20 },
+
+ { -1, -1, -1, -1}
};
static const struct scarlett2_device_info s18i8_gen2_info = {
+ .usb_id = USB_ID(0x1235, 0x8204),
+
/* The first two analogue inputs can be switched between line
* and instrument levels.
*/
@@ -307,64 +682,91 @@
/* The first four analogue inputs have an optional pad. */
.pad_input_count = 4,
- .line_out_descrs = {
- "Monitor L",
- "Monitor R",
- "Headphones 1 L",
- "Headphones 1 R",
- "Headphones 2 L",
- "Headphones 2 R",
- },
+ .has_mux = 1,
+
+ .has_mixer = 1,
+
+ .has_sw_config = 1,
+
+ .has_meters = 1,
+
+ .has_hw_volume = 1,
+
+ .port_names = s18i8_gen2_port_names,
+
+ .sw_port_mapping = s18i8_gen2_sw_port_mapping,
+
+ .mux_size = { 60, 60, 60, 56, 50 },
.ports = {
- [SCARLETT2_PORT_TYPE_NONE] = {
- .id = 0x000,
- .num = { 1, 0, 8, 8, 4 },
- .src_descr = "Off",
- .src_num_offset = 0,
- },
[SCARLETT2_PORT_TYPE_ANALOGUE] = {
- .id = 0x080,
+ .id = SCARLETT2_PORT_ID_ANALOGUE,
.num = { 8, 6, 6, 6, 6 },
- .src_descr = "Analogue %d",
+ .src_descr = "Analogue In %02d",
.src_num_offset = 1,
- .dst_descr = "Analogue Output %02d Playback"
+ .dst_descr = "Analogue Out %02d"
},
[SCARLETT2_PORT_TYPE_SPDIF] = {
- .id = 0x180,
- /* S/PDIF outputs aren't available at 192kHz
- * but are included in the USB mux I/O
- * assignment message anyway
- */
+ .id = SCARLETT2_PORT_ID_SPDIF,
.num = { 2, 2, 2, 2, 2 },
- .src_descr = "S/PDIF %d",
+ .src_descr = "S/PDIF In %d",
.src_num_offset = 1,
- .dst_descr = "S/PDIF Output %d Playback"
+ .dst_descr = "S/PDIF Out %d"
},
[SCARLETT2_PORT_TYPE_ADAT] = {
- .id = 0x200,
+ .id = SCARLETT2_PORT_ID_ADAT,
.num = { 8, 0, 0, 0, 0 },
- .src_descr = "ADAT %d",
+ .src_descr = "ADAT In %d",
.src_num_offset = 1,
+ .dst_descr = "ADAT Out %d",
},
[SCARLETT2_PORT_TYPE_MIX] = {
- .id = 0x300,
+ .id = SCARLETT2_PORT_ID_MIX,
.num = { 10, 18, 18, 18, 18 },
- .src_descr = "Mix %c",
- .src_num_offset = 65,
- .dst_descr = "Mixer Input %02d Capture"
+ .src_descr = "Mix %c Out",
+ .src_num_offset = 'A',
+ .dst_descr = "Mix In %02d"
},
[SCARLETT2_PORT_TYPE_PCM] = {
- .id = 0x600,
- .num = { 20, 18, 18, 14, 10 },
- .src_descr = "PCM %d",
+ .id = SCARLETT2_PORT_ID_PCM,
+ .num = { 8, 18, 18, 14, 10 },
+ .src_descr = "PCM In %02d",
.src_num_offset = 1,
- .dst_descr = "PCM %02d Capture"
+ .dst_descr = "PCM Out %02d"
},
},
+
+ .config = scarlett2_pro_config_items
+};
+
+static const struct scarlett2_port_name s18i20_gen2_port_names[] = {
+ { SCARLETT2_PORT_OUT, SCARLETT2_PORT_TYPE_ANALOGUE, 0, "Monitor L" },
+ { SCARLETT2_PORT_OUT, SCARLETT2_PORT_TYPE_ANALOGUE, 1, "Monitor R" },
+ { SCARLETT2_PORT_OUT, SCARLETT2_PORT_TYPE_ANALOGUE, 6, "Headphones 1 L" },
+ { SCARLETT2_PORT_OUT, SCARLETT2_PORT_TYPE_ANALOGUE, 7, "Headphones 1 R" },
+ { SCARLETT2_PORT_OUT, SCARLETT2_PORT_TYPE_ANALOGUE, 8, "Headphones 2 L" },
+ { SCARLETT2_PORT_OUT, SCARLETT2_PORT_TYPE_ANALOGUE, 9, "Headphones 2 R" },
+ { -1, -1, -1, NULL }
+};
+
+static const struct scarlett2_sw_port_mapping s18i20_gen2_sw_port_mapping[] = {
+ { SCARLETT2_PORT_OUT, SCARLETT2_PORT_TYPE_ANALOGUE, 0, 10 },
+ { SCARLETT2_PORT_OUT, SCARLETT2_PORT_TYPE_SPDIF, 0, 2 },
+ { SCARLETT2_PORT_OUT, SCARLETT2_PORT_TYPE_ADAT, 0, 8 },
+ { SCARLETT2_PORT_OUT, SCARLETT2_PORT_TYPE_ADAT2, 0, 4 },
+
+ { SCARLETT2_PORT_IN, SCARLETT2_PORT_TYPE_ANALOGUE, 0, 8 },
+ { SCARLETT2_PORT_IN, SCARLETT2_PORT_TYPE_SPDIF, 0, 2 },
+ { SCARLETT2_PORT_IN, SCARLETT2_PORT_TYPE_ADAT, 0, 8 },
+ { SCARLETT2_PORT_IN, SCARLETT2_PORT_TYPE_ADAT2, 0, 4 },
+ { SCARLETT2_PORT_IN, SCARLETT2_PORT_TYPE_PCM, 0, 20 },
+
+ { -1, -1, -1, -1}
};
static const struct scarlett2_device_info s18i20_gen2_info = {
+ .usb_id = USB_ID(0x1235, 0x8201),
+
/* The analogue line outputs on the 18i20 can be switched
* between software and hardware volume control
*/
@@ -373,200 +775,944 @@
/* Mute and dim buttons */
.button_count = 2,
- .line_out_descrs = {
- "Monitor L",
- "Monitor R",
- NULL,
- NULL,
- NULL,
- NULL,
- "Headphones 1 L",
- "Headphones 1 R",
- "Headphones 2 L",
- "Headphones 2 R",
- },
+ .has_mux = 1,
+
+ .has_mixer = 1,
+
+ .has_sw_config = 1,
+
+ .has_meters = 1,
+
+ .has_hw_volume = 1,
+
+ .port_names = s18i20_gen2_port_names,
+
+ .sw_port_mapping = s18i20_gen2_sw_port_mapping,
+
+ .mux_size = { 77, 77, 77, 73, 46 },
.ports = {
- [SCARLETT2_PORT_TYPE_NONE] = {
- .id = 0x000,
- .num = { 1, 0, 8, 8, 6 },
- .src_descr = "Off",
- .src_num_offset = 0,
- },
[SCARLETT2_PORT_TYPE_ANALOGUE] = {
- .id = 0x080,
+ .id = SCARLETT2_PORT_ID_ANALOGUE,
.num = { 8, 10, 10, 10, 10 },
- .src_descr = "Analogue %d",
+ .src_descr = "Analogue In %02d",
.src_num_offset = 1,
- .dst_descr = "Analogue Output %02d Playback"
+ .dst_descr = "Analogue Out %02d"
},
[SCARLETT2_PORT_TYPE_SPDIF] = {
- /* S/PDIF outputs aren't available at 192kHz
+ /* S/PDIF outputs aren't available at 192KHz
* but are included in the USB mux I/O
* assignment message anyway
*/
- .id = 0x180,
+ .id = SCARLETT2_PORT_ID_SPDIF,
.num = { 2, 2, 2, 2, 2 },
- .src_descr = "S/PDIF %d",
+ .src_descr = "S/PDIF In %d",
.src_num_offset = 1,
- .dst_descr = "S/PDIF Output %d Playback"
+ .dst_descr = "S/PDIF Out %d"
},
[SCARLETT2_PORT_TYPE_ADAT] = {
- .id = 0x200,
+ .id = SCARLETT2_PORT_ID_ADAT,
.num = { 8, 8, 8, 4, 0 },
- .src_descr = "ADAT %d",
+ .src_descr = "ADAT In %d",
.src_num_offset = 1,
- .dst_descr = "ADAT Output %d Playback"
+ .dst_descr = "ADAT Out %d"
},
[SCARLETT2_PORT_TYPE_MIX] = {
- .id = 0x300,
+ .id = SCARLETT2_PORT_ID_MIX,
.num = { 10, 18, 18, 18, 18 },
- .src_descr = "Mix %c",
- .src_num_offset = 65,
- .dst_descr = "Mixer Input %02d Capture"
+ .src_descr = "Mix %c Out",
+ .src_num_offset = 'A',
+ .dst_descr = "Mix In %02d"
},
[SCARLETT2_PORT_TYPE_PCM] = {
- .id = 0x600,
+ .id = SCARLETT2_PORT_ID_PCM,
.num = { 20, 18, 18, 14, 10 },
- .src_descr = "PCM %d",
+ .src_descr = "PCM In %02d",
.src_num_offset = 1,
- .dst_descr = "PCM %02d Capture"
+ .dst_descr = "PCM Out %02d"
},
},
+
+ .config = scarlett2_pro_config_items
};
-/* get the starting port index number for a given port type/direction */
-static int scarlett2_get_port_start_num(const struct scarlett2_ports *ports,
- int direction, int port_type)
-{
- int i, num = 0;
+static const struct scarlett2_port_name ssolo_gen3_port_names[] = {
+ { SCARLETT2_PORT_OUT, SCARLETT2_PORT_TYPE_ANALOGUE, 0, "Headphones L" },
+ { SCARLETT2_PORT_OUT, SCARLETT2_PORT_TYPE_ANALOGUE, 1, "Headphones R" },
+ { -1, -1, -1, NULL }
+};
- for (i = 0; i < port_type; i++)
- num += ports[i].num[direction];
+static const struct scarlett2_device_info ssolo_gen3_info = {
+ .usb_id = USB_ID(0x1235, 0x8211),
- return num;
-}
+ /* Has mass-storage device (MSD) mode */
+ //.has_msd_mode = 1,
+
+ /* The first two analogue inputs can be switched between line
+ * and instrument levels.
+ */
+ .level_input_count = 1,
+ .level_input_offset = 1,
+ .level_input_bitmask = 1,
+
+ /* The first two analogue inputs have an optional "air" feature. */
+ .air_input_count = 1,
+ .air_input_bitmask = 1,
+
+ /* The device has 'Direct Monitor' feature */
+ .has_direct_monitor = 1,
+
+ /* One 48V phantom power switch */
+ .power_48v_count = 1,
+
+ /* Has a 'Retain 48V' switch */
+ .has_retain48v = 1,
+
+ /* 26 bytes configuration space */
+ .config_size = 29,
+
+ /* Number of gain halos */
+ .gain_halos_count = 2,
+
+ .config = scarlett2_home_config_items,
+
+ .port_names = ssolo_gen3_port_names,
+
+ .ports = {
+ [SCARLETT2_PORT_TYPE_ANALOGUE] = {
+ .id = SCARLETT2_PORT_ID_ANALOGUE,
+ .num = { 2, 2, 2, 2, 2 },
+ .src_descr = "Analogue In %02d",
+ .src_num_offset = 1,
+ .dst_descr = "Analogue Out %02d"
+ },
+ [SCARLETT2_PORT_TYPE_PCM] = {
+ .id = SCARLETT2_PORT_ID_PCM,
+ .num = { 2, 2, 2, 2, 2 },