diff --git a/sound/soc/msm/qdsp6v2/msm-pcm-voice-v2.c b/sound/soc/msm/qdsp6v2/msm-pcm-voice-v2.c index 2b89d5ee4713..94dc0638cdc9 100644 --- a/sound/soc/msm/qdsp6v2/msm-pcm-voice-v2.c +++ b/sound/soc/msm/qdsp6v2/msm-pcm-voice-v2.c @@ -582,6 +582,8 @@ static struct snd_kcontrol_new msm_voice_controls[] = { msm_voice_tty_mode_put), SOC_SINGLE_MULTI_EXT("Slowtalk Enable", SND_SOC_NOPM, 0, VSID_MAX, 0, 2, NULL, msm_voice_slowtalk_put), + /* Dummy control to expose stereo recording support in kernel to user-space */ + SOC_SINGLE_EXT("Stereo Recording", SND_SOC_NOPM, 1, VSID_MAX, 0, NULL, NULL), #ifdef CONFIG_SEC_SOLUTION SOC_SINGLE_MULTI_EXT("Sec Set DHA data", SND_SOC_NOPM, 0, 65535, 0, 14, msm_sec_dha_get, msm_sec_dha_put), diff --git a/sound/soc/msm/qdsp6v2/q6voice.c b/sound/soc/msm/qdsp6v2/q6voice.c index ec00a2973095..9580049508bc 100644 --- a/sound/soc/msm/qdsp6v2/q6voice.c +++ b/sound/soc/msm/qdsp6v2/q6voice.c @@ -4023,8 +4023,13 @@ static int voice_cvs_start_record(struct voice_data *v, uint32_t rec_mode) cvs_start_record.hdr.token = 0; cvs_start_record.hdr.opcode = VSS_IRECORD_CMD_START; + /* In order to enable stereo recording, + * i.e. TX on the left and RX on the right + * the respective ports need to be explicitly specified: + * INCALL_RECORD_TX => 0x8003 + * INCALL_RECORD_RX => 0x8004 */ cvs_start_record.rec_mode.port_id = - VSS_IRECORD_PORT_ID_DEFAULT; + VSS_IRECORD_PORT_ID_TX_RX; if (rec_mode == VOC_REC_UPLINK) { cvs_start_record.rec_mode.rx_tap_point = VSS_IRECORD_TAP_POINT_NONE; @@ -4048,6 +4053,9 @@ static int voice_cvs_start_record(struct voice_data *v, uint32_t rec_mode) goto fail; } + /* Request stereo recording */ + cvs_start_record.rec_mode.mode = VSS_IRECORD_MODE_TX_RX_STEREO; + v->cvs_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_cvs, (uint32_t *) &cvs_start_record); diff --git a/sound/soc/msm/qdsp6v2/q6voice.h b/sound/soc/msm/qdsp6v2/q6voice.h index cc94c3aeea3f..dca9c7ca7962 100644 --- a/sound/soc/msm/qdsp6v2/q6voice.h +++ b/sound/soc/msm/qdsp6v2/q6voice.h @@ -518,6 +518,9 @@ struct vss_imemory_cmd_unmap_t { #define VSS_IRECORD_PORT_ID_DEFAULT 0x0000FFFF /* Default AFE port ID. */ +/* Port explicitly identifying TX and RX streams */ +#define VSS_IRECORD_PORT_ID_TX_RX 0x00008003 + #define VSS_IRECORD_TAP_POINT_NONE 0x00010F78 /* Indicates no tapping for specified path. */