Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 54f0b765 authored by Amit Shekhar's avatar Amit Shekhar Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: msm: qdsp6v2: Fix asm bitwidth for next track in gapless mode



asm is opened at fixed bitwidth 16 for next track in gapless mode.
This is causing noise when a 24 bit clip is played in single repeat
gapless mode.
By opening asm based on input stream bitwidth, asm is configured
at appropriate bitwidth.

Change-Id: Icc815d0a812fa17ae981cdeaf8e56142623deb79
CRs-Fixed: 778865
Signed-off-by: default avatarAmit Shekhar <ashekhar@codeaurora.org>
parent 07c7432a
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -812,7 +812,7 @@ static int msm_compr_configure_dsp(struct snd_compr_stream *cstream)
	pr_debug("%s: stream_id %d\n", __func__, ac->stream_id);
	if (prtd->codec_param.codec.format == SNDRV_PCM_FORMAT_S24_LE)
		bits_per_sample = 24;
	if (prtd->codec_param.codec.format == SNDRV_PCM_FORMAT_S32_LE)
	else if (prtd->codec_param.codec.format == SNDRV_PCM_FORMAT_S32_LE)
		bits_per_sample = 32;

	if (prtd->compr_passthr != LEGACY_PCM) {
@@ -835,7 +835,8 @@ static int msm_compr_configure_dsp(struct snd_compr_stream *cstream)
			return ret;
		}
	} else {
		pr_debug("%s: stream_id %d\n", __func__, ac->stream_id);
		pr_debug("%s: stream_id %d bits_per_sample %d\n",
				__func__, ac->stream_id, bits_per_sample);
		ret = q6asm_stream_open_write_v2(ac,
				prtd->codec, bits_per_sample,
				ac->stream_id,
@@ -1354,6 +1355,7 @@ static int msm_compr_trigger(struct snd_compr_stream *cstream, int cmd)
	unsigned long flags;
	int stream_id;
	uint32_t stream_index;
	uint16_t bits_per_sample = 16;

	if (cstream->direction != SND_COMPRESS_PLAYBACK) {
		pr_err("%s: Unsupported stream type\n", __func__);
@@ -1727,9 +1729,17 @@ static int msm_compr_trigger(struct snd_compr_stream *cstream, int cmd)
			}
			break;
		}
		pr_debug("%s: open_write stream_id %d", __func__, stream_id);

		if (prtd->codec_param.codec.format == SNDRV_PCM_FORMAT_S24_LE)
			bits_per_sample = 24;
		else if (prtd->codec_param.codec.format ==
			 SNDRV_PCM_FORMAT_S32_LE)
			bits_per_sample = 32;

		pr_debug("%s: open_write stream_id %d bits_per_sample %d",
				__func__, stream_id, bits_per_sample);
		rc = q6asm_stream_open_write_v2(prtd->audio_client,
				prtd->codec, 16,
				prtd->codec, bits_per_sample,
				stream_id,
				prtd->gapless_state.use_dsp_gapless_mode);
		if (rc < 0) {