Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Additional mixer mapping |
| 3 | * |
| 4 | * Copyright (c) 2002 by Takashi Iwai <tiwai@suse.de> |
| 5 | * |
| 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. |
| 10 | * |
| 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. |
| 15 | * |
| 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 |
| 19 | * |
| 20 | */ |
| 21 | |
| 22 | |
| 23 | struct usbmix_name_map { |
| 24 | int id; |
| 25 | const char *name; |
| 26 | int control; |
| 27 | }; |
| 28 | |
Clemens Ladisch | 8e062ec | 2005-04-22 15:49:52 +0200 | [diff] [blame] | 29 | struct usbmix_selector_map { |
| 30 | int id; |
| 31 | int count; |
| 32 | const char **names; |
| 33 | }; |
| 34 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 | struct usbmix_ctl_map { |
Clemens Ladisch | 27d10f5 | 2005-05-02 08:51:26 +0200 | [diff] [blame] | 36 | u32 id; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | const struct usbmix_name_map *map; |
Clemens Ladisch | 8e062ec | 2005-04-22 15:49:52 +0200 | [diff] [blame] | 38 | const struct usbmix_selector_map *selector_map; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | int ignore_ctl_error; |
| 40 | }; |
| 41 | |
| 42 | /* |
| 43 | * USB control mappers for SB Exitigy |
| 44 | */ |
| 45 | |
| 46 | /* |
| 47 | * Topology of SB Extigy (see on the wide screen :) |
| 48 | |
| 49 | USB_IN[1] --->FU[2]------------------------------+->MU[16]-->PU[17]-+->FU[18]--+->EU[27]--+->EU[21]-->FU[22]--+->FU[23] > Dig_OUT[24] |
| 50 | ^ | | | | |
| 51 | USB_IN[3] -+->SU[5]-->FU[6]--+->MU[14] ->PU[15]->+ | | | +->FU[25] > Dig_OUT[26] |
| 52 | ^ ^ | | | | |
| 53 | Dig_IN[4] -+ | | | | +->FU[28]---------------------> Spk_OUT[19] |
| 54 | | | | | |
| 55 | Lin-IN[7] -+-->FU[8]---------+ | | +----------------------------------------> Hph_OUT[20] |
| 56 | | | | |
| 57 | Mic-IN[9] --+->FU[10]----------------------------+ | |
| 58 | || | |
| 59 | || +----------------------------------------------------+ |
| 60 | VV V |
| 61 | ++--+->SU[11]-->FU[12] --------------------------------------------------------------------------------------> USB_OUT[13] |
| 62 | */ |
| 63 | |
| 64 | static struct usbmix_name_map extigy_map[] = { |
| 65 | /* 1: IT pcm */ |
| 66 | { 2, "PCM Playback" }, /* FU */ |
| 67 | /* 3: IT pcm */ |
| 68 | /* 4: IT digital in */ |
| 69 | { 5, NULL }, /* DISABLED: this seems to be bogus on some firmware */ |
| 70 | { 6, "Digital In" }, /* FU */ |
| 71 | /* 7: IT line */ |
| 72 | { 8, "Line Playback" }, /* FU */ |
| 73 | /* 9: IT mic */ |
| 74 | { 10, "Mic Playback" }, /* FU */ |
| 75 | { 11, "Capture Input Source" }, /* SU */ |
| 76 | { 12, "Capture" }, /* FU */ |
| 77 | /* 13: OT pcm capture */ |
| 78 | /* 14: MU (w/o controls) */ |
| 79 | /* 15: PU (3D enh) */ |
| 80 | /* 16: MU (w/o controls) */ |
| 81 | { 17, NULL, 1 }, /* DISABLED: PU-switch (any effect?) */ |
| 82 | { 17, "Channel Routing", 2 }, /* PU: mode select */ |
| 83 | { 18, "Tone Control - Bass", USB_FEATURE_BASS }, /* FU */ |
| 84 | { 18, "Tone Control - Treble", USB_FEATURE_TREBLE }, /* FU */ |
| 85 | { 18, "Master Playback" }, /* FU; others */ |
| 86 | /* 19: OT speaker */ |
| 87 | /* 20: OT headphone */ |
| 88 | { 21, NULL }, /* DISABLED: EU (for what?) */ |
| 89 | { 22, "Digital Out Playback" }, /* FU */ |
| 90 | { 23, "Digital Out1 Playback" }, /* FU */ /* FIXME: corresponds to 24 */ |
| 91 | /* 24: OT digital out */ |
| 92 | { 25, "IEC958 Optical Playback" }, /* FU */ |
| 93 | { 26, "IEC958 Optical Playback" }, /* OT */ |
| 94 | { 27, NULL }, /* DISABLED: EU (for what?) */ |
| 95 | /* 28: FU speaker (mute) */ |
| 96 | { 29, NULL }, /* Digital Input Playback Source? */ |
| 97 | { 0 } /* terminator */ |
| 98 | }; |
| 99 | |
Takashi Iwai | 54ab87e | 2005-04-01 13:14:14 +0200 | [diff] [blame] | 100 | /* Sound Blaster MP3+ controls mapping |
| 101 | * The default mixer channels have totally misleading names, |
| 102 | * e.g. no Master and fake PCM volume |
| 103 | * Pavel Mihaylov <bin@bash.info> |
| 104 | */ |
| 105 | static struct usbmix_name_map mp3plus_map[] = { |
| 106 | /* 1: IT pcm */ |
| 107 | /* 2: IT mic */ |
| 108 | /* 3: IT line */ |
| 109 | /* 4: IT digital in */ |
| 110 | /* 5: OT digital out */ |
| 111 | /* 6: OT speaker */ |
| 112 | /* 7: OT pcm capture */ |
| 113 | { 8, "Capture Input Source" }, /* FU, default PCM Capture Source */ |
| 114 | /* (Mic, Input 1 = Line input, Input 2 = Optical input) */ |
| 115 | { 9, "Master Playback" }, /* FU, default Speaker 1 */ |
| 116 | /* { 10, "Mic Capture", 1 }, */ /* FU, Mic Capture */ |
| 117 | /* { 10, "Mic Capture", 2 }, */ /* FU, Mic Capture */ |
| 118 | { 10, "Mic Boost", 7 }, /* FU, default Auto Gain Input */ |
| 119 | { 11, "Line Capture" }, /* FU, default PCM Capture */ |
| 120 | { 12, "Digital In Playback" }, /* FU, default PCM 1 */ |
| 121 | /* { 13, "Mic Playback" }, */ /* FU, default Mic Playback */ |
| 122 | { 14, "Line Playback" }, /* FU, default Speaker */ |
| 123 | /* 15: MU */ |
| 124 | { 0 } /* terminator */ |
| 125 | }; |
| 126 | |
Clemens Ladisch | 863ad94 | 2005-04-22 08:52:03 +0200 | [diff] [blame] | 127 | /* Topology of SB Audigy 2 NX |
| 128 | |
| 129 | +----------------------------->EU[27]--+ |
| 130 | | v |
| 131 | | +----------------------------------->SU[29]---->FU[22]-->Dig_OUT[24] |
| 132 | | | ^ |
| 133 | USB_IN[1]-+------------+ +->EU[17]->+->FU[11]-+ |
| 134 | | v | v | |
| 135 | Dig_IN[4]---+->FU[6]-->MU[16]->FU[18]-+->EU[21]->SU[31]----->FU[30]->Hph_OUT[20] |
| 136 | | ^ | | |
| 137 | Lin_IN[7]-+--->FU[8]---+ +->EU[23]->FU[28]------------->Spk_OUT[19] |
| 138 | | | v |
| 139 | +--->FU[12]------------------------------------->SU[14]--->USB_OUT[15] |
| 140 | | ^ |
| 141 | +->FU[13]--------------------------------------+ |
| 142 | */ |
| 143 | static struct usbmix_name_map audigy2nx_map[] = { |
| 144 | /* 1: IT pcm playback */ |
| 145 | /* 4: IT digital in */ |
| 146 | { 6, "Digital In Playback" }, /* FU */ |
| 147 | /* 7: IT line in */ |
| 148 | { 8, "Line Playback" }, /* FU */ |
| 149 | { 11, "What-U-Hear Capture" }, /* FU */ |
| 150 | { 12, "Line Capture" }, /* FU */ |
| 151 | { 13, "Digital In Capture" }, /* FU */ |
| 152 | { 14, "Capture Source" }, /* SU */ |
| 153 | /* 15: OT pcm capture */ |
| 154 | /* 16: MU w/o controls */ |
| 155 | { 17, NULL }, /* DISABLED: EU (for what?) */ |
| 156 | { 18, "Master Playback" }, /* FU */ |
| 157 | /* 19: OT speaker */ |
| 158 | /* 20: OT headphone */ |
| 159 | { 21, NULL }, /* DISABLED: EU (for what?) */ |
| 160 | { 22, "Digital Out Playback" }, /* FU */ |
| 161 | { 23, NULL }, /* DISABLED: EU (for what?) */ |
| 162 | /* 24: OT digital out */ |
| 163 | { 27, NULL }, /* DISABLED: EU (for what?) */ |
| 164 | { 28, "Speaker Playback" }, /* FU */ |
| 165 | { 29, "Digital Out Source" }, /* SU */ |
| 166 | { 30, "Headphone Playback" }, /* FU */ |
| 167 | { 31, "Headphone Source" }, /* SU */ |
| 168 | { 0 } /* terminator */ |
| 169 | }; |
| 170 | |
Clemens Ladisch | 8e062ec | 2005-04-22 15:49:52 +0200 | [diff] [blame] | 171 | static struct usbmix_selector_map audigy2nx_selectors[] = { |
| 172 | { |
| 173 | .id = 14, /* Capture Source */ |
| 174 | .count = 3, |
| 175 | .names = (const char*[]) {"Line", "Digital In", "What-U-Hear"} |
| 176 | }, |
| 177 | { |
| 178 | .id = 29, /* Digital Out Source */ |
| 179 | .count = 3, |
| 180 | .names = (const char*[]) {"Front", "PCM", "Digital In"} |
| 181 | }, |
| 182 | { |
| 183 | .id = 31, /* Headphone Source */ |
| 184 | .count = 2, |
| 185 | .names = (const char*[]) {"Front", "Side"} |
| 186 | }, |
| 187 | { 0 } /* terminator */ |
| 188 | }; |
| 189 | |
Timofei Bondarenko | 69b1f1e | 2007-10-30 15:28:14 +0100 | [diff] [blame] | 190 | /* Creative SoundBlaster Live! 24-bit External */ |
| 191 | static struct usbmix_name_map live24ext_map[] = { |
| 192 | /* 2: PCM Playback Volume */ |
| 193 | { 5, "Mic Capture" }, /* FU, default PCM Capture Volume */ |
| 194 | { 0 } /* terminator */ |
| 195 | }; |
| 196 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 197 | /* LineX FM Transmitter entry - needed to bypass controls bug */ |
| 198 | static struct usbmix_name_map linex_map[] = { |
| 199 | /* 1: IT pcm */ |
| 200 | /* 2: OT Speaker */ |
| 201 | { 3, "Master" }, /* FU: master volume - left / right / mute */ |
| 202 | { 0 } /* terminator */ |
| 203 | }; |
| 204 | |
Clemens Ladisch | c7a93b8 | 2006-03-16 08:25:56 +0100 | [diff] [blame] | 205 | static struct usbmix_name_map maya44_map[] = { |
| 206 | /* 1: IT line */ |
| 207 | { 2, "Line Playback" }, /* FU */ |
| 208 | /* 3: IT line */ |
| 209 | { 4, "Line Playback" }, /* FU */ |
| 210 | /* 5: IT pcm playback */ |
| 211 | /* 6: MU */ |
| 212 | { 7, "Master Playback" }, /* FU */ |
| 213 | /* 8: OT speaker */ |
| 214 | /* 9: IT line */ |
| 215 | { 10, "Line Capture" }, /* FU */ |
| 216 | /* 11: MU */ |
| 217 | /* 12: OT pcm capture */ |
| 218 | { } |
| 219 | }; |
| 220 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 221 | /* Section "justlink_map" below added by James Courtier-Dutton <James@superbug.demon.co.uk> |
| 222 | * sourced from Maplin Electronics (http://www.maplin.co.uk), part number A56AK |
| 223 | * Part has 2 connectors that act as a single output. (TOSLINK Optical for digital out, and 3.5mm Jack for Analogue out.) |
| 224 | * The USB Mixer publishes a Microphone and extra Volume controls for it, but none exist on the device, |
| 225 | * so this map removes all unwanted sliders from alsamixer |
| 226 | */ |
| 227 | |
| 228 | static struct usbmix_name_map justlink_map[] = { |
| 229 | /* 1: IT pcm playback */ |
| 230 | /* 2: Not present */ |
| 231 | { 3, NULL}, /* IT mic (No mic input on device) */ |
| 232 | /* 4: Not present */ |
| 233 | /* 5: OT speacker */ |
| 234 | /* 6: OT pcm capture */ |
| 235 | { 7, "Master Playback" }, /* Mute/volume for speaker */ |
| 236 | { 8, NULL }, /* Capture Switch (No capture inputs on device) */ |
| 237 | { 9, NULL }, /* Capture Mute/volume (No capture inputs on device */ |
| 238 | /* 0xa: Not present */ |
| 239 | /* 0xb: MU (w/o controls) */ |
| 240 | { 0xc, NULL }, /* Mic feedback Mute/volume (No capture inputs on device) */ |
| 241 | { 0 } /* terminator */ |
| 242 | }; |
| 243 | |
Clemens Ladisch | fef8a0c | 2006-09-22 11:00:51 +0200 | [diff] [blame] | 244 | /* TerraTec Aureon 5.1 MkII USB */ |
| 245 | static struct usbmix_name_map aureon_51_2_map[] = { |
| 246 | /* 1: IT USB */ |
| 247 | /* 2: IT Mic */ |
| 248 | /* 3: IT Line */ |
| 249 | /* 4: IT SPDIF */ |
| 250 | /* 5: OT SPDIF */ |
| 251 | /* 6: OT Speaker */ |
| 252 | /* 7: OT USB */ |
| 253 | { 8, "Capture Source" }, /* SU */ |
| 254 | { 9, "Master Playback" }, /* FU */ |
| 255 | { 10, "Mic Capture" }, /* FU */ |
| 256 | { 11, "Line Capture" }, /* FU */ |
| 257 | { 12, "IEC958 In Capture" }, /* FU */ |
| 258 | { 13, "Mic Playback" }, /* FU */ |
| 259 | { 14, "Line Playback" }, /* FU */ |
| 260 | /* 15: MU */ |
| 261 | {} /* terminator */ |
| 262 | }; |
| 263 | |
Andreas Bergmeier | 8693290 | 2009-01-18 18:48:03 +0100 | [diff] [blame] | 264 | static struct usbmix_name_map scratch_live_map[] = { |
| 265 | /* 1: IT Line 1 (USB streaming) */ |
| 266 | /* 2: OT Line 1 (Speaker) */ |
| 267 | /* 3: IT Line 1 (Line connector) */ |
| 268 | { 4, "Line 1 In" }, /* FU */ |
| 269 | /* 5: OT Line 1 (USB streaming) */ |
| 270 | /* 6: IT Line 2 (USB streaming) */ |
| 271 | /* 7: OT Line 2 (Speaker) */ |
| 272 | /* 8: IT Line 2 (Line connector) */ |
| 273 | { 9, "Line 2 In" }, /* FU */ |
| 274 | /* 10: OT Line 2 (USB streaming) */ |
| 275 | /* 11: IT Mic (Line connector) */ |
| 276 | /* 12: OT Mic (USB streaming) */ |
| 277 | { 0 } /* terminator */ |
| 278 | }; |
| 279 | |
Alexey Fisher | e0feefc | 2009-12-01 13:40:53 +0100 | [diff] [blame] | 280 | /* "Gamesurround Muse Pocket LT" looks same like "Sound Blaster MP3+" |
| 281 | * most importand difference is SU[8], it should be set to "Capture Source" |
| 282 | * to make alsamixer and PA working properly. |
| 283 | * FIXME: or mp3plus_map should use "Capture Source" too, |
| 284 | * so this maps can be merget |
| 285 | */ |
| 286 | static struct usbmix_name_map hercules_usb51_map[] = { |
| 287 | { 8, "Capture Source" }, /* SU, default "PCM Capture Source" */ |
| 288 | { 9, "Master Playback" }, /* FU, default "Speaker Playback" */ |
| 289 | { 10, "Mic Boost", 7 }, /* FU, default "Auto Gain Input" */ |
| 290 | { 11, "Line Capture" }, /* FU, default "PCM Capture" */ |
| 291 | { 13, "Mic Bypass Playback" }, /* FU, default "Mic Playback" */ |
| 292 | { 14, "Line Bypass Playback" }, /* FU, default "Line Playback" */ |
| 293 | { 0 } /* terminator */ |
| 294 | }; |
| 295 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 296 | /* |
| 297 | * Control map entries |
| 298 | */ |
| 299 | |
| 300 | static struct usbmix_ctl_map usbmix_ctl_maps[] = { |
Clemens Ladisch | 8e062ec | 2005-04-22 15:49:52 +0200 | [diff] [blame] | 301 | { |
Clemens Ladisch | 27d10f5 | 2005-05-02 08:51:26 +0200 | [diff] [blame] | 302 | .id = USB_ID(0x041e, 0x3000), |
Clemens Ladisch | 8e062ec | 2005-04-22 15:49:52 +0200 | [diff] [blame] | 303 | .map = extigy_map, |
| 304 | .ignore_ctl_error = 1, |
| 305 | }, |
| 306 | { |
Clemens Ladisch | 27d10f5 | 2005-05-02 08:51:26 +0200 | [diff] [blame] | 307 | .id = USB_ID(0x041e, 0x3010), |
Clemens Ladisch | 8e062ec | 2005-04-22 15:49:52 +0200 | [diff] [blame] | 308 | .map = mp3plus_map, |
| 309 | }, |
| 310 | { |
Clemens Ladisch | 27d10f5 | 2005-05-02 08:51:26 +0200 | [diff] [blame] | 311 | .id = USB_ID(0x041e, 0x3020), |
Clemens Ladisch | 8e062ec | 2005-04-22 15:49:52 +0200 | [diff] [blame] | 312 | .map = audigy2nx_map, |
| 313 | .selector_map = audigy2nx_selectors, |
| 314 | }, |
Timofei Bondarenko | 69b1f1e | 2007-10-30 15:28:14 +0100 | [diff] [blame] | 315 | { |
| 316 | .id = USB_ID(0x041e, 0x3040), |
| 317 | .map = live24ext_map, |
| 318 | }, |
Clemens Ladisch | 8e062ec | 2005-04-22 15:49:52 +0200 | [diff] [blame] | 319 | { |
Andrea Borgia | 3195954 | 2009-01-07 22:58:50 +0100 | [diff] [blame] | 320 | .id = USB_ID(0x041e, 0x3048), |
| 321 | .map = audigy2nx_map, |
| 322 | .selector_map = audigy2nx_selectors, |
| 323 | }, |
| 324 | { |
Clemens Ladisch | 9c9565f | 2005-10-05 13:02:38 +0200 | [diff] [blame] | 325 | /* Hercules DJ Console (Windows Edition) */ |
| 326 | .id = USB_ID(0x06f8, 0xb000), |
| 327 | .ignore_ctl_error = 1, |
| 328 | }, |
| 329 | { |
| 330 | /* Hercules DJ Console (Macintosh Edition) */ |
Clemens Ladisch | 460dc98 | 2005-09-16 16:56:01 +0200 | [diff] [blame] | 331 | .id = USB_ID(0x06f8, 0xd002), |
| 332 | .ignore_ctl_error = 1, |
| 333 | }, |
| 334 | { |
Alexey Fisher | e0feefc | 2009-12-01 13:40:53 +0100 | [diff] [blame] | 335 | /* Hercules Gamesurround Muse Pocket LT |
| 336 | * (USB 5.1 Channel Audio Adapter) |
| 337 | */ |
| 338 | .id = USB_ID(0x06f8, 0xc000), |
| 339 | .map = hercules_usb51_map, |
| 340 | }, |
| 341 | { |
Clemens Ladisch | 27d10f5 | 2005-05-02 08:51:26 +0200 | [diff] [blame] | 342 | .id = USB_ID(0x08bb, 0x2702), |
Clemens Ladisch | 8e062ec | 2005-04-22 15:49:52 +0200 | [diff] [blame] | 343 | .map = linex_map, |
| 344 | .ignore_ctl_error = 1, |
| 345 | }, |
| 346 | { |
Clemens Ladisch | c7a93b8 | 2006-03-16 08:25:56 +0100 | [diff] [blame] | 347 | .id = USB_ID(0x0a92, 0x0091), |
| 348 | .map = maya44_map, |
| 349 | }, |
| 350 | { |
Clemens Ladisch | 27d10f5 | 2005-05-02 08:51:26 +0200 | [diff] [blame] | 351 | .id = USB_ID(0x0c45, 0x1158), |
Clemens Ladisch | 8e062ec | 2005-04-22 15:49:52 +0200 | [diff] [blame] | 352 | .map = justlink_map, |
| 353 | }, |
Clemens Ladisch | fef8a0c | 2006-09-22 11:00:51 +0200 | [diff] [blame] | 354 | { |
| 355 | .id = USB_ID(0x0ccd, 0x0028), |
| 356 | .map = aureon_51_2_map, |
| 357 | }, |
Andreas Bergmeier | 8693290 | 2009-01-18 18:48:03 +0100 | [diff] [blame] | 358 | { |
| 359 | .id = USB_ID(0x13e5, 0x0001), |
| 360 | .map = scratch_live_map, |
| 361 | .ignore_ctl_error = 1, |
| 362 | }, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 363 | { 0 } /* terminator */ |
| 364 | }; |
| 365 | |