2 * Additional mixer mapping
4 * Copyright (c) 2002 by Takashi Iwai <tiwai@suse.de>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 struct usbmix_dB_map {
27 struct usbmix_name_map {
31 const struct usbmix_dB_map *dB;
34 struct usbmix_selector_map {
40 struct usbmix_ctl_map {
42 const struct usbmix_name_map *map;
43 const struct usbmix_selector_map *selector_map;
44 const struct usbmix_connector_map *connector_map;
49 * USB control mappers for SB Exitigy
53 * Topology of SB Extigy (see on the wide screen :)
55 USB_IN[1] --->FU[2]------------------------------+->MU[16]-->PU[17]-+->FU[18]--+->EU[27]--+->EU[21]-->FU[22]--+->FU[23] > Dig_OUT[24]
57 USB_IN[3] -+->SU[5]-->FU[6]--+->MU[14] ->PU[15]->+ | | | +->FU[25] > Dig_OUT[26]
59 Dig_IN[4] -+ | | | | +->FU[28]---------------------> Spk_OUT[19]
61 Lin-IN[7] -+-->FU[8]---------+ | | +----------------------------------------> Hph_OUT[20]
63 Mic-IN[9] --+->FU[10]----------------------------+ |
65 || +----------------------------------------------------+
67 ++--+->SU[11]-->FU[12] --------------------------------------------------------------------------------------> USB_OUT[13]
70 static const struct usbmix_name_map extigy_map[] = {
72 { 2, "PCM Playback" }, /* FU */
74 /* 4: IT digital in */
75 { 5, NULL }, /* DISABLED: this seems to be bogus on some firmware */
76 { 6, "Digital In" }, /* FU */
78 { 8, "Line Playback" }, /* FU */
80 { 10, "Mic Playback" }, /* FU */
81 { 11, "Capture Source" }, /* SU */
82 { 12, "Capture" }, /* FU */
83 /* 13: OT pcm capture */
84 /* 14: MU (w/o controls) */
86 /* 16: MU (w/o controls) */
87 { 17, NULL, 1 }, /* DISABLED: PU-switch (any effect?) */
88 { 17, "Channel Routing", 2 }, /* PU: mode select */
89 { 18, "Tone Control - Bass", UAC_FU_BASS }, /* FU */
90 { 18, "Tone Control - Treble", UAC_FU_TREBLE }, /* FU */
91 { 18, "Master Playback" }, /* FU; others */
93 /* 20: OT headphone */
94 { 21, NULL }, /* DISABLED: EU (for what?) */
95 { 22, "Digital Out Playback" }, /* FU */
96 { 23, "Digital Out1 Playback" }, /* FU */ /* FIXME: corresponds to 24 */
97 /* 24: OT digital out */
98 { 25, "IEC958 Optical Playback" }, /* FU */
99 { 26, "IEC958 Optical Playback" }, /* OT */
100 { 27, NULL }, /* DISABLED: EU (for what?) */
101 /* 28: FU speaker (mute) */
102 { 29, NULL }, /* Digital Input Playback Source? */
103 { 0 } /* terminator */
106 /* Sound Blaster MP3+ controls mapping
107 * The default mixer channels have totally misleading names,
108 * e.g. no Master and fake PCM volume
109 * Pavel Mihaylov <bin@bash.info>
111 static const struct usbmix_dB_map mp3plus_dB_1 = {.min = -4781, .max = 0};
113 static const struct usbmix_dB_map mp3plus_dB_2 = {.min = -1781, .max = 618};
116 static const struct usbmix_name_map mp3plus_map[] = {
120 /* 4: IT digital in */
121 /* 5: OT digital out */
123 /* 7: OT pcm capture */
124 { 8, "Capture Source" }, /* FU, default PCM Capture Source */
125 /* (Mic, Input 1 = Line input, Input 2 = Optical input) */
126 { 9, "Master Playback" }, /* FU, default Speaker 1 */
127 /* { 10, "Mic Capture", 1 }, */ /* FU, Mic Capture */
128 { 10, /* "Mic Capture", */ NULL, 2, .dB = &mp3plus_dB_2 },
129 /* FU, Mic Capture */
130 { 10, "Mic Boost", 7 }, /* FU, default Auto Gain Input */
131 { 11, "Line Capture", .dB = &mp3plus_dB_2 },
132 /* FU, default PCM Capture */
133 { 12, "Digital In Playback" }, /* FU, default PCM 1 */
134 { 13, /* "Mic Playback", */ .dB = &mp3plus_dB_1 },
135 /* FU, default Mic Playback */
136 { 14, "Line Playback", .dB = &mp3plus_dB_1 }, /* FU, default Speaker */
138 { 0 } /* terminator */
141 /* Topology of SB Audigy 2 NX
143 +----------------------------->EU[27]--+
145 | +----------------------------------->SU[29]---->FU[22]-->Dig_OUT[24]
147 USB_IN[1]-+------------+ +->EU[17]->+->FU[11]-+
149 Dig_IN[4]---+->FU[6]-->MU[16]->FU[18]-+->EU[21]->SU[31]----->FU[30]->Hph_OUT[20]
151 Lin_IN[7]-+--->FU[8]---+ +->EU[23]->FU[28]------------->Spk_OUT[19]
153 +--->FU[12]------------------------------------->SU[14]--->USB_OUT[15]
155 +->FU[13]--------------------------------------+
157 static const struct usbmix_name_map audigy2nx_map[] = {
158 /* 1: IT pcm playback */
159 /* 4: IT digital in */
160 { 6, "Digital In Playback" }, /* FU */
162 { 8, "Line Playback" }, /* FU */
163 { 11, "What-U-Hear Capture" }, /* FU */
164 { 12, "Line Capture" }, /* FU */
165 { 13, "Digital In Capture" }, /* FU */
166 { 14, "Capture Source" }, /* SU */
167 /* 15: OT pcm capture */
168 /* 16: MU w/o controls */
169 { 17, NULL }, /* DISABLED: EU (for what?) */
170 { 18, "Master Playback" }, /* FU */
172 /* 20: OT headphone */
173 { 21, NULL }, /* DISABLED: EU (for what?) */
174 { 22, "Digital Out Playback" }, /* FU */
175 { 23, NULL }, /* DISABLED: EU (for what?) */
176 /* 24: OT digital out */
177 { 27, NULL }, /* DISABLED: EU (for what?) */
178 { 28, "Speaker Playback" }, /* FU */
179 { 29, "Digital Out Source" }, /* SU */
180 { 30, "Headphone Playback" }, /* FU */
181 { 31, "Headphone Source" }, /* SU */
182 { 0 } /* terminator */
185 static const struct usbmix_name_map mbox1_map[] = {
187 { 0 } /* terminator */
190 static const struct usbmix_selector_map c400_selectors[] = {
194 .names = (const char*[]) {"Internal", "SPDIF"}
196 { 0 } /* terminator */
199 static const struct usbmix_selector_map audigy2nx_selectors[] = {
201 .id = 14, /* Capture Source */
203 .names = (const char*[]) {"Line", "Digital In", "What-U-Hear"}
206 .id = 29, /* Digital Out Source */
208 .names = (const char*[]) {"Front", "PCM", "Digital In"}
211 .id = 31, /* Headphone Source */
213 .names = (const char*[]) {"Front", "Side"}
215 { 0 } /* terminator */
218 /* Creative SoundBlaster Live! 24-bit External */
219 static const struct usbmix_name_map live24ext_map[] = {
220 /* 2: PCM Playback Volume */
221 { 5, "Mic Capture" }, /* FU, default PCM Capture Volume */
222 { 0 } /* terminator */
225 /* LineX FM Transmitter entry - needed to bypass controls bug */
226 static const struct usbmix_name_map linex_map[] = {
229 { 3, "Master" }, /* FU: master volume - left / right / mute */
230 { 0 } /* terminator */
233 static const struct usbmix_name_map maya44_map[] = {
235 { 2, "Line Playback" }, /* FU */
237 { 4, "Line Playback" }, /* FU */
238 /* 5: IT pcm playback */
240 { 7, "Master Playback" }, /* FU */
243 { 10, "Line Capture" }, /* FU */
245 /* 12: OT pcm capture */
249 /* Section "justlink_map" below added by James Courtier-Dutton <James@superbug.demon.co.uk>
250 * sourced from Maplin Electronics (http://www.maplin.co.uk), part number A56AK
251 * Part has 2 connectors that act as a single output. (TOSLINK Optical for digital out, and 3.5mm Jack for Analogue out.)
252 * The USB Mixer publishes a Microphone and extra Volume controls for it, but none exist on the device,
253 * so this map removes all unwanted sliders from alsamixer
256 static const struct usbmix_name_map justlink_map[] = {
257 /* 1: IT pcm playback */
259 { 3, NULL}, /* IT mic (No mic input on device) */
262 /* 6: OT pcm capture */
263 { 7, "Master Playback" }, /* Mute/volume for speaker */
264 { 8, NULL }, /* Capture Switch (No capture inputs on device) */
265 { 9, NULL }, /* Capture Mute/volume (No capture inputs on device */
266 /* 0xa: Not present */
267 /* 0xb: MU (w/o controls) */
268 { 0xc, NULL }, /* Mic feedback Mute/volume (No capture inputs on device) */
269 { 0 } /* terminator */
272 /* TerraTec Aureon 5.1 MkII USB */
273 static const struct usbmix_name_map aureon_51_2_map[] = {
281 { 8, "Capture Source" }, /* SU */
282 { 9, "Master Playback" }, /* FU */
283 { 10, "Mic Capture" }, /* FU */
284 { 11, "Line Capture" }, /* FU */
285 { 12, "IEC958 In Capture" }, /* FU */
286 { 13, "Mic Playback" }, /* FU */
287 { 14, "Line Playback" }, /* FU */
292 static const struct usbmix_name_map scratch_live_map[] = {
293 /* 1: IT Line 1 (USB streaming) */
294 /* 2: OT Line 1 (Speaker) */
295 /* 3: IT Line 1 (Line connector) */
296 { 4, "Line 1 In" }, /* FU */
297 /* 5: OT Line 1 (USB streaming) */
298 /* 6: IT Line 2 (USB streaming) */
299 /* 7: OT Line 2 (Speaker) */
300 /* 8: IT Line 2 (Line connector) */
301 { 9, "Line 2 In" }, /* FU */
302 /* 10: OT Line 2 (USB streaming) */
303 /* 11: IT Mic (Line connector) */
304 /* 12: OT Mic (USB streaming) */
305 { 0 } /* terminator */
308 static const struct usbmix_name_map ebox44_map[] = {
309 { 4, NULL }, /* FU */
310 { 6, NULL }, /* MU */
311 { 7, NULL }, /* FU */
312 { 10, NULL }, /* FU */
313 { 11, NULL }, /* MU */
317 /* "Gamesurround Muse Pocket LT" looks same like "Sound Blaster MP3+"
318 * most importand difference is SU[8], it should be set to "Capture Source"
319 * to make alsamixer and PA working properly.
320 * FIXME: or mp3plus_map should use "Capture Source" too,
321 * so this maps can be merget
323 static const struct usbmix_name_map hercules_usb51_map[] = {
324 { 8, "Capture Source" }, /* SU, default "PCM Capture Source" */
325 { 9, "Master Playback" }, /* FU, default "Speaker Playback" */
326 { 10, "Mic Boost", 7 }, /* FU, default "Auto Gain Input" */
327 { 11, "Line Capture" }, /* FU, default "PCM Capture" */
328 { 13, "Mic Bypass Playback" }, /* FU, default "Mic Playback" */
329 { 14, "Line Bypass Playback" }, /* FU, default "Line Playback" */
330 { 0 } /* terminator */
333 /* Plantronics Gamecom 780 has a broken volume control, better to disable it */
334 static const struct usbmix_name_map gamecom780_map[] = {
335 { 9, NULL }, /* FU, speaker out */
339 /* some (all?) SCMS USB3318 devices are affected by a firmware lock up
340 * when anything attempts to access FU 10 (control)
342 static const struct usbmix_name_map scms_usb3318_map[] = {
347 /* Bose companion 5, the dB conversion factor is 16 instead of 256 */
348 static const struct usbmix_dB_map bose_companion5_dB = {-5006, -6};
349 static const struct usbmix_name_map bose_companion5_map[] = {
350 { 3, NULL, .dB = &bose_companion5_dB },
351 { 0 } /* terminator */
354 /* Sennheiser Communications Headset [PC 8], the dB value is reported as -6 negative maximum */
355 static const struct usbmix_dB_map sennheiser_pc8_dB = {-9500, 0};
356 static const struct usbmix_name_map sennheiser_pc8_map[] = {
357 { 9, NULL, .dB = &sennheiser_pc8_dB },
358 { 0 } /* terminator */
362 * Dell usb dock with ALC4020 codec had a firmware problem where it got
363 * screwed up when zero volume is passed; just skip it as a workaround
365 * Also the extension unit gives an access error, so skip it as well.
367 static const struct usbmix_name_map dell_alc4020_map[] = {
368 { 4, NULL }, /* extension unit */
374 /* Some mobos shipped with a dummy HD-audio show the invalid GET_MIN/GET_MAX
375 * response for Input Gain Pad (id=19, control=12) and the connector status
376 * for SPDIF terminal (id=18). Skip them.
378 static const struct usbmix_name_map asus_rog_map[] = {
379 { 18, NULL }, /* OT, connector control */
380 { 19, NULL, 12 }, /* FU, Input Gain Pad */
384 /* TRX40 mobos with Realtek ALC1220-VB */
385 static const struct usbmix_name_map trx40_mobo_map[] = {
386 { 18, NULL }, /* OT, IEC958 - broken response, disabled */
387 { 19, NULL, 12 }, /* FU, Input Gain Pad - broken response, disabled */
388 { 16, "Speaker" }, /* OT */
389 { 22, "Speaker Playback" }, /* FU */
390 { 7, "Line" }, /* IT */
391 { 19, "Line Capture" }, /* FU */
392 { 17, "Front Headphone" }, /* OT */
393 { 23, "Front Headphone Playback" }, /* FU */
394 { 8, "Mic" }, /* IT */
395 { 20, "Mic Capture" }, /* FU */
396 { 9, "Front Mic" }, /* IT */
397 { 21, "Front Mic Capture" }, /* FU */
398 { 24, "IEC958 Playback" }, /* FU */
402 static const struct usbmix_connector_map trx40_mobo_connector_map[] = {
403 { 10, 16 }, /* (Back) Speaker */
404 { 11, 17 }, /* Front Headphone */
405 { 13, 7 }, /* Line */
407 { 15, 9 }, /* Front Mic */
411 /* Rear panel + front mic on Gigabyte TRX40 Aorus Master with ALC1220-VB */
412 static const struct usbmix_name_map aorus_master_alc1220vb_map[] = {
413 { 17, NULL }, /* OT, IEC958?, disabled */
414 { 19, NULL, 12 }, /* FU, Input Gain Pad - broken response, disabled */
415 { 16, "Line Out" }, /* OT */
416 { 22, "Line Out Playback" }, /* FU */
417 { 7, "Line" }, /* IT */
418 { 19, "Line Capture" }, /* FU */
419 { 8, "Mic" }, /* IT */
420 { 20, "Mic Capture" }, /* FU */
421 { 9, "Front Mic" }, /* IT */
422 { 21, "Front Mic Capture" }, /* FU */
427 * Control map entries
430 static const struct usbmix_ctl_map usbmix_ctl_maps[] = {
432 .id = USB_ID(0x041e, 0x3000),
434 .ignore_ctl_error = 1,
437 .id = USB_ID(0x041e, 0x3010),
441 .id = USB_ID(0x041e, 0x3020),
442 .map = audigy2nx_map,
443 .selector_map = audigy2nx_selectors,
446 .id = USB_ID(0x041e, 0x3040),
447 .map = live24ext_map,
450 .id = USB_ID(0x041e, 0x3048),
451 .map = audigy2nx_map,
452 .selector_map = audigy2nx_selectors,
454 { /* Logitech, Inc. QuickCam Pro for Notebooks */
455 .id = USB_ID(0x046d, 0x0991),
456 .ignore_ctl_error = 1,
458 { /* Logitech, Inc. QuickCam E 3500 */
459 .id = USB_ID(0x046d, 0x09a4),
460 .ignore_ctl_error = 1,
462 { /* Plantronics GameCom 780 */
463 .id = USB_ID(0x047f, 0xc010),
464 .map = gamecom780_map,
467 /* Hercules DJ Console (Windows Edition) */
468 .id = USB_ID(0x06f8, 0xb000),
469 .ignore_ctl_error = 1,
472 /* Hercules DJ Console (Macintosh Edition) */
473 .id = USB_ID(0x06f8, 0xd002),
474 .ignore_ctl_error = 1,
477 /* Hercules Gamesurround Muse Pocket LT
478 * (USB 5.1 Channel Audio Adapter)
480 .id = USB_ID(0x06f8, 0xc000),
481 .map = hercules_usb51_map,
484 .id = USB_ID(0x0763, 0x2030),
485 .selector_map = c400_selectors,
488 .id = USB_ID(0x0763, 0x2031),
489 .selector_map = c400_selectors,
492 .id = USB_ID(0x08bb, 0x2702),
494 .ignore_ctl_error = 1,
497 .id = USB_ID(0x0a92, 0x0091),
501 .id = USB_ID(0x0c45, 0x1158),
505 .id = USB_ID(0x0ccd, 0x0028),
506 .map = aureon_51_2_map,
509 .id = USB_ID(0x0bda, 0x4014),
510 .map = dell_alc4020_map,
513 .id = USB_ID(0x0dba, 0x1000),
517 .id = USB_ID(0x13e5, 0x0001),
518 .map = scratch_live_map,
519 .ignore_ctl_error = 1,
522 .id = USB_ID(0x200c, 0x1018),
527 .id = USB_ID(0x2573, 0x0008),
532 .id = USB_ID(0x27ac, 0x1000),
533 .map = scms_usb3318_map,
537 .id = USB_ID(0x25c4, 0x0003),
538 .map = scms_usb3318_map,
541 /* Bose Companion 5 */
542 .id = USB_ID(0x05a7, 0x1020),
543 .map = bose_companion5_map,
545 { /* Gigabyte TRX40 Aorus Master (rear panel + front mic) */
546 .id = USB_ID(0x0414, 0xa001),
547 .map = aorus_master_alc1220vb_map,
549 { /* Gigabyte TRX40 Aorus Pro WiFi */
550 .id = USB_ID(0x0414, 0xa002),
551 .map = trx40_mobo_map,
552 .connector_map = trx40_mobo_connector_map,
554 { /* ASUS ROG Zenith II */
555 .id = USB_ID(0x0b05, 0x1916),
558 { /* ASUS ROG Strix */
559 .id = USB_ID(0x0b05, 0x1917),
562 { /* MSI TRX40 Creator */
563 .id = USB_ID(0x0db0, 0x0d64),
564 .map = trx40_mobo_map,
565 .connector_map = trx40_mobo_connector_map,
568 .id = USB_ID(0x0db0, 0x543d),
569 .map = trx40_mobo_map,
570 .connector_map = trx40_mobo_connector_map,
572 { /* Asrock TRX40 Creator */
573 .id = USB_ID(0x26ce, 0x0a01),
574 .map = trx40_mobo_map,
575 .connector_map = trx40_mobo_connector_map,
577 { 0 } /* terminator */
581 * Control map entries for UAC3 BADD profiles
584 static const struct usbmix_name_map uac3_badd_generic_io_map[] = {
585 { UAC3_BADD_FU_ID2, "Generic Out Playback" },
586 { UAC3_BADD_FU_ID5, "Generic In Capture" },
587 { 0 } /* terminator */
589 static const struct usbmix_name_map uac3_badd_headphone_map[] = {
590 { UAC3_BADD_FU_ID2, "Headphone Playback" },
591 { 0 } /* terminator */
593 static const struct usbmix_name_map uac3_badd_speaker_map[] = {
594 { UAC3_BADD_FU_ID2, "Speaker Playback" },
595 { 0 } /* terminator */
597 static const struct usbmix_name_map uac3_badd_microphone_map[] = {
598 { UAC3_BADD_FU_ID5, "Mic Capture" },
599 { 0 } /* terminator */
601 /* Covers also 'headset adapter' profile */
602 static const struct usbmix_name_map uac3_badd_headset_map[] = {
603 { UAC3_BADD_FU_ID2, "Headset Playback" },
604 { UAC3_BADD_FU_ID5, "Headset Capture" },
605 { UAC3_BADD_FU_ID7, "Sidetone Mixing" },
606 { 0 } /* terminator */
608 static const struct usbmix_name_map uac3_badd_speakerphone_map[] = {
609 { UAC3_BADD_FU_ID2, "Speaker Playback" },
610 { UAC3_BADD_FU_ID5, "Mic Capture" },
611 { 0 } /* terminator */
614 static const struct usbmix_ctl_map uac3_badd_usbmix_ctl_maps[] = {
616 .id = UAC3_FUNCTION_SUBCLASS_GENERIC_IO,
617 .map = uac3_badd_generic_io_map,
620 .id = UAC3_FUNCTION_SUBCLASS_HEADPHONE,
621 .map = uac3_badd_headphone_map,
624 .id = UAC3_FUNCTION_SUBCLASS_SPEAKER,
625 .map = uac3_badd_speaker_map,
628 .id = UAC3_FUNCTION_SUBCLASS_MICROPHONE,
629 .map = uac3_badd_microphone_map,
632 .id = UAC3_FUNCTION_SUBCLASS_HEADSET,
633 .map = uac3_badd_headset_map,
636 .id = UAC3_FUNCTION_SUBCLASS_HEADSET_ADAPTER,
637 .map = uac3_badd_headset_map,
640 .id = UAC3_FUNCTION_SUBCLASS_SPEAKERPHONE,
641 .map = uac3_badd_speakerphone_map,
644 /* Sennheiser Communications Headset [PC 8] */
645 .id = USB_ID(0x1395, 0x0025),
646 .map = sennheiser_pc8_map,
648 { 0 } /* terminator */