Skip to content

Commit

Permalink
stereo call recording support
Browse files Browse the repository at this point in the history
Patch that allows for call recording in
stereo (left channel: TX; right channel:
RX). Tested on Nexus 5 (MSM8974). Likely
works on other recent MSM chipsets as
well.

Change-Id: I934c252283d1346f9c1f6cf786ce2f661f20a049

Signed-off-by: flar2 <asegaert@gmail.com>
  • Loading branch information
Heinz Teutsch authored and javilonas committed May 23, 2015
1 parent e083137 commit 4f33449
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions sound/soc/msm/qdsp6v2/msm-pcm-voice-v2.c
Expand Up @@ -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),
Expand Down
10 changes: 9 additions & 1 deletion sound/soc/msm/qdsp6v2/q6voice.c
Expand Up @@ -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;
Expand All @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions sound/soc/msm/qdsp6v2/q6voice.h
Expand Up @@ -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. */

Expand Down

0 comments on commit 4f33449

Please sign in to comment.