alsa/0023-PCM-Define-MONO-and-other-channel-map-positions.patch
Takashi Iwai 8a90d87ca6 Accepting request 138456 from home:tiwai:branches:multimedia:libs
- backport from upstream tree:
  * lots of patches to support the new chmap API
  * fix segfault in rate plugin error path
  * add a couple of test programs
  * fix inifinte loop in htimestamp of dmix & co

OBS-URL: https://build.opensuse.org/request/show/138456
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa?expand=0&rev=113
2012-10-17 08:17:46 +00:00

117 lines
4.0 KiB
Diff

From f7300682dc0fe9faec94461af6fdcf098047a0d1 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Wed, 12 Sep 2012 18:43:59 +0200
Subject: [PATCH 23/30] PCM: Define MONO and other channel map positions
Follow the new definitions in the kernel side. MONO and others have
been added, and the order of position table was changed again.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
include/pcm.h | 11 +++++++++--
include/sound/asound.h | 13 ++++++++++---
src/pcm/pcm.c | 14 +++++++++++---
3 files changed, 30 insertions(+), 8 deletions(-)
--- a/include/pcm.h
+++ b/include/pcm.h
@@ -489,6 +489,8 @@ enum snd_pcm_chmap_type {
/** channel positions */
enum snd_pcm_chmap_position {
SND_CHMAP_UNKNOWN = 0, /** unspecified */
+ SND_CHMAP_NA, /** N/A, silent */
+ SND_CHMAP_MONO, /** mono stream */
SND_CHMAP_FL, /** front left */
SND_CHMAP_FR, /** front right */
SND_CHMAP_RL, /** rear left */
@@ -508,8 +510,13 @@ enum snd_pcm_chmap_position {
SND_CHMAP_FCH, /** front center high */
SND_CHMAP_FRH, /** front right high */
SND_CHMAP_TC, /** top center */
- SND_CHMAP_NA, /** N/A, silent */
- SND_CHMAP_LAST = SND_CHMAP_NA, /** last entry */
+ SND_CHMAP_TFL, /** top front left */
+ SND_CHMAP_TFR, /** top front right */
+ SND_CHMAP_TFC, /** top front center */
+ SND_CHMAP_TRL, /** top rear left */
+ SND_CHMAP_TRR, /** top rear right */
+ SND_CHMAP_TRC, /** top rear center */
+ SND_CHMAP_LAST = SND_CHMAP_TRC, /** last entry */
};
#define SND_CHMAP_POSITION_MASK 0xffff /** bitmask for channel position */
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -479,8 +479,10 @@ enum {
/* channel positions */
enum {
- /* this follows the alsa-lib mixer channel value + 1 */
SNDRV_CHMAP_UNKNOWN = 0,
+ SNDRV_CHMAP_NA, /* N/A, silent */
+ SNDRV_CHMAP_MONO, /* mono stream */
+ /* this follows the alsa-lib mixer channel value + 3 */
SNDRV_CHMAP_FL, /* front left */
SNDRV_CHMAP_FR, /* front right */
SNDRV_CHMAP_RL, /* rear left */
@@ -501,8 +503,13 @@ enum {
SNDRV_CHMAP_FCH, /* front center high */
SNDRV_CHMAP_FRH, /* front right high */
SNDRV_CHMAP_TC, /* top center */
- SNDRV_CHMAP_NA, /* N/A, silent */
- SNDRV_CHMAP_LAST = SNDRV_CHMAP_NA,
+ SNDRV_CHMAP_TFL, /* top front left */
+ SNDRV_CHMAP_TFR, /* top front right */
+ SNDRV_CHMAP_TFC, /* top front center */
+ SNDRV_CHMAP_TRL, /* top rear left */
+ SNDRV_CHMAP_TRR, /* top rear right */
+ SNDRV_CHMAP_TRC, /* top rear center */
+ SNDRV_CHMAP_LAST = SNDRV_CHMAP_TRC,
};
#define SNDRV_CHMAP_POSITION_MASK 0xffff
--- a/src/pcm/pcm.c
+++ b/src/pcm/pcm.c
@@ -7375,7 +7375,7 @@ const char *snd_pcm_chmap_type_name(enum
#define _NAME(n) [SND_CHMAP_##n] = #n
static const char *chmap_names[SND_CHMAP_LAST + 1] = {
- _NAME(UNKNOWN),
+ _NAME(UNKNOWN), _NAME(NA), _NAME(MONO),
_NAME(FL), _NAME(FR),
_NAME(RL), _NAME(RR),
_NAME(FC), _NAME(LFE),
@@ -7383,7 +7383,8 @@ static const char *chmap_names[SND_CHMAP
_NAME(RC), _NAME(FLC), _NAME(FRC), _NAME(RLC), _NAME(RRC),
_NAME(FLW), _NAME(FRW),
_NAME(FLH), _NAME(FCH), _NAME(FRH), _NAME(TC),
- _NAME(NA),
+ _NAME(TFL), _NAME(TFR), _NAME(TFC),
+ _NAME(TRL), _NAME(TRR), _NAME(TRC),
};
#undef _NAME
@@ -7397,6 +7398,8 @@ const char *snd_pcm_chmap_name(enum snd_
static const char *chmap_long_names[SND_CHMAP_LAST + 1] = {
[SND_CHMAP_UNKNOWN] = "Unknown",
+ [SND_CHMAP_NA] = "Unused",
+ [SND_CHMAP_MONO] = "Mono",
[SND_CHMAP_FL] = "Front Left",
[SND_CHMAP_FR] = "Front Right",
[SND_CHMAP_RL] = "Rear Left",
@@ -7416,7 +7419,12 @@ static const char *chmap_long_names[SND_
[SND_CHMAP_FCH] = "Front Center High",
[SND_CHMAP_FRH] = "Front Right High",
[SND_CHMAP_TC] = "Top Center",
- [SND_CHMAP_NA] = "Unused",
+ [SND_CHMAP_TFL] = "Top Front Left",
+ [SND_CHMAP_TFR] = "Top Front Right",
+ [SND_CHMAP_TFC] = "Top Front Center",
+ [SND_CHMAP_TRL] = "Top Rear Left",
+ [SND_CHMAP_TRR] = "Top Rear Right",
+ [SND_CHMAP_TRC] = "Top Rear Center",
};
const char *snd_pcm_chmap_long_name(enum snd_pcm_chmap_position val)