ASoc: msm: Multi channel AAC clips don't play
Send channel mapping command to DSP; This command
is used to identify the output PCM buffers's
upsampling/downsampling sequence.
Change-Id: I79739eeb9504177d603bb552432acd16c4f7e696
CRs-fixed: 351804
CRs-fixed: 351817
Signed-off-by: Swaminathan Sathappan <Swami@codeaurora.org>
diff --git a/include/sound/apr_audio.h b/include/sound/apr_audio.h
index 0007fd8..b806040 100644
--- a/include/sound/apr_audio.h
+++ b/include/sound/apr_audio.h
@@ -770,7 +770,10 @@
#define PCM_FORMAT_MAX_NUM_CHANNEL 8
-
+/* Maximum number of channels supported
+ * in ASM_ENCDEC_DEC_CHAN_MAP command
+ */
+#define MAX_CHAN_MAP_CHANNELS 16
/*
* Multiple-channel PCM decoder format block structure used in the
* #ASM_STREAM_CMD_OPEN_WRITE command.
@@ -980,6 +983,32 @@
u16 sce_right;
};
+struct asm_dec_chan_map {
+ u32 num_channels; /* Number of decoder output
+ * channels. A value of 0
+ * indicates native channel
+ * mapping, which is valid
+ * only for NT mode. This
+ * means the output of the
+ * decoder is to be preserved
+ * as is.
+ */
+
+ u8 channel_mapping[MAX_CHAN_MAP_CHANNELS];/* Channel array of size
+ * num_channels. It can grow
+ * till MAX_CHAN_MAP_CHANNELS.
+ * Channel[i] mapping
+ * describes channel I inside
+ * the decoder output buffer.
+ * Valid channel mapping
+ * values are to be present at
+ * the beginning of the array.
+ * All remaining elements of
+ * the array are to be filled
+ * with PCM_CHANNEL_NULL.
+ */
+};
+
struct asm_encode_cfg_blk {
u32 frames_per_buf;
u32 format_id;
@@ -1132,6 +1161,14 @@
struct asm_dual_mono channel_map;
} __packed;
+#define ASM_ENCDEC_DEC_CHAN_MAP 0x00010D82
+struct asm_stream_cmd_encdec_channelmap {
+ struct apr_hdr hdr;
+ u32 param_id;
+ u32 param_size;
+ struct asm_dec_chan_map chan_map;
+} __packed;
+
#define ASM_STREAM _CMD_ADJUST_SAMPLES 0x00010C0A
struct asm_stream_cmd_adjust_samples{
struct apr_hdr hdr;
diff --git a/include/sound/q6asm.h b/include/sound/q6asm.h
index aec4171..968d46e 100644
--- a/include/sound/q6asm.h
+++ b/include/sound/q6asm.h
@@ -247,6 +247,9 @@
int q6asm_cfg_dual_mono_aac(struct audio_client *ac,
uint16_t sce_left, uint16_t sce_right);
+int q6asm_set_encdec_chan_map(struct audio_client *ac,
+ uint32_t num_channels);
+
int q6asm_enc_cfg_blk_qcelp(struct audio_client *ac, uint32_t frames_per_buf,
uint16_t min_rate, uint16_t max_rate,
uint16_t reduced_rate_level, uint16_t rate_modulation_cmd);