dsp: codecs: add support to enable multiaac 5.1 channel playback

Channel number of multiaac audio decoder is hard-coded to two during
the configuration. Modify it to accept different channel numbers to
enable 5.1 channel playback.

Change-Id: Ibc33ddc7f2ac810a6a34cdbd7a832e58531dfa4f
Signed-off-by: Xiaoyu Ye <benyxy@codeaurora.org>
This commit is contained in:
Xiaoyu Ye 2017-11-13 23:44:32 -08:00 committed by Gerrit - the friendly Code Review server
parent 9326b2df53
commit d99897f5bb

View file

@ -111,7 +111,14 @@ static long audio_ioctl_shared(struct file *file, unsigned int cmd,
pr_err("cmd media format block failed\n");
break;
}
rc = q6asm_set_encdec_chan_map(audio->ac, 2);
/* Fall back to the default number of channels
* if aac_cfg.ch_cfg is not between 1-6
*/
if ((aac_cfg.ch_cfg == 0) || (aac_cfg.ch_cfg > 6))
aac_cfg.ch_cfg = 2;
rc = q6asm_set_encdec_chan_map(audio->ac, aac_cfg.ch_cfg);
if (rc < 0) {
pr_err("%s: cmd set encdec_chan_map failed\n",
__func__);