1193640Sariff/*- 2193640Sariff * Copyright (c) 2009 Ariff Abdullah <ariff@FreeBSD.org> 3193640Sariff * All rights reserved. 4193640Sariff * 5193640Sariff * Redistribution and use in source and binary forms, with or without 6193640Sariff * modification, are permitted provided that the following conditions 7193640Sariff * are met: 8193640Sariff * 1. Redistributions of source code must retain the above copyright 9193640Sariff * notice, this list of conditions and the following disclaimer. 10193640Sariff * 2. Redistributions in binary form must reproduce the above copyright 11193640Sariff * notice, this list of conditions and the following disclaimer in the 12193640Sariff * documentation and/or other materials provided with the distribution. 13193640Sariff * 14193640Sariff * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15193640Sariff * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16193640Sariff * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17193640Sariff * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18193640Sariff * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19193640Sariff * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20193640Sariff * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21193640Sariff * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22193640Sariff * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23193640Sariff * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24193640Sariff * SUCH DAMAGE. 25193640Sariff * 26193640Sariff * $FreeBSD: releng/10.2/sys/dev/sound/pcm/matrix_map.h 243138 2012-11-16 07:05:57Z mav $ 27193640Sariff */ 28193640Sariff 29193640Sariff#ifndef _SND_MATRIX_MAP_H_ 30193640Sariff#define _SND_MATRIX_MAP_H_ 31193640Sariff 32193640Sariff/* 33193640Sariff * Standard matrix maps: 34193640Sariff * 35193640Sariff * struct pcmchan_matrix { 36193640Sariff * .id = Matrix identity (see matrix.h). Custom defined should use 37193640Sariff * one of SND_CHN_MATRIX_MISC (for whatever purposes) or 38193640Sariff * SND_CHN_MATRIX_DRV (hardware driver). 39193640Sariff * .channels = Total number of channels, including whatever 'extended' 40193640Sariff * (the X.ext notions, mostly LFE). 41193640Sariff * .ext = Total number of extended channels (LFE). 42193640Sariff * .map = { 43193640Sariff * Sequences of channel type and interleave structure. 44193640Sariff * [interleave offset] = { 45193640Sariff * .type = channel type (see matrix.h). 46193640Sariff * .members = Masks of channels that is acceptable as a 47193640Sariff * member of this channel type. 48193640Sariff * }, 49193640Sariff * [total channels] = { 50193640Sariff * .type = Maximum channels marker (SND_CHN_T_MAX). 51193640Sariff * .members = 0 (no channels allowed here). 52193640Sariff * }, 53193640Sariff * }, 54193640Sariff * .mask = Mask of channels that exist in this map. 55193640Sariff * .offset = { 56193640Sariff * channel offset that directly translate to the above interleave 57193640Sariff * offset according to SND_CHN_T_* definitions. 58193640Sariff * } 59193640Sariff * }; 60193640Sariff * 61193640Sariff * Rule of thumb: Avoid using SND_CHN_T_* that is marked with XXX (matrix.h), 62193640Sariff * or be prepared for the horror to come. 63193640Sariff * 64193640Sariff */ 65193640Sariff 66193640Sariff#define SND_CHN_MATRIX_MAP_1_0 { \ 67193640Sariff .id = SND_CHN_MATRIX_1_0, \ 68193640Sariff .channels = 1, \ 69193640Sariff .ext = 0, \ 70193640Sariff .map = { \ 71193640Sariff /* Mono, center, etc. */ \ 72193640Sariff [0] = { \ 73193640Sariff .type = SND_CHN_T_FL, \ 74193640Sariff .members = \ 75193640Sariff SND_CHN_T_MASK_FL | SND_CHN_T_MASK_FR | \ 76193640Sariff SND_CHN_T_MASK_FC | SND_CHN_T_MASK_LF | \ 77193640Sariff SND_CHN_T_MASK_BL | SND_CHN_T_MASK_BR | \ 78193640Sariff SND_CHN_T_MASK_BC | SND_CHN_T_MASK_SL | \ 79193640Sariff SND_CHN_T_MASK_SR \ 80193640Sariff }, \ 81193640Sariff [1] = { \ 82193640Sariff .type = SND_CHN_T_MAX, \ 83193640Sariff .members = 0 \ 84193640Sariff } \ 85193640Sariff }, \ 86193640Sariff .mask = SND_CHN_T_MASK_FL | SND_CHN_T_MASK_FR | \ 87193640Sariff SND_CHN_T_MASK_FC, \ 88193640Sariff .offset = { 0, 0, 0, 0, 0, 0, -1, -1, 0, \ 89193640Sariff 0, 0, -1, -1, -1, -1, -1, -1, -1 } \ 90193640Sariff} 91193640Sariff 92193640Sariff#define SND_CHN_MATRIX_MAP_2_0 { \ 93193640Sariff .id = SND_CHN_MATRIX_2_0, \ 94193640Sariff .channels = 2, \ 95193640Sariff .ext = 0, \ 96193640Sariff .map = { \ 97193640Sariff /* Left */ \ 98193640Sariff [0] = { \ 99193640Sariff .type = SND_CHN_T_FL, \ 100193640Sariff .members = \ 101193640Sariff SND_CHN_T_MASK_FL | SND_CHN_T_MASK_FC | \ 102193640Sariff SND_CHN_T_MASK_LF | SND_CHN_T_MASK_BL | \ 103193640Sariff SND_CHN_T_MASK_BC | SND_CHN_T_MASK_SL \ 104193640Sariff }, \ 105193640Sariff /* Right */ \ 106193640Sariff [1] = { \ 107193640Sariff .type = SND_CHN_T_FR, \ 108193640Sariff .members = \ 109193640Sariff SND_CHN_T_MASK_FR | SND_CHN_T_MASK_FC | \ 110193640Sariff SND_CHN_T_MASK_LF | SND_CHN_T_MASK_BR | \ 111193640Sariff SND_CHN_T_MASK_BC | SND_CHN_T_MASK_SR \ 112193640Sariff }, \ 113193640Sariff [2] = { \ 114193640Sariff .type = SND_CHN_T_MAX, \ 115193640Sariff .members = 0 \ 116193640Sariff } \ 117193640Sariff }, \ 118193640Sariff .mask = SND_CHN_T_MASK_FL | SND_CHN_T_MASK_FR, \ 119193640Sariff .offset = { 0, 1, -1, -1, -1, -1, -1, -1, -1, \ 120193640Sariff -1, -1, -1, -1, -1, -1, -1, -1, -1 } \ 121193640Sariff} 122193640Sariff 123193640Sariff#define SND_CHN_MATRIX_MAP_2_1 { \ 124193640Sariff .id = SND_CHN_MATRIX_2_1, \ 125193640Sariff .channels = 3, \ 126193640Sariff .ext = 1, \ 127193640Sariff .map = { \ 128193640Sariff /* Left */ \ 129193640Sariff [0] = { \ 130193640Sariff .type = SND_CHN_T_FL, \ 131193640Sariff .members = \ 132193640Sariff SND_CHN_T_MASK_FL | SND_CHN_T_MASK_FC | \ 133193640Sariff SND_CHN_T_MASK_BL | SND_CHN_T_MASK_BC | \ 134193640Sariff SND_CHN_T_MASK_SL \ 135193640Sariff }, \ 136193640Sariff /* Right */ \ 137193640Sariff [1] = { \ 138193640Sariff .type = SND_CHN_T_FR, \ 139193640Sariff .members = \ 140193640Sariff SND_CHN_T_MASK_FR | SND_CHN_T_MASK_FC | \ 141193640Sariff SND_CHN_T_MASK_BR | SND_CHN_T_MASK_BC | \ 142193640Sariff SND_CHN_T_MASK_SR \ 143193640Sariff }, \ 144193640Sariff /* LFE */ \ 145193640Sariff [2] = { \ 146193640Sariff .type = SND_CHN_T_LF, \ 147193640Sariff .members = SND_CHN_T_MASK_LF \ 148193640Sariff }, \ 149193640Sariff [3] = { \ 150193640Sariff .type = SND_CHN_T_MAX, \ 151193640Sariff .members = 0 \ 152193640Sariff } \ 153193640Sariff }, \ 154193640Sariff .mask = SND_CHN_T_MASK_FL | SND_CHN_T_MASK_FR | \ 155193640Sariff SND_CHN_T_MASK_LF, \ 156193640Sariff .offset = { 0, 1, -1, 2, -1, -1, -1, -1, -1, \ 157193640Sariff -1, -1, -1, -1, -1, -1, -1, -1, -1 } \ 158193640Sariff} 159193640Sariff 160193640Sariff#define SND_CHN_MATRIX_MAP_3_0 { /* 3 channels default */ \ 161193640Sariff .id = SND_CHN_MATRIX_3_0, \ 162193640Sariff .channels = 3, \ 163193640Sariff .ext = 0, \ 164193640Sariff .map = { \ 165193640Sariff /* Left */ \ 166193640Sariff [0] = { \ 167193640Sariff .type = SND_CHN_T_FL, \ 168193640Sariff .members = \ 169193640Sariff SND_CHN_T_MASK_FL | SND_CHN_T_MASK_FC | \ 170193640Sariff SND_CHN_T_MASK_LF | SND_CHN_T_MASK_SL \ 171193640Sariff }, \ 172193640Sariff /* Right */ \ 173193640Sariff [1] = { \ 174193640Sariff .type = SND_CHN_T_FR, \ 175193640Sariff .members = \ 176193640Sariff SND_CHN_T_MASK_FR | SND_CHN_T_MASK_FC | \ 177193640Sariff SND_CHN_T_MASK_LF | SND_CHN_T_MASK_SR \ 178193640Sariff }, \ 179193640Sariff /* Rear Center */ \ 180193640Sariff [2] = { \ 181193640Sariff .type = SND_CHN_T_BC, \ 182193640Sariff .members = \ 183193640Sariff SND_CHN_T_MASK_LF | SND_CHN_T_MASK_BL | \ 184193640Sariff SND_CHN_T_MASK_BR | SND_CHN_T_MASK_BC | \ 185193640Sariff SND_CHN_T_MASK_SL | SND_CHN_T_MASK_SR \ 186193640Sariff }, \ 187193640Sariff [3] = { \ 188193640Sariff .type = SND_CHN_T_MAX, \ 189193640Sariff .members = 0 \ 190193640Sariff } \ 191193640Sariff }, \ 192193640Sariff .mask = SND_CHN_T_MASK_FL | SND_CHN_T_MASK_FR | \ 193193640Sariff SND_CHN_T_MASK_BC, \ 194193640Sariff .offset = { 0, 1, -1, -1, -1, -1, -1, -1, 2, \ 195193640Sariff -1, -1, -1, -1, -1, -1, -1, -1, -1 } \ 196193640Sariff} 197193640Sariff 198243138Smav#define SND_CHN_MATRIX_MAP_3_1 { \ 199243138Smav .id = SND_CHN_MATRIX_3_1, \ 200243138Smav .channels = 4, \ 201243138Smav .ext = 1, \ 202243138Smav .map = { \ 203243138Smav /* Left */ \ 204243138Smav [0] = { \ 205243138Smav .type = SND_CHN_T_FL, \ 206243138Smav .members = \ 207243138Smav SND_CHN_T_MASK_FL | SND_CHN_T_MASK_FC | \ 208243138Smav SND_CHN_T_MASK_SL \ 209243138Smav }, \ 210243138Smav /* Right */ \ 211243138Smav [1] = { \ 212243138Smav .type = SND_CHN_T_FR, \ 213243138Smav .members = \ 214243138Smav SND_CHN_T_MASK_FR | SND_CHN_T_MASK_FC | \ 215243138Smav SND_CHN_T_MASK_SR \ 216243138Smav }, \ 217243138Smav /* LFE */ \ 218243138Smav [2] = { \ 219243138Smav .type = SND_CHN_T_LF, \ 220243138Smav .members = SND_CHN_T_MASK_LF \ 221243138Smav }, \ 222243138Smav /* Rear Center */ \ 223243138Smav [3] = { \ 224243138Smav .type = SND_CHN_T_BC, \ 225243138Smav .members = \ 226243138Smav SND_CHN_T_MASK_BL | SND_CHN_T_MASK_BR | \ 227243138Smav SND_CHN_T_MASK_BC | \ 228243138Smav SND_CHN_T_MASK_SL | SND_CHN_T_MASK_SR \ 229243138Smav }, \ 230243138Smav [4] = { \ 231243138Smav .type = SND_CHN_T_MAX, \ 232243138Smav .members = 0 \ 233243138Smav } \ 234243138Smav }, \ 235243138Smav .mask = SND_CHN_T_MASK_FL | SND_CHN_T_MASK_FR | \ 236243138Smav SND_CHN_T_MASK_LF | SND_CHN_T_MASK_BC, \ 237243138Smav .offset = { 0, 1, -1, 2, -1, -1, -1, -1, 3, \ 238243138Smav -1, -1, -1, -1, -1, -1, -1, -1, -1 } \ 239243138Smav} 240243138Smav 241193640Sariff#define SND_CHN_MATRIX_MAP_4_0 { \ 242193640Sariff .id = SND_CHN_MATRIX_4_0, \ 243193640Sariff .channels = 4, \ 244193640Sariff .ext = 0, \ 245193640Sariff .map = { \ 246193640Sariff /* Left */ \ 247193640Sariff [0] = { \ 248193640Sariff .type = SND_CHN_T_FL, \ 249193640Sariff .members = \ 250193640Sariff SND_CHN_T_MASK_FL | SND_CHN_T_MASK_FC | \ 251193640Sariff SND_CHN_T_MASK_LF | SND_CHN_T_MASK_SL \ 252193640Sariff }, \ 253193640Sariff /* Right */ \ 254193640Sariff [1] = { \ 255193640Sariff .type = SND_CHN_T_FR, \ 256193640Sariff .members = \ 257193640Sariff SND_CHN_T_MASK_FR | SND_CHN_T_MASK_FC | \ 258193640Sariff SND_CHN_T_MASK_LF | SND_CHN_T_MASK_SR \ 259193640Sariff }, \ 260193640Sariff /* Rear Left */ \ 261193640Sariff [2] = { \ 262193640Sariff .type = SND_CHN_T_BL, \ 263193640Sariff .members = \ 264193640Sariff SND_CHN_T_MASK_LF | SND_CHN_T_MASK_BL | \ 265193640Sariff SND_CHN_T_MASK_BC | SND_CHN_T_MASK_SL \ 266193640Sariff }, \ 267193640Sariff /* Rear Right */ \ 268193640Sariff [3] = { \ 269193640Sariff .type = SND_CHN_T_BR, \ 270193640Sariff .members = \ 271193640Sariff SND_CHN_T_MASK_LF | SND_CHN_T_MASK_BR | \ 272193640Sariff SND_CHN_T_MASK_BC | SND_CHN_T_MASK_SR \ 273193640Sariff }, \ 274193640Sariff [4] = { \ 275193640Sariff .type = SND_CHN_T_MAX, \ 276193640Sariff .members = 0 \ 277193640Sariff } \ 278193640Sariff }, \ 279193640Sariff .mask = SND_CHN_T_MASK_FL | SND_CHN_T_MASK_FR | \ 280193640Sariff SND_CHN_T_MASK_BL | SND_CHN_T_MASK_BR, \ 281193640Sariff .offset = { 0, 1, -1, -1, 2, 3, -1, -1, -1, \ 282193640Sariff -1, -1, -1, -1, -1, -1, -1, -1, -1 } \ 283193640Sariff} 284193640Sariff 285193640Sariff#define SND_CHN_MATRIX_MAP_4_1 { \ 286193640Sariff .id = SND_CHN_MATRIX_4_1, \ 287193640Sariff .channels = 5, \ 288193640Sariff .ext = 1, \ 289193640Sariff .map = { \ 290193640Sariff /* Left */ \ 291193640Sariff [0] = { \ 292193640Sariff .type = SND_CHN_T_FL, \ 293193640Sariff .members = \ 294193640Sariff SND_CHN_T_MASK_FL | SND_CHN_T_MASK_FC | \ 295193640Sariff SND_CHN_T_MASK_SL \ 296193640Sariff }, \ 297193640Sariff /* Right */ \ 298193640Sariff [1] = { \ 299193640Sariff .type = SND_CHN_T_FR, \ 300193640Sariff .members = \ 301193640Sariff SND_CHN_T_MASK_FR | SND_CHN_T_MASK_FC | \ 302193640Sariff SND_CHN_T_MASK_SR \ 303193640Sariff }, \ 304193640Sariff /* Rear Left */ \ 305193640Sariff [2] = { \ 306193640Sariff .type = SND_CHN_T_BL, \ 307193640Sariff .members = \ 308193640Sariff SND_CHN_T_MASK_BL | SND_CHN_T_MASK_BC | \ 309193640Sariff SND_CHN_T_MASK_SL \ 310193640Sariff }, \ 311193640Sariff /* Rear Right */ \ 312193640Sariff [3] = { \ 313193640Sariff .type = SND_CHN_T_BR, \ 314193640Sariff .members = \ 315193640Sariff SND_CHN_T_MASK_BR | SND_CHN_T_MASK_BC | \ 316193640Sariff SND_CHN_T_MASK_SR \ 317193640Sariff }, \ 318193640Sariff /* LFE */ \ 319193640Sariff [4] = { \ 320193640Sariff .type = SND_CHN_T_LF, \ 321193640Sariff .members = SND_CHN_T_MASK_LF \ 322193640Sariff }, \ 323193640Sariff [5] = { \ 324193640Sariff .type = SND_CHN_T_MAX, \ 325193640Sariff .members = 0 \ 326193640Sariff } \ 327193640Sariff }, \ 328193640Sariff .mask = SND_CHN_T_MASK_FL | SND_CHN_T_MASK_FR | \ 329193640Sariff SND_CHN_T_MASK_BL | SND_CHN_T_MASK_BR | \ 330193640Sariff SND_CHN_T_MASK_LF, \ 331193640Sariff .offset = { 0, 1, -1, 4, 2, 3, -1, -1, -1, \ 332193640Sariff -1, -1, -1, -1, -1, -1, -1, -1, -1 } \ 333193640Sariff} 334193640Sariff 335193640Sariff#define SND_CHN_MATRIX_MAP_5_0 { /* 5 channels default */ \ 336193640Sariff .id = SND_CHN_MATRIX_5_0, \ 337193640Sariff .channels = 5, \ 338193640Sariff .ext = 0, \ 339193640Sariff .map = { \ 340193640Sariff /* Left */ \ 341193640Sariff [0] = { \ 342193640Sariff .type = SND_CHN_T_FL, \ 343193640Sariff .members = \ 344193640Sariff SND_CHN_T_MASK_FL | SND_CHN_T_MASK_LF | \ 345193640Sariff SND_CHN_T_MASK_SL \ 346193640Sariff }, \ 347193640Sariff /* Right */ \ 348193640Sariff [1] = { \ 349193640Sariff .type = SND_CHN_T_FR, \ 350193640Sariff .members = \ 351193640Sariff SND_CHN_T_MASK_FR | SND_CHN_T_MASK_LF | \ 352193640Sariff SND_CHN_T_MASK_SR \ 353193640Sariff }, \ 354193640Sariff /* Rear Left */ \ 355193640Sariff [2] = { \ 356193640Sariff .type = SND_CHN_T_BL, \ 357193640Sariff .members = \ 358193640Sariff SND_CHN_T_MASK_LF | SND_CHN_T_MASK_BL | \ 359193640Sariff SND_CHN_T_MASK_BC | SND_CHN_T_MASK_SL \ 360193640Sariff }, \ 361193640Sariff /* Rear Right */ \ 362193640Sariff [3] = { \ 363193640Sariff .type = SND_CHN_T_BR, \ 364193640Sariff .members = \ 365193640Sariff SND_CHN_T_MASK_LF | SND_CHN_T_MASK_BR | \ 366193640Sariff SND_CHN_T_MASK_BC | SND_CHN_T_MASK_SR \ 367193640Sariff }, \ 368193640Sariff /* Center */ \ 369193640Sariff [4] = { \ 370193640Sariff .type = SND_CHN_T_FC, \ 371193640Sariff .members = SND_CHN_T_MASK_FC \ 372193640Sariff }, \ 373193640Sariff [5] = { \ 374193640Sariff .type = SND_CHN_T_MAX, \ 375193640Sariff .members = 0 \ 376193640Sariff } \ 377193640Sariff }, \ 378193640Sariff .mask = SND_CHN_T_MASK_FL | SND_CHN_T_MASK_FR | \ 379193640Sariff SND_CHN_T_MASK_BL | SND_CHN_T_MASK_BR | \ 380193640Sariff SND_CHN_T_MASK_FC, \ 381193640Sariff .offset = { 0, 1, 4, -1, 2, 3, -1, -1, -1, \ 382193640Sariff -1, -1, -1, -1, -1, -1, -1, -1, -1 } \ 383193640Sariff} 384193640Sariff 385193640Sariff#define SND_CHN_MATRIX_MAP_5_1 { /* 6 channels default */ \ 386193640Sariff .id = SND_CHN_MATRIX_5_1, \ 387193640Sariff .channels = 6, \ 388193640Sariff .ext = 1, \ 389193640Sariff .map = { \ 390193640Sariff /* Left */ \ 391193640Sariff [0] = { \ 392193640Sariff .type = SND_CHN_T_FL, \ 393193640Sariff .members = \ 394193640Sariff SND_CHN_T_MASK_FL | SND_CHN_T_MASK_SL \ 395193640Sariff }, \ 396193640Sariff /* Right */ \ 397193640Sariff [1] = { \ 398193640Sariff .type = SND_CHN_T_FR, \ 399193640Sariff .members = \ 400193640Sariff SND_CHN_T_MASK_FR | SND_CHN_T_MASK_SR \ 401193640Sariff }, \ 402193640Sariff /* Rear Left */ \ 403193640Sariff [2] = { \ 404193640Sariff .type = SND_CHN_T_BL, \ 405193640Sariff .members = \ 406193640Sariff SND_CHN_T_MASK_BL | SND_CHN_T_MASK_BC | \ 407193640Sariff SND_CHN_T_MASK_SL \ 408193640Sariff }, \ 409193640Sariff /* Rear Right */ \ 410193640Sariff [3] = { \ 411193640Sariff .type = SND_CHN_T_BR, \ 412193640Sariff .members = \ 413193640Sariff SND_CHN_T_MASK_BR | SND_CHN_T_MASK_BC | \ 414193640Sariff SND_CHN_T_MASK_SR \ 415193640Sariff }, \ 416193640Sariff /* Center */ \ 417193640Sariff [4] = { \ 418193640Sariff .type = SND_CHN_T_FC, \ 419193640Sariff .members = SND_CHN_T_MASK_FC \ 420193640Sariff }, \ 421193640Sariff /* LFE */ \ 422193640Sariff [5] = { \ 423193640Sariff .type = SND_CHN_T_LF, \ 424193640Sariff .members = SND_CHN_T_MASK_LF \ 425193640Sariff }, \ 426193640Sariff [6] = { \ 427193640Sariff .type = SND_CHN_T_MAX, \ 428193640Sariff .members = 0 \ 429193640Sariff } \ 430193640Sariff }, \ 431193640Sariff .mask = SND_CHN_T_MASK_FL | SND_CHN_T_MASK_FR | \ 432193640Sariff SND_CHN_T_MASK_BL | SND_CHN_T_MASK_BR | \ 433193640Sariff SND_CHN_T_MASK_FC | SND_CHN_T_MASK_LF, \ 434193640Sariff .offset = { 0, 1, 4, 5, 2, 3, -1, -1, -1, \ 435193640Sariff -1, -1, -1, -1, -1, -1, -1, -1, -1 } \ 436193640Sariff} 437193640Sariff 438193640Sariff#define SND_CHN_MATRIX_MAP_6_0 { \ 439193640Sariff .id = SND_CHN_MATRIX_6_0, \ 440193640Sariff .channels = 6, \ 441193640Sariff .ext = 0, \ 442193640Sariff .map = { \ 443193640Sariff /* Left */ \ 444193640Sariff [0] = { \ 445193640Sariff .type = SND_CHN_T_FL, \ 446193640Sariff .members = \ 447193640Sariff SND_CHN_T_MASK_FL | SND_CHN_T_MASK_LF | \ 448193640Sariff SND_CHN_T_MASK_SL \ 449193640Sariff }, \ 450193640Sariff /* Right */ \ 451193640Sariff [1] = { \ 452193640Sariff .type = SND_CHN_T_FR, \ 453193640Sariff .members = \ 454193640Sariff SND_CHN_T_MASK_FR | SND_CHN_T_MASK_LF | \ 455193640Sariff SND_CHN_T_MASK_SR \ 456193640Sariff }, \ 457193640Sariff /* Rear Left */ \ 458193640Sariff [2] = { \ 459193640Sariff .type = SND_CHN_T_BL, \ 460193640Sariff .members = \ 461193640Sariff SND_CHN_T_MASK_BL | SND_CHN_T_MASK_LF | \ 462193640Sariff SND_CHN_T_MASK_SL \ 463193640Sariff }, \ 464193640Sariff /* Rear Right */ \ 465193640Sariff [3] = { \ 466193640Sariff .type = SND_CHN_T_BR, \ 467193640Sariff .members = \ 468193640Sariff SND_CHN_T_MASK_BR | SND_CHN_T_MASK_LF | \ 469193640Sariff SND_CHN_T_MASK_SR \ 470193640Sariff }, \ 471193640Sariff /* Center */ \ 472193640Sariff [4] = { \ 473193640Sariff .type = SND_CHN_T_FC, \ 474193640Sariff .members = SND_CHN_T_MASK_FC \ 475193640Sariff }, \ 476193640Sariff /* Rear Center */ \ 477193640Sariff [5] = { \ 478193640Sariff .type = SND_CHN_T_BC, \ 479193640Sariff .members = SND_CHN_T_MASK_BC \ 480193640Sariff }, \ 481193640Sariff [6] = { \ 482193640Sariff .type = SND_CHN_T_MAX, \ 483193640Sariff .members = 0 \ 484193640Sariff } \ 485193640Sariff }, \ 486193640Sariff .mask = SND_CHN_T_MASK_FL | SND_CHN_T_MASK_FR | \ 487193640Sariff SND_CHN_T_MASK_BL | SND_CHN_T_MASK_BR | \ 488193640Sariff SND_CHN_T_MASK_FC | SND_CHN_T_MASK_BC, \ 489193640Sariff .offset = { 0, 1, 4, -1, 2, 3, -1, -1, 5, \ 490193640Sariff -1, -1, -1, -1, -1, -1, -1, -1, -1 } \ 491193640Sariff} 492193640Sariff 493193640Sariff#define SND_CHN_MATRIX_MAP_6_1 { \ 494193640Sariff .id = SND_CHN_MATRIX_6_1, \ 495193640Sariff .channels = 7, \ 496193640Sariff .ext = 1, \ 497193640Sariff .map = { \ 498193640Sariff /* Left */ \ 499193640Sariff [0] = { \ 500193640Sariff .type = SND_CHN_T_FL, \ 501193640Sariff .members = \ 502193640Sariff SND_CHN_T_MASK_FL | SND_CHN_T_MASK_SL \ 503193640Sariff }, \ 504193640Sariff /* Right */ \ 505193640Sariff [1] = { \ 506193640Sariff .type = SND_CHN_T_FR, \ 507193640Sariff .members = \ 508193640Sariff SND_CHN_T_MASK_FR | SND_CHN_T_MASK_SR \ 509193640Sariff }, \ 510193640Sariff /* Rear Left */ \ 511193640Sariff [2] = { \ 512193640Sariff .type = SND_CHN_T_BL, \ 513193640Sariff .members = \ 514193640Sariff SND_CHN_T_MASK_BL | SND_CHN_T_MASK_SL \ 515193640Sariff }, \ 516193640Sariff /* Rear Right */ \ 517193640Sariff [3] = { \ 518193640Sariff .type = SND_CHN_T_BR, \ 519193640Sariff .members = \ 520193640Sariff SND_CHN_T_MASK_BR | SND_CHN_T_MASK_SR \ 521193640Sariff }, \ 522193640Sariff /* Center */ \ 523193640Sariff [4] = { \ 524193640Sariff .type = SND_CHN_T_FC, \ 525193640Sariff .members = SND_CHN_T_MASK_FC \ 526193640Sariff }, \ 527193640Sariff /* LFE */ \ 528193640Sariff [5] = { \ 529193640Sariff .type = SND_CHN_T_LF, \ 530193640Sariff .members = SND_CHN_T_MASK_LF \ 531193640Sariff }, \ 532193640Sariff /* Rear Center */ \ 533193640Sariff [6] = { \ 534193640Sariff .type = SND_CHN_T_BC, \ 535193640Sariff .members = SND_CHN_T_MASK_BC \ 536193640Sariff }, \ 537193640Sariff [7] = { \ 538193640Sariff .type = SND_CHN_T_MAX, \ 539193640Sariff .members = 0 \ 540193640Sariff } \ 541193640Sariff }, \ 542193640Sariff .mask = SND_CHN_T_MASK_FL | SND_CHN_T_MASK_FR | \ 543193640Sariff SND_CHN_T_MASK_BL | SND_CHN_T_MASK_BR | \ 544193640Sariff SND_CHN_T_MASK_FC | SND_CHN_T_MASK_LF | \ 545193640Sariff SND_CHN_T_MASK_BC, \ 546193640Sariff .offset = { 0, 1, 4, 5, 2, 3, -1, -1, 6, \ 547193640Sariff -1, -1, -1, -1, -1, -1, -1, -1, -1 } \ 548193640Sariff} 549193640Sariff 550243138Smav#define SND_CHN_MATRIX_MAP_7_0 { \ 551243138Smav .id = SND_CHN_MATRIX_7_0, \ 552243138Smav .channels = 7, \ 553243138Smav .ext = 0, \ 554243138Smav .map = { \ 555243138Smav /* Left */ \ 556243138Smav [0] = { \ 557243138Smav .type = SND_CHN_T_FL, \ 558243138Smav .members = \ 559243138Smav SND_CHN_T_MASK_FL | SND_CHN_T_MASK_LF \ 560243138Smav }, \ 561243138Smav /* Right */ \ 562243138Smav [1] = { \ 563243138Smav .type = SND_CHN_T_FR, \ 564243138Smav .members = \ 565243138Smav SND_CHN_T_MASK_FR | SND_CHN_T_MASK_LF \ 566243138Smav }, \ 567243138Smav /* Rear Left */ \ 568243138Smav [2] = { \ 569243138Smav .type = SND_CHN_T_BL, \ 570243138Smav .members = \ 571243138Smav SND_CHN_T_MASK_BL | SND_CHN_T_MASK_BC | \ 572243138Smav SND_CHN_T_MASK_LF \ 573243138Smav }, \ 574243138Smav /* Rear Right */ \ 575243138Smav [3] = { \ 576243138Smav .type = SND_CHN_T_BR, \ 577243138Smav .members = \ 578243138Smav SND_CHN_T_MASK_BR | SND_CHN_T_MASK_BC | \ 579243138Smav SND_CHN_T_MASK_LF \ 580243138Smav }, \ 581243138Smav /* Center */ \ 582243138Smav [4] = { \ 583243138Smav .type = SND_CHN_T_FC, \ 584243138Smav .members = \ 585243138Smav SND_CHN_T_MASK_FC | SND_CHN_T_MASK_LF \ 586243138Smav }, \ 587243138Smav /* Side Left */ \ 588243138Smav [5] = { \ 589243138Smav .type = SND_CHN_T_SL, \ 590243138Smav .members = \ 591243138Smav SND_CHN_T_MASK_SL | SND_CHN_T_MASK_LF \ 592243138Smav }, \ 593243138Smav /* Side Right */ \ 594243138Smav [6] = { \ 595243138Smav .type = SND_CHN_T_SR, \ 596243138Smav .members = \ 597243138Smav SND_CHN_T_MASK_SR | SND_CHN_T_MASK_LF \ 598243138Smav }, \ 599243138Smav [7] = { \ 600243138Smav .type = SND_CHN_T_MAX, \ 601243138Smav .members = 0 \ 602243138Smav } \ 603243138Smav }, \ 604243138Smav .mask = SND_CHN_T_MASK_FL | SND_CHN_T_MASK_FR | \ 605243138Smav SND_CHN_T_MASK_BL | SND_CHN_T_MASK_BR | \ 606243138Smav SND_CHN_T_MASK_FC | \ 607243138Smav SND_CHN_T_MASK_SL | SND_CHN_T_MASK_SR, \ 608243138Smav .offset = { 0, 1, 4, -1, 2, 3, -1, -1, -1, \ 609243138Smav 5, 6, -1, -1, -1, -1, -1, -1, -1 } \ 610243138Smav} 611243138Smav 612193640Sariff#define SND_CHN_MATRIX_MAP_7_1 { \ 613193640Sariff .id = SND_CHN_MATRIX_7_1, \ 614193640Sariff .channels = 8, \ 615193640Sariff .ext = 1, \ 616193640Sariff .map = { \ 617193640Sariff /* Left */ \ 618193640Sariff [0] = { \ 619193640Sariff .type = SND_CHN_T_FL, \ 620193640Sariff .members = SND_CHN_T_MASK_FL \ 621193640Sariff }, \ 622193640Sariff /* Right */ \ 623193640Sariff [1] = { \ 624193640Sariff .type = SND_CHN_T_FR, \ 625193640Sariff .members = SND_CHN_T_MASK_FR \ 626193640Sariff }, \ 627193640Sariff /* Rear Left */ \ 628193640Sariff [2] = { \ 629193640Sariff .type = SND_CHN_T_BL, \ 630193640Sariff .members = \ 631193640Sariff SND_CHN_T_MASK_BL | SND_CHN_T_MASK_BC \ 632193640Sariff }, \ 633193640Sariff /* Rear Right */ \ 634193640Sariff [3] = { \ 635193640Sariff .type = SND_CHN_T_BR, \ 636193640Sariff .members = \ 637193640Sariff SND_CHN_T_MASK_BR | SND_CHN_T_MASK_BC \ 638193640Sariff }, \ 639193640Sariff /* Center */ \ 640193640Sariff [4] = { \ 641193640Sariff .type = SND_CHN_T_FC, \ 642193640Sariff .members = SND_CHN_T_MASK_FC \ 643193640Sariff }, \ 644193640Sariff /* LFE */ \ 645193640Sariff [5] = { \ 646193640Sariff .type = SND_CHN_T_LF, \ 647193640Sariff .members = SND_CHN_T_MASK_LF \ 648193640Sariff }, \ 649193640Sariff /* Side Left */ \ 650193640Sariff [6] = { \ 651193640Sariff .type = SND_CHN_T_SL, \ 652193640Sariff .members = SND_CHN_T_MASK_SL \ 653193640Sariff }, \ 654193640Sariff /* Side Right */ \ 655193640Sariff [7] = { \ 656193640Sariff .type = SND_CHN_T_SR, \ 657193640Sariff .members = SND_CHN_T_MASK_SR \ 658193640Sariff }, \ 659193640Sariff [8] = { \ 660193640Sariff .type = SND_CHN_T_MAX, \ 661193640Sariff .members = 0 \ 662193640Sariff } \ 663193640Sariff }, \ 664193640Sariff .mask = SND_CHN_T_MASK_FL | SND_CHN_T_MASK_FR | \ 665193640Sariff SND_CHN_T_MASK_BL | SND_CHN_T_MASK_BR | \ 666193640Sariff SND_CHN_T_MASK_FC | SND_CHN_T_MASK_LF | \ 667193640Sariff SND_CHN_T_MASK_SL | SND_CHN_T_MASK_SR, \ 668193640Sariff .offset = { 0, 1, 4, 5, 2, 3, -1, -1, -1, \ 669193640Sariff 6, 7, -1, -1, -1, -1, -1, -1, -1 } \ 670193640Sariff} 671193640Sariff 672193640Sariff#endif /* !_SND_MATRIX_MAP_H_ */ 673