aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-09-12 12:06:54 -0400
committerTakashi Iwai <tiwai@suse.de>2012-09-12 12:13:03 -0400
commit7b31d0095e87221dc32c95642a2a714ea08259aa (patch)
tree098dc2c137b0f9a0d098d6e7751ab350e027cd6e
parent0afdb8f2869610b7c2eb99d75ba8b9003b8e88d7 (diff)
ALSA: Define more channel map positions
For following the standard, define more channel map positions and shuffle the items a bit: - As both PulseAudio and gstreamer define MONO channel position explicitly, we should follow that, too. The mono streams point to this channel position unless they are explicitly assigned to certain channel positions. - Top-front-* and Top-rear-* positions are added, carried from PulseAudio's definitions. - Move NA and MONO definitions at the top of table right after UNKNOWN, since these are more abstract in comparison with other practical positions. Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--Documentation/sound/alsa/Channel-Mapping-API.txt13
-rw-r--r--include/sound/asound.h13
-rw-r--r--sound/pci/ctxfi/ctpcm.c6
3 files changed, 23 insertions, 9 deletions
diff --git a/Documentation/sound/alsa/Channel-Mapping-API.txt b/Documentation/sound/alsa/Channel-Mapping-API.txt
index 4bbf12d5553f..3c43d1a4ca0e 100644
--- a/Documentation/sound/alsa/Channel-Mapping-API.txt
+++ b/Documentation/sound/alsa/Channel-Mapping-API.txt
@@ -76,8 +76,10 @@ here is a cut:
76 76
77/* channel positions */ 77/* channel positions */
78enum { 78enum {
79 /* this follows the alsa-lib mixer channel value + 1 */
80 SNDRV_CHMAP_UNKNOWN = 0, 79 SNDRV_CHMAP_UNKNOWN = 0,
80 SNDRV_CHMAP_NA, /* N/A, silent */
81 SNDRV_CHMAP_MONO, /* mono stream */
82 /* this follows the alsa-lib mixer channel value + 3 */
81 SNDRV_CHMAP_FL, /* front left */ 83 SNDRV_CHMAP_FL, /* front left */
82 SNDRV_CHMAP_FR, /* front right */ 84 SNDRV_CHMAP_FR, /* front right */
83 SNDRV_CHMAP_RL, /* rear left */ 85 SNDRV_CHMAP_RL, /* rear left */
@@ -98,8 +100,13 @@ enum {
98 SNDRV_CHMAP_FCH, /* front center high */ 100 SNDRV_CHMAP_FCH, /* front center high */
99 SNDRV_CHMAP_FRH, /* front right high */ 101 SNDRV_CHMAP_FRH, /* front right high */
100 SNDRV_CHMAP_TC, /* top center */ 102 SNDRV_CHMAP_TC, /* top center */
101 SNDRV_CHMAP_NA, /* N/A, silent */ 103 SNDRV_CHMAP_TFL, /* top front left */
102 SNDRV_CHMAP_LAST = SNDRV_CHMAP_NA, 104 SNDRV_CHMAP_TFR, /* top front right */
105 SNDRV_CHMAP_TFC, /* top front center */
106 SNDRV_CHMAP_TRL, /* top rear left */
107 SNDRV_CHMAP_TRR, /* top rear right */
108 SNDRV_CHMAP_TRC, /* top rear center */
109 SNDRV_CHMAP_LAST = SNDRV_CHMAP_TRC,
103}; 110};
104 111
105When a PCM stream can provide more than one channel map, you can 112When a PCM stream can provide more than one channel map, you can
diff --git a/include/sound/asound.h b/include/sound/asound.h
index 27686da0f650..dfe7d441748c 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -474,8 +474,10 @@ enum {
474 474
475/* channel positions */ 475/* channel positions */
476enum { 476enum {
477 /* this follows the alsa-lib mixer channel value + 1 */
478 SNDRV_CHMAP_UNKNOWN = 0, 477 SNDRV_CHMAP_UNKNOWN = 0,
478 SNDRV_CHMAP_NA, /* N/A, silent */
479 SNDRV_CHMAP_MONO, /* mono stream */
480 /* this follows the alsa-lib mixer channel value + 3 */
479 SNDRV_CHMAP_FL, /* front left */ 481 SNDRV_CHMAP_FL, /* front left */
480 SNDRV_CHMAP_FR, /* front right */ 482 SNDRV_CHMAP_FR, /* front right */
481 SNDRV_CHMAP_RL, /* rear left */ 483 SNDRV_CHMAP_RL, /* rear left */
@@ -496,8 +498,13 @@ enum {
496 SNDRV_CHMAP_FCH, /* front center high */ 498 SNDRV_CHMAP_FCH, /* front center high */
497 SNDRV_CHMAP_FRH, /* front right high */ 499 SNDRV_CHMAP_FRH, /* front right high */
498 SNDRV_CHMAP_TC, /* top center */ 500 SNDRV_CHMAP_TC, /* top center */
499 SNDRV_CHMAP_NA, /* N/A, silent */ 501 SNDRV_CHMAP_TFL, /* top front left */
500 SNDRV_CHMAP_LAST = SNDRV_CHMAP_NA, 502 SNDRV_CHMAP_TFR, /* top front right */
503 SNDRV_CHMAP_TFC, /* top front center */
504 SNDRV_CHMAP_TRL, /* top rear left */
505 SNDRV_CHMAP_TRR, /* top rear right */
506 SNDRV_CHMAP_TRC, /* top rear center */
507 SNDRV_CHMAP_LAST = SNDRV_CHMAP_TRC,
501}; 508};
502 509
503#define SNDRV_CHMAP_POSITION_MASK 0xffff 510#define SNDRV_CHMAP_POSITION_MASK 0xffff
diff --git a/sound/pci/ctxfi/ctpcm.c b/sound/pci/ctxfi/ctpcm.c
index d317107d98cc..e8a4feb1ed86 100644
--- a/sound/pci/ctxfi/ctpcm.c
+++ b/sound/pci/ctxfi/ctpcm.c
@@ -397,7 +397,7 @@ static struct snd_pcm_ops ct_pcm_capture_ops = {
397 397
398static const struct snd_pcm_chmap_elem surround_map[] = { 398static const struct snd_pcm_chmap_elem surround_map[] = {
399 { .channels = 1, 399 { .channels = 1,
400 .map = { SNDRV_CHMAP_UNKNOWN } }, 400 .map = { SNDRV_CHMAP_MONO } },
401 { .channels = 2, 401 { .channels = 2,
402 .map = { SNDRV_CHMAP_RL, SNDRV_CHMAP_RR } }, 402 .map = { SNDRV_CHMAP_RL, SNDRV_CHMAP_RR } },
403 { } 403 { }
@@ -405,7 +405,7 @@ static const struct snd_pcm_chmap_elem surround_map[] = {
405 405
406static const struct snd_pcm_chmap_elem clfe_map[] = { 406static const struct snd_pcm_chmap_elem clfe_map[] = {
407 { .channels = 1, 407 { .channels = 1,
408 .map = { SNDRV_CHMAP_UNKNOWN } }, 408 .map = { SNDRV_CHMAP_MONO } },
409 { .channels = 2, 409 { .channels = 2,
410 .map = { SNDRV_CHMAP_FC, SNDRV_CHMAP_LFE } }, 410 .map = { SNDRV_CHMAP_FC, SNDRV_CHMAP_LFE } },
411 { } 411 { }
@@ -413,7 +413,7 @@ static const struct snd_pcm_chmap_elem clfe_map[] = {
413 413
414static const struct snd_pcm_chmap_elem side_map[] = { 414static const struct snd_pcm_chmap_elem side_map[] = {
415 { .channels = 1, 415 { .channels = 1,
416 .map = { SNDRV_CHMAP_UNKNOWN } }, 416 .map = { SNDRV_CHMAP_MONO } },
417 { .channels = 2, 417 { .channels = 2,
418 .map = { SNDRV_CHMAP_SL, SNDRV_CHMAP_SR } }, 418 .map = { SNDRV_CHMAP_SL, SNDRV_CHMAP_SR } },
419 { } 419 { }