ASoc: msm: qdsp6v2: Fix audio noise issue during incall recording

The timestamp API is called even when timestamp flag is not set.
Correct the read API calls based on timestamp flag.

CRs-fixed: 1107319
Change-Id: Ic40b166e9ddd42f20fecadcd4eafe187b3ff8785
Signed-off-by: Satish Babu Patakokila <sbpata@codeaurora.org>
This commit is contained in:
Satish Babu Patakokila 2017-01-05 20:45:38 +05:30 committed by Gerrit - the friendly Code Review server
parent 3145cd4109
commit 355f0c4d27
4 changed files with 16 additions and 10 deletions

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -270,7 +270,7 @@ int q6asm_open_read_v3(struct audio_client *ac, uint32_t format,
uint16_t bits_per_sample);
int q6asm_open_read_v4(struct audio_client *ac, uint32_t format,
uint16_t bits_per_sample);
uint16_t bits_per_sample, bool ts_mode);
int q6asm_open_write(struct audio_client *ac, uint32_t format
/*, uint16_t bits_per_sample*/);

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -1242,8 +1242,13 @@ static int msm_compr_configure_dsp_for_capture(struct snd_compr_stream *cstream)
pr_debug("%s: stream_id %d bits_per_sample %d\n",
__func__, ac->stream_id, bits_per_sample);
if (prtd->codec_param.codec.flags & COMPRESSED_TIMESTAMP_FLAG) {
ret = q6asm_open_read_v4(prtd->audio_client, FORMAT_LINEAR_PCM,
bits_per_sample);
bits_per_sample, true);
} else {
ret = q6asm_open_read_v4(prtd->audio_client, FORMAT_LINEAR_PCM,
bits_per_sample, false);
}
if (ret < 0) {
pr_err("%s: q6asm_open_read failed:%d\n", __func__, ret);
return ret;

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -423,7 +423,7 @@ static int msm_pcm_capture_prepare(struct snd_pcm_substream *substream)
prtd->audio_client->perf_mode);
ret = q6asm_open_read_v4(prtd->audio_client, FORMAT_LINEAR_PCM,
bits_per_sample);
bits_per_sample, false);
if (ret < 0) {
pr_err("%s: q6asm_open_read failed\n", __func__);
q6asm_audio_client_free(prtd->audio_client);

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
* Author: Brian Swetland <swetland@google.com>
*
* This software is licensed under the terms of the GNU General Public
@ -2441,13 +2441,14 @@ EXPORT_SYMBOL(q6asm_open_read_v3);
* @ac: Client session handle
* @format: encoder format
* @bits_per_sample: bit width of capture session
* @ts_mode: timestamp mode
*/
int q6asm_open_read_v4(struct audio_client *ac, uint32_t format,
uint16_t bits_per_sample)
uint16_t bits_per_sample, bool ts_mode)
{
return __q6asm_open_read(ac, format, bits_per_sample,
PCM_MEDIA_FORMAT_V4 /*media fmt block ver*/,
true/*ts_mode*/);
ts_mode);
}
EXPORT_SYMBOL(q6asm_open_read_v4);